修改bug
This commit is contained in:
@@ -2,43 +2,45 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 10:32:10
|
||||
* @LastEditTime: 2023-11-25 18:09:05
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入部门名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门编码" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上级部门" prop="parentId">
|
||||
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="dialog">
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入部门名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门编码" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上级部门" prop="parentId">
|
||||
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -68,6 +70,7 @@ export default {
|
||||
},
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
isChoosed: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
|
||||
@@ -104,3 +107,9 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog {
|
||||
min-height: 180px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -46,35 +46,36 @@
|
||||
}}文件大小不超过2MB
|
||||
</div>
|
||||
</el-upload>
|
||||
<!-- <div
|
||||
class="file-list__item"
|
||||
v-for="n in 9"
|
||||
:key="n"
|
||||
:style="{
|
||||
display: n > 4 && !expand ? 'none' : 'block',
|
||||
}"
|
||||
:data-name="n"
|
||||
:class="{ 'default-icon': !isPicMode }">
|
||||
<i class="el-icon-delete"></i>
|
||||
</div> -->
|
||||
<div
|
||||
class="file-list__item"
|
||||
v-for="(file, index) in files"
|
||||
:key="file.fileName"
|
||||
:style="{
|
||||
background: isPicMode
|
||||
? `url(${file.fileUrl}) no-repeat`
|
||||
: `url(${defaultBg}) no-repeat`,
|
||||
backgroundSize: isPicMode ? '100% 100%' : '64px',
|
||||
backgroundPosition: isPicMode ? '0% 0%' : 'center',
|
||||
}"
|
||||
:data-name="file.fileName">
|
||||
<el-button
|
||||
v-if="!disabled"
|
||||
type="text"
|
||||
class="el-icon-delete"
|
||||
style="padding: 0"
|
||||
@click="(e) => handleDelete(file)" />
|
||||
style="width: 100%">
|
||||
<div
|
||||
class="file-list__item"
|
||||
v-if="!isPicMode"
|
||||
:style="{
|
||||
background: isPicMode
|
||||
? `url(${file.fileUrl}) no-repeat`
|
||||
: `url(${defaultBg}) no-repeat`,
|
||||
backgroundSize: isPicMode ? '100% 100%' : '64px',
|
||||
backgroundPosition: isPicMode ? '0% 0%' : 'center',
|
||||
}"
|
||||
@click="handleDownload(file)"
|
||||
:data-name="file.fileName">
|
||||
<el-button
|
||||
v-if="!disabled"
|
||||
type="text"
|
||||
class="el-icon-delete"
|
||||
style="padding: 0"
|
||||
@click="(e) => handleDelete(file)" />
|
||||
</div>
|
||||
|
||||
<el-image
|
||||
v-else
|
||||
class="file-list__item"
|
||||
style="width: 100%"
|
||||
:src="file.fileUrl"
|
||||
:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -189,6 +190,32 @@ export default {
|
||||
}, 500);
|
||||
},
|
||||
|
||||
async handleDownload(file) {
|
||||
if (this.isPicMode) {
|
||||
// this.$emit('preview', file);
|
||||
const link = document.createElement('a');
|
||||
link.href = file.fileUrl;
|
||||
link.target = '_blank';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
// this.$emit('download', file);
|
||||
const data = await this.$axios({
|
||||
url: file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(new Blob([data]));
|
||||
link.download = file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(link.href);
|
||||
}
|
||||
},
|
||||
|
||||
emitFilelist() {
|
||||
this.$emit('update', this.files);
|
||||
},
|
||||
|
||||
@@ -42,16 +42,26 @@
|
||||
v-model="form" />
|
||||
</div>
|
||||
|
||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
||||
<div
|
||||
v-if="section.key == 'attrs'"
|
||||
style="margin-top: 12px; position: relative">
|
||||
<div
|
||||
v-if="!mode.includes('detail')"
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
</el-button>
|
||||
</div>
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="section.props"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="list"
|
||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr" -->
|
||||
<method-btn
|
||||
v-if="section.tableBtn"
|
||||
slot="handleBtn"
|
||||
@@ -76,7 +86,7 @@
|
||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">确定</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
@@ -162,7 +172,9 @@ export default {
|
||||
input: true,
|
||||
label: '属性名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '属性名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '属性名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
|
||||
@@ -1,29 +1,62 @@
|
||||
<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" v-model="form"
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
key="index-dialog-form"
|
||||
ref="form"
|
||||
label-position="top"
|
||||
size="small"
|
||||
v-model="form"
|
||||
:has-files="['files', 'files2']"
|
||||
: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',
|
||||
@@ -50,20 +83,23 @@
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
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>
|
||||
|
||||
@@ -96,21 +132,21 @@ export default {
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-equipment:update`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
@@ -176,14 +212,18 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:export') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:core-equipment:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:core-equipment:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
@@ -196,7 +236,9 @@ export default {
|
||||
input: true,
|
||||
label: '设备名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
// bind: {
|
||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
||||
// }
|
||||
@@ -225,7 +267,9 @@ export default {
|
||||
label: '设备类型',
|
||||
prop: 'equipmentTypeId',
|
||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||
rules: [{ required: true, message: '设备类型不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '设备类型不能为空', trigger: 'blur' },
|
||||
],
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
@@ -235,7 +279,11 @@ export default {
|
||||
label: '预计生产时间(min/天)',
|
||||
prop: 'workTime',
|
||||
rules: [
|
||||
{ required: true, message: '预计生产时间不能为空', trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
message: '预计生产时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
@@ -288,10 +336,14 @@ export default {
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '产品加工时间(s)',
|
||||
label: '单件产品加工时间(s)',
|
||||
prop: 'processingTime',
|
||||
rules: [
|
||||
{ required: true, message: '产品加工时间不能为空', trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
message: '单件产品加工时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
@@ -320,8 +372,21 @@ export default {
|
||||
},
|
||||
],
|
||||
[
|
||||
{ input: true, label: '备注', prop: 'remark' }
|
||||
]
|
||||
{
|
||||
upload: true,
|
||||
label: '设备资料',
|
||||
prop: 'files',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
upload: true,
|
||||
label: '设备图片',
|
||||
prop: 'files2',
|
||||
fileType: 1,
|
||||
},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
// [
|
||||
// {
|
||||
// assetUpload: true,
|
||||
@@ -422,7 +487,7 @@ export default {
|
||||
// 表单参数
|
||||
form: {
|
||||
id: null,
|
||||
files: []
|
||||
files: [],
|
||||
},
|
||||
showUploadComponents: false, // 是否显示上传组件
|
||||
};
|
||||
@@ -434,36 +499,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;
|
||||
},
|
||||
},
|
||||
@@ -505,7 +570,8 @@ export default {
|
||||
spec: undefined,
|
||||
description: undefined,
|
||||
remark: undefined,
|
||||
files: []
|
||||
files: [],
|
||||
files2: [],
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
@@ -533,9 +599,12 @@ export default {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const payload = Object.assign({}, this.form);
|
||||
payload.files = [...payload.files, ...payload.files2];
|
||||
delete payload.files2;
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipment(this.form).then((response) => {
|
||||
updateEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@@ -543,7 +612,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipment(this.form).then((response) => {
|
||||
createEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@@ -562,7 +631,7 @@ export default {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@@ -580,7 +649,7 @@ export default {
|
||||
this.$download.excel(response, '设备.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {});
|
||||
},
|
||||
// 查看详情
|
||||
viewDetail(id) {
|
||||
|
||||
@@ -189,6 +189,10 @@ export default {
|
||||
],
|
||||
label: '产线统计类型',
|
||||
prop: 'lineDataType',
|
||||
bind: {
|
||||
clearable: true, filterable: true
|
||||
},
|
||||
rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
@@ -199,6 +203,10 @@ export default {
|
||||
],
|
||||
label: '工段统计类型',
|
||||
prop: 'sectionDataType',
|
||||
bind: {
|
||||
clearable: true, filterable: true
|
||||
},
|
||||
rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }],
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-15 16:23:49
|
||||
* @LastEditTime: 2023-11-27 20:12:00
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -11,7 +11,7 @@
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
label-width="90px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="原料名称" prop="name">
|
||||
@@ -46,6 +46,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
@@ -70,7 +73,8 @@ export default {
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
unit: undefined,
|
||||
dailyCost: undefined
|
||||
dailyCost: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
width="45%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-15 15:41:44
|
||||
* @LastEditTime: 2023-11-27 20:07:09
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
@@ -114,14 +114,6 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="drawer-body__footer">
|
||||
<el-button v-if="!idAttrShow" @click="goback()">取消</el-button>
|
||||
<el-button v-else :disabled="isdetail" @click="init(dataForm.id)">重置</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<small-title
|
||||
@@ -158,14 +150,16 @@
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page-sizes="[5, 10, 15]"
|
||||
@pagination="getList" />
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button @click="goback()">取消</el-button>
|
||||
<el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@@ -253,8 +247,8 @@ export default {
|
||||
isdetail: false,
|
||||
idAttrShow: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
|
||||
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
@@ -270,11 +264,7 @@ export default {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.attrName
|
||||
? '[名称=' + raw.data.attrName + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
`是否确认删除属性名为"${raw.data.name}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
|
||||
@@ -84,18 +84,18 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-product:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-product:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-product:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-product:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
@@ -141,6 +141,27 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否确认删除产品名称为"${name}"的数据项`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
// 查看详情
|
||||
otherMethods(val) {
|
||||
if (val.type === 'detail') {
|
||||
|
||||
@@ -144,8 +144,8 @@ export default {
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.list;
|
||||
// this.getStatus(response.data.list)
|
||||
// this.tableData = response.data.list;
|
||||
this.getStatus(response.data.list)
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
label: '供应商',
|
||||
placeholder: '供应商名称',
|
||||
param: 'name',
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-20 16:51:24
|
||||
* @LastEditTime: 2023-11-24 18:20:26
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -29,11 +29,10 @@
|
||||
|
||||
<div class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block;" @click="addNew()">
|
||||
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
||||
<span class="add">添加</span>
|
||||
</span>
|
||||
</template>
|
||||
<span style="display: inline-block;">
|
||||
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
@@ -298,7 +297,7 @@ export default {
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
<template>
|
||||
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm" label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="工单名称" prop="name">
|
||||
<el-input v-model="dataForm.name"></el-input>
|
||||
<el-input v-model="dataForm.name" placeholder="请输入工单名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="工单编码" prop="code">
|
||||
<el-input v-model="dataForm.code" disabled></el-input>
|
||||
<el-input v-model="dataForm.code" disabled placeholder="请输入工单编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="dataForm.planProductId" placeholder="请选择" style="width: 100%;" @change="selectProduct">
|
||||
<el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" @change="selectProduct">
|
||||
<el-option
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
@@ -25,52 +23,50 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="产品规格" prop="specifications">
|
||||
<el-input v-model="dataForm.specifications" />
|
||||
<el-input v-model="dataForm.specifications" placeholder="请输入产品规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="计划开始时间">
|
||||
<el-date-picker
|
||||
v-model="dataForm.planStartTime"
|
||||
type="datetime"
|
||||
value-format="timestamp"
|
||||
style="width: 100%;"
|
||||
placeholder="选择日期">
|
||||
placeholder="请选择计划开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="计划完成时间">
|
||||
<el-date-picker
|
||||
v-model="dataForm.planFinishTime"
|
||||
type="datetime"
|
||||
value-format="timestamp"
|
||||
style="width: 100%;"
|
||||
placeholder="选择日期">
|
||||
placeholder="请选择计划完成时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
||||
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划投入数量"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="计划生产数量" prop="planQuantity">
|
||||
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划生产数量"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="关联工艺" prop="processFlowId">
|
||||
<el-select v-model="dataForm.processFlowId" placeholder="请选择工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange">
|
||||
<el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange">
|
||||
<el-option
|
||||
v-for="item in processFlowList"
|
||||
:key="item.id"
|
||||
@@ -80,19 +76,23 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange">
|
||||
<!-- <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange">
|
||||
<el-radio :label="1">产品基础BOM</el-radio>
|
||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||
</el-radio-group>
|
||||
</el-radio-group> -->
|
||||
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange">
|
||||
<el-option key="1" label="产品基础BOM" :value="1" />
|
||||
<el-option key="2" label="工艺扩展BOM" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="dataForm.priority" placeholder="请选择" style="width: 100%;">
|
||||
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
|
||||
:key="item.value"
|
||||
@@ -102,9 +102,9 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择" style="width: 100%;">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in workOrderTypeList"
|
||||
:key="item.id"
|
||||
@@ -115,10 +115,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="关联产线" prop="productLineIds">
|
||||
<el-select v-model="dataForm.productLineIds" placeholder="请选择" multiple style="width: 100%;">
|
||||
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
@@ -128,9 +128,9 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="dataForm.workers"></el-input>
|
||||
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -311,11 +311,11 @@ export default {
|
||||
if (val) {
|
||||
this.productList.map(item => {
|
||||
if (val === item.id) {
|
||||
this.dataForm.productSpec = item.specifications
|
||||
this.dataForm.specifications = item.specifications
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.dataForm.productSpec = ''
|
||||
this.dataForm.specifications = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 09:47:53
|
||||
* @LastEditTime: 2023-11-23 18:45:15
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -49,7 +49,9 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">负责人:{{ dataForm.workers }}</el-col>
|
||||
<el-col :span="8">关联产线:{{ dataForm.productLineNames }}</el-col>
|
||||
<el-col :span="8">关联产线:
|
||||
<span v-for="(item, index) in dataForm.productLineNames" :key="index" style="margin-right: 10px">{{ item }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
|
||||
@@ -65,7 +65,8 @@ const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
'show-overflow-tooltip': true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
@@ -127,48 +128,10 @@ export default {
|
||||
allocationVisible: false,
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-work-order:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:material`)
|
||||
this.$auth.hasPermi(`base:core-work-order:material`)
|
||||
? {
|
||||
type: 'material',
|
||||
btnName: '预使用原料信息',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
btnName: '原料信息',
|
||||
}
|
||||
: undefined,
|
||||
{
|
||||
@@ -246,7 +209,45 @@ export default {
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
this.$auth.hasPermi(`base:core-work-order:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
].filter((v)=>v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 10:26:58
|
||||
* @LastEditTime: 2023-11-24 18:13:02
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -196,7 +196,7 @@ export default {
|
||||
workCost: undefined,
|
||||
remark: undefined,
|
||||
},
|
||||
majorIdList: undefined,
|
||||
majorIdList: [],
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
bindIds: [],
|
||||
@@ -267,7 +267,7 @@ export default {
|
||||
workCost: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
this.majorIdList = undefined
|
||||
this.majorIdList = []
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
@@ -288,24 +288,28 @@ export default {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
this.majorIdList.forEach(majorId => {
|
||||
createWoBindMa({
|
||||
workerId: this.dataForm.id,
|
||||
majorId: majorId
|
||||
}).then(res => {})
|
||||
});
|
||||
if (this.majorIdList.length > 0) {
|
||||
this.majorIdList.forEach(majorId => {
|
||||
createWoBindMa({
|
||||
workerId: this.dataForm.id,
|
||||
majorId: majorId
|
||||
}).then(res => {})
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
// response.data = id
|
||||
this.workerId = response.data
|
||||
this.majorIdList.forEach(majorId => {
|
||||
createWoBindMa({
|
||||
workerId: this.workerId,
|
||||
majorId: majorId
|
||||
}).then(res => {})
|
||||
});
|
||||
if (this.majorIdList.length > 0) {
|
||||
this.majorIdList.forEach(majorId => {
|
||||
createWoBindMa({
|
||||
workerId: this.workerId,
|
||||
majorId: majorId
|
||||
}).then(res => {})
|
||||
});
|
||||
}
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
@@ -324,6 +328,7 @@ export default {
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
this.dataForm.departmentName = undefined
|
||||
});
|
||||
// 获取员工--专业
|
||||
getWoBindMaPage({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 08:55:37
|
||||
* @LastEditTime: 2023-11-27 09:21:48
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -43,7 +43,9 @@
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="dataForm.sort"
|
||||
placeholder="排序" />
|
||||
controls-position="right"
|
||||
placeholder="排序"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
||||
@@ -166,13 +166,17 @@ export default {
|
||||
input: true,
|
||||
label: '参数列名',
|
||||
prop: 'plcParamName',
|
||||
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '参数名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -419,35 +423,35 @@ export default {
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
async submitAttrForm() {
|
||||
this.$refs['attrForm'].validate((valid) => {
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: {
|
||||
...this.attrForm,
|
||||
connectId: this.infoData.id
|
||||
},
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: {
|
||||
...this.attrForm,
|
||||
connectId: this.infoData.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 11:22:38
|
||||
* @LastEditTime: 2023-11-27 15:26:12
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
@@ -120,6 +120,7 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
@@ -156,13 +157,11 @@
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
@@ -293,11 +292,7 @@ export default {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.attrName
|
||||
? '[名称=' + raw.data.attrName + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
`是否确认删除属性名为"${raw.data.attrName}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
@@ -363,6 +358,29 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.idAttrShow = true
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
@@ -432,7 +450,7 @@ export default {
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -35px 15px;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:width="'35%'"
|
||||
:width="'30%'"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
class="dialog">
|
||||
@@ -17,7 +17,7 @@
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
label-width="70px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="属性名" prop="attrName">
|
||||
<el-input
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="220"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
deleteMaterial
|
||||
} from '@/api/base/material';
|
||||
import { listData } from "@/api/system/dict/data";
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -59,8 +60,9 @@ const tableProps = [
|
||||
label: '英文名称'
|
||||
},
|
||||
{
|
||||
prop: 'materialType',
|
||||
label: '物料类型'
|
||||
prop: 'type',
|
||||
label: '物料类型',
|
||||
filter: publicFormatter('material_type')
|
||||
},
|
||||
{
|
||||
prop: 'supplierName',
|
||||
@@ -83,25 +85,25 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:material:queryAttr`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看属性',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material:queryAttr`)
|
||||
? {
|
||||
type: 'search',
|
||||
btnName: '查看属性',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material:editAttr`)
|
||||
? {
|
||||
type: 'editAttr',
|
||||
btnName: '编辑属性',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material:delete`)
|
||||
// this.$auth.hasPermi(`base:material:editAttr`)
|
||||
// ? {
|
||||
// type: 'editAttr',
|
||||
// btnName: '编辑属性',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi(`base:material:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@@ -134,7 +136,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:material:create') ? 'button' : '',
|
||||
btnName: '新增物料',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
@@ -164,7 +166,7 @@ export default {
|
||||
});
|
||||
},
|
||||
otherMethods(val) {
|
||||
if (val.type === 'search') {
|
||||
if (val.type === 'detail') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-06 19:55:59
|
||||
* @LastEditTime: 2023-11-27 15:10:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -18,7 +18,8 @@
|
||||
<el-select
|
||||
v-model="dataForm.materialId"
|
||||
placeholder="请选择物料"
|
||||
@change="setMaterialCode">
|
||||
@change="setMaterialCode"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in materialList"
|
||||
:key="dict.id"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 11:09:44
|
||||
* @LastEditTime: 2023-11-27 19:50:36
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="70%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
@@ -25,7 +25,7 @@
|
||||
label-width="100px"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="productId">
|
||||
<el-select
|
||||
v-model="dataForm.productId"
|
||||
@@ -42,15 +42,17 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品BOM编码" prop="code">
|
||||
<el-input v-model="dataForm.code" :disabled="isdetail" placeholder="请输入产品Bom编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
@@ -60,90 +62,26 @@
|
||||
BOM明细
|
||||
</small-title>
|
||||
|
||||
<!-- <base-table
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block;">
|
||||
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:add-button-show="isdetail ? null : '添加属性'"
|
||||
@emitButtonClick="addNew()"
|
||||
:table-data="materialAttrList">
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
:width="90"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table> -->
|
||||
<el-button v-show="!isdetail" type="success" size="small" style="float: right" @click="addRow()">添加一行</el-button>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" label="序号" />
|
||||
<el-table-column prop="createTime" label="添加时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialId" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.materialId"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!scope.row.isEdit"
|
||||
placeholder="请选择物料"
|
||||
@change="setCode(scope.row)">
|
||||
<el-option
|
||||
v-for="dict in materialList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialCode" label="物料编码" />
|
||||
<el-table-column prop="mUnit" label="单位" />
|
||||
<el-table-column prop="num" label="数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.num" :disabled="!scope.row.isEdit"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark" :disabled="!scope.row.isEdit"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="!isdetail" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip v-if="!scope.row.isEdit" placement="top" content="编辑">
|
||||
<el-button
|
||||
type="text"
|
||||
:style="{color:'#0B58FF'}"
|
||||
size="mini"
|
||||
@click="edit(scope.row)"
|
||||
>
|
||||
<!-- 此处的icon的名字命名为'table_'加上按钮的type -->
|
||||
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="edit" />
|
||||
<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-button v-else type="text" size="small" @click="saveData(scope.row)">保存</el-button>
|
||||
<el-tooltip placement="top" content="删除">
|
||||
<el-button
|
||||
type="text"
|
||||
:style="{color:'#FF5454'}"
|
||||
size="mini"
|
||||
@click="deleteDetail(scope.row)"
|
||||
>
|
||||
<!-- 此处的icon的名字命名为'table_'加上按钮的type -->
|
||||
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="table_delete" />
|
||||
<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</base-table>
|
||||
<pagination
|
||||
v-show="listQuery.total > 0"
|
||||
:total="listQuery.total"
|
||||
@@ -153,20 +91,17 @@
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <attr-add
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:material-id="dataForm.id"
|
||||
@refreshDataList="getList" /> -->
|
||||
:bom-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
@@ -177,7 +112,8 @@ import { getMaterialList } from "@/api/base/material";
|
||||
import { listData } from "@/api/system/dict/data";
|
||||
import SmallTitle from '../material/SmallTitle';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
import attrAdd from './attr-add';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
@@ -196,18 +132,31 @@ const tableProps = [
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'attrName',
|
||||
label: '属性名',
|
||||
prop: 'materialName',
|
||||
label: '物料名称',
|
||||
},
|
||||
{
|
||||
prop: 'attrValue',
|
||||
label: '属性值',
|
||||
prop: 'materialCode',
|
||||
label: '物料编码',
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict'),
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '数量',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { SmallTitle },
|
||||
components: { SmallTitle, attrAdd },
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
@@ -233,7 +182,6 @@ export default {
|
||||
},
|
||||
productList: [],
|
||||
materialAttrList: [],
|
||||
materialList: [],
|
||||
tableData: [],
|
||||
unitList: [],
|
||||
visible: false,
|
||||
@@ -248,13 +196,42 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.deleteDetail(raw.data);
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
// this.visible = false;
|
||||
this.idAttrShow = true;
|
||||
this.dataForm.id = response.data
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
async getDict() {
|
||||
// 产品列表
|
||||
const proRes = await getProList();
|
||||
this.productList = proRes.data;
|
||||
// 物料列表
|
||||
const res = await getMaterialList();
|
||||
this.materialList = res.data;
|
||||
// 物料单位列表
|
||||
const unitRes = await listData({
|
||||
pageNo: 1,
|
||||
@@ -274,8 +251,7 @@ export default {
|
||||
},
|
||||
deleteDetail(raw) {
|
||||
this.$confirm(
|
||||
`确定删除关于物料编码为${
|
||||
raw.materialCode}的数据?`,
|
||||
`是否确认删除物料名称为"${raw.materialName}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
@@ -297,67 +273,13 @@ export default {
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
setCode(row) {
|
||||
const tempM = this.materialList.filter(item => {
|
||||
if (row.materialId === item.id) {
|
||||
row.materialCode = item.code
|
||||
}
|
||||
return row.materialId === item.id
|
||||
})
|
||||
if (tempM[0].unit) {
|
||||
this.unitList.filter(u => {
|
||||
if (tempM[0].unit === u.value) {
|
||||
row.unit = u.value
|
||||
row.mUnit = u.label
|
||||
}
|
||||
})
|
||||
}
|
||||
// row.materialCode = tempList[0].code
|
||||
// row.unit = tempList[0].unit
|
||||
},
|
||||
edit(row) {
|
||||
row.isEdit = true
|
||||
},
|
||||
saveData(row) {
|
||||
// this.$refs['dataForm'].validate((valid) => {
|
||||
// if (valid) {
|
||||
// 修改的提交
|
||||
if (row.id) {
|
||||
updateMaterialPBDet({
|
||||
...row
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
// this.visible = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createMaterialPBDet({
|
||||
...row
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
// this.visible = false;
|
||||
this.getList();
|
||||
});
|
||||
// }
|
||||
// });
|
||||
},
|
||||
getList() {
|
||||
// 获取产品Bom详细列表
|
||||
getProBomList({
|
||||
...this.listQuery,
|
||||
bomId: this.dataForm.id
|
||||
}).then((response) => {
|
||||
this.tableData = response.data.records.map(item => {
|
||||
this.unitList.filter(u => {
|
||||
if (item.unit === u.value) {
|
||||
item.mUnit = u.label
|
||||
}
|
||||
})
|
||||
item.isEdit = false
|
||||
return item
|
||||
});
|
||||
this.tableData = response.data.records
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
@@ -453,7 +375,7 @@ export default {
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 30vh;
|
||||
max-height: 20vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
@@ -469,4 +391,12 @@ export default {
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
||||
|
||||
197
src/views/base/materialProductBom/attr-add.vue
Normal file
197
src/views/base/materialProductBom/attr-add.vue
Normal file
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:width="'40%'"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
class="dialog">
|
||||
<template #title>
|
||||
<slot name="title">
|
||||
<div class="titleStyle">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</div>
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="80px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料名称" prop="materialId">
|
||||
<el-select
|
||||
v-model="dataForm.materialId"
|
||||
placeholder="请选择物料"
|
||||
clearable
|
||||
filterable
|
||||
@change="setCode"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in materialList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="dataForm.materialCode"
|
||||
clearable
|
||||
disabled
|
||||
placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-select
|
||||
v-model="dataForm.unit"
|
||||
style="width: 100%"
|
||||
disabled
|
||||
placeholder="请选择单位">
|
||||
<el-option
|
||||
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数量" prop="num">
|
||||
<el-input-number v-model="dataForm.num" controls-position="right" clearable placeholder="请输入数量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMaterialList } from '@/api/base/material';
|
||||
import { createMaterialPBDet, updateMaterialPBDet, getMaterialPBDet } from "@/api/base/materialProductBom";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
bomId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
materialId: '',
|
||||
num: 0,
|
||||
materialCode: undefined,
|
||||
unit: undefined,
|
||||
remark: '',
|
||||
},
|
||||
materialList: [],
|
||||
dataRule: {
|
||||
materialId: [{ required: true, message: '物料名称不能为空', trigger: 'change' }],
|
||||
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }]
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getMaterialList();
|
||||
this.materialList = res.data;
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getMaterialPBDet(this.dataForm.id).then((res) => {
|
||||
this.dataForm = res.data
|
||||
this.setCode()
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
setCode() {
|
||||
const tempMaterial = this.materialList.filter(item =>{
|
||||
return item.id === this.dataForm.materialId
|
||||
})
|
||||
this.dataForm.materialCode = tempMaterial[0]?.code
|
||||
this.dataForm.unit = tempMaterial[0].unit === undefined ? undefined : String(tempMaterial[0]?.unit)
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateMaterialPBDet({
|
||||
...this.dataForm,
|
||||
bomId: this.bomId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createMaterialPBDet({
|
||||
...this.dataForm,
|
||||
bomId: this.bomId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog >>> .el-dialog__body {
|
||||
padding: 30px 24px;
|
||||
}
|
||||
.dialog >>> .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -13,7 +13,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="220"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@@ -68,24 +68,24 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:material-product-bom:update`)
|
||||
this.$auth.hasPermi(`base:material-product-bom:queryMaterial`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看物料',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material-product-bom:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material-product-bom:queryMaterial`)
|
||||
? {
|
||||
type: 'search',
|
||||
btnName: '查看物料',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:material-product-bom:editMaterial`)
|
||||
? {
|
||||
type: 'editMaterial',
|
||||
btnName: '编辑物料',
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi(`base:material-product-bom:editMaterial`)
|
||||
// ? {
|
||||
// type: 'editMaterial',
|
||||
// btnName: '编辑物料',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi(`base:material-product-bom:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
created() {},
|
||||
methods: {
|
||||
otherMethods(val) {
|
||||
if (val.type === 'search') {
|
||||
if (val.type === 'detail') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 10:40:08
|
||||
* @LastEditTime: 2023-11-27 19:57:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -11,9 +11,10 @@
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
label-width="80px"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="materialId">
|
||||
<el-select
|
||||
v-model="dataForm.materialId"
|
||||
@@ -21,6 +22,7 @@
|
||||
clearable
|
||||
filterable
|
||||
@change="setCode"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in materialList"
|
||||
@@ -30,7 +32,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="dataForm.materialCode"
|
||||
@@ -39,15 +41,14 @@
|
||||
placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="批次号" prop="materialDateId">
|
||||
<el-select
|
||||
v-model="dataForm.materialDateId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择物料批次"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in materialDateList"
|
||||
@@ -57,13 +58,16 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用设备" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择使用设备">
|
||||
placeholder="请选择使用设备"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in eqList"
|
||||
:key="dict.id"
|
||||
@@ -72,9 +76,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用时间" prop="useTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.useTime"
|
||||
@@ -84,14 +86,15 @@
|
||||
placeholder="选择日期时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="操作员" prop="userNames">
|
||||
<el-select
|
||||
v-model="dataForm.userNames"
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
placeholder="请选择操作员">
|
||||
placeholder="请选择操作员"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in workersList"
|
||||
:key="dict.id"
|
||||
@@ -102,12 +105,12 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用数量" prop="num">
|
||||
<el-input-number v-model="dataForm.num" clearable placeholder="请输入使用数量" />
|
||||
<el-input-number v-model="dataForm.num" clearable controls-position="right" placeholder="请输入使用数量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数据来源" prop="source">
|
||||
<el-select
|
||||
v-model="dataForm.source"
|
||||
@@ -121,10 +124,12 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
@@ -237,13 +242,8 @@ export default {
|
||||
this.dataForm.source = response.data.source
|
||||
this.dataForm.remark = response.data.remark
|
||||
this.dataForm.userNames = response.data.userName.split(',')
|
||||
console.log('打印', this.dataForm)
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
} else {}
|
||||
});
|
||||
},
|
||||
setCode() {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
width="60%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
@@ -215,12 +215,33 @@ export default {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === "delete") {
|
||||
this.deleteHandle(val.data.id, val.data.materialName, val.data._pageIndex)
|
||||
this.deleteHandle(val.data.id, val.data.materialName)
|
||||
} else if (val.type === "change") {
|
||||
this.changeStatus(val.data.id)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name) {
|
||||
this.$confirm(`是否确认删除物料名称为${name}的数据项?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -6,131 +6,150 @@
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin: 20px">
|
||||
<el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
|
||||
</div>
|
||||
<div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" />
|
||||
</div>
|
||||
<div class="balace-chart">
|
||||
<div style="margin: 20px">
|
||||
<el-button
|
||||
v-for="(item, index) in buttonList"
|
||||
:key="index"
|
||||
:class="[item.actived ? 'activeButton' : '']"
|
||||
@click="changeChart(index)">
|
||||
{{ item.name }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div
|
||||
id="chart"
|
||||
ref="chartDiv"
|
||||
:class="className"
|
||||
:style="{ height: height, width: width }" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import * as echarts from 'echarts';
|
||||
require('echarts/theme/macarons'); // echarts theme
|
||||
// import resize from './mixins/resize'
|
||||
|
||||
export default {
|
||||
// mixins: [resize],
|
||||
props: {
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '350px'
|
||||
},
|
||||
// autoResize: {
|
||||
// type: Boolean,
|
||||
// default: true
|
||||
// }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
dataArray: [],
|
||||
xDatas: [],
|
||||
buttonList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.initChart()
|
||||
},
|
||||
methods: {
|
||||
changeChart(index) {
|
||||
this.setOptions(this.xDatas, this.dataArray[index])
|
||||
this.buttonList.forEach((item, s) => {
|
||||
if (index === s) {
|
||||
// item.actived = true
|
||||
this.$nextTick(() =>{
|
||||
// item.actived = true
|
||||
this.$set(item, 'actived', true)
|
||||
})
|
||||
} else {
|
||||
// item.actived = false
|
||||
this.$nextTick(() =>{
|
||||
// item.actived = false
|
||||
this.$set(item, 'actived', false)
|
||||
})
|
||||
// this.$set(item, 'actived', false)
|
||||
}
|
||||
})
|
||||
console.log('看一下数22222据', this.dataArray)
|
||||
},
|
||||
initChart(xData, yData, lineName) {
|
||||
this.dataArray = yData
|
||||
this.buttonList = this.dataArray.map((item, index) => {
|
||||
return {
|
||||
'name': item.name,
|
||||
'actived': index === 0 ? true : false
|
||||
}
|
||||
})
|
||||
console.log('看一下数据', this.dataArray)
|
||||
this.xDatas = xData
|
||||
this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
|
||||
// this.chart = echarts.init(document.getElementById('chart'), 'macarons')
|
||||
// this.setOptions(xData, yData[0], lineName)
|
||||
},
|
||||
setOptions(xData, dataList, lineName) {
|
||||
// let seriesData = []
|
||||
// lineName.forEach((item,index) => {
|
||||
// seriesData.push({
|
||||
// name: item,
|
||||
// data: yData[index],
|
||||
// type: 'line',
|
||||
// })
|
||||
// })
|
||||
this.chart.setOption({
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data:lineName
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '设备CT',
|
||||
data: dataList.eqData,
|
||||
type: 'line',
|
||||
},
|
||||
{
|
||||
name: '产线CT',
|
||||
data: dataList.plData,
|
||||
type: 'line',
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
// mixins: [resize],
|
||||
props: {
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart',
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '350px',
|
||||
},
|
||||
// autoResize: {
|
||||
// type: Boolean,
|
||||
// default: true
|
||||
// }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
dataArray: [],
|
||||
xDatas: [],
|
||||
buttonList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.initChart()
|
||||
this.$nextTick(() => {
|
||||
this.changeChart(0);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
changeChart(index) {
|
||||
this.setOptions(this.xDatas, this.dataArray[index]);
|
||||
this.buttonList.forEach((item, s) => {
|
||||
if (index === s) {
|
||||
// item.actived = true
|
||||
this.$nextTick(() => {
|
||||
// item.actived = true
|
||||
this.$set(item, 'actived', true);
|
||||
});
|
||||
} else {
|
||||
// item.actived = false
|
||||
this.$nextTick(() => {
|
||||
// item.actived = false
|
||||
this.$set(item, 'actived', false);
|
||||
});
|
||||
// this.$set(item, 'actived', false)
|
||||
}
|
||||
});
|
||||
console.log('看一下数22222据', this.dataArray);
|
||||
},
|
||||
initChart(xData, yData, lineName) {
|
||||
this.dataArray = yData;
|
||||
this.buttonList = this.dataArray.map((item, index) => {
|
||||
return {
|
||||
name: item.name,
|
||||
actived: index === 0 ? true : false,
|
||||
};
|
||||
});
|
||||
console.log('看一下数据', this.dataArray);
|
||||
this.xDatas = xData;
|
||||
this.chart = echarts.init(this.$refs.chartDiv, 'macarons');
|
||||
// this.chart = echarts.init(document.getElementById('chart'), 'macarons')
|
||||
// this.setOptions(xData, yData[0], lineName)
|
||||
},
|
||||
setOptions(xData, dataList, lineName) {
|
||||
// let seriesData = []
|
||||
// lineName.forEach((item,index) => {
|
||||
// seriesData.push({
|
||||
// name: item,
|
||||
// data: yData[index],
|
||||
// type: 'line',
|
||||
// })
|
||||
// })
|
||||
this.chart.setOption({
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
legend: {
|
||||
data: lineName,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '设备CT',
|
||||
data: dataList.eqData,
|
||||
type: 'line',
|
||||
},
|
||||
{
|
||||
name: '产线CT',
|
||||
data: dataList.plData,
|
||||
type: 'line',
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.activeButton {
|
||||
background-color: rgb(93,159,255);
|
||||
}
|
||||
.normalButton {
|
||||
background-color: none;
|
||||
.balace-chart >>> .el-button {
|
||||
background: #e3e3e3;
|
||||
color: #333;
|
||||
transition: all 0.3s;
|
||||
border: none;
|
||||
|
||||
&.activeButton,
|
||||
&:hover {
|
||||
background: #0b58ff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -110,7 +110,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
@@ -149,6 +149,27 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`确定确认删除工厂名称为"${name}"的数据项?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form" label-position='top'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="订单名" prop="orderId">
|
||||
<el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
@@ -13,14 +13,12 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="发货单名称" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="发货时间" prop="deliveryTime">
|
||||
<el-date-picker
|
||||
v-model="form.deliveryTime"
|
||||
@@ -32,14 +30,14 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="发货单号" prop="code">
|
||||
<el-input v-model="form.code"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="发货负责人" prop="deliveryPersonId">
|
||||
<el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
@@ -51,21 +49,19 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="运输负责人" prop="principal">
|
||||
<el-input v-model="form.principal"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="运输联系方式" prop="principalCall">
|
||||
<el-input v-model="form.principalCall"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="运输费用" prop="principalCost">
|
||||
<el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2'></el-input-number>
|
||||
<el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2' style='width: 100%;'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
<div>
|
||||
<el-drawer
|
||||
title="发货清单详情"
|
||||
size="60%"
|
||||
size="65%"
|
||||
:append-to-body="true"
|
||||
:visible.sync="centervisible"
|
||||
@close='close'>
|
||||
@close='close'
|
||||
:show-close='false'>
|
||||
<div class="box1">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
@@ -90,7 +91,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'packagingSize',
|
||||
label: '装箱规格(片/箱)',
|
||||
width: 120
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
prop: 'packagingNum',
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
<template>
|
||||
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form" label-position='top'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="发货单号">
|
||||
<el-input v-model="code" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="装车单号" prop="deliveryCarCode">
|
||||
<el-input v-model="form.deliveryCarCode"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="装车时间" prop="loadTime">
|
||||
<el-date-picker
|
||||
v-model="form.loadTime"
|
||||
@@ -25,19 +23,19 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="车辆联系人" prop="contactPerson">
|
||||
<el-input v-model="form.contactPerson"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="联系方式" prop="contactPersonCall">
|
||||
<el-input v-model="form.contactPersonCall"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="装车产品" prop="productId">
|
||||
<el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
@@ -49,26 +47,24 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="装箱规格(片/箱)" prop="packagingSize">
|
||||
<el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="产品批次" prop="productDate">
|
||||
<el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="箱/托数" prop="packagingNum">
|
||||
<el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="装车总量" prop="quantity">
|
||||
<el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
@@ -103,7 +103,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'principalCost',
|
||||
label: '运输费用'
|
||||
label: '运输费用',
|
||||
align: 'right'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
@@ -225,7 +226,11 @@ export default {
|
||||
},
|
||||
getList() {
|
||||
deliveryLogPage({...this.queryParams}).then(res => {
|
||||
this.list = res.data.list || []
|
||||
let arr = res.data.list || []
|
||||
arr && arr.map(item => {
|
||||
item.principalCost = item.principalCost.toFixed(2)
|
||||
})
|
||||
this.list = arr
|
||||
this.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
<el-drawer
|
||||
title="发货进度"
|
||||
:visible.sync="centervisible"
|
||||
size="80%"
|
||||
size="50%"
|
||||
class="deliveryLogDetail"
|
||||
@close='closeA'>
|
||||
@close='closeA'
|
||||
:show-close='false'>
|
||||
<div class="box1">
|
||||
<div class="box_col">
|
||||
<div class="blodTip">订单名</div>
|
||||
@@ -46,7 +47,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="150"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="viewDetDetail"
|
||||
@@ -64,7 +65,7 @@
|
||||
<div v-if="activeName === 'barChart'">
|
||||
<div
|
||||
id="logDetPieBar"
|
||||
style="width: 100%"
|
||||
style="width: 60%"
|
||||
:style="{ height: chartHeight + 'px' }"
|
||||
></div>
|
||||
</div>
|
||||
@@ -74,10 +75,11 @@
|
||||
<!-- 详情抽屉 -->
|
||||
<el-drawer
|
||||
title="发货详情"
|
||||
size="60%"
|
||||
size="50%"
|
||||
:append-to-body="true"
|
||||
:visible.sync="innerDrawer"
|
||||
@close='closeB'>
|
||||
@close='closeB'
|
||||
:show-close='false'>
|
||||
<div class="box3">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
@@ -139,7 +141,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'rate',
|
||||
label: '发货比列(%)'
|
||||
label: '发货比列(%)',
|
||||
width: 110
|
||||
},
|
||||
{
|
||||
prop: 'principalCost',
|
||||
@@ -171,7 +174,8 @@ const tableProps2 = [
|
||||
},
|
||||
{
|
||||
prop: 'packagingSize',
|
||||
label: '装箱规格(片/箱)'
|
||||
label: '装箱规格(片/箱)',
|
||||
minWidth: 140
|
||||
},
|
||||
{
|
||||
prop: 'packagingNum',
|
||||
@@ -208,8 +212,8 @@ export default {
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team:update')
|
||||
? {
|
||||
type: 'detDetail',
|
||||
btnName: '查看发货详情'
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
@@ -228,7 +232,7 @@ export default {
|
||||
// 图
|
||||
chartDom: '',
|
||||
chart: '',
|
||||
chartHeight: this.tableHeight(300)
|
||||
chartHeight: this.tableHeight(300)*0.6
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
@@ -268,6 +272,8 @@ export default {
|
||||
}
|
||||
},
|
||||
getBar() {
|
||||
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
|
||||
let colorList = []
|
||||
if (
|
||||
this.chart !== null &&
|
||||
this.chart !== '' &&
|
||||
@@ -278,64 +284,90 @@ export default {
|
||||
this.chartDom = document.getElementById('logDetPieBar')
|
||||
this.chart = echarts.init(this.chartDom)
|
||||
let seriesData = []
|
||||
let sumData = 0
|
||||
this.tableData && this.tableData.map(item =>{
|
||||
if (this.tableData.length > 0) {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
let obj = {}
|
||||
obj.value = this.tableData[i].num
|
||||
obj.name = this.tableData[i].name
|
||||
seriesData.push(obj)
|
||||
if (i < 5) {
|
||||
colorList.push(color[i])
|
||||
} else {
|
||||
colorList.push(color[i%5])
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.orderMsg.num < this.orderMsg.orderNum) {
|
||||
let obj = {}
|
||||
obj.value = item.rate
|
||||
obj.name = item.name
|
||||
seriesData.push(obj)
|
||||
sumData+=item.rate
|
||||
})
|
||||
if (sumData < 100) {
|
||||
let obj = {}
|
||||
obj.value = 100 - sumData
|
||||
obj.value = this.orderMsg.orderNum - this.orderMsg.num
|
||||
obj.name = "未发货"
|
||||
seriesData.push(obj)
|
||||
colorList.push('#F5F5F5')
|
||||
}else {
|
||||
let obj = {}
|
||||
obj.value = 0
|
||||
obj.name = "未发货"
|
||||
seriesData.push(obj)
|
||||
colorList.push('#F5F5F5')
|
||||
}
|
||||
var option = {
|
||||
color: ['#B0EB42', '#FF9747', '#FF6860', '#7164FF', '#288AFF', '#63BDFF', '#73DE93', '#FFCE6A'],
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function(params) {
|
||||
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${params.color};"></span>`
|
||||
return `<span>
|
||||
<span style="color:rgba(0,0,0,0.85);">${str}${params.name}</span>
|
||||
<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${params.percent}</span>
|
||||
</span>`
|
||||
}
|
||||
},
|
||||
color: colorList,
|
||||
legend: {
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: '10%',
|
||||
top: 20,
|
||||
bottom: 20,
|
||||
icon: 'rect',
|
||||
itemHeight: 8,
|
||||
itemWidth: 8
|
||||
bottom: '5%',
|
||||
left: 'center',
|
||||
itemWidth: 8,
|
||||
itemHeight: 8
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['60%', '80%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
radius: ['40%', '55%'],
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 40,
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
scale: true ,
|
||||
scaleSize: 20 ,
|
||||
scale: false
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
label: {
|
||||
alignTo: 'edge',
|
||||
formatter: '{name|{b}}\n{value|{c}}',
|
||||
minMargin: 5,
|
||||
edgeDistance: 10,
|
||||
lineHeight: 15,
|
||||
rich: {
|
||||
name: {
|
||||
fontSize: 14,
|
||||
color: 'rgba(0,0,0,0.65)'
|
||||
},
|
||||
value: {
|
||||
fontSize: 14,
|
||||
color: 'rgba(0,0,0,0.65)'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: seriesData
|
||||
},
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['40%', '40%'],
|
||||
label: {
|
||||
show: true,
|
||||
position: 'center',
|
||||
color: '#000',
|
||||
formatter: [
|
||||
'{a|'+this.orderMsg.orderNum+'}',
|
||||
'{b|总数}'
|
||||
].join('\n\n'),
|
||||
rich: {
|
||||
a: {
|
||||
fontSize: 26 +'px'
|
||||
},
|
||||
b: {
|
||||
fontSize: 16 +'px'
|
||||
}
|
||||
}
|
||||
},
|
||||
emphasis: {
|
||||
scale: false
|
||||
},
|
||||
data: [100]
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -375,11 +407,13 @@ export default {
|
||||
</script>
|
||||
<style scoped lang='scss'>
|
||||
.box1 {
|
||||
height: 56px;
|
||||
height: 76px;
|
||||
border-bottom: 1px solid #E9E9E9;
|
||||
margin: 0px 8px 20px 30px;
|
||||
.box_col {
|
||||
display: inline-block;
|
||||
width: 20%;
|
||||
padding: 8px 8px 8px 40px;
|
||||
padding: 8px 8px 8px 8px;
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
@@ -396,7 +430,7 @@ export default {
|
||||
}
|
||||
}
|
||||
.box2 {
|
||||
padding:32px 32px 30px 30px;
|
||||
padding:0px 32px 30px 30px;
|
||||
height: calc(100vh - 150px);
|
||||
}
|
||||
.boxTitle {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<span class="blue-block"></span>
|
||||
<el-form-item label="能源类型">
|
||||
<el-form-item label="能源类型" required>
|
||||
<el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small">
|
||||
<el-option
|
||||
v-for="item in energyTypeList"
|
||||
@@ -12,7 +12,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间维度">
|
||||
<el-form-item label="时间维度" required>
|
||||
<el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
|
||||
@@ -22,7 +22,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间范围">
|
||||
<el-form-item label="时间范围" required>
|
||||
<div v-show="queryParams.timeDim === '1'">
|
||||
<el-date-picker
|
||||
v-model="timeValue"
|
||||
@@ -124,7 +124,7 @@
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="对象维度">
|
||||
<el-form-item label="对象维度" required>
|
||||
<el-select v-model="queryParams.objType" placeholder="请选择" style="width: 80px;" @change="selectObjs" size="small">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(this.DICT_TYPE.OBJECT_TYPE)"
|
||||
@@ -134,7 +134,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="对象选择">
|
||||
<el-form-item label="对象选择" required>
|
||||
<el-select v-model="queryParams.objIds" placeholder="请选择" multiple :multiple-limit='5' collapse-tags style="width: 200px;" size="small">
|
||||
<el-option
|
||||
v-for="item in objectList"
|
||||
@@ -148,6 +148,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="search">查询</el-button>
|
||||
<span class="separateStyle"></span>
|
||||
<el-button size="small" @click="resetBtn">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span v-if="isFold" class="foldClass" @click='switchMode'>
|
||||
@@ -400,6 +402,19 @@ export default {
|
||||
console.log(this.queryParams)
|
||||
this.$emit('submit', this.queryParams)
|
||||
},
|
||||
resetBtn() {
|
||||
this.queryParams.energyTypeId = null
|
||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
||||
this.queryParams.objIds = []
|
||||
this.queryParams.objType = ''
|
||||
this.timeValue = []
|
||||
this.dateValue = []
|
||||
this.weekValue1 = null
|
||||
this.weekValue2 = null
|
||||
this.monthValue = []
|
||||
this.yearValue1 = null
|
||||
this.yearValue2 = null
|
||||
},
|
||||
transformTime(timeStamp) {// 本月最后一天
|
||||
let year = moment(timeStamp).format('YYYY')
|
||||
let month = moment(timeStamp).format('MM')
|
||||
@@ -471,4 +486,12 @@ export default {
|
||||
height: 45px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.separateStyle {
|
||||
display: inline-block;
|
||||
width: 1px;
|
||||
height: 24px;
|
||||
background: #E8E8E8;
|
||||
vertical-align: middle;
|
||||
margin: 0 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -34,10 +34,10 @@ export default {
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310)
|
||||
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
|
||||
// console.log(document.getElementById("contrastAnalysisBox").offsetWidth)
|
||||
})
|
||||
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310)
|
||||
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
|
||||
},
|
||||
methods: {
|
||||
getList(params) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<span class="blue-block"></span>
|
||||
<el-form-item label="对象选择">
|
||||
<el-form-item label="对象选择" required>
|
||||
<el-cascader
|
||||
v-model="objArr"
|
||||
:options="objList"
|
||||
@@ -11,7 +11,7 @@
|
||||
style="width: 250px;"
|
||||
clearable></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间维度">
|
||||
<el-form-item label="时间维度" required>
|
||||
<el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small">
|
||||
<el-option
|
||||
v-for="item in timeType"
|
||||
@@ -22,7 +22,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间">
|
||||
<el-form-item label="时间" required>
|
||||
<div v-show="queryParams.type === 1">
|
||||
<el-date-picker
|
||||
v-model="monthValue"
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
},
|
||||
// 查询
|
||||
search() {
|
||||
if (!this.objArr.length === 0) {
|
||||
if (this.objArr.length === 0) {
|
||||
this.$modal.msgError('请选择对象')
|
||||
return false
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<span class="blue-block"></span>
|
||||
<el-form-item label="能源类型">
|
||||
<el-form-item label="能源类型" required>
|
||||
<el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small">
|
||||
<el-option
|
||||
v-for="item in energyTypeList"
|
||||
@@ -12,7 +12,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="对象选择">
|
||||
<el-form-item label="对象选择" required>
|
||||
<el-cascader
|
||||
v-model="objArr"
|
||||
:options="objList"
|
||||
@@ -21,7 +21,7 @@
|
||||
size="small"
|
||||
clearable></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间维度">
|
||||
<el-form-item label="时间维度" required>
|
||||
<el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
|
||||
@@ -32,7 +32,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间范围">
|
||||
<el-form-item label="时间范围" required>
|
||||
<div v-show="queryParams.timeDim === '1'">
|
||||
<el-date-picker
|
||||
v-model="timeValue"
|
||||
@@ -129,6 +129,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="search">查询</el-button>
|
||||
<span class="separateStyle"></span>
|
||||
<el-button size="small" @click="resetBtn">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span v-if="isFold" class="foldClass" @click='switchMode'>
|
||||
@@ -360,6 +362,14 @@ export default {
|
||||
this.queryParams.endTime = this.queryParams.endTime + ''
|
||||
this.$emit('submit', this.queryParams)
|
||||
},
|
||||
// 重置
|
||||
resetBtn() {
|
||||
this.queryParams.energyTypeId = null
|
||||
this.queryParams.objId = null
|
||||
this.objArr = []
|
||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
||||
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
|
||||
},
|
||||
transformTime(timeStamp) {// 本月最后一天
|
||||
let year = moment(timeStamp).format('YYYY')
|
||||
let month = moment(timeStamp).format('MM')
|
||||
@@ -435,4 +445,12 @@ export default {
|
||||
height: 45px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.separateStyle {
|
||||
display: inline-block;
|
||||
width: 1px;
|
||||
height: 24px;
|
||||
background: #E8E8E8;
|
||||
vertical-align: middle;
|
||||
margin: 0 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -34,9 +34,9 @@ export default {
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
this.isFold = this.searchBarWidth('trendAnalysisBox', 1146)
|
||||
this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
|
||||
})
|
||||
this.isFold = this.searchBarWidth('trendAnalysisBox', 1146)
|
||||
this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
|
||||
},
|
||||
methods: {
|
||||
getList(params) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<span class="blue-block"></span>
|
||||
<el-form-item label="对象选择">
|
||||
<el-form-item label="对象选择" required>
|
||||
<el-cascader
|
||||
v-model="objArr"
|
||||
:options="objList"
|
||||
@@ -10,7 +10,7 @@
|
||||
size="small"
|
||||
clearable></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间维度">
|
||||
<el-form-item label="时间维度" required>
|
||||
<el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small">
|
||||
<el-option
|
||||
v-for="item in timeType"
|
||||
@@ -21,7 +21,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间">
|
||||
<el-form-item label="时间" required>
|
||||
<div v-show="queryParams.type === 1 || queryParams.type === 2">
|
||||
<el-date-picker
|
||||
v-model="yearValue"
|
||||
@@ -103,7 +103,7 @@ export default {
|
||||
},
|
||||
// 查询
|
||||
search() {
|
||||
if (!this.objArr.length === 0) {
|
||||
if (this.objArr.length === 0) {
|
||||
this.$modal.msgError('请选择对象')
|
||||
return false
|
||||
} else {
|
||||
|
||||
@@ -25,18 +25,16 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="form.description"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否采集" prop="collection">
|
||||
<el-switch v-model="form.collection"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="form.description"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'>
|
||||
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
|
||||
<div class="box">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="关联表名">
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEnergyQuantityRealtimePage, exportEnergyQuantityRealtimeExcel } from "@/api/base/energyQuantityRealtime"
|
||||
import { getEnergyQuantityRealtimePage } from "@/api/base/energyQuantityRealtime"
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType"
|
||||
// import { publicFormatter } from '@/utils/dict'
|
||||
import FileSaver from "file-saver"
|
||||
@@ -140,18 +140,16 @@ export default {
|
||||
break
|
||||
default:
|
||||
this.exportTable()
|
||||
// this.$modal.confirm('是否确认导出').then(() => {
|
||||
// return exportEnergyQuantityRealtimeExcel({...this.queryParams});
|
||||
// }).then(response => {
|
||||
// console.log(response)
|
||||
// this.$download.excel(response, '能源抄表.xls');
|
||||
// }).catch(() => {})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getEnergyQuantityRealtimePage(this.queryParams).then(response => {
|
||||
this.list = response.data.list || []
|
||||
let arr = response.data.list || []
|
||||
arr && arr.map(item => {
|
||||
item.amount = item.amount ? (!isNaN(parseFloat(item.amount)) && isFinite(item.amount) ? item.amount.toFixed(2) : '') : ''
|
||||
})
|
||||
this.list = arr
|
||||
this.total = response.data.total;
|
||||
this.exportList = []
|
||||
});
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
v-for='item in tableProps'
|
||||
:key="item.prop"
|
||||
:prop="item.prop"
|
||||
:label="item.label"
|
||||
:label="item.label"
|
||||
:align="item.align ? item.align : 'left'"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'>
|
||||
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
|
||||
<div class="box">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="方案名称">
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
title="新增"
|
||||
:visible.sync="centervisible"
|
||||
size="60%"
|
||||
@close='closeA'>
|
||||
@close='closeA'
|
||||
:show-close='false'>
|
||||
<div class="box">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
|
||||
@@ -28,59 +28,96 @@
|
||||
|
||||
<script>
|
||||
import basicPage from '../../../core/mixins/basic-page';
|
||||
import { parseTime } from '../../../core/mixins/code-filter';
|
||||
import moment from 'moment';
|
||||
import {
|
||||
getEqAnalysis,
|
||||
exportEqAnalysisExcel
|
||||
exportEqAnalysisExcel,
|
||||
} from '@/api/equipment/analysis/statistics';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '时间段',
|
||||
filter: parseTime
|
||||
filter: (val) => {
|
||||
if (val && val.length > 0) {
|
||||
return (
|
||||
moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
|
||||
' ~ ' +
|
||||
moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
);
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线'
|
||||
label: '产线',
|
||||
},
|
||||
{
|
||||
prop: 'sectionName',
|
||||
label: '工段'
|
||||
label: '工段',
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称'
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'equipmentType',
|
||||
label: '设备类型'
|
||||
label: '设备类型',
|
||||
},
|
||||
{
|
||||
prop: 'workTime',
|
||||
label: '工作时间累积(h)'
|
||||
label: '工作时间累积(h)',
|
||||
},
|
||||
{
|
||||
prop: 'repairCount',
|
||||
label: '维修次数'
|
||||
label: '维修次数',
|
||||
},
|
||||
{
|
||||
prop: 'maintainCount',
|
||||
label: '保养次数'
|
||||
}
|
||||
label: '保养次数',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
const today = new Date();
|
||||
|
||||
const todayStart = new Date(
|
||||
today.getFullYear(),
|
||||
today.getMonth(),
|
||||
today.getDate(),
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
const todayEnd = new Date(
|
||||
today.getFullYear(),
|
||||
today.getMonth(),
|
||||
today.getDate(),
|
||||
23,
|
||||
59,
|
||||
59
|
||||
);
|
||||
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getEqAnalysis,
|
||||
exportURL: exportEqAnalysisExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [].filter((v)=>v),
|
||||
tableBtn: [].filter((v) => v),
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
recordTime: [
|
||||
moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
|
||||
moment(todayEnd).format('YYYY-MM-DD HH:mm:ss'),
|
||||
],
|
||||
},
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
@@ -101,7 +138,10 @@ export default {
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'recordTime',
|
||||
defaultSelect: [],
|
||||
defaultSelect: [
|
||||
moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
|
||||
moment(todayEnd).format('YYYY-MM-DD HH:mm:ss'),
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -113,33 +153,38 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:analysis-statistics:export') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('equipment:analysis-statistics:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
plain: true
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||
this.tableData = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.equipmentName = val.name ? val.name : undefined;
|
||||
this.listQuery.recordTime = val.recordTime ? val.recordTime : undefined;
|
||||
this.listQuery.recordTime = val.recordTime
|
||||
? val.recordTime
|
||||
: undefined;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
@@ -158,20 +203,24 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '设备统计分析.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备统计分析.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
<template>
|
||||
<div class="app-container allow-overflow">
|
||||
<!-- 搜索工作栏 -->
|
||||
<small-title
|
||||
<!-- <small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
设备运行状态
|
||||
</small-title>
|
||||
</small-title> -->
|
||||
|
||||
<div
|
||||
class="graph"
|
||||
@@ -22,7 +22,8 @@
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
">
|
||||
<div class="blue-title">各设备加工数量</div>
|
||||
<!-- <div class="blue-title">各设备加工数量</div> -->
|
||||
<div class="blue-title">设备运行状态</div>
|
||||
<div class="legend">
|
||||
<div class="legend-item">
|
||||
<span class="icon blue"></span>
|
||||
@@ -41,22 +42,17 @@
|
||||
<span class="text">速度开动率</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="graph-grid">
|
||||
<div v-if="list.length" class="graph-grid">
|
||||
<div class="bg-grid grid-line">
|
||||
<div
|
||||
class="grid-item"
|
||||
v-for="item in list.length"
|
||||
:key="item"></div>
|
||||
<div class="grid-item" v-for="item in list.length" :key="item"></div>
|
||||
</div>
|
||||
|
||||
<div class="bg-grid grid-charts">
|
||||
<pie-chart
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
:value="item" />
|
||||
<pie-chart v-for="item in list" :key="item.id" :value="item" />
|
||||
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -202,7 +202,9 @@ export default {
|
||||
];
|
||||
this.config.series[1].data = [
|
||||
{ name: '速度开动率', value: peEfficiency },
|
||||
{ name: '', value: Math.ceil(peEfficiency) - peEfficiency },
|
||||
{ name: '', value: 100 },
|
||||
// { name: '速度开动率', value: peEfficiency },
|
||||
// { name: '', value: Math.ceil(peEfficiency) - peEfficiency },
|
||||
];
|
||||
//
|
||||
this.textData = {
|
||||
|
||||
@@ -237,6 +237,7 @@ export default {
|
||||
label: '工厂',
|
||||
placeholder: '请选择工厂',
|
||||
param: 'factoryId',
|
||||
filterable: true,
|
||||
selectOptions: [],
|
||||
},
|
||||
{
|
||||
@@ -244,6 +245,7 @@ export default {
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'lineId',
|
||||
filterable: true,
|
||||
selectOptions: [],
|
||||
},
|
||||
// 选项切换
|
||||
|
||||
@@ -21,18 +21,15 @@ export default {
|
||||
chart: null,
|
||||
};
|
||||
},
|
||||
// watch: {
|
||||
// list: {
|
||||
// handler(listdata) {
|
||||
// if (listdata && listdata.length) {
|
||||
// console.log('[linechart] list changed', listdata);
|
||||
// const option = this.handleList(listdata);
|
||||
// this.setOption(option);
|
||||
// }
|
||||
// },
|
||||
// immediate: true,
|
||||
// },
|
||||
// },
|
||||
watch: {
|
||||
list: {
|
||||
handler(listdata) {
|
||||
this.setOption();
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
option() {
|
||||
const opt = [];
|
||||
@@ -55,7 +52,7 @@ export default {
|
||||
},
|
||||
formatter: (params) => {
|
||||
const name = params[0].name;
|
||||
const goodRate = opt.find((item) => item[0] == name)[4];
|
||||
const goodRate = opt.find((item) => item[0] == name)[4] || '0';
|
||||
return `
|
||||
<h1 style="font-size: 18px; letter-spacing: 1px;">${
|
||||
params[0].axisValue
|
||||
@@ -109,6 +106,9 @@ export default {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisTick: { show: false },
|
||||
axisLabel: {
|
||||
rotate: 45,
|
||||
},
|
||||
data: opt.map((item) => item[0]),
|
||||
},
|
||||
yAxis: {
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container" style="flex: 1; height: 1px; display: flex; flex-direction: column;">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<el-row>
|
||||
<el-col class="custom-tabs">
|
||||
<el-row type="flex" style="flex: 1;">
|
||||
<el-col class="custom-tabs" style="flex: 1;">
|
||||
<el-tabs
|
||||
v-model="activeName"
|
||||
:stretch="true"
|
||||
@@ -32,7 +32,7 @@
|
||||
<div
|
||||
v-if="activeName == 'graph'"
|
||||
class="graph"
|
||||
style="height: 40vh; display: flex; flex-direction: column">
|
||||
style="height: 100%; display: flex; flex-direction: column">
|
||||
<div class="blue-title">各设备加工数量</div>
|
||||
<LineChart v-if="list && list.length" :list="list" />
|
||||
<div v-else class="no-data-bg"></div>
|
||||
@@ -63,13 +63,13 @@ export default {
|
||||
activeName: 'table', // defaults to 'table'
|
||||
searchBarFormConfig: [
|
||||
// 产品
|
||||
{
|
||||
__index: 'product',
|
||||
type: 'select',
|
||||
label: '产品',
|
||||
placeholder: '请选择产品',
|
||||
param: 'productId',
|
||||
},
|
||||
// {
|
||||
// __index: 'product',
|
||||
// type: 'select',
|
||||
// label: '产品',
|
||||
// placeholder: '请选择产品',
|
||||
// param: 'productId',
|
||||
// },
|
||||
// 产线
|
||||
{
|
||||
__index: 'line',
|
||||
@@ -156,17 +156,17 @@ export default {
|
||||
{
|
||||
// width: 160,
|
||||
prop: 'inQuantity',
|
||||
label: '进片数量',
|
||||
label: '加工数量',
|
||||
},
|
||||
{
|
||||
// width: 160,
|
||||
prop: 'outQuantity',
|
||||
label: '出片数量',
|
||||
label: '合格数量',
|
||||
},
|
||||
{
|
||||
// width: 160,
|
||||
prop: 'nokQuantity',
|
||||
label: '破损/不合格数',
|
||||
label: '不合格数量',
|
||||
},
|
||||
{
|
||||
// width: 160,
|
||||
@@ -377,6 +377,9 @@ export default {
|
||||
}
|
||||
|
||||
:deep(.custom-tabs) {
|
||||
.el-tabs {
|
||||
height: 100%;
|
||||
}
|
||||
.el-tabs__header {
|
||||
margin-bottom: 8px;
|
||||
display: inline-block;
|
||||
@@ -389,6 +392,14 @@ export default {
|
||||
line-height: 36px !important;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.el-tabs__content {
|
||||
height: calc(100% - 48px);
|
||||
}
|
||||
|
||||
#pane-graph {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.blue-title {
|
||||
|
||||
301
src/views/equipment/base/alarm/Record/AddOrUpdate.vue
Normal file
301
src/views/equipment/base/alarm/Record/AddOrUpdate.vue
Normal file
@@ -0,0 +1,301 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-11 20:33:12
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="alarm-handle">
|
||||
<el-skeleton v-if="loading" />
|
||||
<div v-else>
|
||||
<DialogForm
|
||||
ref="orderForm"
|
||||
key="orderForm"
|
||||
v-model="orderForm"
|
||||
:disabled="readOnly"
|
||||
:has-files="false"
|
||||
label-position="top"
|
||||
:rows="orderFormRows" />
|
||||
|
||||
<small-title style="margin: 16px 0" :no-padding="true" size="sm">
|
||||
处理方式
|
||||
</small-title>
|
||||
|
||||
<DialogForm
|
||||
key="handleMethodForm"
|
||||
ref="handleMethodForm"
|
||||
v-model="handleMethodForm"
|
||||
:disabled="readOnly"
|
||||
:has-files="true"
|
||||
label-position="top"
|
||||
:rows="handleMethodFormRows" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { getworkerAll } from '@/api/base/materialUseLog';
|
||||
import Editor from '@/components/Editor';
|
||||
import DialogForm from '@/components/DialogForm';
|
||||
|
||||
export default {
|
||||
name: 'AlarmHandle',
|
||||
props: ['readOnly', 'logId'],
|
||||
components: { SmallTitle, DialogForm, Editor },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
orderForm: {
|
||||
id: null,
|
||||
equipment: null,
|
||||
createTime: null,
|
||||
alarmContent: null,
|
||||
alarmValue: null,
|
||||
// 缺少报警编号字段, 用 alarmValue 代替
|
||||
},
|
||||
orderFormRows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '设备编码',
|
||||
prop: 'equipment',
|
||||
},
|
||||
{
|
||||
datetime: true,
|
||||
label: '报警时间',
|
||||
prop: 'createTime',
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '报警编号',
|
||||
prop: 'alarmValue',
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '报警内容',
|
||||
prop: 'alarmContent',
|
||||
},
|
||||
],
|
||||
],
|
||||
handleMethodFormRows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '处理人',
|
||||
prop: 'hander',
|
||||
url: '/base/core-worker/listAll',
|
||||
bind: {
|
||||
multiple: true,
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '类型名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
upload: true,
|
||||
label: '上传资料',
|
||||
prop: 'files',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
key: 'handerMode',
|
||||
subcomponent: Editor,
|
||||
label: '处理方式',
|
||||
prop: 'handerMode',
|
||||
bind: {
|
||||
'min-height': 200,
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
handleMethodForm: {
|
||||
id: null,
|
||||
logId: null,
|
||||
hander: null,
|
||||
handerMode: null,
|
||||
remark: null,
|
||||
files: [
|
||||
// {
|
||||
// fileName: '',
|
||||
// fileType: '',
|
||||
// fileUrl: ''
|
||||
// }
|
||||
],
|
||||
},
|
||||
workersList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loading = true;
|
||||
this.getDict()
|
||||
.then(() => {
|
||||
this.init();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取员工数据
|
||||
*/
|
||||
async getDict() {
|
||||
const workerRes = await getworkerAll();
|
||||
this.workersList = workerRes.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
async init() {
|
||||
await this.initTop();
|
||||
await this.initDown();
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 初始化上部表单
|
||||
*/
|
||||
async initTop() {
|
||||
if (!this.logId) {
|
||||
this.$msgError('缺少报警日志id');
|
||||
this.$emit('close');
|
||||
}
|
||||
const url = '/base/equipment-alarm-log/get';
|
||||
const { data, code } = await this.$axios({
|
||||
url: url,
|
||||
method: 'get',
|
||||
params: {
|
||||
id: this.logId,
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
this.orderForm = data;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 初始化下部表单
|
||||
*/
|
||||
async initDown() {
|
||||
if (!this.logId) {
|
||||
this.$msgError('缺少报警日志id');
|
||||
this.$emit('close');
|
||||
}
|
||||
const url = '/base/equipment-alarm-hand/page'; // 经沟通,此处采用page接口的第一个返回值
|
||||
const { data, code } = await this.$axios({
|
||||
url: url,
|
||||
method: 'get',
|
||||
params: {
|
||||
logId: this.logId,
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
this.handleMethodForm = {
|
||||
...data.list[0],
|
||||
hander: data.list[0]?.hander?.split(',') || '',
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新表单
|
||||
*/
|
||||
async submit() {
|
||||
const result = await Promise.all([
|
||||
await this.updateTop(),
|
||||
await this.updateHandleMethod(),
|
||||
]);
|
||||
if (result[0] == true && result[1] == true) {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
this.$emit('refreshDataList');
|
||||
} else {
|
||||
this.$modal.msgError('更新失败');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新下部表单
|
||||
*/
|
||||
async updateHandleMethod() {
|
||||
const url = '/base/equipment-alarm-hand';
|
||||
const valid = await this.$refs.orderForm.validate();
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
const { code, data } = await this.$axios({
|
||||
url: url + (this.handleMethodForm.id ? '/update' : '/create'),
|
||||
method: this.handleMethodForm.id ? 'put' : 'post',
|
||||
data: {
|
||||
...this.handleMethodForm,
|
||||
hander: this.handleMethodForm.hander?.join(',') || '',
|
||||
logId: this.logId,
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新上部分表单
|
||||
*/
|
||||
async updateTop() {
|
||||
const url = '/base/equipment-alarm-log';
|
||||
const valid = await this.$refs.handleMethodForm.validate();
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
const { code, data } = await this.$axios({
|
||||
url: url + '/update',
|
||||
method: 'put',
|
||||
data: this.orderForm,
|
||||
});
|
||||
if (code == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.file) {
|
||||
const temp = this.file.split(','); // 获取文件个数
|
||||
let arry = [];
|
||||
temp.forEach((item) => {
|
||||
arry.push({
|
||||
fileType: 2,
|
||||
fileUrl: item,
|
||||
});
|
||||
});
|
||||
this.dataForm.files = arry;
|
||||
}
|
||||
this.urlOptions.createURL(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.alarm-handle {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.alarm-handle__method >>> .el-select {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
@@ -40,7 +40,7 @@ $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
font-size: $height;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
@@ -53,7 +53,7 @@ $mgr: 8px;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
margin-right: 4px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-11 20:33:12
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
系统自带
|
||||
</small-title>
|
||||
<el-form
|
||||
:model="dataForm1"
|
||||
ref="dataForm1"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编码" prop="equipment">
|
||||
<el-input
|
||||
v-model="dataForm1.equipment"
|
||||
disabled
|
||||
placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报警时间" prop="createTime">
|
||||
<el-input
|
||||
v-model="dataForm1.createTime"
|
||||
disabled
|
||||
placeholder="请输入报警时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报警编号" prop="code">
|
||||
<!-- 接口缺参数 -->
|
||||
<el-input
|
||||
v-model="dataForm1.code"
|
||||
disabled
|
||||
placeholder="请输入报警编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报警内容" prop="alarmContent">
|
||||
<el-input
|
||||
v-model="dataForm1.alarmContent"
|
||||
disabled
|
||||
placeholder="请输入报警内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
处理方式
|
||||
</small-title>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
label-width="80px">
|
||||
<el-form-item label="处理人" prop="hander">
|
||||
<el-select
|
||||
v-model="dataForm.hander"
|
||||
:disabled="isdetail"
|
||||
placeholder="请选择处理人"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in workersList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理方式" prop="handerMode">
|
||||
<editor v-model="dataForm.handerMode" :read-only="isdetail" :min-height="200"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="file">
|
||||
<!-- <el-input
|
||||
v-model="dataForm.file"
|
||||
type="textarea"
|
||||
min-size="3"
|
||||
placeholder="请输入处理方式" /> -->
|
||||
<FileUpload v-model="file" :disabled="isdetail" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { getworkerAll } from "@/api/base/materialUseLog";
|
||||
import { createAlarmHand, getAlarmLog } from '@/api/equipment/base/alarm/records';
|
||||
import FileUpload from "@/components/FileUpload";
|
||||
import Editor from "@/components/Editor";
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, FileUpload, Editor },
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: createAlarmHand,
|
||||
infoURL: getAlarmLog,
|
||||
},
|
||||
dataForm1: {
|
||||
id: undefined,
|
||||
equipment: undefined,
|
||||
createTime: undefined,
|
||||
alarmContent: undefined,
|
||||
code: undefined
|
||||
},
|
||||
file: '',
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
hander: undefined,
|
||||
handerMode: undefined
|
||||
},
|
||||
isdetail: false,
|
||||
workersList: [],
|
||||
dataRule: {
|
||||
hander: [{ required: true, message: "处理人不能为空", trigger: "change" }],
|
||||
handerMode: [{ required: true, message: "处理方式不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
console.log('我看看', this.dataForm)
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 获得员工
|
||||
const workerRes = await getworkerAll()
|
||||
this.workersList = workerRes.data
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
// if (this.dataForm.id) {
|
||||
// this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.visible = false;
|
||||
// this.$emit("refreshDataList");
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// 添加的提交
|
||||
if (this.file) {
|
||||
const temp = this.file.split(',') // 获取文件个数
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
arry.push({
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
})
|
||||
this.dataForm.files = arry
|
||||
}
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.dataForm1.id = id || "";
|
||||
this.isdetail = isdetail || false
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm1"].resetFields();
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm1.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
if (response.data) {
|
||||
this.dataForm1 = response.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -45,20 +45,28 @@
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="false"
|
||||
:rows="rows" /> -->
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit" />
|
||||
<AddOrUpdate
|
||||
v-if="open"
|
||||
ref="addOrUpdate"
|
||||
:read-only="readOnly"
|
||||
:log-id="chosedLogId"
|
||||
@close="cancel"
|
||||
@refreshDataList="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import AddOrUpdate from './add-or-updata.vue'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
<<<<<<< HEAD
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
=======
|
||||
import AddOrUpdate from './AddOrUpdate.vue';
|
||||
import moment from 'moment';
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
>>>>>>> projects/mes-test
|
||||
|
||||
const btn = {
|
||||
name: 'tableBtn',
|
||||
@@ -68,7 +76,10 @@ const btn = {
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
|
||||
this.$emit('emitData', {
|
||||
action: this.injectData.name,
|
||||
value: this.injectData,
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
@@ -80,15 +91,19 @@ const btn = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
name: 'Record',
|
||||
components: { AddOrUpdate },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
<<<<<<< HEAD
|
||||
searchBarKeys: ['equipmentName', 'createTime'],
|
||||
=======
|
||||
readOnly: false,
|
||||
chosedLogId: false,
|
||||
searchBarKeys: ['equipmentName', 'recordTime'],
|
||||
>>>>>>> projects/mes-test
|
||||
tableBtn: [
|
||||
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||
// ? {
|
||||
@@ -113,12 +128,22 @@ export default {
|
||||
{ prop: 'productionLine', label: '产线' },
|
||||
{ prop: 'workshopSection', label: '工段' },
|
||||
{ prop: 'equipment', label: '设备名称' },
|
||||
<<<<<<< HEAD
|
||||
{ prop: 'alarmGrade', label: '报警级别', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
|
||||
{ prop: 'createTime', label: '报警时间',filter: timeFilter }, // 接口缺
|
||||
{ prop: 'responsible1', label: '设备报警码' }, // 接口缺
|
||||
=======
|
||||
{
|
||||
prop: 'alarmGrade',
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
||||
},
|
||||
{ prop: 'createTime', label: '报警时间', filter: timeFilter }, // 接口缺
|
||||
{ prop: 'alarmCode', label: '设备报警码' }, // 接口缺
|
||||
>>>>>>> projects/mes-test
|
||||
{ prop: 'alarmContent', label: '报警内容' },
|
||||
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
|
||||
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@@ -135,8 +160,8 @@ export default {
|
||||
dateType: 'daterange', // datetimerange
|
||||
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||
format: 'yyyy-MM-dd',
|
||||
// valueFormat: 'timestamp',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
@@ -196,9 +221,10 @@ export default {
|
||||
pageSize: 10,
|
||||
lineId: null,
|
||||
equipmentId: null,
|
||||
recordTime: []
|
||||
},
|
||||
basePath: '/base/equipment-alarm-log',
|
||||
list: []
|
||||
list: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -206,21 +232,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleEmitFun(val) {
|
||||
console.log('你好', val)
|
||||
if (val.action === '报警处理') {
|
||||
// this.chosedLogId = val.value.alarmId;
|
||||
this.chosedLogId = val.value.id;
|
||||
// 报警处理
|
||||
this.open = true
|
||||
this.title = '报警处理'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.value.id);
|
||||
});
|
||||
this.open = true;
|
||||
this.title = '报警处理';
|
||||
this.readOnly = false;
|
||||
} else {
|
||||
// this.chosedLogId = val.value.alarmId;
|
||||
this.chosedLogId = val.value.id;
|
||||
// 查看
|
||||
this.open = true
|
||||
this.title = '查看'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.value.id, true);
|
||||
});
|
||||
this.open = true;
|
||||
this.title = '查看';
|
||||
this.readOnly = true;
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
@@ -234,9 +259,9 @@ export default {
|
||||
});
|
||||
},
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
this.cancel();
|
||||
this.getList();
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -282,7 +307,7 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.addOrUpdate.dataFormSubmit()
|
||||
this.$refs.addOrUpdate.submit();
|
||||
// this.$refs['form'].validate((valid) => {
|
||||
// if (!valid) {
|
||||
// return;
|
||||
@@ -310,7 +335,7 @@ export default {
|
||||
this.$modal
|
||||
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.delete({ id });
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
:size="size || '50%'"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
@@ -42,7 +42,8 @@
|
||||
:dataForm="form"
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<el-row style="margin-bottom: 24px">
|
||||
<!-- if -->
|
||||
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
@@ -62,13 +63,39 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- else -->
|
||||
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备分组名称"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入设备分组名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备分组编码"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
placeholder="请输入设备分组编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="section.key == 'attrs'"
|
||||
style="position: relative; margin-top: 12px">
|
||||
<!-- v-if="!mode.includes('detail')" -->
|
||||
<div style="position: absolute; top: -40px; right: 0">
|
||||
<div
|
||||
v-if="!mode.includes('detail')"
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加报警
|
||||
@@ -84,7 +111,7 @@
|
||||
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr" -->
|
||||
<method-btn
|
||||
v-if="section.tableBtn"
|
||||
v-if="section.tableBtn && !mode.includes('detail')"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@@ -103,11 +130,13 @@
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
|
||||
<el-button style="" @click="handleCancel">返回</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleSave">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -163,7 +192,7 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm, BaseInfoForm },
|
||||
props: ['sections', 'defaultMode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
@@ -191,7 +220,9 @@ export default {
|
||||
label: '报警编码', // 自动生成
|
||||
prop: 'code',
|
||||
url: '/base/equipment-group-alarm/getCode',
|
||||
rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '报警编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
@@ -205,13 +236,17 @@ export default {
|
||||
input: true,
|
||||
label: '参数列名', // 在实时数据库的列名
|
||||
prop: 'plcParamName',
|
||||
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '报警内容',
|
||||
prop: 'alarmContent',
|
||||
rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '报警内容不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -223,7 +258,9 @@ export default {
|
||||
{ label: '布尔型', value: 2 },
|
||||
{ label: '字符型', value: 1 },
|
||||
],
|
||||
rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '报警类型不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
@@ -322,7 +359,7 @@ export default {
|
||||
handleSave() {
|
||||
this.$refs['form'][0].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.mode == 'edit';
|
||||
const isEdit = !this.mode.includes('detail');
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: isEdit ? 'put' : 'post',
|
||||
@@ -403,32 +440,32 @@ export default {
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
async submitAttrForm() {
|
||||
this.$refs['attrForm'].validate((valid) => {
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<BasicDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
size="45%"
|
||||
:default-mode="editMode"
|
||||
:data-id="alarmForm.id"
|
||||
:sections="[
|
||||
@@ -198,26 +199,23 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ width: 240, prop: 'code', label: '报警编码' },
|
||||
{ prop: 'code', label: '报警编码' },
|
||||
{
|
||||
width: 100,
|
||||
prop: 'type',
|
||||
label: '报警类型',
|
||||
filter: (val) =>
|
||||
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
|
||||
},
|
||||
{
|
||||
width: 90,
|
||||
prop: 'grade',
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
||||
},
|
||||
{ width: 180, prop: 'alarmCode', label: '设备报警编码' },
|
||||
{ width: 128, prop: 'plcParamName', label: '参数列名' },
|
||||
{ width: 128, prop: 'alarmContent', label: '报警内容' },
|
||||
{ prop: 'alarmCode', label: '设备报警编码' },
|
||||
{ prop: 'plcParamName', label: '参数列名' },
|
||||
{ prop: 'alarmContent', label: '报警内容' },
|
||||
],
|
||||
alarmForm: {
|
||||
id: undefined,
|
||||
@@ -406,12 +404,25 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleTableBtnClick({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleDetail(data, 'edit');
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(data);
|
||||
break;
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 查看报警
|
||||
handleDetail(row) {
|
||||
handleDetail(row, mode = 'detail') {
|
||||
// debugger;
|
||||
const { id, code, name, createTime } = row;
|
||||
// 打开抽屉
|
||||
this.editMode = 'detail';
|
||||
this.editMode = mode;
|
||||
this.alarmForm.id = id;
|
||||
this.alarmForm.equipmentGroupCode = code;
|
||||
this.alarmForm.equipmentGroupName = name;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
:size="size || '50%'"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
@@ -42,6 +42,7 @@
|
||||
:dataForm="form"
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<!-- <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> -->
|
||||
<el-row style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
@@ -62,13 +63,38 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备分组名称"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入设备分组名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备分组编码"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
placeholder="请输入设备分组编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row> -->
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="section.key == 'attrs'"
|
||||
style="position: relative; margin-top: 12px">
|
||||
<!-- v-if="!mode.includes('detail')" -->
|
||||
<div style="position: absolute; top: -40px; right: 0">
|
||||
<div
|
||||
v-if="!mode.includes('detail')"
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
@@ -84,7 +110,7 @@
|
||||
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr" -->
|
||||
<method-btn
|
||||
v-if="section.tableBtn"
|
||||
v-if="section.tableBtn && !mode.includes('detail')"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@@ -104,10 +130,12 @@
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleCancel">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -163,7 +191,7 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm, BaseInfoForm },
|
||||
props: ['sections', 'defaultMode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
@@ -191,7 +219,9 @@ export default {
|
||||
label: '报警编码', // 自动生成
|
||||
prop: 'code',
|
||||
url: '/base/equipment-group-alarm/getCode',
|
||||
rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '报警编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
@@ -201,7 +231,9 @@ export default {
|
||||
{ label: '布尔型', value: 2 },
|
||||
{ label: '字符型', value: 1 },
|
||||
],
|
||||
rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '报警类型不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -222,13 +254,17 @@ export default {
|
||||
input: true,
|
||||
label: '参数列名', // 在实时数据库的列名
|
||||
prop: 'plcParamName',
|
||||
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '报警内容',
|
||||
prop: 'alarmContent',
|
||||
rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '报警内容不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
@@ -322,7 +358,7 @@ export default {
|
||||
handleSave() {
|
||||
this.$refs['form'][0].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.mode == 'edit';
|
||||
const isEdit = !this.mode.includes('detail');
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: isEdit ? 'put' : 'post',
|
||||
@@ -403,33 +439,32 @@ export default {
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
async submitAttrForm() {
|
||||
this.$refs['attrForm'].validate((valid) => {
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
console.log('this.attrform', this.attrForm);
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<BasicDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
size="45%"
|
||||
:default-mode="editMode"
|
||||
:data-id="alarmForm.id"
|
||||
:sections="[
|
||||
@@ -224,7 +225,9 @@ export default {
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -238,7 +241,9 @@ export default {
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '报警分组不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '报警分组不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
@@ -269,7 +274,13 @@ export default {
|
||||
input: true,
|
||||
label: '设备分组名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '设备分组名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '设备分组名称不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
// bind: {
|
||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
||||
// }
|
||||
@@ -287,26 +298,23 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ width: 240, prop: 'code', label: '报警编码' },
|
||||
{ prop: 'code', label: '报警编码' },
|
||||
{
|
||||
width: 100,
|
||||
prop: 'type',
|
||||
label: '报警类型',
|
||||
filter: (val) =>
|
||||
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
|
||||
},
|
||||
{
|
||||
width: 90,
|
||||
prop: 'grade',
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
||||
},
|
||||
{ width: 180, prop: 'alarmCode', label: '设备报警编码' },
|
||||
{ width: 128, prop: 'plcParamName', label: '参数列名' },
|
||||
{ width: 128, prop: 'alarmContent', label: '报警内容' },
|
||||
{ prop: 'alarmCode', label: '设备报警编码' },
|
||||
{ prop: 'plcParamName', label: '参数列名' },
|
||||
{ prop: 'alarmContent', label: '报警内容' },
|
||||
],
|
||||
};
|
||||
},
|
||||
@@ -361,6 +369,19 @@ export default {
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
handleTableBtnClick({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleDetail(data, 'edit');
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(data);
|
||||
break;
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
@@ -411,11 +432,11 @@ export default {
|
||||
});
|
||||
},
|
||||
// 查看报警
|
||||
handleDetail(row) {
|
||||
handleDetail(row, mode = 'detail') {
|
||||
const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
|
||||
row;
|
||||
// 打开抽屉
|
||||
this.editMode = 'detail';
|
||||
this.editMode = mode;
|
||||
this.alarmForm.id = groupId;
|
||||
this.alarmForm.equipmentGroupCode = groupCode;
|
||||
this.alarmForm.equipmentGroupName = groupName;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<BasicDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
size="45%"
|
||||
:default-mode="editMode"
|
||||
:info-data="alarmForm"
|
||||
:sections="[
|
||||
@@ -59,6 +60,10 @@
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
rows: drawerBaseInfoRows,
|
||||
url: '/base/equipment-plc-connect/get',
|
||||
urlUpdate: '/base/equipment-plc-connect/update',
|
||||
urlCreate: '/base/equipment-plc-connect/create',
|
||||
queryParams: { id: alarmForm.id },
|
||||
},
|
||||
{
|
||||
name: '采集参数',
|
||||
@@ -189,7 +194,7 @@ export default {
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
selectOptions: [],
|
||||
filterable: true
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -197,7 +202,7 @@ export default {
|
||||
placeholder: '请选择关联表编码',
|
||||
param: 'plcId',
|
||||
selectOptions: [],
|
||||
filterable: true
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -311,8 +316,8 @@ export default {
|
||||
label: '生产参数类型',
|
||||
filter: (val) =>
|
||||
val != null
|
||||
// ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
|
||||
? ['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
|
||||
? // ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
|
||||
['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
|
||||
: '-',
|
||||
},
|
||||
{
|
||||
@@ -423,6 +428,19 @@ export default {
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
handleTableBtnClick({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleDetail(data, 'edit');
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(data);
|
||||
break;
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
@@ -474,7 +492,7 @@ export default {
|
||||
},
|
||||
|
||||
// 查看报警
|
||||
handleDetail(row) {
|
||||
handleDetail(row, mode = 'detail') {
|
||||
// debugger;
|
||||
const {
|
||||
id,
|
||||
@@ -490,7 +508,7 @@ export default {
|
||||
workshopSection,
|
||||
} = row;
|
||||
// 打开抽屉
|
||||
this.editMode = 'detail';
|
||||
this.editMode = mode;
|
||||
this.alarmForm.id = id;
|
||||
this.alarmForm.plcTableName = plcTableName; // 关联表名
|
||||
this.alarmForm.equipmentName = equipmentName;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
:size="size || '50%'"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
@@ -42,7 +42,8 @@
|
||||
v-model="form"
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<el-row style="margin-bottom: 24px">
|
||||
<!-- if -->
|
||||
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
@@ -64,13 +65,39 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- else -->
|
||||
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备名"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-input
|
||||
v-model="form.equipmentName"
|
||||
placeholder="请输入设备名"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备关联表名"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-input
|
||||
v-model="form.plcTableName"
|
||||
placeholder="请输入关联表名"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="section.key == 'attrs'"
|
||||
style="position: relative; margin-top: 12px">
|
||||
<!-- v-if="!mode.includes('detail')" -->
|
||||
<div style="position: absolute; top: -40px; right: 0">
|
||||
<div
|
||||
v-if="!mode.includes('detail')"
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
@@ -86,7 +113,7 @@
|
||||
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr" -->
|
||||
<method-btn
|
||||
v-if="section.tableBtn"
|
||||
v-if="section.tableBtn && !mode.includes('detail')"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@@ -106,10 +133,12 @@
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleSave">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -164,7 +193,7 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
|
||||
props: ['sections', 'defaultMode', 'infoData'],
|
||||
props: ['sections', 'defaultMode', 'infoData', 'size'],
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
@@ -412,7 +441,7 @@ export default {
|
||||
handleSave() {
|
||||
this.$refs['form'][0].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.mode == 'edit';
|
||||
const isEdit = !this.mode.includes('detail');
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: isEdit ? 'put' : 'post',
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { deleteCheck } from "@/api/equipment/base/inspection/settings";
|
||||
import { deleteCheck } from '@/api/equipment/base/inspection/settings';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -128,15 +128,21 @@ export default {
|
||||
label: '巡检内容编号',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-check/getCode',
|
||||
rules: [{ required: true, message: '巡检内容编号不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '巡检内容编号不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '巡检项目',
|
||||
prop: 'program',
|
||||
rules: [{ required: true, message: '巡检项目不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -144,10 +150,10 @@ export default {
|
||||
input: true,
|
||||
label: '巡检内容',
|
||||
prop: 'content',
|
||||
rules: [{ required: true, message: '巡检内容不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '巡检内容不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
@@ -168,7 +174,7 @@ export default {
|
||||
code: '',
|
||||
program: '',
|
||||
id: undefined,
|
||||
content: ''
|
||||
content: '',
|
||||
},
|
||||
basePath: '/base/equipment-check',
|
||||
mode: null,
|
||||
@@ -271,10 +277,10 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除巡检项目名称为"' + row.program + '"的数据项?')
|
||||
.confirm('是否确认删除该巡检项目?')
|
||||
.then(function () {
|
||||
// return this.delete({ id });
|
||||
return deleteCheck(id)
|
||||
// return this.del({ id });
|
||||
return deleteCheck(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
ref="drawer"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '查看详情' : '新增' }}
|
||||
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
@@ -77,9 +78,9 @@
|
||||
<el-form-item label="巡检时间" prop="actualTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.actualTime"
|
||||
type="date"
|
||||
type="datetime"
|
||||
:disabled="isdetail"
|
||||
format='yyyy-MM-dd'
|
||||
format='yyyy-MM-dd HH:mm:ss'
|
||||
value-format="timestamp"
|
||||
placeholder="选择巡检时间" />
|
||||
</el-form-item>
|
||||
@@ -93,20 +94,20 @@
|
||||
:table-data="list" />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检详情" prop="description">
|
||||
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="380"/>
|
||||
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="150"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<FileUpload v-model="file" :disabled="isdetail" />
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">取消</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
<el-button type="primary" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-button> -->
|
||||
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
@@ -184,6 +185,7 @@ export default {
|
||||
total: 0,
|
||||
},
|
||||
file: '',
|
||||
fileName: '',
|
||||
dataRule: {
|
||||
responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }],
|
||||
actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }]
|
||||
@@ -194,6 +196,9 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
async getDict() {
|
||||
const res = await getEquipmentAll()
|
||||
this.eqList = res.data
|
||||
@@ -232,6 +237,8 @@ export default {
|
||||
files: []
|
||||
}
|
||||
this.list = []
|
||||
this.file = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
@@ -239,6 +246,10 @@ export default {
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
|
||||
// const scrollContainer = this.$refs.dataForm;
|
||||
// const scrollPosition = scrollContainer.scrollTop;
|
||||
// console.log('12', scrollPosition);
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
@@ -247,6 +258,11 @@ export default {
|
||||
getEqCheckLog(this.dataForm.id).then(response => {
|
||||
this.formLoading = false
|
||||
this.dataForm = response.data;
|
||||
if (this.dataForm.files.length > 0) {
|
||||
this.file = this.dataForm.files[0].fileUrl
|
||||
this.fileName = this.dataForm.files[0].fileName
|
||||
}
|
||||
this.setConfig()
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
@@ -283,8 +299,9 @@ export default {
|
||||
if (this.file) {
|
||||
const temp = this.file.split(',') // 获取文件个数
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
temp.forEach((item, index) => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
searchBarKeys: ['equipmentId', 'createTime'],
|
||||
searchBarKeys: ['equipmentId', 'actualTime'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:check-record:detail')
|
||||
? {
|
||||
@@ -105,6 +105,7 @@ export default {
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
@@ -112,12 +113,12 @@ export default {
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'startTime',
|
||||
param: 'actualTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-09 11:09:26
|
||||
* @LastEditTime: 2023-11-27 10:48:55
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -52,11 +52,10 @@
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block;" @click="addNew()">
|
||||
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
||||
<span class="add">添加</span>
|
||||
</span>
|
||||
</template>
|
||||
<span style="display: inline-block;">
|
||||
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
@@ -177,11 +176,7 @@ export default {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.attrName
|
||||
? '[名称=' + raw.data.attrName + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
`是否确认删除巡检项目名称为"${raw.data.program}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
@@ -290,7 +285,7 @@ export default {
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
max-height: 16vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
@@ -308,7 +303,7 @@ export default {
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
|
||||
105
src/views/equipment/base/inspection/Settings/add.vue
Normal file
105
src/views/equipment/base/inspection/Settings/add.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-25 16:23:13
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
placeholder="请输入配置名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
placeholder="请输入配置编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
placeholder="请选择设备名称"
|
||||
@change="setCode">
|
||||
<el-option
|
||||
v-for="dict in eqList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input v-model="dataForm.equipmentCode" disabled placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
import { getEqCheck, getCode, createCheckConfig, updateCheckConfig } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentAll } from '@/api/base/equipment'
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createCheckConfig,
|
||||
updateURL: updateCheckConfig,
|
||||
infoURL: getEqCheck,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
equipmentId: undefined,
|
||||
equipmentCode: undefined
|
||||
},
|
||||
eqList: [],
|
||||
dataRule: {
|
||||
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "配置编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "配置名称不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 设备列表
|
||||
const res = await getEquipmentAll()
|
||||
this.eqList = res.data
|
||||
},
|
||||
setCode() {
|
||||
const chooseM = this.eqList.filter(item => {
|
||||
return item.id === this.dataForm.equipmentId
|
||||
})
|
||||
this.dataForm.equipmentCode = chooseM[0].code
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -36,14 +36,10 @@
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="false"
|
||||
:rows="rows" />
|
||||
@confirm="handleConfirm">
|
||||
<add
|
||||
ref="add"
|
||||
@refreshDataList="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 添加巡检,查看详情 -->
|
||||
<addOrUpdata
|
||||
@@ -54,15 +50,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue'
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentCheckSetting',
|
||||
components: { addOrUpdata },
|
||||
components: { addOrUpdata, add },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -101,9 +97,9 @@ export default {
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'equipmentName', label: '设备' },
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'equipmentCode', label: '描述' },
|
||||
{ prop: 'checkNumber', label: '巡检条数' } // TODO: 操作 选项,四个,群里询问
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
// { prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: 操作 选项,四个,群里询问
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@@ -117,6 +113,7 @@ export default {
|
||||
label: '设备名称',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -151,14 +148,18 @@ export default {
|
||||
input: true,
|
||||
label: '配置名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '配置编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-check-config/getCode',
|
||||
rules: [{ required: true, message: '配置编码不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '配置编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -167,7 +168,13 @@ export default {
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'change' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
@@ -196,6 +203,13 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
this.$refs.add.dataFormSubmit()
|
||||
},
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.$set(
|
||||
@@ -220,9 +234,10 @@ export default {
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.$refs.add.formClear()
|
||||
this.open = false;
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
this.title = ''
|
||||
// this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
@@ -247,18 +262,26 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
// this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加巡检设置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.add.init();
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改巡检设置';
|
||||
// this.reset();
|
||||
// const id = row.id;
|
||||
// this.info({ id }).then((response) => {
|
||||
// this.form = response.data;
|
||||
// this.open = true;
|
||||
// this.title = '修改巡检设置';
|
||||
// });
|
||||
this.open = true;
|
||||
this.title = '修改巡检设置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.add.init(row.id);
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@@ -288,9 +311,9 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.delete({ id });
|
||||
.confirm('是否确认删除配置名为"' + row.name + '"的数据项?')
|
||||
.then(() => {
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
@@ -317,14 +340,14 @@ export default {
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
});
|
||||
},
|
||||
handleAddDetail({ id }) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "添加巡检";
|
||||
this.addOrEditTitle = '添加巡检';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
|
||||
@@ -52,6 +52,7 @@ import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
|
||||
const remainBox = {
|
||||
name: 'RemainBox',
|
||||
@@ -99,7 +100,7 @@ const btn = {
|
||||
render: function (h) {
|
||||
return (
|
||||
<el-button type="text" onClick={this.handleClick}>
|
||||
{this.injectData.label}
|
||||
{this.injectData.name}
|
||||
</el-button>
|
||||
);
|
||||
},
|
||||
@@ -113,16 +114,16 @@ export default {
|
||||
return {
|
||||
searchBarKeys: ['planId', 'equipmentId'],
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{ prop: 'name', label: '保养计划' },
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'lineName', label: '产线名' },
|
||||
{ prop: 'sectionName', label: '工段名' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率' },
|
||||
@@ -134,16 +135,16 @@ export default {
|
||||
{
|
||||
prop: 'lastMaintainTime',
|
||||
label: '上次保养时间',
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间' },
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
|
||||
{
|
||||
prop: 'remainDays',
|
||||
label: '距离保养时间(天)',
|
||||
subcomponent: remainBox,
|
||||
},
|
||||
{ prop: 'opt1', label: '设备保养', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', subcomponent: btn },
|
||||
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@@ -243,15 +244,16 @@ export default {
|
||||
switch (action) {
|
||||
// 查看详情
|
||||
case '设备保养':
|
||||
this.$router.push({ path: '/equipment/base/maintain/plan-config',query: {
|
||||
equipmentId: value.equipmentId,
|
||||
equipmentName: value.equipmentName
|
||||
this.$router.push({ path: '/equipment/base/maintain/record',query: {
|
||||
addRecord: 1,
|
||||
row: value
|
||||
} })
|
||||
break;
|
||||
case '保养记录':
|
||||
const queryData = {
|
||||
equipmentId: value.equipmentId,
|
||||
maintainPlanId: value.id
|
||||
maintainPlanId: value.id,
|
||||
relatePlan: value.lastMaintainTime ? 1 : 2
|
||||
}
|
||||
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
|
||||
break;
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
export default {
|
||||
name: 'PlanConfig',
|
||||
@@ -95,7 +96,7 @@ export default {
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率(天/次)' },
|
||||
{ prop: 'maintainType', label: '保养类型' },
|
||||
{ prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@@ -106,37 +107,37 @@ export default {
|
||||
param: 'equipmentName',
|
||||
},
|
||||
// 时间段
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
// valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'createTime',
|
||||
// defaultSelect: [
|
||||
// new Date(y, m, d)
|
||||
// .toLocaleString()
|
||||
// .split('/')
|
||||
// .map((item, index) => {
|
||||
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// return item;
|
||||
// })
|
||||
// .join('-'),
|
||||
// new Date(y, m, d, 23, 59, 59)
|
||||
// .toLocaleString()
|
||||
// .split('/')
|
||||
// .map((item, index) => {
|
||||
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// return item;
|
||||
// })
|
||||
// .join('-'),
|
||||
// ],
|
||||
},
|
||||
// {
|
||||
// type: 'datePicker',
|
||||
// label: '时间段',
|
||||
// dateType: 'daterange', // datetimerange
|
||||
// format: 'yyyy-MM-dd',
|
||||
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
// // valueFormat: 'timestamp',
|
||||
// rangeSeparator: '-',
|
||||
// startPlaceholder: '开始日期',
|
||||
// endPlaceholder: '结束日期',
|
||||
// defaultTime: ['00:00:00', '23:59:59'],
|
||||
// param: 'createTime',
|
||||
// // defaultSelect: [
|
||||
// // new Date(y, m, d)
|
||||
// // .toLocaleString()
|
||||
// // .split('/')
|
||||
// // .map((item, index) => {
|
||||
// // if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// // return item;
|
||||
// // })
|
||||
// // .join('-'),
|
||||
// // new Date(y, m, d, 23, 59, 59)
|
||||
// // .toLocaleString()
|
||||
// // .split('/')
|
||||
// // .map((item, index) => {
|
||||
// // if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// // return item;
|
||||
// // })
|
||||
// // .join('-'),
|
||||
// // ],
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
@@ -224,6 +225,17 @@ export default {
|
||||
rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
switch: true,
|
||||
label: '启用状态',
|
||||
prop: 'enabled',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
},
|
||||
}
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
@@ -300,7 +312,8 @@ export default {
|
||||
const queryData = {
|
||||
equipmentId: row.equipmentId,
|
||||
maintainPlanId: row.id,
|
||||
relatePlan: row.enabled
|
||||
isAdd: 1
|
||||
// relatePlan: row.enabled
|
||||
}
|
||||
if (this.queryParams.createTime) {
|
||||
queryData.createTime = this.queryParams.createTime
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="true"
|
||||
:rows="rows" />
|
||||
<el-row v-if="mode === 'detail'" slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" class="btnTextStyle" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -53,7 +58,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import Editor from '@/components/Editor';
|
||||
import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record';
|
||||
import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -121,14 +126,14 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '保养计划',
|
||||
placeholder: '请选择保养计划',
|
||||
label: '计划名称',
|
||||
placeholder: '请选择计划名称',
|
||||
param: 'maintainPlanId',
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
label: '保养开始时间',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
@@ -311,13 +316,16 @@ export default {
|
||||
this.searchBarFormConfig[0].defaultSelect =
|
||||
this.$route.query.equipmentId ?? undefined;
|
||||
this.searchBarFormConfig[1].defaultSelect =
|
||||
Number(this.$route.query.maintainPlanId) ?? undefined;
|
||||
this.$route.query.maintainPlanId ?? undefined;
|
||||
this.searchBarFormConfig[2].defaultSelect =
|
||||
this.$route.query?.createTime ?? undefined;
|
||||
this.searchBarFormConfig[3].defaultSelect =
|
||||
Number(this.$route.query.relatePlan) ?? undefined;
|
||||
}
|
||||
this.getList();
|
||||
if (this.$route.query.addRecord) {
|
||||
this.handleAdd()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
@@ -398,6 +406,19 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
if (this.$route.query.addRecord) {
|
||||
// 赋值
|
||||
const tempRow = this.$route.query.row
|
||||
this.form.equipmentId = tempRow.equipmentId
|
||||
this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2
|
||||
this.form.startTime = tempRow.nextMaintainTime
|
||||
this.form.maintainPlanId = tempRow.id
|
||||
}
|
||||
if (this.$route.query.isAdd) {
|
||||
// 赋值
|
||||
this.form.equipmentId = this.$route.query.equipmentId
|
||||
this.form.maintainPlanId = this.$route.query.maintainPlanId
|
||||
}
|
||||
this.open = true;
|
||||
this.title = '添加保养记录';
|
||||
},
|
||||
@@ -440,7 +461,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否删除设备名称为"' + row.equipmentName + '"的数据项?')
|
||||
.confirm('是否确认删除设备名称为"' + row.equipmentName + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEqMaintainLog(id);
|
||||
})
|
||||
@@ -456,7 +477,7 @@ export default {
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改保养记录';
|
||||
this.title = '查看保养记录详情';
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
@@ -469,10 +490,10 @@ export default {
|
||||
.confirm('是否确认导出所有保养记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
return exportMaintainLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '保养记录.xls');
|
||||
this.$download.excel(response, '设备保养记录.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
@@ -41,12 +41,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ dataForm.faultTime }}</span>
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>{{ dataForm.faultLevel }}</span>
|
||||
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -146,7 +146,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修附件" prop="file">
|
||||
<FileUpload v-model="file" :disabled="disabled" />
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -164,11 +164,11 @@
|
||||
</el-form>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||
<el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-button> -->
|
||||
<el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
@@ -179,6 +179,8 @@ import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
|
||||
import Editor from "@/components/Editor";
|
||||
import FileUpload from "@/components/FileUpload";
|
||||
import { getDictDatas } from "@/utils/dict";
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
@@ -204,11 +206,15 @@ export default {
|
||||
visible: false,
|
||||
disabled: false,
|
||||
dataForm: {},
|
||||
file: ''
|
||||
file: '',
|
||||
fileName: ''
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
@@ -223,12 +229,15 @@ export default {
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
initData() {
|
||||
this.file = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
init(row, isdetail) {
|
||||
// this.initData();
|
||||
this.initData();
|
||||
this.disabled = isdetail || false;
|
||||
this.dataForm.id = row.id || undefined;
|
||||
this.visible = true;
|
||||
console.log('111', this.dataForm, row)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
@@ -239,6 +248,10 @@ export default {
|
||||
this.formLoading = false
|
||||
this.dataForm = response.data;
|
||||
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
|
||||
if (this.dataForm.files.length > 0) {
|
||||
this.file = this.dataForm.files[0].fileUrl
|
||||
this.fileName = this.dataForm.files[0].fileName
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
@@ -259,6 +272,7 @@ export default {
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
|
||||
@@ -53,12 +53,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
// import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import CustomDialogForm from './CustomDialogForm.vue';
|
||||
import { deleteRepair } from '@/api/equipment/base/repair'
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentRepair',
|
||||
@@ -100,14 +100,14 @@ export default {
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: timeFilter,
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'repairOrderNumber', label: '设备维修单号' },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: timeFilter },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
|
||||
{
|
||||
prop: 'maintenanceFinishTime',
|
||||
label: '结束时间',
|
||||
filter: timeFilter,
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceStatus',
|
||||
@@ -129,6 +129,7 @@ export default {
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -417,10 +418,10 @@ export default {
|
||||
.confirm('是否确认导出所有维修记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
return exportRepairLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '维修记录.xls');
|
||||
this.$download.excel(response, '设备维修.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
@@ -75,9 +75,6 @@
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||
<el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@@ -79,21 +79,13 @@ export default {
|
||||
this.partList = res.data.list;
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.visible = false
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
// this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs['dataForm'].resetFields();
|
||||
// if (this.dataForm.id) {
|
||||
// getCoreProductAttr({
|
||||
// id: this.dataForm.id
|
||||
// }).then((res) => {
|
||||
// const { name, value } = res.data;
|
||||
// this.dataForm.name = name;
|
||||
// this.dataForm.value = value;
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
@@ -117,6 +109,7 @@ export default {
|
||||
configId: this.configId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
|
||||
36
src/views/equipment/base/spareParts/Config/htmls.vue
Normal file
36
src/views/equipment/base/spareParts/Config/htmls.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-08 14:00:52
|
||||
* @LastEditTime: 2023-11-24 09:12:36
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div v-html="content" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getContent()
|
||||
console.log('12', this.injectData)
|
||||
},
|
||||
|
||||
methods: {
|
||||
getContent() {
|
||||
this.content = this.injectData.description ?? ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -60,8 +60,9 @@ import { publicFormatter } from '@/utils/dict';
|
||||
import Editor from '@/components/Editor';
|
||||
import addSparts from './addSparts.vue';
|
||||
import { deleteConfig } from '@/api/equipment/base/spare-parts/config'
|
||||
import htmls from './htmls.vue'
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentSparePartsConfig',
|
||||
@@ -111,7 +112,7 @@ export default {
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
// { prop: 'unit', label: '单位', filter: publicFormatter('unit_dict') },
|
||||
{ prop: 'description', label: '描述' },
|
||||
{ prop: 'description', label: '描述', subcomponent: htmls },
|
||||
{ prop: 'sparePartNumber', label: '备品备件数量' },
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list'
|
||||
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
label: '备件名称',
|
||||
placeholder: '请输入备件名称',
|
||||
param: 'name',
|
||||
},
|
||||
@@ -132,20 +132,33 @@ export default {
|
||||
input: true,
|
||||
label: '备件名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '备件名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '备件名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '备件型号',
|
||||
prop: 'model',
|
||||
label: '备件编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-spare-part/getCode',
|
||||
rules: [
|
||||
{ required: true, message: '备件编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备件型号',
|
||||
prop: 'model',
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '规格',
|
||||
prop: 'specifications',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '供应商',
|
||||
@@ -155,10 +168,10 @@ export default {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '供应商不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '物料类型',
|
||||
@@ -169,8 +182,12 @@ export default {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '物料类型不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '物料类型不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '使用寿命',
|
||||
@@ -184,14 +201,14 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '单位',
|
||||
prop: 'unit', // 数据字典
|
||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
@@ -284,6 +301,12 @@ export default {
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
if (this.form.unit !== undefined) {
|
||||
this.form.unit = String(this.form.unit)
|
||||
}
|
||||
if (this.form.type !== undefined) {
|
||||
this.form.type = String(this.form.type)
|
||||
}
|
||||
this.open = true;
|
||||
this.title = '修改备品备件';
|
||||
});
|
||||
|
||||
@@ -310,7 +310,8 @@ export default {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'change') {
|
||||
// 更换
|
||||
this.addNew();
|
||||
console.log(raw)
|
||||
this.addNew(raw.data.sparePartId);
|
||||
} else {}
|
||||
},
|
||||
getList() {
|
||||
@@ -320,7 +321,7 @@ export default {
|
||||
configId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.list = response.data;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.listQuery.total = response.data.length;
|
||||
});
|
||||
},
|
||||
getList1() {
|
||||
@@ -334,10 +335,10 @@ export default {
|
||||
});
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
addNew(sparePartId) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
this.$refs.addOrUpdate.init(sparePartId);
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@@ -25,10 +25,27 @@
|
||||
clearable
|
||||
placeholder="请输入操作人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更换耗时(min)" prop="timeUsed">
|
||||
<el-input-number
|
||||
v-model="dataForm.timeUsed"
|
||||
controls-position="right"
|
||||
clearable
|
||||
placeholder="请输入更换耗时"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更换时间" prop="replacementTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.replacementTime"
|
||||
type="date"
|
||||
format='yyyy-MM-dd'
|
||||
value-format='timestamp'
|
||||
placeholder="选择入更换时间"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@@ -49,11 +66,15 @@ export default {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
responsible: ''
|
||||
responsible: '',
|
||||
timeUsed: 0,
|
||||
sparePartId: '',
|
||||
replacementTime: undefined
|
||||
},
|
||||
partList: [],
|
||||
dataRule: {
|
||||
responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }]
|
||||
responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }],
|
||||
replacementTime: [{ required: true, message: '更换时间不能为空', trigger: 'blur' }]
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -66,9 +87,13 @@ export default {
|
||||
// this.partList = res.data
|
||||
// },
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.dataForm.sparePartId = id || undefined;
|
||||
this.visible = true;
|
||||
},
|
||||
cancel() {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
this.visible = false;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
@@ -91,6 +116,7 @@ export default {
|
||||
configId: this.configId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$refs['dataForm'].resetFields();
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
|
||||
@@ -72,10 +72,10 @@ const remainBox = {
|
||||
},
|
||||
computed: {
|
||||
value() {
|
||||
const temp = this.injectData[this.injectData.prop] || null
|
||||
const temp = this.injectData[this.injectData.prop] || null;
|
||||
if (temp) {
|
||||
console.log('12', temp)
|
||||
return temp === 'Green' ? 'green' : 'red'
|
||||
console.log('12', temp);
|
||||
return temp === 'Green' ? 'green' : 'red';
|
||||
}
|
||||
return this.injectData[this.injectData.prop] || null;
|
||||
},
|
||||
@@ -83,7 +83,7 @@ const remainBox = {
|
||||
if (this.value) {
|
||||
// const v = +this.value;
|
||||
// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
|
||||
return this.value
|
||||
return this.value;
|
||||
}
|
||||
return 'unset';
|
||||
},
|
||||
@@ -95,8 +95,7 @@ const remainBox = {
|
||||
this.color
|
||||
// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
|
||||
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
|
||||
'unset'
|
||||
// this.color == 'red' ? '#fff' : 'unset'
|
||||
this.color == 'red' || this.color == 'green' ? '#fff' : 'unset'
|
||||
}`}>
|
||||
{this.injectData[this.injectData.prop] || ''}
|
||||
</div>
|
||||
@@ -112,7 +111,10 @@ const btn = {
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
|
||||
this.$emit('emitData', {
|
||||
action: this.injectData.name,
|
||||
value: this.injectData,
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
@@ -124,8 +126,6 @@ const btn = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
name: 'EquipmentSparePartsMonitor',
|
||||
components: { addSparts },
|
||||
@@ -162,7 +162,12 @@ export default {
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'color', label: '是否超期', subcomponent: remainBox },
|
||||
{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '更换记录', name: '更新记录', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
|
||||
{
|
||||
prop: 'opt2',
|
||||
label: '更换记录',
|
||||
name: '更新记录',
|
||||
subcomponent: btn,
|
||||
}, // TODO: 是否换成按钮, 群里问
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@@ -171,12 +176,14 @@ export default {
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'lineId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -211,7 +218,9 @@ export default {
|
||||
input: true,
|
||||
label: '配置名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -224,7 +233,9 @@ export default {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -281,29 +292,29 @@ export default {
|
||||
}
|
||||
},
|
||||
eqOperation({ id }) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
updateLog({ id }) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
});
|
||||
},
|
||||
initSearchBar() {
|
||||
// 产线列表
|
||||
getCorePLList().then(res => {
|
||||
getCorePLList().then((res) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
'selectOptions',
|
||||
res.data.map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
})
|
||||
});
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[1],
|
||||
@@ -319,7 +330,11 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.http('/base/equipment-spare-part-config/monitor', 'get', this.queryParams).then((response) => {
|
||||
this.http(
|
||||
'/base/equipment-spare-part-config/monitor',
|
||||
'get',
|
||||
this.queryParams
|
||||
).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
@@ -338,7 +353,7 @@ export default {
|
||||
name: null,
|
||||
equipmentId: null,
|
||||
description: null,
|
||||
responsible: null
|
||||
responsible: null,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
@@ -397,7 +412,7 @@ export default {
|
||||
this.$modal
|
||||
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.delete({ id });
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
||||
143
src/views/equipment/monitor/SearchBar.vue
Normal file
143
src/views/equipment/monitor/SearchBar.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<!--
|
||||
filename: SearchBar.vue
|
||||
author: liubin
|
||||
date: 2023-11-23 14:01:17
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="search-bar">
|
||||
<div class="vertical-blue-line"></div>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="search-bar__form"
|
||||
:model="form"
|
||||
class="search-bar__form">
|
||||
<el-form-item :label="'产线'" prop="productionLineId">
|
||||
<el-select
|
||||
size="small"
|
||||
placeholder="请选择产线"
|
||||
@change="getEquipmentByLineId"
|
||||
v-model="form.productionLineId">
|
||||
<el-option
|
||||
v-for="item in listLine"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="'设备'" prop="equipmentId">
|
||||
<el-select
|
||||
size="small"
|
||||
placeholder="请选择设备"
|
||||
v-model="form.equipmentId">
|
||||
<el-option
|
||||
v-for="item in listEq"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button type="primary" @click="handleSearch" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SearchBar',
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change',
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listLine: [],
|
||||
listEq: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form: {
|
||||
set(val) {
|
||||
this.emit(val);
|
||||
},
|
||||
get() {
|
||||
return this.value;
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getLine();
|
||||
},
|
||||
methods: {
|
||||
emit(newValue) {
|
||||
debugger;
|
||||
this.$emit('update', { ...this.form, ...newValue });
|
||||
},
|
||||
async getLine() {
|
||||
const { data, code } = await this.$axios({
|
||||
url: '/base/core-production-line/listAll',
|
||||
});
|
||||
if (code == 0) {
|
||||
this.listLine = data;
|
||||
return;
|
||||
}
|
||||
this.listLine.splice(0);
|
||||
},
|
||||
async getEquipmentByLineId(id) {
|
||||
const { data, code } = await this.$axios({
|
||||
url: '/base/core-equipment/listByLine',
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
this.listEq = data;
|
||||
return;
|
||||
}
|
||||
this.listEq.splice(0);
|
||||
},
|
||||
handleSearch() {
|
||||
this.$emit('action', {
|
||||
action: 'search',
|
||||
payload: this.form,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.search-bar {
|
||||
padding: 12px 0;
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0 !important;
|
||||
margin-right: 0;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-right: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.vertical-blue-line {
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0b58ff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
<SearchBarNew v-model="searchBarForm" @action="handleSearchBarActions" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
@@ -13,13 +10,13 @@
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
@clickBtn="handleTableBtnClick" /> -->
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
@@ -50,22 +47,23 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import SearchBarNew from '../SearchBar.vue';
|
||||
|
||||
const btn = {
|
||||
name: 'tableBtn',
|
||||
props: ['injectData'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
|
||||
this.$emit('emitData', {
|
||||
action: this.injectData.label,
|
||||
value: this.injectData,
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
@@ -77,154 +75,104 @@ const btn = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
// monitoring/equipment-monitor/realtime-page
|
||||
export default {
|
||||
name: 'StatusAndParams',
|
||||
mixins: [basicPageMixin],
|
||||
components: { SearchBarNew },
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['equipmentName', 'recordTime'],
|
||||
tableBtn: [
|
||||
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||
// ? {
|
||||
// type: 'detail',
|
||||
// btnName: '详情',
|
||||
// }
|
||||
// : undefined,
|
||||
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '修改',
|
||||
// }
|
||||
// : undefined,
|
||||
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
|
||||
// ? {
|
||||
// type: 'delete',
|
||||
// btnName: '删除',
|
||||
// }
|
||||
// : undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{ prop: 'productionLine', label: '设备名称' },
|
||||
{ prop: 'workshopSection', label: '设备编码' },
|
||||
{ prop: 'equipment', label: '投入数' },
|
||||
{ prop: 'productionLine', label: '产出数' },
|
||||
{ prop: 'workshopSection', label: '是否运行' },
|
||||
{ prop: 'equipment22', label: '状态' },
|
||||
// { prop: 'alarmGrade', label: '报警级别', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
|
||||
{ prop: 'productionLine', label: '是否故障' },
|
||||
{ prop: 'workshopSection', label: '生产量记录时间', filter: parseTime },
|
||||
{ prop: 'equipment1', label: '状态记录时间', filter: parseTime },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'inQuantity', label: '投入数' },
|
||||
{ prop: 'outQuantity', label: '产出数' },
|
||||
{
|
||||
prop: 'run',
|
||||
label: '是否运行',
|
||||
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
filter: (val) =>
|
||||
val != null ? ['正常', '计划停机', '故障'][val] : '',
|
||||
},
|
||||
{
|
||||
prop: 'error',
|
||||
label: '是否故障',
|
||||
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
|
||||
},
|
||||
{
|
||||
prop: 'quantityRecordTime',
|
||||
label: '生产量记录时间',
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
|
||||
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn } // TODO: 是否换成按钮, 群里问
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备名',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
// 时间段
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||
format: 'yyyy-MM-dd',
|
||||
// valueFormat: 'timestamp',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'recordTime',
|
||||
// defaultSelect: [
|
||||
// new Date(y, m, d)
|
||||
// .toLocaleString()
|
||||
// .split('/')
|
||||
// .map((item, index) => {
|
||||
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// return item;
|
||||
// })
|
||||
// .join('-'),
|
||||
// new Date(y, m, d, 23, 59, 59)
|
||||
// .toLocaleString()
|
||||
// .split('/')
|
||||
// .map((item, index) => {
|
||||
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// return item;
|
||||
// })
|
||||
// .join('-'),
|
||||
// ],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:spare-parts-config:create')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// plain: true,
|
||||
// color: 'success',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:spare-parts-config:export')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
|
||||
],
|
||||
searchBarForm: {
|
||||
productionLineId: null,
|
||||
equipmentId: null,
|
||||
},
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
lineId: null,
|
||||
equipmentId: null,
|
||||
productionLineId: null,
|
||||
},
|
||||
basePath: '/base/equipment-alarm-log',
|
||||
list: []
|
||||
list: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList();
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleEmitFun(val) {
|
||||
console.log('你好', val)
|
||||
if (val.action === '状态可视化') {
|
||||
/**
|
||||
* 处理表格按钮点击事件
|
||||
* @param {string} action 按钮名称
|
||||
* @param {object} value 按钮数据(行数据) { equipmentId, equipmentCode, equipmentName, inQuantity, outQuantity, run, status, error, quantityRecordTime, statusRecordTime}
|
||||
*/
|
||||
handleEmitFun({ action, value: row } = {}) {
|
||||
if (action === '状态可视化') {
|
||||
// 状态可视化
|
||||
} else {
|
||||
} else if (action === '参数监控') {
|
||||
// 参数监控
|
||||
// 接口需要 equipmentId recordTime workOrderId 工单id
|
||||
this.$router.push({
|
||||
// path: '/equipment/monitor/full-params',
|
||||
name: 'EquipmentFullParams',
|
||||
params: {
|
||||
equipmentId: row.equipmentId,
|
||||
equipmentCode: row.equipmentCode,
|
||||
equipmentName: row.equipmentName,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv(this.queryParams).then((response) => {
|
||||
this.http(
|
||||
'/monitoring/equipment-monitor/realtime-page',
|
||||
'get',
|
||||
this.queryParams
|
||||
).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
this.cancel();
|
||||
this.getList();
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -242,9 +190,25 @@ export default {
|
||||
// };
|
||||
// this.resetForm('form');
|
||||
// },
|
||||
handleSearchBarActions({ action, payload }) {
|
||||
switch (action) {
|
||||
case 'search':
|
||||
this.handleQuery();
|
||||
break;
|
||||
case 'reset':
|
||||
this.resetQuery();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
...this.searchBarForm,
|
||||
pageNo: 1,
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
@@ -270,7 +234,7 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.addOrUpdate.dataFormSubmit()
|
||||
this.$refs.addOrUpdate.dataFormSubmit();
|
||||
// this.$refs['form'].validate((valid) => {
|
||||
// if (!valid) {
|
||||
// return;
|
||||
@@ -297,8 +261,8 @@ export default {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.delete({ id });
|
||||
.then(() => {
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
v-if="open"
|
||||
style="width: 100%"
|
||||
v-model="queryParams.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择一个设备">
|
||||
<el-option
|
||||
v-for="eq in eqList"
|
||||
|
||||
@@ -94,12 +94,19 @@
|
||||
|
||||
<script>
|
||||
import Gantt from './chart';
|
||||
import moment from 'moment';
|
||||
|
||||
export default {
|
||||
name: 'SGStatus',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
const today = new Date();
|
||||
const todayStart = new Date(
|
||||
today.getFullYear(),
|
||||
today.getMonth(),
|
||||
today.getDate()
|
||||
);
|
||||
return {
|
||||
chart: null,
|
||||
searchBarFormConfig: [
|
||||
@@ -129,6 +136,7 @@ export default {
|
||||
placeholder: '选择日期',
|
||||
param: 'recordTime',
|
||||
required: true,
|
||||
defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -369,7 +377,10 @@ export default {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/monitoring/equipment-monitor/status-series',
|
||||
method: 'get',
|
||||
params: this.queryParams,
|
||||
params: {
|
||||
recordTime: this.queryParams.recordTime,
|
||||
equipmentId: this.queryParams.equipmentId,
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
const newEqlist = this.objectToArray(data);
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
<<<<<<< HEAD
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-28 10:09:20
|
||||
=======
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-27 16:37:17
|
||||
>>>>>>> projects/mes-test
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="border: 1px solid #ccc; display: flex">
|
||||
<el-row v-if="filteredBomList.length" style="border: 1px solid #ccc; display: flex">
|
||||
<el-col :span="8">
|
||||
<div class="select-list">
|
||||
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
|
||||
@@ -78,6 +78,7 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</template>
|
||||
;
|
||||
|
||||
@@ -218,34 +218,45 @@ export default {
|
||||
this.total = 0;
|
||||
}
|
||||
|
||||
this.selectedBoms = [];
|
||||
// 获取设备及bom列表
|
||||
this.http('/extend/process-flow-det/getEquipmentDetBySectionId', 'post', {
|
||||
sectionId,
|
||||
flowDetId: detId,
|
||||
}).then(({ code, data }) => {
|
||||
if (code == 0) {
|
||||
this.bomList = data.map((eq) => {
|
||||
eq.materialsBom = eq.materialsBom || [];
|
||||
eq.valuesBom = eq.valuesBom || [];
|
||||
// 设置选中状态
|
||||
eq.materialsBom.chosen = eq.materialsBomChoseId ?? null;
|
||||
eq.valuesBom.chosen = eq.valuesBomChoseId ?? null;
|
||||
if (eq.equChose || eq.materialsBom.chosen || eq.valuesBom.chosen) {
|
||||
this.selectedBoms.push({
|
||||
equipmentId: eq.id,
|
||||
equMaterialBomId: eq.materialsBom.chosen,
|
||||
equValueBomId: eq.valuesBom.chosen,
|
||||
});
|
||||
}
|
||||
// 设置设备id
|
||||
eq.materialsBom.equipmentId = eq.id;
|
||||
eq.valuesBom.equipmentId = eq.id;
|
||||
return eq;
|
||||
});
|
||||
} else {
|
||||
})
|
||||
.then(({ code, data }) => {
|
||||
if (code == 0) {
|
||||
this.bomList = data.map((eq) => {
|
||||
eq.materialsBom = eq.materialsBom || [];
|
||||
eq.valuesBom = eq.valuesBom || [];
|
||||
// 设置选中状态
|
||||
eq.materialsBom.chosen = eq.materialsBomChoseId ?? null;
|
||||
eq.valuesBom.chosen = eq.valuesBomChoseId ?? null;
|
||||
if (
|
||||
eq.equChose ||
|
||||
eq.materialsBom.chosen ||
|
||||
eq.valuesBom.chosen
|
||||
) {
|
||||
this.selectedBoms.push({
|
||||
equipmentId: eq.id,
|
||||
equMaterialBomId: eq.materialsBom.chosen,
|
||||
equValueBomId: eq.valuesBom.chosen,
|
||||
});
|
||||
}
|
||||
// 设置设备id
|
||||
eq.materialsBom.equipmentId = eq.id;
|
||||
eq.valuesBom.equipmentId = eq.id;
|
||||
return eq;
|
||||
});
|
||||
} else {
|
||||
this.bomList.splice(0);
|
||||
this.selectedBoms = [];
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.bomList.splice(0);
|
||||
}
|
||||
});
|
||||
this.selectedBoms = [];
|
||||
});
|
||||
},
|
||||
async handleAddEquipment() {
|
||||
this.open = true;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
class="btn-refresh"
|
||||
@click="handleUpdateLayout"
|
||||
icon="el-icon-refresh">
|
||||
刷新布局
|
||||
保存布局
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
|
||||
@@ -156,7 +156,7 @@ export default {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
createGroupClasses({ ...obj }).then((res) => {
|
||||
createGroupClasses({ ...this.form }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer :title="title" :visible.sync="visible" size="70%" @close='closeD'>
|
||||
<el-drawer :title="title" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
|
||||
<div class="box">
|
||||
<el-row class="topBox">
|
||||
<el-col :span="6">
|
||||
@@ -59,6 +59,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='40%'
|
||||
>
|
||||
<worker-team-add ref="workerTeamAdd" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='40%'
|
||||
>
|
||||
<group-team-add ref="groupList" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
@@ -50,9 +51,9 @@
|
||||
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import GroupTeamAdd from './components/groupTeamAdd'
|
||||
import StatusBtn from './components/statusBtn.vue'
|
||||
import WorkerOperate from './components/workerOperate.vue'
|
||||
import WorkerEdit from './components/workerEdit.vue';
|
||||
import StatusBtn from './components/statusBtn'
|
||||
import WorkerOperate from './components/workerOperate'
|
||||
import WorkerEdit from './components/workerEdit'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="no-data-bg">
|
||||
</div>
|
||||
<div v-else class="no-data-bg"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Message } from 'element-ui';
|
||||
import LocalDataManager from './utils/local-data-manager';
|
||||
// import response from './response';
|
||||
import moment from 'moment';
|
||||
@@ -55,7 +55,6 @@ export default {
|
||||
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
|
||||
const aWeekAgo = today - 3600 * 1000 * 24 * 7;
|
||||
return {
|
||||
tableList: [],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
@@ -109,35 +108,67 @@ export default {
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
id() {
|
||||
return this.$route.params.equipmentId;
|
||||
},
|
||||
code() {
|
||||
return this.$route.params.equipmentCode;
|
||||
},
|
||||
name() {
|
||||
return this.$route.params.equipmentName;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.id) this.$set(this.queryParams, 'id', this.id);
|
||||
if (this.code)
|
||||
this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code);
|
||||
if (this.name)
|
||||
this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name);
|
||||
beforeRouteEnter(to, from, next) {
|
||||
if (Object.keys(to.params).length > 0) {
|
||||
next((vm) => {
|
||||
vm.$set(vm.queryParams, 'id', to.params.equipmentId);
|
||||
vm.$set(
|
||||
vm.searchBarFormConfig[0],
|
||||
'defaultSelect',
|
||||
to.params.equipmentCode
|
||||
);
|
||||
vm.$set(
|
||||
vm.searchBarFormConfig[1],
|
||||
'defaultSelect',
|
||||
to.params.equipmentName
|
||||
);
|
||||
vm.handleQuery();
|
||||
});
|
||||
} else {
|
||||
// let timeleft = 3;
|
||||
|
||||
// this.handleResponse();
|
||||
// const message = Message({
|
||||
// type: 'warning',
|
||||
// duration: 0,
|
||||
// message: `请先选择设备, 即将引导进入设备状态和参数页面, 剩余 ${timeleft} s`,
|
||||
// });
|
||||
|
||||
// const timer = setInterval(() => {
|
||||
// if (timeleft > 0) {
|
||||
// timeleft--;
|
||||
// message.$data.message = `请先选择设备, 即将引导进入设备状态和参数页面, 剩余 ${timeleft} s`
|
||||
// return;
|
||||
// }
|
||||
// message.close();
|
||||
// clearInterval(timer);
|
||||
// timer = null;
|
||||
// }, 1000);
|
||||
|
||||
// next({ name: 'EquipmentStatusAndParams' });
|
||||
next((vm) => {
|
||||
vm.$message({
|
||||
type: 'error',
|
||||
message: `请先选择设备`,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
// clean job
|
||||
this.$set(this.queryParams, 'id', null);
|
||||
this.$set(this.searchBarFormConfig[0], 'defaultSelect', null);
|
||||
this.$set(this.searchBarFormConfig[1], 'defaultSelect', null);
|
||||
this.tableList = [];
|
||||
next();
|
||||
},
|
||||
methods: {
|
||||
buildProps(table) {
|
||||
console.log('building props', table);
|
||||
// 通过 otherList 来构建 props
|
||||
const { otherList } = table;
|
||||
const props = [
|
||||
{
|
||||
// type: 'index',
|
||||
width: 48,
|
||||
width: 56,
|
||||
prop: 'index',
|
||||
label: '序号',
|
||||
},
|
||||
@@ -147,7 +178,7 @@ export default {
|
||||
label: '时间',
|
||||
},
|
||||
{
|
||||
width: 200,
|
||||
width: 240,
|
||||
prop: 'plcCode',
|
||||
label: 'PLC编码',
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
color: ['#288AFF'],
|
||||
grid: {
|
||||
top: 64,
|
||||
left: 56,
|
||||
left: '8%',
|
||||
right: 64,
|
||||
bottom: 56,
|
||||
},
|
||||
|
||||
@@ -67,15 +67,20 @@
|
||||
class="app-container equipment-process-amount"
|
||||
style="flex: 1; border-radius: 8px; background: #fff">
|
||||
<!-- main area -->
|
||||
<div class="main-content" style="display: flex; flex-direction: column">
|
||||
<div
|
||||
class="main-content"
|
||||
style="height: 100%; display: flex; flex-direction: column">
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<el-row>
|
||||
<el-col class="custom-tabs">
|
||||
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
||||
<el-row style="flex: 1">
|
||||
<el-col class="custom-tabs" style="height: 100%">
|
||||
<el-tabs
|
||||
v-model="activeName"
|
||||
@tab-click="handleTabClick"
|
||||
style="height: 100%">
|
||||
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
|
||||
<base-table
|
||||
v-if="mode == 'table'"
|
||||
@@ -93,7 +98,9 @@
|
||||
</base-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'\u3000柱状图\u3000'" name="graph">
|
||||
<div class="graph" style="height: 56vh">
|
||||
<div
|
||||
class="graph"
|
||||
style="height: 100%;">
|
||||
<!-- graph -->
|
||||
<Graph
|
||||
v-if="list.length"
|
||||
@@ -546,6 +553,13 @@ li {
|
||||
.el-tree-node__content {
|
||||
padding: 8px 24px !important;
|
||||
}
|
||||
|
||||
.custom-tabs >>> .el-tabs__content {
|
||||
height: calc(100% - 42px);
|
||||
}
|
||||
.custom-tabs >>> .el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-form ref="addWorkOrder" :rules="rules" label-width="130px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form ref="addWorkOrder" :rules="rules" label-width="130px" :model="form" label-position='top'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="工单名称" prop="name" v-if='!isBind'>
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
@@ -16,14 +16,12 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="工单编码" prop="code">
|
||||
<el-input v-model="form.code" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
|
||||
<el-option
|
||||
@@ -37,7 +35,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划开始时间">
|
||||
<el-date-picker
|
||||
v-model="planStartTime"
|
||||
@@ -50,8 +48,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划完成时间">
|
||||
<el-date-picker
|
||||
v-model="planFinishTime"
|
||||
@@ -63,19 +61,17 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
||||
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划生产数量" prop="planQuantity">
|
||||
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="关联工艺" prop="processFlowId">
|
||||
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
|
||||
<el-option
|
||||
@@ -88,16 +84,16 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-radio-group v-model="form.materialMethod" disabled>
|
||||
<el-radio :label="1">产品基础BOM</el-radio>
|
||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||
</el-radio-group>
|
||||
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled>
|
||||
<el-option label="产品基础BOM" :value="1"></el-option>
|
||||
<el-option label="工艺扩展BOM" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
@@ -109,9 +105,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
@@ -123,7 +117,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="关联产线" prop="productLineId">
|
||||
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
@@ -136,15 +130,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="form.workers" :disabled="isBind"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
|
||||
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
<template>
|
||||
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="订单名称" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="订单号" prop="code">
|
||||
<el-input v-model="form.code"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划加工数量" prop="planQuantity">
|
||||
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
@@ -33,13 +31,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="客户" prop="customerId">
|
||||
<el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;" clearable>
|
||||
<el-option
|
||||
@@ -51,9 +49,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable>
|
||||
<el-option
|
||||
@@ -65,7 +61,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="包装规格" prop="packSpec">
|
||||
<el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable>
|
||||
<el-option
|
||||
@@ -78,13 +74,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="form.workers"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="关联工艺" prop="processFlowId">
|
||||
<el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;" clearable @change="processFlowIdChange">
|
||||
<el-option
|
||||
@@ -96,17 +92,15 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-radio-group v-model="form.materialMethod" @change='materialMethodChange'>
|
||||
<el-radio :label="1">产品基础BOM</el-radio>
|
||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||
</el-radio-group>
|
||||
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" @change='materialMethodChange'>
|
||||
<el-option label="产品基础BOM" :value="1"></el-option>
|
||||
<el-option label="工艺扩展BOM" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="订单计划开始时间" prop="planStartTime">
|
||||
<el-date-picker
|
||||
v-model="form.planStartTime"
|
||||
@@ -119,8 +113,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='12'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="订单计划完成时间" prop="planFinishTime">
|
||||
<el-date-picker
|
||||
v-model="form.planFinishTime"
|
||||
@@ -138,20 +132,19 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span='24'>
|
||||
<el-form-item label="描述信息" prop="description">
|
||||
<el-input v-model="form.description"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage'
|
||||
import { getProductAll } from '@/api/base/product'
|
||||
import { getCustomerList } from '@/api/base/customer'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'OrderAdd',
|
||||
data() {
|
||||
@@ -170,12 +163,13 @@ export default {
|
||||
processFlowId: '',
|
||||
materialMethod: 1,
|
||||
remark: '',
|
||||
description: '',
|
||||
// description: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: ''
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
|
||||
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
|
||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
|
||||
},
|
||||
@@ -207,7 +201,7 @@ export default {
|
||||
this.form.materialMethod = res.data.materialMethod
|
||||
this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
|
||||
this.form.remark = res.data.remark
|
||||
this.form.description = res.data.description
|
||||
// this.form.description = res.data.description
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="320"
|
||||
:width="240"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
@@ -36,7 +36,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width='70%'
|
||||
width='60%'
|
||||
>
|
||||
<order-add ref="orderAdd" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
@@ -120,7 +120,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '单价(元)'
|
||||
label: '单价(元)',
|
||||
align: 'right'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNum',
|
||||
@@ -192,7 +193,8 @@ export default {
|
||||
this.$auth.hasPermi('base:order-manage:addWorkOrder')
|
||||
? {
|
||||
type: 'add',
|
||||
btnName: '新增工单',
|
||||
btnName: '新增',
|
||||
showTip: '新增工单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
@@ -218,7 +220,8 @@ export default {
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定工单',
|
||||
btnName: '绑定',
|
||||
showTip: '绑定工单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
@@ -244,7 +247,8 @@ export default {
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成订单',
|
||||
btnName: '完成',
|
||||
showTip: '完成订单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user