projects/mes-zhp #387

Merged
juzi merged 4 commits from projects/mes-zhp into projects/mes-test 2024-08-01 16:37:23 +08:00
116 changed files with 7494 additions and 6522 deletions
Showing only changes of commit 2a801bf834 - Show all commits

View File

@ -1,8 +1,8 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-04 10:42:50
* @LastEditors: DY
* @LastEditTime: 2024-07-08 14:35:17
* @LastEditors: zwq
* @Description:
*/
import request from '@/utils/request'
@ -61,7 +61,7 @@ export function getCoreProductPage(query) {
// 获得所有列表
export function getCoreProductList(query) {
return request({
url: '/base/core-product/listAll',
url: '/base/core-product-material/listAll',
method: 'get',
params: query
})

View File

@ -51,6 +51,13 @@ export function getCode() {
})
}
// 获得可用的班次列表
export function listClassesEnabled() {
return request({
url: '/base/group-classes/listEnable',
method: 'get'
})
}
// 导出班次基础信息 Excel
export function exportGroupClassesExcel(query) {
return request({

View File

@ -0,0 +1,125 @@
import request from '@/utils/request'
// 创建排班计划配置基础信息
export function createGroupPlan(data) {
return request({
url: '/base/group-scheduling-plan/create',
method: 'post',
data: data
})
}
// 更新排班计划配置基础信息
export function updateGroupPlan(data) {
return request({
url: '/base/group-scheduling-plan/update',
method: 'put',
data: data
})
}
// 删除排班计划配置基础信息
export function deleteGroupPlan(id) {
return request({
url: '/base/group-scheduling-plan/delete?id=' + id,
method: 'delete'
})
}
// 获得排班计划配置基础信息
export function getGroupPlan(id) {
return request({
url: '/base/group-scheduling-plan/get?id=' + id,
method: 'get'
})
}
// 获得排班计划配置基础信息分页
export function getGroupPlanPage(query) {
return request({
url: '/base/group-scheduling-plan/page',
method: 'get',
params: query
})
}
// 获得所有排班计划列表
export function groupPlanList() {
return request({
url: '/base/group-scheduling-plan/listAll',
method: 'get'
})
}
// 获得排班计划相关班组列表
export function groupPlanTeamList(id) {
return request({
url: '/base/group-scheduling-plan-team/teamListByPlanId?planId=' + id,
method: 'get'
})
}
// 获得排班计划相关班次列表
export function groupPlanClassesList(id) {
return request({
url: '/base/group-scheduling-plan-classes/classesListByPlanId?planId=' + id,
method: 'get'
})
}
// 获取code
export function getCode() {
return request({
url: '/base/group-scheduling-plan/getCode',
method: 'get'
})
}
// 导出排班计划配置基础信息 Excel
export function exportGroupPlanExcel(query) {
return request({
url: '/base/group-scheduling-plan/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 获得产线工段树形结构
export function getGroupPlanTree() {
return request({
url: '/base/group-scheduling-plan/getLineSectionTree',
method: 'get'
})
}
// 创建排班计划产线工段
export function createGroupPlanLine(data) {
return request({
url: '/base/group-scheduling-plan-line-section/createPlanLineSection',
method: 'post',
data: data
})
}
// 更新排班计划产线工段
export function updateGroupPlanLine(data) {
return request({
url: '/base/group-scheduling-plan-line-section/updatePlanLineSection',
method: 'put',
data: data
})
}
// 获得排班计划配置基础信息
export function getGroupPlanLine(id) {
return request({
url: '/base/group-scheduling-plan-line-section/getLineSectionByPlanId?planId=' + id,
method: 'get'
})
}
// 获得当前登录用户所在部门id
export function getLoginUserDeptId() {
return request({
url: '/base/group-scheduling-plan-line-section/getLoginUserDeptId',
method: 'get'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建排班规则基础信息
export function createGroupRule(data) {
return request({
url: '/base/group-scheduling-rule/create',
method: 'post',
data: data
})
}
// 更新排班规则基础信息
export function updateGroupRule(data) {
return request({
url: '/base/group-scheduling-rule/update',
method: 'put',
data: data
})
}
// 删除排班规则基础信息
export function deleteGroupRule(id) {
return request({
url: '/base/group-scheduling-rule/delete?id=' + id,
method: 'delete'
})
}
// 获得排班规则基础信息
export function getGroupRule(id) {
return request({
url: '/base/group-scheduling-rule/get?id=' + id,
method: 'get'
})
}
// 获得排班规则基础信息分页
export function getGroupRulePage(query) {
return request({
url: '/base/group-scheduling-rule/page',
method: 'get',
params: query
})
}
// 导出排班规则基础信息 Excel
export function exportGroupRuleExcel(query) {
return request({
url: '/base/group-scheduling-rule/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -8,7 +8,14 @@ export function getPreset(query) {
params: query
})
}
// 获取某月预排班
export function getScheduling(query) {
return request({
url: '/base/group-team-scheduling/getScheduling',
method: 'get',
params: query
})
}
// 批量创建-更新排班信息
export function createOrUpdateList(data) {
return request({

View File

@ -1,8 +1,8 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-24 11:22:28
* @LastEditors: DY
* @LastEditTime: 2024-07-05 10:09:18
* @LastEditors: zwq
* @Description:
*/
import request from '@/utils/request'
@ -61,7 +61,7 @@ export function getMaterialPage(query) {
// 获得物料列表
export function getMaterialList(query) {
return request({
url: '/base/material/listbyfilter',
url: '/base/core-product-material/listAll',
method: 'get',
params: query
})
@ -119,3 +119,84 @@ export function getMaterialAttr(query) {
params: query
})
}
// 获得物料树结构
export function getMaterialTree() {
return request({
url: '/base/core-product-material-type/listTree',
method: 'get'
})
}
// 创建物料树
export function createMaterialTree(data) {
return request({
url: '/base/core-product-material-type/create',
method: 'post',
data: data
})
}
// 更新物料树
export function updateMaterialTree(data) {
return request({
url: '/base/core-product-material-type/update',
method: 'put',
data: data
})
}
// 删除物料树
export function deleteMaterialTree(id) {
return request({
url: '/base/core-product-material-type/delete?id=' + id,
method: 'delete'
})
}
// 获得产品物料分页
export function getProductMaterialPage(query) {
return request({
url: '/base/core-product-material/page',
method: 'get',
params: query
})
}
// 删除产品物料
export function deleteProductMaterial(id) {
return request({
url: '/base/core-product-material/delete?id=' + id,
method: 'delete'
})
}
// 创建产品物料
export function createProductMaterial(data) {
return request({
url: '/base/core-product-material/create',
method: 'post',
data: data
})
}
// 更新产品物料
export function updateProductMaterial(data) {
return request({
url: '/base/core-product-material/update',
method: 'put',
data: data
})
}
// 获得产品物料
export function getProductMaterial(id) {
return request({
url: '/base/core-product-material/get?id=' + id,
method: 'get'
})
}
// 获得产品物料code
export function getProductMaterialCode() {
return request({
url: '/base/core-product-material/getCode',
method: 'POST'
})
}

View File

@ -70,7 +70,7 @@ export function getMaterialPBList(query) {
// 获得产品列表
export function getProList(query) {
return request({
url: '/base/core-product/listAll',
url: '/base/core-product-material/listAll',
method: 'get',
params: query
})

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
// 获得产品列表
export function getProductAll() {
return request({
url: '/base/core-product/listAll',
url: '/base/core-product-material/listAll',
method: 'get'
})
}

View File

@ -1,8 +1,8 @@
/*
* @Author: zhp
* @Date: 2023-11-07 19:47:48
* @LastEditTime: 2023-11-23 13:57:41
* @LastEditors: zhp
* @LastEditTime: 2024-07-08 14:33:12
* @LastEditors: zwq
* @Description:
*/
import request from '@/utils/request'
@ -99,7 +99,7 @@ export function getProcessEquMaterialBomDet(data) {
export function getMaterialList(data) {
return request({
url: '/base/material/listbyfilter',
url: '/base/core-product-material/listAll',
method: 'get',
data: data
})

View File

@ -25,7 +25,7 @@ export function getWorkOrderList(query) {
}
export function getProductList(query) {
return request({
url: '/base/core-product/listAll',
url: '/base/core-product-material/listAll',
method: 'get',
params: query,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -77,6 +77,9 @@ function findMaxLabelWidth(rows) {
if (!opt.label) return 0;
if (opt.label.length > max) {
max = opt.label.length;
if (opt.label.includes('(')) {
max = max - 3
}
}
});
});
@ -174,7 +177,7 @@ export default {
size: {
type: String,
default: '',
},
}
},
data() {
return {

View File

@ -83,7 +83,7 @@ export default {
],
},
placeholder: '请输入内容',
readOnly: true,
// readOnly: false,
},
};
},
@ -123,11 +123,13 @@ export default {
const editor = this.$refs.editor;
this.Quill = new Quill(editor, this.options);
// start
this.Quill?.enable(false);
this.$nextTick(() => {
this.Quill?.enable(true);
this.Quill?.blur();
if (!this.readOnly) {
this.Quill?.enable();
}
// if (!this.readOnly) {
// this.Quill?.enable();
// }
});
//
if (this.type === 'url') {
@ -196,7 +198,7 @@ export default {
};
</script>
<style>
<style lang="scss" scoped>
.editor-wrapper {
position: relative;
cursor: not-allowed;

View File

@ -78,7 +78,6 @@ export default {
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
},
del(payload) {
debugger;
return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
},

View File

@ -0,0 +1,20 @@
export default {
data() {
return {
tableH: this.tableHeight(260),
};
},
created() {
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
window.addEventListener('resize', this._setTableHeight);
},
destroyed() {
window.removeEventListener('resize', this._setTableHeight);
},
methods: {
_setTableHeight() {
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
// this.tableH = this.tableHeight(260);
},
},
};

View File

@ -59,6 +59,33 @@ export default {
type: "warning",
})
},
// 删除确认窗体UI规范
delConfirm(title) {
return MessageBox.confirm("确定删除后不可恢复该数据", `是否确认删除 【${title}】 数据项?`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: "warning",
showClose:false
})
},
// 关闭页面确认窗体UI规范
closeConfirm() {
return MessageBox.confirm("确定关闭将不保留编辑内容", "是否确认要关闭页面?", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: "warning",
showClose:false
})
},
// 确认窗体UI规范
newConfirm(content,title) {
return MessageBox.confirm(content, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: "warning",
showClose:false
})
},
// 提交内容
prompt(content) {
return MessageBox.prompt(content, "系统提示", {

View File

@ -201,3 +201,34 @@ input, textarea{
.el-form--label-top .el-form-item__label {
padding: 0;
}
// 确认弹窗(UI样式修改和原样式有区别--start)
.el-message-box__status+.el-message-box__message {
padding-left: 58px;
}
.el-message-box {
width: auto;
min-width: 424px;
.el-message-box__header {
padding:32px 32px 0px 72px;
.el-message-box__title {
font-size: 16px;
font-weight: 600;
color: rgba(0,0,0,0.85);
}
}
.el-message-box__content {
padding-bottom: 24px;
.el-message-box__status {
top:-72%;
left:20px;
font-size:21px !important
}
}
.el-message-box__btns {
padding-right: 32px;
padding-bottom:14px;
}
}
// 确认弹窗(UI样式修改和原样式有区别--end)

View File

@ -1,8 +1,8 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-16 09:14:35
* @LastEditors: zwq
* @LastEditTime: 2024-07-03 14:19:01
* @Description:
-->
<template>
@ -105,7 +105,7 @@
<script>
import basicAdd from '../../core/mixins/basic-add';
import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
import SmallTitle from '../material/SmallTitle';
import SmallTitle from '../coreWorkOrder/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add';

View File

@ -1,65 +0,0 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -1,22 +1,11 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-27 15:26:12
* @LastEditors: zwq
* @LastEditTime: 2024-07-08 16:52:34
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form
:model="dataForm"
:rules="dataRule"
@ -25,435 +14,210 @@
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料编码" prop="code">
<el-col :span="8">
<el-form-item label="物料产品名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入物料产品名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料产品编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
:disabled="isdetail"
placeholder="请输入物料编码" />
placeholder="请输入物料产品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
<el-col :span="8">
<el-form-item label="物料产品类型" prop="typeId">
<treeselect
v-model="dataForm.typeId"
:options="deptOptions"
:normalizer="normalizer"
@select="setShowTime"
:show-count="true"
:appendToBody="true"
z-index="99999"
placeholder="选择物料产品类型" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="英文名称" prop="engName">
<el-input
v-model="dataForm.engName"
clearable
:disabled="isdetail"
placeholder="请输入英文名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料类型" prop="type">
<el-col :span="8">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.type"
v-model="dataForm.unit"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料类型">
placeholder="请选择单位">
<el-option
v-for="dict in materialList"
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-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-col :span="8">
<el-form-item label="规格" prop="specifications">
<el-input
v-model="dataForm.spec"
v-model="dataForm.specifications"
clearable
:disabled="isdetail"
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="8">
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="dataForm.supplierId"
filterable
clearable
:disabled="isdetail"
style="width: 100%"
:style="{ width: '100%' }"
placeholder="请选择供应商">
<el-option
v-for="dict in supplierList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
v-for="item in supplierArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</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"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料单位">
<el-option
v-for="dict in getDictDatas('unit_dict')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
<el-col :span="8" v-if="showTime">
<el-form-item label="生产单位用时" prop="processTime">
<el-input
v-model.number="dataForm.processTime"
type="number"
clearable
placeholder="请输入产线生产单位用时" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
物料属性
</small-title>
<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"
:table-data="materialAttrList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<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
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:material-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createMaterial, updateMaterial, getMaterial, getCode, getSupplierList, getMaterialAttrList, deleteMaterialAttr } from "@/api/base/material";
import { listData } from "@/api/system/dict/data";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import { getDictDatas } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'attrName',
label: '属性名',
},
{
prop: 'attrValue',
label: '属性值',
},
];
import { getTreeArr } from '../mixins/code-filter';
import {
createProductMaterial,
updateProductMaterial,
getProductMaterial,
getProductMaterialCode,
getSupplierList,
getMaterialTree,
} from '@/api/base/material';
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
components: {
Treeselect,
},
data() {
return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createMaterial,
updateURL: updateMaterial,
infoURL: getMaterial,
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
codeURL: getProductMaterialCode,
createURL: createProductMaterial,
updateURL: updateProductMaterial,
infoURL: getProductMaterial,
},
deptOptions: undefined,
showTime: false,
dataForm: {
id: undefined,
code: undefined,
name: '',
engName: '',
type: '',
spec: undefined,
typeId: undefined,
unit: undefined,
specifications: undefined,
supplierId: undefined,
processTime: 0,
remark: undefined,
unit: ''
},
materialList: [],
supplierList: [],
materialAttrList: [],
unitList: [],
visible: false,
isdetail: false,
idAttrShow: false,
supplierArr: [],
treeArr: [],
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
type: [{ required: true, message: "物料类型不能为空", trigger: "blur" }]
}
code: [{ required: true, message: '编号不能为空', trigger: 'blur' }],
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
typeId: [
{
required: true,
message: '物料产品类型不能为空',
trigger: 'blur',
},
],
},
};
},
mounted() {
this.getDict()
},
mounted() {},
methods: {
async getDict() {
//
const res = await listData({
pageNo: 1,
pageSize: 99,
dictType: 'material_type',
});
this.materialList = res.data.list.map(item => {
return {
label: item.label,
value: Number(item.value)
}
});
//
const supplierRes = await getSupplierList();
this.supplierList = supplierRes.data;
//
// const unitRes = await listData({
// pageNo: 1,
// pageSize: 99,
// dictType: 'goods_unit',
// });
// this.unitList = unitRes.data.list.map(item => {
// return {
// label: item.label,
// value: Number(item.value)
// }
// });
},
initData() {
this.materialAttrList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`是否确认删除属性名为"${raw.data.attrName}"的数据项?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteMaterialAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getMaterialAttrList({
...this.listQuery,
materialId: this.dataForm.id,
}).then((response) => {
this.materialAttrList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
init(id) {
this.dataForm.id = id || '';
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.urlOptions.infoURL(id).then((response) => {
this.dataForm = response.data;
if (this.dataForm.unit) {
this.dataForm.unit = String(this.dataForm.unit)
}
this.setDataForm();
});
//
this.getList();
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
this.getCode();
this.setDataForm();
}
}
});
},
//
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;
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
typeId(typeId, product) {
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
this.dataForm.typeId = typeId || undefined;
this.showTime = product || false;
});
},
setDataForm() {
getSupplierList().then((res) => {
this.supplierArr = res.data;
});
//
getMaterialTree().then((response) => {
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, 'id'));
this.$nextTick(() => {
if (this.dataForm.id) {
this.treeArr = [];
this.treeArr = getTreeArr(response.data);//
this.showTime = this.treeArr.find(
(item) => item.id == this.dataForm.typeId
).product;
}
});
});
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children,
};
},
setShowTime(node) {
this.showTime = node.product || false;
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: -40px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -1,141 +0,0 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'30%'"
: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="70px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="属性名" prop="attrName">
<el-input
v-model="dataForm.attrName"
placeholder="请输入属性名"
clearable />
</el-form-item>
<el-form-item label="属性值" prop="attrValue">
<el-input
v-model="dataForm.attrValue"
placeholder="请输入属性值"
clearable />
</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 {
createMaterialAttr,
updateMaterialAttr,
getMaterialAttr
} from '@/api/base/material';
export default {
props: {
materialId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
attrName: '',
attrValue: '',
},
dataRule: {
attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getMaterialAttr({
id: this.dataForm.id
}).then((res) => {
const { attrName, attrValue } = res.data;
this.dataForm.attrName = attrName;
this.dataForm.attrValue = attrValue;
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateMaterialAttr({
...this.dataForm,
materialId: this.materialId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createMaterialAttr({
...this.dataForm,
materialId: this.materialId,
}).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>

View File

@ -1,5 +1,71 @@
<!--
* @Author: zwq
* @Date: 2024-07-01 14:54:06
* @LastEditors: zwq
* @LastEditTime: 2024-07-08 15:12:18
* @Description:
-->
<template>
<div class="app-container">
<div style="display: flex; gap: 16px; flex: 1; background: #eff1f6">
<div
class="app-container"
style="background: white; width: 280px; border-radius: 8px">
<div class="head-container">
<el-input
v-model="treeName"
placeholder="请输入名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px" />
</div>
<div class="head-container">
<el-tree
v-loading="treeLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
:data="deptOptions1"
:props="defaultProps"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
highlight-current
@node-click="handleNodeClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span style="float: right" v-if="data.parentId !== -1">
<el-button
class="btnHover"
type="text"
icon="el-icon-edit"
size="mini"
v-if="data.parentId !== 0"
@click="() => edit(node, data)" />
<el-button
class="btnHover"
type="text"
icon="el-icon-circle-plus-outline"
size="mini"
@click="() => append(data)" />
<el-button
class="btnHover"
type="text"
icon="el-icon-remove-outline"
size="mini"
v-if="data.parentId !== 0"
@click="() => remove(node, data)" />
</span>
</span>
</el-tree>
</div>
</div>
<div
class="app-container"
style="background: #fff; border-radius: 8px; width: 1px; flex: 1">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@ -13,7 +79,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@ -23,10 +89,47 @@
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" />
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="父类型">
<treeselect
v-model="form.parentId"
:options="deptOptions"
:normalizer="normalizer"
:show-count="true"
:appendToBody="true"
z-index="99999"
placeholder="选择父类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -34,97 +137,129 @@
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getMaterialPage,
deleteMaterial
} from '@/api/base/material';
import { listData } from "@/api/system/dict/data";
import { publicFormatter } from '@/utils/dict';
import {
getProductMaterialPage,
deleteProductMaterial,
getMaterialTree,
createMaterialTree,
updateMaterialTree,
deleteMaterialTree,
} from '@/api/base/material';
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '物料编码'
filter: parseTime,
width: 150,
},
{
prop: 'name',
label: '物料名称'
label: '物料产品名称',
},
{
prop: 'engName',
label: '英文名称'
prop: 'code',
label: '物料产品编码',
},
{
prop: 'type',
label: '物料类型',
filter: publicFormatter('material_type')
prop: 'typeNameChain',
label: '物料产品类型',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict'),
width: 60,
},
{
prop: 'specifications',
label: '规格',
},
{
prop: 'supplierName',
label: '供应商'
label: '供应商',
},
{
prop: 'remark',
label: '备注'
}
label: '备注',
},
];
export default {
mixins: [basicPage],
name: '',
components: {
AddOrUpdate,
Treeselect,
},
data() {
return {
//
treeName: undefined,
deptOptions: undefined,
deptOptions1: undefined,
treeLoading: false,
defaultProps: {
children: 'children',
label: 'name',
},
//
title: '',
//
open: false,
//
form: {
id: undefined,
parentId: undefined,
name: undefined,
defaultType: false,
},
//
rules: {
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
urlOptions: {
getDataListURL: getMaterialPage,
deleteURL: deleteMaterial
// exportURL: exportFactoryExcel,
getDataListURL: getProductMaterialPage,
deleteURL: deleteProductMaterial,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:material:queryAttr`)
? {
type: 'detail',
btnName: '查看属性',
}
: undefined,
this.$auth.hasPermi(`base:material:update`)
this.$auth.hasPermi(`base:core-product:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
// this.$auth.hasPermi(`base:material:editAttr`)
// ? {
// type: 'editAttr',
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi(`base:material:delete`)
this.$auth.hasPermi(`base:core-product:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
].filter((v) => v),
tableData: [],
typeList: [],
formConfig: [
{
type: 'input',
label: '物料名称',
placeholder: '物料名称',
label: '物料产品名称',
placeholder: '物料产品名称',
param: 'name',
},
{
type: 'input',
label: '物料编码',
placeholder: '物料编码',
label: '物料产品编号',
placeholder: '物料产品编号',
param: 'code',
},
{
type: 'input',
label: '物料产品类型',
param: 'type',
disabled: true,
},
{
type: 'button',
btnName: '查询',
@ -139,62 +274,42 @@ export default {
btnName: '新增',
name: 'add',
color: 'success',
plain: true
plain: true,
},
],
};
},
components: {
AddOrUpdate,
watch: {
//
treeName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getDict()
this.getDataList();
this.getTreeselect();
},
methods: {
async getDict() {
//
const res = await listData({
pageNo: 1,
pageSize: 99,
dictType: 'material_type',
});
this.typeList = res.data.list.map(item => {
return {
label: item.label,
value: Number(item.value)
}
});
},
otherMethods(val) {
if (val.type === 'detail') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
} else {
this.addOrEditTitle = '编辑';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.records.map(item => {
this.typeList.filter(t => {
if (item.type === t.value) {
item.materialType = t.label
}
//
deleteHandle(id, name, index) {
this.$confirm(`是否确认删除物料产品名称为"${name}"的数据项`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
return item
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
})
.catch(() => {});
},
buttonClick(val) {
switch (val.btnName) {
@ -205,19 +320,13 @@ export default {
this.listQuery.code = val.code ? val.code : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
this.$refs.addOrUpdate.typeId(this.listQuery.typeId,this.listQuery.product);
});
break;
case 'export':
this.handleExport();
@ -226,27 +335,126 @@ export default {
console.log(val);
}
},
//
deleteHandle(id, name, index) {
this.$confirm(`是否删除物料名称为"${name}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
/** 树操作 */
//
getTreeselect() {
this.treeLoading = true;
getMaterialTree().then((response) => {
// treeArr[0].push(...this.handleTree(response.data, 'id'));
// deptOptions
this.deptOptions = [];
this.treeLoading = false;
this.deptOptions.push(...this.handleTree(response.data, 'id'));
const arr = [{ name: '全部', parentId: -1 }];
this.deptOptions1 = arr.concat(this.deptOptions);
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.listQuery.typeId = data.id || undefined;
this.listQuery.product = data.product;
this.$refs.searchBarForm.formInline.type = data.name || undefined;
},
//
append(data) {
this.open = true;
this.title = '新增物料产品类型';
this.form.id = undefined;
this.form.parentId = data.id;
},
//
remove(node, data) {
this.$confirm(`是否确认删除名称为"${data.name}"的数据项`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
deleteMaterialTree(data.id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
this.getTreeselect();
},
});
});
})
.catch(() => { });
.catch(() => {});
},
//
edit(node, data) {
this.open = true;
this.title = '编辑物料产品类型';
this.form.id = data.id;
this.form.name = data.name;
this.form.parentId = data.parentId;
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children,
};
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
parentId: 0,
name: undefined,
defaultType: false,
};
this.resetForm('form');
},
//
submitForm() {
this.$refs['form'].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.form.id) {
updateMaterialTree(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.cancel();
this.getTreeselect();
});
return;
}
//
createMaterialTree(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.cancel();
this.getTreeselect();
});
});
},
},
};
</script>
<style scoped>
.btnHover:hover {
color: #67c23a;
transform: scale(1.5);
}
</style>

View File

@ -1,8 +1,8 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-27 19:50:36
* @LastEditors: zwq
* @LastEditTime: 2024-07-09 09:59:11
* @Description:
-->
<template>
@ -107,10 +107,9 @@
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProList, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom";
import { getMaterialList } from "@/api/base/material";
import { listData } from "@/api/system/dict/data";
import SmallTitle from '../material/SmallTitle';
import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom";
import { getMaterialTree,getMaterialList } from '@/api/base/material';
import SmallTitle from '../coreWorkOrder/SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import { publicFormatter } from '@/utils/dict';
@ -183,7 +182,6 @@ export default {
productList: [],
materialAttrList: [],
tableData: [],
unitList: [],
visible: false,
isdetail: false,
idAttrShow: false,
@ -229,21 +227,14 @@ export default {
});
},
async getDict() {
//
const proRes = await getProList();
this.productList = proRes.data;
//
const unitRes = await listData({
pageNo: 1,
pageSize: 99,
dictType: 'unit_dict',
});
this.unitList = unitRes.data.list.map(item => {
return {
label: item.label,
value: Number(item.value)
const materRes = await getMaterialTree();
let typeId = materRes.data[0].product?materRes.data[0].id:materRes.data[1].id
const listQuery= {
typeId:typeId
}
});
const materData = await getMaterialList(listQuery);
this.productList = [];
this.productList = materData.data;
},
initData() {
// this.materialAttrList.splice(0);

View File

@ -83,7 +83,7 @@
</template>
<script>
import { getMaterialList } from '@/api/base/material';
import { getMaterialTree,getMaterialList } from '@/api/base/material';
import { createMaterialPBDet, updateMaterialPBDet, getMaterialPBDet } from "@/api/base/materialProductBom";
export default {
@ -117,8 +117,14 @@ export default {
methods: {
async getDict() {
//
const res = await getMaterialList();
this.materialList = res.data;
const materRes = await getMaterialTree();
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id
const listQuery= {
typeId:typeId
}
const materData = await getMaterialList(listQuery);
this.materialList = [];
this.materialList = materData.data;
},
init(id) {
this.dataForm.id = id || '';

View File

@ -1,8 +1,8 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-27 19:57:23
* @LastEditors: zwq
* @LastEditTime: 2024-07-09 09:58:24
* @Description:
-->
<template>
@ -22,8 +22,7 @@
clearable
filterable
@change="setCode"
style="width: 100%"
>
style="width: 100%">
<el-option
v-for="dict in materialList"
:key="dict.id"
@ -42,14 +41,13 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="批次" prop="materialDateId">
<el-form-item label="物料批次" prop="materialDateId">
<el-select
v-model="dataForm.materialDateId"
clearable
filterable
placeholder="请选择物料批次"
style="width: 100%"
>
style="width: 100%">
<el-option
v-for="dict in materialDateList"
:key="dict.id"
@ -81,8 +79,8 @@
<el-date-picker
v-model="dataForm.useTime"
type="datetime"
format='yyyy-MM-dd HH:mm:ss'
value-format='timestamp'
format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp"
placeholder="选择日期时间" />
</el-form-item>
</el-col>
@ -98,8 +96,8 @@
<el-option
v-for="dict in workersList"
:key="dict.id"
:label="dict.name"
:value="dict.name" />
:label="dict.nickname"
:value="dict.nickname" />
</el-select>
</el-form-item>
</el-col>
@ -107,7 +105,12 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="使用数量" prop="num">
<el-input-number v-model="dataForm.num" clearable controls-position="right" placeholder="请输入使用数量" style="width: 100%" />
<el-input-number
v-model="dataForm.num"
clearable
controls-position="right"
placeholder="请输入使用数量"
style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
@ -126,7 +129,10 @@
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
@ -135,9 +141,15 @@
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createMaterialLog, updateMaterialLog, getMaterialLog, getEqListAll, getworkerAll } from "@/api/base/materialUseLog";
import { getMaterialList } from "@/api/base/material"
import { getMaterDateList } from "@/api/base/materialDate"
import {
createMaterialLog,
updateMaterialLog,
getMaterialLog,
getEqListAll,
} from '@/api/base/materialUseLog';
import { getMaterialTree,getMaterialList } from '@/api/base/material';
import { getMaterDateList } from '@/api/base/materialDate';
import { listSimpleUsers } from '@/api/system/user';
export default {
mixins: [basicAdd],
@ -146,7 +158,7 @@ export default {
urlOptions: {
createURL: createMaterialLog,
updateURL: updateMaterialLog,
infoURL: getMaterialLog
infoURL: getMaterialLog,
},
dataForm: {
id: undefined,
@ -160,66 +172,77 @@ export default {
address: undefined,
num: 0,
source: undefined,
remark: undefined
remark: undefined,
},
dataSourceList: [
{
id: 1,
name: '手动'
name: '手动',
},
{
id: 2,
name: 'PDA'
}
name: 'PDA',
},
],
materialList: [],
materialDateList: [],
eqList: [],
workersList: [],
dataRule: {
materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }],
materialDateId: [{ required: true, message: "批次号不能为空", trigger: "blur" }],
useTime: [{ required: true, message: "使用时间不能为空", trigger: "blur" }],
userNames: [{ required: true, message: "操作员不能为空", trigger: "blur" }],
num: [{ required: true, message: "使用数量不能为空", trigger: "blur" }]
}
materialId: [
{ required: true, message: '物料不能为空', trigger: 'blur' },
],
useTime: [
{ required: true, message: '使用时间不能为空', trigger: 'blur' },
],
userNames: [
{ required: true, message: '操作员不能为空', trigger: 'blur' },
],
num: [{ required: true, message: '使用数量不能为空', trigger: 'blur' }],
},
};
},
mounted() {
this.getDictData()
this.getDictData();
},
methods: {
async getDictData() {
const materRes = await getMaterialList()
this.materialList = materRes.data
const dateRes = await getMaterDateList()
this.materialDateList = dateRes.data
const eqRes = await getEqListAll()
this.eqList = eqRes.data
const workerRes = await getworkerAll()
this.workersList = workerRes.data
const materRes = await getMaterialTree();
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id
const listQuery= {
typeId:typeId
}
const materData = await getMaterialList(listQuery);
this.materialList = [];
this.materialList = materData.data;
const dateRes = await getMaterDateList();
this.materialDateList = dateRes.data;
const eqRes = await getEqListAll();
this.eqList = eqRes.data;
const workerRes = await listSimpleUsers();
this.workersList = workerRes.data;
},
//
dataFormSubmit() {
this.dataForm.userName = this.dataForm.userNames.join(',')
this.$refs["dataForm"].validate((valid) => {
this.dataForm.userName = this.dataForm.userNames.join(',');
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.urlOptions.updateURL(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit("refreshDataList");
this.$emit('refreshDataList');
});
return;
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.urlOptions.createURL(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit("refreshDataList");
this.$emit('refreshDataList');
});
});
},
@ -228,33 +251,34 @@ export default {
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm.id = response.data.id
this.dataForm.materialCode = response.data.materialCode
this.dataForm.materialId = response.data.materialId
this.dataForm.materialDateId = response.data.materialDateId
this.dataForm.equipmentId = response.data.equipmentId
this.dataForm.useTime = response.data.useTime
this.urlOptions.infoURL(id).then((response) => {
this.dataForm.id = response.data.id;
this.dataForm.materialCode = response.data.materialCode;
this.dataForm.materialId = response.data.materialId;
this.dataForm.materialDateId = response.data.materialDateId;
this.dataForm.equipmentId = response.data.equipmentId;
this.dataForm.useTime = response.data.useTime;
// this.dataForm.userName = response.data.userName
this.dataForm.num = response.data.num
this.dataForm.source = response.data.source
this.dataForm.remark = response.data.remark
this.dataForm.userNames = response.data.userName.split(',')
this.dataForm.num = response.data.num;
this.dataForm.source = response.data.source;
this.dataForm.remark = response.data.remark;
this.dataForm.userNames = response.data.userName.split(',');
});
} else {}
} else {
}
});
},
setCode() {
const tempMaterial = this.materialList.filter(item =>{
return item.id === this.dataForm.materialId
})
this.dataForm.materialCode = tempMaterial[0].code
getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{
this.materialDateList = res.data
})
}
const tempMaterial = this.materialList.filter((item) => {
return item.id === this.dataForm.materialId;
});
this.dataForm.materialCode = tempMaterial[0].code;
getMaterDateList({ materialId: this.dataForm.materialId }).then((res) => {
this.materialDateList = res.data;
});
},
},
};
</script>

View File

@ -1,8 +1,8 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zhp
* @LastEditTime: 2023-11-24 09:29:36
* @LastEditors: zwq
* @LastEditTime: 2024-07-05 10:10:12
* @Description:
*/
export default {
@ -53,11 +53,12 @@ export default {
this.listQuery.pageNo = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
// 新增
addOrUpdateHandle() {
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
this.$refs.addOrUpdate.init();
});
},
cancel(id) {

View File

@ -1,8 +1,8 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: DY
* @LastEditTime: 2023-09-12 11:13:34
* @LastEditors: zwq
* @LastEditTime: 2024-07-08 16:27:39
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
@ -33,7 +33,7 @@ export function parseTime(time, pattern) {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), '');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
@ -62,6 +62,22 @@ export function parseTime(time, pattern) {
})
return time_str
}
// 遍历树结构返回数组
export function getTreeArr(arr) {
let result =[]
arr.forEach(item => {
if(item.children && item.children.length>0){
let {children,...obj} = item
result.push(obj)
result = result.concat(getTreeArr(children))
}else{
let {children,...obj} = item
result.push(obj)
}
});
return result
}
export default function (dictTable) {
return function (val) {
return table?.[dictTable]?.[val]

View File

@ -2,19 +2,29 @@
<div class="choicepart-container">
<navbar />
<div class="choicepart-wrapper">
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem">
<div
class="choicepart-box"
id="choicepartBox"
:style="'transform:scale(' + scale + ');width:1574px;height:538px;'"
v-show="showItem">
<div class="choicepart-line1">
<div
v-for="(item, index) in menuArr1"
:key="index"
class="choicepart-item"
@click="handelClick(item, item.choicepart)"
:style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
>
:style="{
opacity: item.visible ? 1 : 0.4,
pointerEvents: item.visible ? 'auto' : 'none',
}">
<div>
<img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
<img
:src="
require(`../../assets/images/choicepart/${item.name}.png`)
"
alt="" />
</div>
<div class="choicepart-item-title">{{item.meta.title}}</div>
<div class="choicepart-item-title">{{ item.meta.title }}</div>
</div>
</div>
<div class="choicepart-line2">
@ -23,12 +33,18 @@
:key="index"
class="choicepart-item"
@click="handelClick(item, item.choicepart)"
:style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
>
:style="{
opacity: item.visible ? 1 : 0.4,
pointerEvents: item.visible ? 'auto' : 'none',
}">
<div>
<img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
<img
:src="
require(`../../assets/images/choicepart/${item.name}.png`)
"
alt="" />
</div>
<div class="choicepart-item-title">{{item.meta.title}}</div>
<div class="choicepart-item-title">{{ item.meta.title }}</div>
</div>
</div>
</div>
@ -37,8 +53,8 @@
</div>
</template>
<script>
import Navbar from './components/Navbar'
import { debounce } from '@/utils/debounce'
import Navbar from './components/Navbar';
import { debounce } from '@/utils/debounce';
export default {
components: { Navbar },
name: 'choicePart',
@ -52,57 +68,57 @@ export default {
title: '基础核心',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Order',
title: '订单管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Equipment',
title: '设备管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Group',
title: '班组管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Quality',
title: '质量管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Warehouse',
title: '仓库管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Energy',
title: '能源管理',
visible: false,
meta: {
title: ''
}
}
title: '',
},
},
],
menuArr2: [
{
@ -110,99 +126,107 @@ export default {
title: '包装管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Material',
title: '物料管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Extend',
title: '工艺管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Delivery',
title: '成品发货',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'Report',
title: '报表管理',
visible: false,
meta: {
title: ''
}
title: '',
},
},
{
name: 'System',
title: '系统管理',
visible: false,
meta: {
title: ''
}
}
title: '',
},
},
{
name: 'Devconfig',
title: '开发配置',
visible: false,
meta: {
title: '',
},
},
],
showItem: false
}
showItem: false,
};
},
// computed:{
// ...mapGetters(['sidebarRouters'])
// },
mounted() {
this.getMsg()
this.getMsg();
this.boxReset = debounce(() => {
this.resetSize()
}, 300)
this.boxReset()
this.resetSize();
}, 300);
this.boxReset();
window.addEventListener('resize', () => {
this.boxReset()
})
this.boxReset();
});
},
methods: {
getMsg() {
let menuList = this.$store.state.permission.sidebarRouters
console.log(menuList)
let menuList = this.$store.state.permission.sidebarRouters;
console.log(menuList);
if (menuList.length > 0) {
for (let i = 0; i < menuList.length; i ++) {
for (let i = 0; i < menuList.length; i++) {
for (let k = 0; k < 7; k++) {
if (menuList[i].name === this.menuArr1[k].name) {
this.menuArr1[k].visible = true
this.menuArr1[k].id = menuList[i].id
this.menuArr1[k].choicepart = i
this.menuArr1[k].children = menuList[i].children
this.menuArr1[k].meta = menuList[i].meta
this.menuArr1[k].visible = true;
this.menuArr1[k].id = menuList[i].id;
this.menuArr1[k].choicepart = i;
this.menuArr1[k].children = menuList[i].children;
this.menuArr1[k].meta = menuList[i].meta;
}
}
for (let j = 0; j < 6; j++) {
for (let j = 0; j < 7; j++) {
if (menuList[i].name === this.menuArr2[j].name) {
this.menuArr2[j].visible = true
this.menuArr2[j].id = menuList[i].id
this.menuArr2[j].choicepart = i
this.menuArr2[j].children = menuList[i].children
this.menuArr2[j].meta = menuList[i].meta
this.menuArr2[j].visible = true;
this.menuArr2[j].id = menuList[i].id;
this.menuArr2[j].choicepart = i;
this.menuArr2[j].children = menuList[i].children;
this.menuArr2[j].meta = menuList[i].meta;
}
}
}
}
console.log(this.menuArr1)
console.log(this.menuArr2)
console.log(this.menuArr1);
console.log(this.menuArr2);
},
handelClick(item, index) {
// this.$router.push({name: 'SystemUser'})
this.$store.dispatch('app/setChoicepart', index)
this.toRouter(item)
this.$store.dispatch('app/setChoicepart', index);
this.toRouter(item);
// if (item.meta.unuse) {
// this.$message.warning(this.$t(''))
// } else {
@ -210,38 +234,38 @@ export default {
// }
},
toRouter(item) {
console.log(item)
console.log(item);
if (item.children) {
this.toRouter(item.children[0])
this.toRouter(item.children[0]);
} else {
this.$router.push({ name: item.name })
this.$router.push({ name: item.name });
}
},
resetSize() {
let _this = this
_this.showItem = false
_this.loading = true
let choicepartBox = document.querySelector('#choicepartBox')
let rw = parseFloat(window.innerWidth)
let rh = parseFloat(window.innerHeight)
let bw = parseFloat(choicepartBox.style.width)
let bh = parseFloat(choicepartBox.style.height)
let wx = 0.82/(bw / rw)
let hx = 0.56/(bh / rh)
_this.scale = wx > hx ? hx : wx
setTimeout(_this.showItemFun, 700)
let _this = this;
_this.showItem = false;
_this.loading = true;
let choicepartBox = document.querySelector('#choicepartBox');
let rw = parseFloat(window.innerWidth);
let rh = parseFloat(window.innerHeight);
let bw = parseFloat(choicepartBox.style.width);
let bh = parseFloat(choicepartBox.style.height);
let wx = 0.82 / (bw / rw);
let hx = 0.56 / (bh / rh);
_this.scale = wx > hx ? hx : wx;
setTimeout(_this.showItemFun, 700);
},
showItemFun() {
this.loading = false
this.showItem = true
}
this.loading = false;
this.showItem = true;
},
},
beforeDestroy() {
this.showItem = false
}
}
this.showItem = false;
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.choicepart-container {
position: relative;
width: 100%;
@ -272,7 +296,8 @@ export default {
.choicepart-item {
width: 184px;
height: 224px;
background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat;
background: url('../../assets/images/choicepart/choice-item-back.png')
no-repeat;
background-size: 100% 100%;
border-radius: 5px;
overflow: hidden;
@ -310,7 +335,7 @@ export default {
.choicepart-footer {
position: absolute;
width: 100%;
color: #C7C7C7;
color: #c7c7c7;
user-select: none;
font-size: 12px;
letter-spacing: 1px;

View File

@ -6,27 +6,54 @@
-->
<template>
<el-form ref="form" :model="dataForm" label-width="120px" v-loading="formLoading">
<el-form
ref="form"
:model="dataForm"
label-width="110px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产线" prop="productionLineId"
<el-form-item
label="产线"
prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="dataForm.productionLineId" placeholder="请选择产线" filterable
<el-select
v-model="dataForm.productionLineId"
placeholder="请选择产线"
filterable
@change="handleProductlineChange">
<el-option v-for="opt in productionLineList" :key="opt.value" :label="opt.label" :value="opt.value" />
<el-option
v-for="opt in productionLineList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工段" prop="sectionId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段" filterable @change="$emit('update', dataForm)">
<el-option v-for="opt in workshopSectionList" :key="opt.value" :label="opt.label" :value="opt.value" />
<el-form-item
label="工段"
prop="sectionId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.sectionId"
placeholder="请选择工段"
filterable
@change="$emit('update', dataForm)">
<el-option
v-for="opt in workshopSectionList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="按钮盒识别码" prop="buttonId" :rules="[
<el-form-item
label="按钮盒识别码"
prop="buttonId"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
@ -35,7 +62,10 @@
transform: (val) => Number.isInteger(Number(val)) && Number(val),
},
]">
<el-input v-model="dataForm.buttonId" @change="$emit('update', dataForm)" placeholder="请输入整数" />
<el-input
v-model="dataForm.buttonId"
@change="$emit('update', dataForm)"
placeholder="请输入整数" />
</el-form-item>
<el-form-item
label="产线"
@ -102,7 +132,10 @@
</el-col>
<el-col :span="12">
<el-form-item label="按钮值" prop="keyValue" :rules="[
<el-form-item
label="按钮值"
prop="keyValue"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
@ -115,16 +148,28 @@
Number(val),
},
]">
<el-input v-model="dataForm.keyValue" type="number" min="0" max="100" @change="$emit('update', dataForm)"
<el-input
v-model="dataForm.keyValue"
type="number"
min="0"
max="100"
@change="$emit('update', dataForm)"
placeholder="请输入按钮盒模式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检测内容" prop="inspectionDetId">
<el-select v-model="dataForm.inspectionDetId" placeholder="请选择检测内容" filterable
<el-select
v-model="dataForm.inspectionDetId"
placeholder="请选择检测内容"
filterable
@change="$emit('update', dataForm)">
<el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" />
<el-option
v-for="opt in inspectionDetList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
@ -151,13 +196,13 @@ export default {
return {
formLoading: true,
productionLineList: [],
inspectionDetList:[],
inspectionDetList: [],
workshopSectionList: [],
};
},
mounted() {
this.getProductionLineList()
this.getQualityInspectionDetList()
this.getProductionLineList();
this.getQualityInspectionDetList();
// this.getWorksectionList();
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
// this.formLoading = false;

View File

@ -12,12 +12,13 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:width="80"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
@ -56,10 +57,11 @@ import {
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import moment from 'moment';
import DialogForm from './dialogForm.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'QualityInspectionBoxBtn',
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
components: { DialogForm },
data() {
return {
@ -70,7 +72,9 @@ export default {
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionId',
rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '产线不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@ -80,7 +84,9 @@ export default {
label: '工段',
url: '/base/workshop-section/listAll',
prop: 'sectionId',
rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '工段不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
@ -182,39 +188,40 @@ export default {
{
prop: 'productionLineName',
label: '产线',
showOverflowtooltip: true,
},
{
prop: 'sectionName',
label: '工段',
showOverflowtooltip: true,
},
{
prop: 'inspectionDetContent',
label: '检测内容',
showOverflowtooltip: true,
},
{
width: 160,
prop: 'buttonId',
label: '按钮盒识别码',
},
// {
// width: 256,
// prop: 'productionId',
// label: '线ID',
// ,
// },
// {
// width: 256,
// prop: 'sectionId',
// label: 'ID',
// ,
// },
{ width: 90, prop: 'keyValue', label: '按钮值' },
{ width: 128, prop: 'model', label: '按钮盒模式' },
{
width: 90,
prop: 'keyValue',
label: '按钮值',
showOverflowtooltip: true,
},
{
width: 128,
prop: 'model',
label: '按钮盒模式',
showOverflowtooltip: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
inspectionDetContent: null,
},
// keys, queryParams pageNo, pageSize key
@ -261,7 +268,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = '添加安灯按钮16键对应';
this.title = '新增';
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -270,7 +277,7 @@ export default {
getQualityInspectionBoxBtn(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改安灯按钮16键对应';
this.title = '编辑';
});
},
/** 提交按钮 */

View File

@ -1,30 +1,63 @@
<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"
@emitFun="handleEmitFun">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="80"
fixed="right"
: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" width="40%" @close="cancel" @cancel="cancel"
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="40%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" :rows="[
<DialogForm
v-if="open"
ref="form"
v-model="form"
:rows="[
[
{
select: true,
label: '检测类型',
prop: 'typeId',
url: '/base/quality-inspection-type/listAll',
rules: [{ required: true, message: '检测类型不能为空', trigger: 'blur' }],
rules: [
{
required: true,
message: '检测类型不能为空',
trigger: 'blur',
},
],
bind: {
filterable: true,
},
@ -33,7 +66,13 @@
input: true,
label: '检测内容',
prop: 'content',
rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
rules: [
{
required: true,
message: '检测内容不能为空',
trigger: 'blur',
},
],
},
],
@ -44,7 +83,8 @@
prop: 'code',
url: '/base/quality-inspection-det/getCode',
},
{ input: true, label: '备注', prop: 'remark' }],
{ input: true, label: '备注', prop: 'remark' },
],
]" />
</base-dialog>
</div>
@ -63,10 +103,11 @@ import {
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'QualityInspectionDet',
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
data() {
return {
typeList: [], //
@ -141,19 +182,18 @@ export default {
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
width: 160,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'typeName', label: '类型名称', },
{ prop: 'content', label: '检测内容', },
{ prop: 'code', label: '检测编码', },
{ prop: 'remark', label: '备注', },
{ prop: 'typeName', label: '检测类型', showOverflowtooltip: true },
{ prop: 'content', label: '检测内容', showOverflowtooltip: true },
{ prop: 'code', label: '检测编码', showOverflowtooltip: true },
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
],
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
content: null,
createTime: [],
},

View File

@ -1,32 +1,58 @@
<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"
@emitFun="handleEmitFun">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="80"
: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" width="30%" @cancel="cancel"
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
@close="cancel"
width="40%"
@cancel="cancel"
@confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" :rows="[
<DialogForm
v-if="open"
ref="form"
v-model="form"
:rows="[
[
{
input: true,
label: '检测类型名称',
label: '检测类型',
prop: 'name',
rules: [
{
required: true,
message: '检测类型名称不能为空',
message: '检测类型不能为空',
trigger: 'blur',
},
],
@ -61,10 +87,11 @@ import {
exportQualityInspectionTypeExcel,
} from '@/api/base/qualityInspectionType';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'QualityInspectionType',
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
data() {
return {
tableBtn: [
@ -85,45 +112,12 @@ export default {
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
width: 160,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'name', label: '检测类型名称' },
{ prop: 'code', label: '检测类型编码' },
{ prop: 'remark', label: '备注' },
// {
// label: '',
// alignt: 'center',
// subcomponent: {
// render: function (h) {
// return h('div', null, [
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' '
// ),
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' '
// ),
// ]);
// },
// },
// },
{ prop: 'name', label: '检测类型', showOverflowtooltip: true },
{ prop: 'code', label: '类型编码', showOverflowtooltip: true },
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
],
//
searchBarFormConfig: [
@ -139,11 +133,6 @@ export default {
name: 'search',
color: 'primary',
},
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
{
type: 'separate',
},
@ -162,7 +151,7 @@ export default {
//
queryParams: {
pageNo: 1,
pageSize: 10,
pageSize: 20,
name: null,
},
//
@ -242,7 +231,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = '添加质量检测类型基础';
this.title = '新增';
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -251,7 +240,7 @@ export default {
getQualityInspectionType(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改质量检测类型基础';
this.title = '编辑';
});
},
/** 提交按钮 */

View File

@ -0,0 +1,104 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-20 15:23:59
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="auto">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废原因编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入报废原因编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废原因" prop="content">
<el-input v-model="dataForm.content" placeholder="请输入报废原因" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废类型" prop="typeId">
<el-select v-model="dataForm.typeId" placeholder="请选择报废类型">
<el-option
v-for="dict in typeList"
: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="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import {
createQualityScrapDet,
updateQualityScrapDet,
getQualityScrapDet,
getCode,
} from '@/api/base/qualityScrapDet';
import { getList } from '@/api/base/qualityScrapType';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapDet,
updateURL: updateQualityScrapDet,
infoURL: getQualityScrapDet,
},
typeList: [],
dataForm: {
id: undefined,
code: undefined,
content: undefined,
typeId: null,
remark: undefined,
},
dataRule: {
code: [
{ required: true, message: '报废原因编码不能为空', trigger: 'blur' },
],
content: [
{ required: true, message: '报废原因不能为空', trigger: 'blur' },
],
typeId: [
{ required: true, message: '报废类型不能为空', trigger: 'change' },
],
},
};
},
mounted() {
this.getDict();
},
methods: {
async getDict() {
//
const res = await getList();
this.typeList = res.data;
},
},
};
</script>

View File

@ -9,11 +9,12 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
:table-data="tableData"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@ -21,7 +22,7 @@
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
:total="total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
@ -29,7 +30,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="30%">
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
@ -45,33 +46,39 @@ import {
getQualityScrapDetPage,
deleteQualityScrapDet,
} from '@/api/base/qualityScrapDet';
import { getList, } from "@/api/base/qualityScrapType";
import { getList } from '@/api/base/qualityScrapType';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
filter: parseTime,
width: 160,
},
{
prop: 'content',
label: '报废原因'
label: '报废原因',
showOverflowtooltip: true,
},
{
prop: 'code',
label: '报废原因编码'
label: '报废原因编码',
showOverflowtooltip: true,
},
{
prop: 'typeName',
label: '报废类型'
label: '报废类型',
showOverflowtooltip: true,
},
{
prop: 'remark',
label: '备注'
label: '备注',
showOverflowtooltip: true,
},
];
export default {
mixins: [basicPage],
mixins: [basicPage, tableHeightMixin],
data() {
return {
urlOptions: {
@ -93,7 +100,7 @@ export default {
btnName: '删除',
}
: undefined,
].filter((v)=>v),
].filter((v) => v),
tableData: [],
formConfig: [
{
@ -109,6 +116,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'typeId',
filterable: true,
},
{
type: 'button',
@ -120,29 +128,36 @@ export default {
type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
type: this.$auth.hasPermi('base:quality-scrap-det:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
plain: true,
},
],
listQuery: {
pageNo: 1,
pageSize: 20,
},
total: 0,
};
},
components: {
AddOrUpdate,
},
created() { },
mounted () {
created() {},
mounted() {
this.getDict();
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.total = response.data.total;
this.dataListLoading = false;
});
},
@ -155,20 +170,10 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.content = val.content ? val.content : undefined;
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;

View File

@ -0,0 +1,88 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-24 08:42:18
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="报废类型编码" prop="code" label-width="120px">
<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废类型" prop="name" label-width="90px">
<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item
label="报废类型描述"
prop="description"
label-width="120px">
<el-input
v-model="dataForm.description"
clearable
placeholder="报废类型描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark" label-width="90px">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import {
createQualityScrapType,
updateQualityScrapType,
getQualityScrapType,
getCode,
} from '@/api/base/qualityScrapType';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapType,
updateURL: updateQualityScrapType,
infoURL: getQualityScrapType,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
remark: undefined,
},
dataRule: {
code: [
{ required: true, message: '报废类型编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '报废类型不能为空', trigger: 'blur' },
],
},
};
},
};
</script>

View File

@ -9,11 +9,12 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
:table-data="tableData"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@ -21,7 +22,7 @@
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
:total="total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
@ -29,7 +30,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="30%">
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
@ -43,35 +44,41 @@ import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter';
import {
getQualityScrapTypePage,
deleteQualityScrapType
deleteQualityScrapType,
} from '@/api/base/qualityScrapType';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
filter: parseTime,
width: 160,
},
{
prop: 'name',
label: '报废类型'
label: '报废类型',
showOverflowtooltip: true,
},
{
prop: 'code',
label: '报废类型编码'
label: '报废类型编码',
showOverflowtooltip: true,
},
{
prop: 'description',
label: '描述信息'
label: '描述信息',
showOverflowtooltip: true,
},
{
prop: 'remark',
label: '备注'
label: '备注',
showOverflowtooltip: true,
},
];
export default {
mixins: [basicPage],
mixins: [basicPage, tableHeightMixin],
data() {
return {
urlOptions: {
@ -93,7 +100,7 @@ export default {
btnName: '删除',
}
: undefined,
].filter((v)=>v),
].filter((v) => v),
tableData: [],
formConfig: [
{
@ -112,13 +119,20 @@ export default {
type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-scrap-type:create') ? 'button' : '',
type: this.$auth.hasPermi('base:quality-scrap-type:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
plain: true,
},
],
listQuery: {
pageNo: 1,
pageSize: 20,
},
total: 0,
};
},
components: {
@ -129,9 +143,9 @@ export default {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.total = response.data.total;
this.dataListLoading = false;
});
},
@ -139,19 +153,9 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;

View File

@ -280,7 +280,7 @@ export default {
async fillProductOptions() {
const { data } = await this.$axios({
url: '/base/core-product/listAll',
url: '/base/core-product-material/listAll',
method: 'get',
});
const cfg = this.searchBarFormConfig.find(

View File

@ -94,7 +94,7 @@ export default {
return {
readOnly: false,
chosedLogId: false,
searchBarKeys: ['equipmentName', 'recordTime'],
searchBarKeys: ['equipmentName', 'createTime'],
tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
@ -124,11 +124,11 @@ export default {
label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
},
{ prop: 'createTime', label: '报警时间', filter: timeFilter }, //
{ prop: 'alarmCode', label: '设备报警码' }, //
{ prop: 'createTime', label: '报警时间', filter: timeFilter },
{ prop: 'alarmCode', label: '设备报警码' },
{ prop: 'alarmContent', label: '报警内容' },
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO:
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn },
// { prop: 'remark', label: '' },
],
searchBarFormConfig: [
@ -145,8 +145,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: '结束日期',

View File

@ -9,7 +9,8 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="mode.includes('detail') ? true : false"
:before-close="handleCancel"
class="drawer"
custom-class="mes-drawer"
:size="size || '50%'"
@ -129,13 +130,12 @@
</section>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">返回</el-button>
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button
type="primary"
v-if="!mode.includes('detail')"
@click="handleSave">
保存
确定
</el-button>
</div>
</div>
@ -383,7 +383,7 @@ export default {
//
handleAddAttr() {
if (!this.dataId) return this.$message.error('请先创建设备分组信息');
if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
this.attrForm = {
id: null,
equipmentGroupId: this.dataId,

View File

@ -9,7 +9,8 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="mode.includes('detail') ? true : false"
:before-close="handleCancel"
class="drawer"
custom-class="mes-drawer"
:size="size || '50%'"
@ -128,11 +129,10 @@
</section>
</div>
<div class="drawer-body__footer">
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button
type="primary"
v-if="!mode.includes('detail')"
@click="handleCancel">
确定
</el-button>
@ -382,7 +382,7 @@ export default {
//
handleAddAttr() {
if (!this.dataId) return this.$message.error('请先创建设备分组信息');
if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
this.attrForm = {
id: null,
equipmentGroupId: this.dataId,

View File

@ -34,7 +34,7 @@
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="700px"
width="30%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">

View File

@ -25,6 +25,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="90"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -41,7 +42,7 @@
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="700px"
width="45%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
@ -127,7 +128,7 @@ export default {
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'code', label: '编码' },
{ prop: 'code', label: '编码', showOverflowtooltip: true },
{ prop: 'plcTableName', label: '关联表名' },
{ prop: 'name', label: '标识名称' },
{ prop: 'enName', label: '英文名称' },
@ -136,7 +137,7 @@ export default {
label: '是否采集',
subcomponent: switchBtn,
},
{ prop: 'description', label: '描述' },
{ prop: 'description', label: '描述', showOverflowtooltip: true },
],
searchBarFormConfig: [
{
@ -213,16 +214,28 @@ export default {
},
],
[
// {
// switch: true,
// label: '', // 0 , 1
// prop: 'collection',
// bind: {
// 'active-value': 1,
// 'inactive-value': 0,
// value: 1,
// },
// },
{
switch: true,
label: '是否采集', // 0 , 1
select: true,
options: [
{ label: '否', value: 0 },
{ label: '是', value: 1 }
],
label: '是否采集',
prop: 'collection',
bind: {
'active-value': 1,
'inactive-value': 0,
value: 1,
},
},
clearable: true, filterable: true
}
}
],
[
{

View File

@ -9,7 +9,8 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="mode.includes('detail') ? true : false"
:before-close="handleCancel"
class="drawer"
custom-class="mes-drawer"
:size="size || '50%'"
@ -147,13 +148,12 @@
</section>
</div>
<div class="drawer-body__footer">
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button
type="primary"
v-if="!mode.includes('detail')"
@click="handleSave">
保存
确定
</el-button>
</div>
</div>

View File

@ -12,7 +12,8 @@
:show-close="false"
:wrapper-closable="isdetail"
class="drawer"
size="60%">
size="60%"
@closed="$emit('destroy')">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
@ -265,6 +266,7 @@ export default {
this.fileName = this.dataForm.files[0].fileName
}
this.setConfig()
this.setInspectionContet()
});
} else {
// if (this.urlOptions.isGetCode) {

View File

@ -49,7 +49,8 @@
<addRecord
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
@refreshDataList="getList"
@destroy="addOrUpdateVisible = false" />
</div>
</template>

View File

@ -49,7 +49,7 @@
<script>
import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
import { parseTime } from '@/utils/ruoyi'
@ -67,7 +67,7 @@ const remainBox = {
color() {
if (this.value) {
const v = +this.value;
return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F';
}
return 'unset';
},
@ -78,9 +78,10 @@ const remainBox = {
style={`background: ${
this.color
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
this.color == 'red' ? '#fff' : 'unset'
// this.color == 'red' ? '#fff' : 'unset'
'#fff'
}`}>
{this.injectData[this.injectData.prop] || ''}
{ this.injectData[this.injectData.prop]?.toFixed(0) || '' }
</div>
);
},
@ -121,30 +122,35 @@ export default {
// width: 180,
// filter: parseTime(createTime),
// },
{ prop: 'name', label: '保养计划' },
{ prop: 'lineName', label: '产线名' },
{ prop: 'sectionName', label: '工段名' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'name', label: '保养计划', minWidth: 100, showOverflowtooltip: true },
{ prop: 'lineName', label: '产线名', minWidth: 100, showOverflowtooltip: true },
{ prop: 'sectionName', label: '工段名', minWidth: 100, showOverflowtooltip: true },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'equipmentCode', label: '设备编码', minWidth: 100, showOverflowtooltip: true },
{ prop: 'maintenancePeriod', label: '保养频率' },
{
prop: 'maintainType',
label: '保养类型',
showOverflowtooltip: true,
filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
},
{
prop: 'lastMaintainTime',
label: '上次保养时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
{
prop: 'remainDays',
label: '距离保养时间(天)',
subcomponent: remainBox,
minWidth: 150,
// showOverflowtooltip: true
},
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn, width: 100 },
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn, width: 100 },
],
searchBarFormConfig: [
{
@ -176,6 +182,7 @@ export default {
: '',
btnName: '导出',
name: 'export',
plain: true,
color: 'warning',
},
],

View File

@ -99,23 +99,24 @@ export default {
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
width: 150,
filter: timeFilter,
},
{ prop: 'maintainOrderNumber', label: '设备保养单号' },
{ prop: 'startTime', label: '开始时间', filter: timeFilter },
{ prop: 'endTime', label: '结束时间', filter: timeFilter },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintainWorker', label: '保养人员' },
{ prop: 'maintainOrderNumber', label: '设备保养单号', width: 110, showOverflowtooltip: true },
{ prop: 'startTime', label: '开始时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true },
{ prop: 'endTime', label: '结束时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'maintainWorker', label: '保养人员', minWidth: 100, showOverflowtooltip: true },
{
prop: 'relatePlan',
label: '是否计划保养',
width: 120,
filter: (v) => (v != null ? ['', '是', '否'][v] : ''),
},
{ prop: 'planName', label: '保养计划名称' },
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
{ prop: 'timeUsed', label: '实际保养用时(h)' },
{ prop: 'remark', label: '备注' },
{ prop: 'planName', label: '保养计划名称', minWidth: 120, showOverflowtooltip: true },
{ prop: 'maintainDuration', label: '计划保养用时(h)', minWidth: 130, showOverflowtooltip: true },
{ prop: 'timeUsed', label: '实际保养用时(h)', minWidth: 130 },
{ prop: 'remark', label: '备注', minWidth: 100, showOverflowtooltip: true },
],
searchBarFormConfig: [
{
@ -162,6 +163,15 @@ export default {
{
type: 'separate',
},
{
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
plain: true,
color: 'warning',
},
{
type: this.$auth.hasPermi('equipment:maintain-record:create')
? 'button'
@ -171,14 +181,6 @@ export default {
plain: true,
color: 'success',
},
{
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
],
rows: [
[
@ -213,17 +215,29 @@ export default {
},
],
[
// {
// switch: true,
// label: '',
// prop: 'relatePlan',
// bind: {
// 'active-value': 1,
// 'inactive-value': 2,
// },
// rules: [{ required: true, message: '', trigger: 'blur' }],
// },
{
switch: true,
select: true,
options: [
{ label: '是', value: 1 },
{ label: '否', value: 2 }
],
label: '是否计划保养',
prop: 'relatePlan',
bind: {
'active-value': 1,
'inactive-value': 2,
clearable: true, filterable: true
},
rules: [{ required: true, message: '是否计划保养不能为空', trigger: 'blur' }],
},
{},
{
select: true,
label: '所属计划',
@ -234,6 +248,11 @@ export default {
clearable: true,
},
},
{
input: true,
label: '保养用时',
prop: 'timeUsed',
},
],
[
{
@ -260,11 +279,7 @@ export default {
clearable: true,
},
},
{
input: true,
label: '保养用时',
prop: 'timeUsed',
},
{}
],
[

View File

@ -9,12 +9,16 @@
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="disabled"
class="drawer"
size="60%">
custom-class="mes-drawer"
size="65%"
@closed="$emit('destroy')">
<small-title slot="title" :no-padding="true">
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
</small-title>
<div class="drawer-body flex">
<div class="drawer-body__content">
<el-form
ref="form"
:model="dataForm"
@ -55,11 +59,14 @@
</el-form-item>
</el-col>
</el-row>
<el-divider style="margin-top: -10px" />
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
{{ '可编辑信息' }}
{{ '设备维修信息' }}
</small-title>
<el-row :gutter="20">
<el-col :span="8">
<el-col :span="6">
<el-form-item
label="维修开始时间"
prop="maintenanceStartTime"
@ -72,8 +79,7 @@
value-format="timestamp" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item
label="维修结束时间"
prop="maintenanceFinishTime"
@ -86,8 +92,7 @@
value-format="timestamp" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item
label="维修方式"
prop="repairMode"
@ -104,9 +109,7 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="故障类型" prop="faultType">
<el-select
:disabled="disabled"
@ -129,7 +132,7 @@
prop="faultDetail"
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
<!-- // -->
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="380"/>
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/>
</el-form-item>
</el-col>
</el-row>
@ -138,7 +141,7 @@
<el-col>
<el-form-item label="维修记录" prop="maintenanceDetail">
<!-- // -->
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="380"/>
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/>
</el-form-item>
</el-col>
</el-row>
@ -163,12 +166,11 @@
</el-row>
</el-form>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
<!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
编辑
</el-button> -->
<el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
<div v-if="!disabled" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
</div>
</el-drawer>
</template>
@ -300,56 +302,39 @@ export default {
</script>
<style scoped>
.el-date-editor,
.el-select {
width: 100%;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 0px;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
.small-title::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: 22px;
border-radius: 1px;
margin-right: 8px;
background-color: #0b58ff;
}
.drawer-body {
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .content {
padding: 30px 24px;
.drawer-body__content {
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
/* background: #eee; */
padding: 20px 30px;
overflow-y: auto;
}
.drawer-body__footer {

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="180"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -48,7 +48,8 @@
<CustomDialogForm
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
@refreshDataList="getList"
@destroy="addOrUpdateVisible = false" />
</div>
</template>
@ -69,12 +70,6 @@ export default {
addOrUpdateVisible: false,
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
tableBtn: [
this.$auth.hasPermi('equipment:repair:update')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('equipment:repair:finish')
? {
type: 'finish',
@ -83,10 +78,16 @@ export default {
: undefined,
this.$auth.hasPermi('equipment:repair:update')
? {
type: 'edit',
btnName: '修改',
type: 'detail',
btnName: '详情',
}
: undefined,
// this.$auth.hasPermi('equipment:repair:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi('equipment:repair:delete')
? {
type: 'delete',
@ -99,29 +100,31 @@ export default {
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
width: 150,
filter: parseTime,
},
{ prop: 'repairOrderNumber', label: '设备维修单号' },
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
{ prop: 'repairOrderNumber', label: '设备维修单号', minWidth: 100, showOverflowtooltip: true },
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
{
prop: 'maintenanceFinishTime',
label: '结束时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'maintenanceStatus',
label: '维修状态',
filter: (v) => (v != null ? ['未完成', '完成', '进行中'][v] : ''),
},
{ prop: 'maintenanceDuration', label: '维修时长(h)' },
{ prop: 'maintenanceDuration', label: '维修时长(h)', width: 110 },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'maintenanceDetail', label: '维修明细' },
{ prop: 'repairman', label: '维修工' },
{ prop: 'repairmanPhone', label: '联系方式' },
{ prop: 'remark', label: '备注' },
{ prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
{ prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true },
],
searchBarFormConfig: [
{
@ -176,6 +179,7 @@ export default {
type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
btnName: '导出',
name: 'export',
plain: true,
color: 'warning',
},
],

View File

@ -270,7 +270,7 @@ export default {
switch (btnName) {
case 'search':
if (!payload.recordTime || payload.recordTime.length <= 0) {
this.$message.error('请选择时间段');
this.$message.warning('请选择时间段');
return;
}
this.startTime = new Date(payload.recordTime).getTime();
@ -493,7 +493,7 @@ export default {
if (code == 0) {
const newEqlist = this.objectToArray(data);
if (!newEqlist || newEqlist.length == 0) {
this.$message.error('该设备没有产量数据');
this.$message.warning('该设备没有产量数据');
return;
}
this.graphList.push(...newEqlist);

View File

@ -338,7 +338,7 @@ export default {
switch (btnName) {
case 'search':
if (!payload.recordTime || payload.recordTime.length <= 0) {
this.$message.error('请选择时间段');
this.$message.warning('请选择时间段');
return;
}
@ -373,7 +373,7 @@ export default {
async submitForm() {
if (this.existingEquipments.indexOf(this.queryParams.equipmentId) >= 0) {
this.$message.error('该设备已存在');
this.$message.warning('该设备已存在');
return;
}
const { code, data } = await this.$axios({
@ -387,7 +387,7 @@ export default {
if (code == 0) {
const newEqlist = this.objectToArray(data);
if (!newEqlist || newEqlist.length == 0) {
this.$message.error('该设备没有状态数据');
this.$message.warning('该设备没有状态数据');
return;
}
this.graphList.push(newEqlist[0]);

View File

@ -1,8 +1,8 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zhp
* @LastEditTime: 2023-11-28 10:03:20
* @LastEditors: zwq
* @LastEditTime: 2024-07-09 13:40:03
* @Description:
-->
<template>

View File

@ -1,8 +1,8 @@
<!--
* @Author: zhp
* @Date: 2023-11-08 15:30:27
* @LastEditTime: 2023-11-23 14:27:59
* @LastEditors: zhp
* @LastEditTime: 2024-07-09 13:29:06
* @LastEditors: zwq
* @Description:
-->
<template>
@ -42,8 +42,8 @@ import {
getProcessEquMaterialBomDet,
createProcessEquMaterialBomDetList,
updateProcessEquMaterialBomDet,
getMaterialList
} from '@/api/extend/processEquMaterialBom';
import { getMaterialTree,getMaterialList } from '@/api/base/material';
export default {
props: {
@ -94,11 +94,15 @@ export default {
}
});
},
getDict() {
getMaterialList().then((res) => [
this.materialList = res.data,
console.log(res)
])
async getDict() {
const materRes = await getMaterialTree();
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id
const listQuery= {
typeId:typeId
}
const materData = await getMaterialList(listQuery);
this.materialList = [];
this.materialList = materData.data;
},
//
dataFormSubmit() {

View File

@ -12,32 +12,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="生效时间" prop="enableTime">
<el-date-picker
v-model="form.enableTime"
type="datetime"
placeholder="选择日期时间"
label-format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp"
style="width: 100%;">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="失效时间" prop="disableTime">
<el-date-picker
v-model="form.disableTime"
type="datetime"
placeholder="选择日期时间"
label-format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp"
style="width: 100%;">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班次开始时间" prop="startTime">
@ -91,8 +65,6 @@ export default {
id: '',
name: '',
code: '',
enableTime: '',
disableTime: '',
startTime: '',
endTime: '',
daySpan: '',
@ -101,7 +73,6 @@ export default {
isEdit: false, //
rules: {
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
enableTime: [{ required: true, message: '请选择班次开始时间', trigger: 'change' }],
code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
startTime: [{ required: true, message: '请输入生效时间', trigger: 'change' }],
endTime: [{ required: true, message: '请选择班次结束时间', trigger: 'change' }]
@ -116,7 +87,6 @@ export default {
getGroupClasses(id).then((res) => {
if (res.code === 0) {
this.form = res.data
this.form.disableTime = res.data.disableTime || ''
}
})
} else {
@ -146,7 +116,6 @@ export default {
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.form.disableTime = this.form.disableTime || ''
if (this.isEdit) {
//
updateGroupClasses({ ...this.form }).then((res) => {

View File

@ -0,0 +1,52 @@
<!--
* @Author: zwq
* @Date: 2024-07-01 14:53:55
* @LastEditors: zwq
* @LastEditTime: 2024-07-10 10:28:05
* @Description:
-->
<template>
<el-switch v-model="state" type="text" size="small" :disabled="readonly" @change="changeHandler" />
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
state: false
}
},
computed: {
readonly() {
return !!this.injectData.readonly
}
},
mounted() {
this.mapToState()
},
methods: {
mapToState() {
if (this.injectData.prop === 'enabled') {
this.state = this.injectData.enabled === 1 ? true : false
}
},
changeHandler() {
let params = {}
let payload = {}
params.name = 'state'
payload.id = this.injectData.id
payload.enabled = this.state ? '1' : '0'
payload.startTime = this.injectData.startTime
payload.endTime = this.injectData.endTime
params.payload = payload
this.$emit('emitData', params)
}
}
}
</script>

View File

@ -1,12 +1,17 @@
<!--
* @Author: zwq
* @Date: 2024-07-01 14:53:55
* @LastEditors: zwq
* @LastEditTime: 2024-07-12 16:19:13
* @Description:
-->
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
@ -14,22 +19,20 @@
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
@emitFun="handleTableEvents">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
@ -37,48 +40,47 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='50%'
>
width="50%">
<group-class-add ref="classList" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { getGroupClassesPage, deleteGroupClasses, updateGroupClasses } from "@/api/base/groupClasses";
import GroupClassAdd from './components/groupClassAdd.vue'
import { formatDate } from '@/utils'
import {
getGroupClassesPage,
deleteGroupClasses,
updateGroupClasses,
} from '@/api/base/groupClasses';
import GroupClassAdd from './components/groupClassAdd.vue';
import StatusBtn from './components/statusBtn';
const tableProps = [
{
prop: 'enableTimeStr',
label: '生效时段',
minWidth: 300
},
{
prop: 'name',
label: '班次名称'
label: '班次名称',
},
{
prop: 'timeStr',
label: '班次时间',
minWidth: 100
minWidth: 100,
},
{
prop: 'code',
label: '班次编码',
minWidth: 200
minWidth: 200,
},
{
prop: 'status',
label: '班次状态'
prop: 'enabled',
label: '班次状态',
subcomponent: StatusBtn,
},
{
prop: 'remark',
label: '备注'
}
]
label: '备注',
},
];
export default {
name: "GroupClass",
name: 'GroupClass',
components: { GroupClassAdd },
data() {
return {
@ -87,55 +89,41 @@ export default {
type: 'input',
label: '班次名称',
placeholder: '班次名称',
param: 'name'
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
color: 'primary',
},
{
type: 'separate'
type: 'separate',
},
{
type: this.$auth.hasPermi('base:group-classes:create') ? 'button' : '',
type: this.$auth.hasPermi('base:group-classes:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
plain: true,
},
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-classes:cancel')
? {
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: '不可用'
}
]
}
}
: undefined,
this.$auth.hasPermi('base:group-classes:update')
? {
type: 'edit',
btnName: '编辑'
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:group-classes:delete')
? {
type: 'delete',
btnName: '删除'
btnName: '删除',
}
: undefined
: undefined,
].filter((v) => v),
tableH: this.tableHeight(260),
//
@ -143,120 +131,133 @@ export default {
//
list: [],
//
addOrEditTitle: "",
addOrEditTitle: '',
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null
}
name: null,
},
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
this.tableH = this.tableHeight(260);
});
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.name = val.name
this.getList()
break
this.queryParams.name = val.name;
this.getList();
break;
default:
this.addOrEditTitle = '新增'
this.centervisible = true
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.classList.init()
this.$refs.classList.init();
});
}
},
//
handleTableEvents(params) {
if (params.name === 'state') {
//
updateGroupClasses({ ...params.payload })
.then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess('操作成功');
this.getList();
}
})
.catch((res) => {
this.getList();
});
}
},
/** 查询列表 */
getList() {
getGroupClassesPage(this.queryParams).then(res => {
if (res.code === 0 && res.data.list.length > 0) {
res.data.list.map(item => {
item.enableTimeStr = formatDate(item.enableTime) + '至' + (item.disableTime ? formatDate(item.disableTime) : '永久')
item.timeStr = item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5)
item.status = item.status === true ? '可用' : '不可用'
})
getGroupClassesPage(this.queryParams).then((res) => {
if (res.code === 0 && res.data.list && res.data.list.length > 0) {
res.data.list.map((item) => {
item.timeStr =
item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5);
});
this.list = res.data.list;
this.total = res.data.total;
} else {
this.list = []
this.total = 0
this.list = [];
this.total = 0;
}
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.classList.init(val.data.id)
})
this.centervisible = true
break
case 'cancel':
this.discard(val.data)
break
this.$refs.classList.init(val.data.id);
});
this.centervisible = true;
break;
default:
this.handleDelete(val.data)
this.handleDelete(val.data);
}
},
handleCancel() {
this.$refs.classList.formClear()
this.centervisible = false
this.addOrEditTitle = ''
this.$refs.classList.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.classList.submitForm()
this.$refs.classList.submitForm();
},
successSubmit() {
this.handleCancel()
this.getList()
},
discard(row) {
let obj = {}
obj.id = row.id
obj.startTime = row.startTime
obj.endTime = row.endTime
obj.enableTime = row.enableTime
obj.disableTime = Date.parse(new Date())
this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function() {
return updateGroupClasses({ ...obj })
}).then(() => {
this.handleCancel();
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row)
let _this = this
if (row.status === '可用') {//
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function() {
return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() {
console.log(row);
let _this = this;
if (row.enabled) {
//
_this.$modal
.confirm(
'删除的班次"' +
row.name +
'"可能会影响交接班计划,请点取消再次确认!'
)
.then(function () {
return _this.$modal
.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupClasses(row.id);
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
} else {
_this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() {
return deleteGroupClasses(row.id);
}).then(() => {
.then(() => {
_this.getList();
_this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
_this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
});
} else {
_this.$modal
.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupClasses(row.id);
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
},
},
};
</script>

View File

@ -14,20 +14,18 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班组组长" prop="leaderId">
<el-select v-model="form.leaderId" placeholder="请选择" style="width: 100%;" filterable @change="selectLeader">
<el-option
v-for="item in workerList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-form-item label="班组组长" prop="leaderName">
<el-input v-model="form.leaderName" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号" prop="telephone">
<el-input v-model="form.telephone" disabled></el-input>
<el-form-item label="手机号" prop="leaderPhone">
<el-input v-model="form.leaderPhone" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="班组人数" prop="num">
<el-input-number style="width: 100%;" v-model="form.num" :step="1" step-strictly></el-input-number>
</el-form-item>
</el-col>
</el-row>
@ -35,7 +33,6 @@
</template>
<script>
import { getGroupTeam, updateGroupTeam, createGroupTeam, getCode } from '@/api/base/groupTeam'
import { getWorkerList } from '@/api/base/worker'
export default {
name: 'groupTeamAdd',
data() {
@ -44,28 +41,26 @@ export default {
id: '',
name: '',
code: '',
leaderId: '',
telephone: ''
leaderName: '',
leaderPhone: '',
num: ''
},
isEdit: false, //
rules: {
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入班组编码', trigger: 'blur' }],
leaderId: [{ required: true, message: '请选择组长', trigger: 'select' }]
leaderName: [{ required: true, message: '请输入组长', trigger: 'blur' }]
},
workerList: []
}
},
methods: {
init(id) {
this.getWorkerList()
if (id) {
this.isEdit = true
this.form.id = id
getGroupTeam( id ).then((res) => {
if (res.code === 0) {
this.form = res.data
this.selectLeader()
}
})
} else {
@ -76,24 +71,6 @@ export default {
})
}
},
// list
getWorkerList() {
getWorkerList().then(res => {
this.workerList = res.data
})
},
//
selectLeader() {
if (this.form.leaderId) {
this.workerList.map(item => {
if (item.id === this.form.leaderId) {
this.form.telephone = item.telephone || ''
}
})
} else {
this.form.telephone = ''
}
},
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {

View File

@ -1,3 +1,10 @@
<!--
* @Author: zwq
* @Date: 2024-07-01 14:53:55
* @LastEditors: zwq
* @LastEditTime: 2024-07-10 10:00:03
* @Description:
-->
<template>
<el-switch v-model="state" type="text" size="small" :disabled="readonly" @change="changeHandler" />
</template>
@ -37,7 +44,7 @@ export default {
payload.enabled = this.state ? '1' : '0'
payload.code = this.injectData.code
payload.name = this.injectData.name
payload.leaderId = this.injectData.leaderId
payload.leaderName = this.injectData.leaderName
params.payload = payload
this.$emit('emitData', params)
}

View File

@ -193,7 +193,7 @@ export default {
},
getList() {
groupTeamPage({ ...this.queryParams }).then(res => {
if (res.code === 0 && res.data.list.length > 0) {
if (res.code === 0 && res.data.list && res.data.list.length > 0) {
let arr = []
res.data.list.map(item => {
let obj = {}

View File

@ -42,8 +42,6 @@
>
<group-team-add ref="groupList" @successSubmit="successSubmit" />
</base-dialog>
<!-- 组员编辑 -->
<worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
</div>
</template>
@ -52,8 +50,6 @@ import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/g
import { parseTime } from '@/utils/ruoyi'
import GroupTeamAdd from './components/groupTeamAdd'
import StatusBtn from './components/statusBtn'
import WorkerOperate from './components/workerOperate'
import WorkerEdit from './components/workerEdit'
const tableProps = [
{
prop: 'createTime',
@ -83,15 +79,10 @@ const tableProps = [
label: '班组状态',
subcomponent: StatusBtn
},
{
prop: 'workerName',
label: '组员',
subcomponent: WorkerOperate
},
]
export default {
name: "GroupTeam",
components: { GroupTeamAdd, WorkerEdit },
components: { GroupTeamAdd },
data() {
return {
formConfig: [
@ -155,7 +146,6 @@ export default {
name: null,
code: null
},
paramVisible: false
};
},
created() {
@ -203,17 +193,14 @@ export default {
},
//
handleTableEvents(params) {
console.log(params)
if (params.name === 'state') {//
updateGroupTeam({ ...params.payload }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.getList()
}
})
}else {// &
this.paramVisible = true
this.$nextTick(() => {
this.$refs.workerEditParam.init(params)
}).catch((res)=>{
this.getList()
})
}
},

View File

@ -1,6 +1,20 @@
<!--
* @Author: zwq
* @Date: 2024-07-01 14:54:06
* @LastEditors: zwq
* @LastEditTime: 2024-07-15 14:55:35
* @Description:
-->
<template>
<div class="groupTeamScheduling">
<div class="operationArea">
<el-tabs v-model="planId" @tab-click="setPlan">
<el-tab-pane
v-for="item in planArr"
:key="item.id"
:label="item.name"
:name="item.id" />
</el-tabs>
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="月份选择">
@ -12,42 +26,55 @@
:disabled="showSetting"
@change="selectMonth"
:clearable="false"
style="width: 120px">
</el-date-picker>
style="width: 120px"></el-date-picker>
</el-form-item>
<el-form-item>
<span class="separateStyle" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
<span
class="separateStyle"
v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')" :disabled="showSetting || settingBtnDis" @click="settingMsg">设置</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" v-show="showSetting && autoScheduling" @click="schedulingBtn">自动排班</el-button>
<el-button
type="primary"
size="small"
v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"
:disabled="showSetting || settingBtnDis"
@click="settingMsg">
设置
</el-button>
</el-form-item>
<el-form-item>
<span class="separateStyle" v-show="showSetting"></span>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" v-show="showSetting" @click="confirmSetting">确认</el-button>
<el-button
type="primary"
size="small"
v-show="showSetting"
@click="confirmSetting">
确认
</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" plain v-show="showSetting" @click="cancelSetting">取消</el-button>
</el-form-item>
<el-form-item label="请先选择查询的班组" class="rightItem">
<!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button> -->
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button>
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('3')">班组检测查询</el-button>
<el-button
type="primary"
size="small"
plain
v-show="showSetting"
@click="cancelSetting">
取消
</el-button>
</el-form-item>
</el-form>
</div>
<!-- 日历区域 -->
<div class="calenderArea">
<div style="font-size: 24px;font-weight: 500">{{ this.month }} {{ this.year }}</div>
<div style="font-size: 24px; font-weight: 500">
{{ this.month }} {{ this.year }}
</div>
<el-calendar v-model="startDay">
<!-- 这里使用的是 2.5 slot 语法对于新项目请使用 2.6 slot 语法-->
<template
slot="dateCell"
slot-scope="{date, data}">
<template slot="dateCell" slot-scope="{ date, data }">
<div v-if="data.type === 'current-month'">
<!-- 日期 -->
<div class="dateStyle">
@ -55,27 +82,62 @@
</div>
<!-- 班次班组 -->
<!-- class有两个样式一个是类似class1还有个是选中红框显示 -->
<el-row :gutter="2" :class="'class' + (index+1) + (chooseTip === (item.startDay+item.classesId) ? ' team-active' : '')" v-for="(item, index) in list[Number(data.day.split('-')[2])]" :key='index'>
<el-row
:gutter="2"
:class="
'class' +
(index + 1) +
(chooseTip === item.startDay + item.classesId
? ' team-active'
: '')
"
v-for="(item, index) in list[Number(data.day.split('-')[2])]"
:key="index">
<el-col :span="12">
<div class="selectDiv">
<!-- 选择班组图标 -->
<div class="toggle-icon" v-show="showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true)">
<svg-icon icon-class="toggle"/>
<div
class="toggle-icon"
v-show="
showSetting &&
(new Date(data.day).valueOf() < new Date().valueOf()
? false
: true)
">
<svg-icon icon-class="toggle" />
</div>
<!-- 不能选择班组 -->
<div class="toggle-icon-hide" v-show="!(showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true))"></div>
<el-select v-model="item.teamId" size='small' :disabled="!showSetting || (new Date(data.day).valueOf() > new Date().valueOf() ? false: true)">
<div
class="toggle-icon-hide"
v-show="
!(
showSetting &&
(new Date(data.day).valueOf() < new Date().valueOf()
? false
: true)
)
"></div>
<el-select
v-model="item.teamId"
size="small"
:disabled="
!showSetting ||
(new Date(data.day).valueOf() > new Date().valueOf()
? false
: true)
">
<el-option
v-for="i in teamList"
:key="i.id"
:label="i.name"
:value="i.id">
</el-option>
:value="i.id"></el-option>
</el-select>
</div>
</el-col>
<el-col :span="12">
<el-button class="labelClass" @click="chooseTeam(item)">{{ item.classesName }}</el-button>
<el-button class="labelClass" @click="chooseTeam(item)">
{{ item.classesName }}
</el-button>
</el-col>
</el-row>
</div>
@ -86,238 +148,211 @@
</template>
<script>
import { getPreset, createOrUpdateList, autoSet } from "@/api/base/groupTeamScheduling";
import { listEnabled } from "@/api/base/groupTeam";
import {
getScheduling,
createOrUpdateList,
} from '@/api/base/groupTeamScheduling';
import {
groupPlanList,
groupPlanTeamList,
} from '@/api/base/groupSchedulingPlan';
import { listEnabled } from '@/api/base/groupTeam';
import moment from 'moment';
export default {
name: "GroupTeamScheduling",
name: 'GroupTeamScheduling',
data() {
return {
startDay: '',//
year: '',// 2023
month: '',//
monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
startDay: '', //
year: '', // 2023
month: '', //
monthList: [
'一月',
'二月',
'三月',
'四月',
'五月',
'六月',
'七月',
'八月',
'九月',
'十月',
'十一月',
'十二月',
],
planId: undefined, //id
list: {},
teamList: [],//
showSetting: false,//
planArr: [], //
teamList: [], //
showSetting: false, //
settingBtnDis: false,
jumpDisabled: true,//
jumpDisabled: true, //
chooseObj: {}, //
chooseTip: '',//
autoScheduling: false //
chooseTip: '', //
autoScheduling: false, //
};
},
created() {
this.startDay = new Date()
this.startDay = new Date();
groupPlanList().then((res) => {
this.planArr = res.data || [];
this.planId = this.planArr[0] ? this.planArr[0].id : undefined;
if (this.planId) {
this.getList();
this.getTeamList();
}
});
//
this.settingBtn()
this.getTeamList()
this.toggleMonth()
this.getList()
this.settingBtn();
this.toggleMonth();
},
methods: {
setPlan() {
this.getList();
this.getTeamList();
},
//
selectMonth() {
if (this.startDay) {
this.settingBtn() // ,getlist
this.toggleMonth()
this.getList()
this.clearChoose()
if ( moment(this.startDay).valueOf() > moment().endOf('month').valueOf()) {
this.autoScheduling = true
this.settingBtn(); // ,getlist
this.toggleMonth();
this.getList();
this.clearChoose();
if (
moment(this.startDay).valueOf() > moment().endOf('month').valueOf()
) {
this.autoScheduling = true;
} else {
this.autoScheduling = false
this.autoScheduling = false;
}
}
},
//
//
getTeamList() {
listEnabled().then(res => {
this.teamList = res.data || []
})
groupPlanTeamList(this.planId).then((res) => {
this.teamList = res.data || [];
});
},
//
getList() {
let year = moment(this.startDay).format('YYYY')
let month = moment(this.startDay).format('M')
getPreset({
let year = moment(this.startDay).format('YYYY');
let month = moment(this.startDay).format('M');
getScheduling({
year: year,
month: month
}).then(res => {
let obj = res.data || {}
month: month,
planId: this.planId,
})
.then((res) => {
let obj = res.data || {};
if (obj) {
for (let item in obj) {
for (let i = 0; i < obj[item].length; i++) {
if (!obj[item][i].teamId) {
obj[item][i].teamId = ''
obj[item][i].teamId = '';
}
}
}
}
this.list = obj
}).catch(() => {
this.list = {}
this.settingBtnDis = true //
this.list = obj;
})
.catch(() => {
this.list = {};
this.settingBtnDis = true; //
});
},
//
settingMsg() {
this.showSetting = !this.showSetting
this.clearChoose()
this.showSetting = !this.showSetting;
this.clearChoose();
},
//
cancelSetting() {
this.showSetting = !this.showSetting
this.getList() //
this.showSetting = !this.showSetting;
this.getList(); //
},
//
confirmSetting() {
let num = 0
let num = 0;
//
if (moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')) {
num = Number(moment().format('DD'))
if (
moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')
) {
num = Number(moment().format('DD'));
} else {
num = 0
num = 0;
}
//
//
let tempArr = Object.values(this.list)
let arr = []
let tempArr = Object.values(this.list);
let arr = [];
for (let i = num; i < tempArr.length; i++) {
for (let j = 0; j < tempArr[i].length; j++) {
arr.push(tempArr[i][j])
arr.push(tempArr[i][j]);
}
}
createOrUpdateList(arr).then(res => {
createOrUpdateList(arr).then((res) => {
if (res.code === 0) {
this.showSetting = !this.showSetting
this.$modal.msgSuccess("操作成功")
this.getList() //
this.showSetting = !this.showSetting;
this.$modal.msgSuccess('操作成功');
this.getList(); //
}
})
});
},
//
chooseTeam(value) {
if (this.showSetting) {
this.$modal.msgWarning("当前处于设置模式")
return false
}
this.chooseObj = value
this.chooseTip = value.startDay + value.classesId //
this.jumpDisabled = false //
},
//
schedulingBtn() {
let tempData = this.list
// 1
if (this.list[1][0].teamId) {
let tempArr = Object.values(this.list)
let arr = []
let n = 0
for (let i = 0; i < tempArr.length; i++) {
if (n > 0) {
break;
}
for (let j = 0; j < tempArr[i].length; j++) {
if (tempArr[i][j].teamId) {
arr.push(tempArr[i][j].teamId)
} else {
n++
}
}
}
let tempNum = 0
for (let k = 0; k < tempArr.length; k++) {
for (let v = 0; v < tempArr[k].length; v++) {
let t = tempNum % arr.length
if (arr.length === 1) {
tempData[k+1][v].teamId = arr[0]
} else {
tempData[k+1][v].teamId = arr[t]
}
tempNum++
}
}
this.list = []
this.list = tempData
} else {
// 1,
// console.log(moment(this.startDay).format("YYYY-MM-DD"))
autoSet({
year: this.year,
month: moment(this.startDay).month() + 1
}).then(res => {
this.list = res.data || {}
})
}
// if (this.showSetting) {
// this.$modal.msgWarning('');
// return false;
// }
this.chooseObj = value;
this.chooseTip = value.startDay + value.classesId; //
this.jumpDisabled = false; //
},
//
settingBtn() {
let nowMonth = moment().startOf('month').valueOf()
let startMonth = moment(this.startDay).valueOf()
let nowDate = moment(new Date()).date()
let sumDate = moment().daysInMonth()
if (nowMonth > startMonth) { //
this.settingBtnDis = true
let nowMonth = moment().startOf('month').valueOf();
let startMonth = moment(this.startDay).valueOf();
let nowDate = moment(new Date()).date();
let sumDate = moment().daysInMonth();
if (nowMonth > startMonth) {
//
this.settingBtnDis = true;
} else {
if (nowDate < sumDate) {
this.settingBtnDis = false
this.settingBtnDis = false;
} else {
this.settingBtnDis = true
this.settingBtnDis = true;
}
}
},
//
clearChoose() {
this.chooseObj = {}
this.chooseTip = ""
this.jumpDisabled = true
this.chooseObj = {};
this.chooseTip = '';
this.jumpDisabled = true;
},
//
toggleMonth() {
this.year = moment(this.startDay).format("YYYY")
let month = Number(moment(this.startDay).format("MM"))
this.month = this.monthList[month - 1]
this.year = moment(this.startDay).format('YYYY');
let month = Number(moment(this.startDay).format('MM'));
this.month = this.monthList[month - 1];
},
// 3
toOtherPage(val) {
switch (val) {
case '1':
this.$router.push({
path: '/core/enhance/product-line-24h?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
})
break;
case '2': //
this.$router.push({
// path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
})
break;
default:
this.$router.push({
path: '/quality/base/quality-inspection-data/detection-information/statistical-data?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
// name: 'QualityStatistics',
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
})
}
}
}
}
},
};
</script>
<style lang='scss'>
<style lang="scss">
.demo-form-inline {
.el-date-editor .el-range__icon {
font-size: 16px;
color: #0B58FF;
color: #0b58ff;
}
.el-input__prefix .el-icon-date {
font-size: 16px;
color: #0B58FF;
color: #0b58ff;
}
}
.groupTeamScheduling {
background-color: #F2F4F9;
background-color: #f2f4f9;
.operationArea {
padding: 14px 10px 0 16px;
margin-bottom: 8px;
@ -327,7 +362,7 @@ export default {
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
margin-top: 10px;
@ -336,7 +371,7 @@ export default {
display: inline-block;
width: 1px;
height: 24px;
background: #E8E8E8;
background: #e8e8e8;
vertical-align: middle;
}
.el-form-item {
@ -366,7 +401,8 @@ export default {
}
.el-calendar-table__row {
height: 133px;
.prev, .next {
.prev,
.next {
pointer-events: none;
}
.el-calendar-day {
@ -383,10 +419,13 @@ export default {
}
}
}
.team-active {//
border:2px solid red
.team-active {
//
border: 2px solid #409eff;
}
.class1, .class2, .class3 {
.class1,
.class2,
.class3 {
padding: 0;
font-weight: 600;
margin-bottom: 2px;
@ -430,47 +469,50 @@ export default {
}
.class1 {
.selectDiv {
.toggle-icon, .toggle-icon-hide {
background-color: #FACE00;
.toggle-icon,
.toggle-icon-hide {
background-color: #face00;
}
.el-input--small .el-input__inner {
color: #E7A200;
background-color: #FFEFC0;
color: #e7a200;
background-color: #ffefc0;
}
}
.labelClass {
color: #E7A200;
background-color: #FFEFC0;
color: #e7a200;
background-color: #ffefc0;
}
}
.class2 {
.selectDiv {
.toggle-icon, .toggle-icon-hide {
background-color: #3984FF;
.toggle-icon,
.toggle-icon-hide {
background-color: #3984ff;
}
.el-input--small .el-input__inner {
color: #2D7BFF;
background-color: #BEEAFF;
color: #2d7bff;
background-color: #beeaff;
}
}
.labelClass {
color: #2D7BFF;
background-color: #BEEAFF;
color: #2d7bff;
background-color: #beeaff;
}
}
.class3 {
.selectDiv {
.toggle-icon, .toggle-icon-hide {
background-color: #37D97F;
.toggle-icon,
.toggle-icon-hide {
background-color: #37d97f;
}
.el-input--small .el-input__inner {
color: #129F51;
background-color: #E0FFEE;
color: #129f51;
background-color: #e0ffee;
}
}
.labelClass {
color: #129F51;
background-color: #E0FFEE;
color: #129f51;
background-color: #e0ffee;
}
}
}

View File

@ -0,0 +1,260 @@
<!--
* @Author: zwq
* @Date: 2024-07-10 13:43:41
* @LastEditors: zwq
* @LastEditTime: 2024-07-15 16:00:36
* @Description:
-->
<template>
<el-form ref="form" :rules="rules" label-width="110px" :model="form">
<el-row>
<el-col :span="12">
<el-form-item label="部门名称" prop="deptId">
<el-select
v-model="form.deptId"
filterable
clearable
style="width: 100%"
placeholder="请选择部门">
<el-option
v-for="item in deptArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划名称" prop="name">
<el-input v-model="form.name" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="相关班组" prop="teamIdList">
<el-select
v-model="form.teamIdList"
filterable
clearable
multiple
style="width: 100%"
placeholder="请选择班组">
<el-option
v-for="item in teamList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="相关班次" prop="classesIdList">
<el-select
v-model="form.classesIdList"
filterable
clearable
multiple
style="width: 100%"
placeholder="请选择班次">
<el-option
v-for="item in classList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否生产班组" prop="isProduction">
<el-radio-group v-model="form.isProduction">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24" v-show="form.isProduction">
<tree-transfer
:title="title"
:from_data="fromData"
:to_data="toData"
@add-btn="add"
@remove-btn="remove"
pid="productionLineId"
:defaultProps="{ label: 'name' }"
height="450px"
:mode="mode"
filter
openAll></tree-transfer>
</el-col>
</el-row>
</el-form>
</template>
<script>
import {
getGroupPlan,
updateGroupPlan,
createGroupPlan,
getGroupPlanTree,
createGroupPlanLine,
updateGroupPlanLine,
getGroupPlanLine,
getLoginUserDeptId,
} from '@/api/base/groupSchedulingPlan';
import { listDept } from '@/api/system/dept';
import { listEnabled } from '@/api/base/groupTeam';
import { listClassesEnabled } from '@/api/base/groupClasses';
import treeTransfer from 'el-tree-transfer';
export default {
components: { treeTransfer },
name: '',
data() {
return {
form: {
id: '',
name: '',
deptId: '',
teamIdList: [],
classesIdList: [],
remark: '',
isProduction: false,
},
deptArr: [], //
teamList: [], //
classList: [], //
rules: {
name: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
deptId: [{ required: true, message: '请选择部门', trigger: 'change' }],
teamIdList: [
{ required: true, message: '请选择相关班组', trigger: 'change' },
],
classesIdList: [
{ required: true, message: '请选择相关班次', trigger: 'change' },
],
},
title: ['待选', '已选'], // Array false ["", ""]
mode: 'transfer',
fromData: [], //
toData: [], //
};
},
methods: {
init(id) {
this.form.id = id || undefined;
this.fromData = [];
this.toData = [];
this.getArr();
this.$nextTick(() => {
this.$refs['form'].resetFields();
if (this.form.id) {
getGroupPlan(id).then((response) => {
this.form = response.data;
if (this.form.isProduction) {
getGroupPlanLine(id).then((res) => {
this.toData = res.data ? res.data.datas : [];
this.getFilterLeftData(this.fromData, this.toData); //bug
});
}
});
} else {
getLoginUserDeptId().then((res) => {
this.form.deptId = res.data;
});
}
});
},
getArr() {
listDept().then((response) => {
this.deptArr = response.data;
});
listEnabled().then((res) => {
this.teamList = res.data || [];
});
listClassesEnabled().then((res) => {
this.classList = res.data || [];
});
getGroupPlanTree().then((res) => {
this.fromData = res.data;
this.fromData.forEach((item) => {
item.productionLineId = 0;
});
});
},
// 穿
add(fromData, toData, obj) {
console.log('fromData:', fromData);
console.log('toData:', toData);
},
// 穿
remove(fromData, toData, obj) {
console.log('fromData:', fromData);
console.log('toData:', toData);
},
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id) {
//
updateGroupPlan({ ...this.form }).then((res) => {
if (res.code === 0) {
if (this.form.isProduction) {
const params = {
planId: this.form.id,
list: this.toData,
};
updateGroupPlanLine(params).then((res) => {
this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit');
});
}
}
});
} else {
createGroupPlan({ ...this.form }).then((res) => {
if (res.code === 0) {
if (this.form.isProduction) {
const params = {
planId: res.data,
list: this.toData,
};
createGroupPlanLine(params).then((res) => {
this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit');
});
}
}
});
}
} else {
return false;
}
});
},
formClear() {
this.$refs.form.resetFields();
},
/** 消除组件左边与右边选中数据相同项 */
//
getFilterLeftData(data, selData) {
for (let i = data.length - 1; i >= 0; i--) {
for (let j = selData.length - 1; j >= 0; j--) {
if (data[i] && data[i].id === selData[j].id) {
// id
if (!data[i].children) {
data.splice(i, 1);
} else {
this.getFilterLeftData(data[i].children, selData[j].children);
}
}
}
}
},
},
};
</script>

View File

@ -0,0 +1,233 @@
<!--
* @Author: zwq
* @Date: 2024-07-10 11:08:48
* @LastEditors: zwq
* @LastEditTime: 2024-07-12 16:19:28
* @Description:
-->
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<schedulingPlanConfigAdd ref="classList" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import {
getGroupPlanPage,
deleteGroupPlan,
} from '@/api/base/groupSchedulingPlan';
import { listDept } from '@/api/system/dept';
import schedulingPlanConfigAdd from './components/schedulingPlanConfigAdd.vue';
const tableProps = [
{
prop: 'deptName',
label: '部门名称',
},
{
prop: 'name',
label: '计划名称',
},
{
prop: 'str',
label: '产线及工段',
minWidth: 200,
},
{
prop: 'teamName',
label: '班组名称',
},
{
prop: 'classesName',
label: '班次名称',
},
];
export default {
name: 'schedulingPlanConfig',
components: { schedulingPlanConfigAdd },
data() {
return {
formConfig: [
{
type: 'select',
label: '部门名称',
selectOptions: [],
param: 'deptId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '计划名称',
placeholder: '计划名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:group-scheduling-plan:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-scheduling-plan:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:group-scheduling-plan:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
//
addOrEditTitle: '',
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
},
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
listDept().then((response) => {
this.formConfig[0].selectOptions = response.data;
});
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.name = val.name || undefined;
this.queryParams.deptId = val.deptId || undefined;
this.getList();
break;
default:
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.classList.init();
});
}
},
/** 查询列表 */
getList() {
getGroupPlanPage(this.queryParams).then((res) => {
if (res.code === 0 && res.data.list && res.data.list.length > 0) {
res.data.list.forEach(item => {
if(item.isProduction){
item.str = item.strList?item.strList.join(','):'-'
}
});
this.list = res.data.list;
this.total = res.data.total;
} else {
this.list = [];
this.total = 0;
}
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.classList.init(val.data.id);
});
this.centervisible = true;
break;
default:
this.handleDelete(val.data);
}
},
handleCancel() {
this.$refs.classList.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.classList.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
/** 删除按钮操作 */
handleDelete(row) {
let _this = this;
_this.$modal
.confirm('是否确认删除名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupPlan(row.id);
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
},
};
</script>

View File

@ -0,0 +1,280 @@
<!--
* @Author: zwq
* @Date: 2024-07-11 09:30:21
* @LastEditors: zwq
* @LastEditTime: 2024-07-12 16:09:46
* @Description:
-->
<template>
<el-form ref="form" :rules="rules" label-width="110px" :model="form">
<el-row>
<el-col :span="12">
<el-form-item label="排班开始日期" prop="startDay">
<el-date-picker
v-model="form.startDay"
type="datetime"
placeholder="选择日期时间"
label-format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排班结束日期" prop="endDay">
<el-date-picker
v-model="form.endDay"
type="datetime"
placeholder="选择日期时间"
label-format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排班计划" prop="planId">
<el-select
v-model="form.planId"
filterable
clearable
@change="setTableArr"
style="width: 100%"
placeholder="请选择排班计划">
<el-option
v-for="item in planArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<div class="min-title">班组上班顺序</div>
<base-table
border
:table-props="tableProps"
:table-data="tableData"
:page="1"
:limit="100"
:height="300"
@emitButtonClick="addNew"
@emitFun="inputChange"
:add-button-show="addButtonShow">
<method-btn
slot="handleBtn"
:width="60"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</el-col>
</el-row>
</el-form>
</template>
<script>
import {
getGroupRule,
updateGroupRule,
createGroupRule,
} from '@/api/base/groupSchedulingRule';
import {
groupPlanList,
groupPlanTeamList,
groupPlanClassesList,
} from '@/api/base/groupSchedulingPlan';
import tableSelect from './tableSelect';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'classesId',
label: '班次',
classesArr: [],
subcomponent: tableSelect,
},
{
prop: 'teamId',
label: '班组',
teamArr: [],
subcomponent: tableSelect,
},
];
export default {
name: 'schedulingRuleConfigAdd',
data() {
return {
form: {
id: '',
startDay: '',
endDay: '',
planId: '',
remark: '',
},
tableBtn,
tableProps,
tableData: [],
addButtonShow: '',
planArr: [], //
rules: {
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
startDay: [
{ required: true, message: '请选择排班开始时间', trigger: 'change' },
],
endDay: [
{ required: true, message: '请选择排班结束时间', trigger: 'change' },
],
},
};
},
methods: {
init(id) {
this.form = {
id: id || undefined,
startDay: '',
endDay: '',
planId: '',
remark: '',
};
this.getArr();
this.tableData = [];
this.$nextTick(() => {
this.$refs['form'].resetFields();
if (this.form.id) {
getGroupRule(id).then((response) => {
this.form = response.data;
this.getTableArr(response.data.planId);
this.tableData = [];
});
}
});
},
getArr() {
groupPlanList().then((res) => {
this.planArr = res.data || [];
});
},
setTableArr() {
if (this.form.planId) {
this.tableData = [];
this.getTableArr(this.form.planId);
} else {
this.tableData = [];
this.addButtonShow = '';
}
},
async getTableArr(id) {
//
this.addButtonShow = '新增';
const res0 = await groupPlanClassesList(id);
this.tableProps[0].classesArr = res0.data || [];
const res1 = await groupPlanTeamList(id);
this.tableProps[1].teamArr = res1.data || [];
if (this.form.id) {
//
this.form.sequenceList.forEach((item) => {
this.tableData.push(item);
});
}
},
inputChange(data) {
this.tableData[data._pageIndex - 1][data.prop] = data[data.prop];
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.tableData.splice(raw.data._pageIndex - 1, 1);
this.tableData.forEach((item, index) => {
item.sequence = index;
});
console.log(this.tableData);
})
.catch(() => {});
}
},
//
addNew() {
this.tableData.push({ sequence: this.tableData.length });
},
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id) {
//
let list = [];
this.tableData.forEach((item) => {
const obj = {
classesId: item.classesId,
sequence: item.sequence,
teamId: item.teamId,
};
list.push(obj);
});
this.form.list = list;
updateGroupRule({ ...this.form }).then((res) => {
this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit');
});
} else {
let list = [];
this.tableData.forEach((item) => {
const obj = {
classesId: item.classesId,
sequence: item.sequence,
teamId: item.teamId,
};
list.push(obj);
});
this.form.list = list;
createGroupRule({ ...this.form }).then((res) => {
this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit');
});
}
} else {
return false;
}
});
},
formClear() {
this.$refs.form.resetFields();
},
},
};
</script>
<style scoped>
.min-title {
margin-bottom: 5px;
}
.min-title::before {
content: '';
display: inline-block;
vertical-align: middle;
width: 6px;
height: 6px;
border-radius: 50%;
margin: auto 5px;
background-color: #0b58ff;
}
</style>

View File

@ -0,0 +1,44 @@
<template>
<div class="tableInner">
<el-select :key="itemProp+list._pageIndex" v-model="list[itemProp]" @change="changeInput">
<el-option
v-for="item in itemProp==='classesId'?list.classesArr:list.teamArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'tableSelect',
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
};
},
methods: {
changeInput() {
this.$emit('emitData', this.list);
},
},
};
</script>
<style scoped>
.tableInner >>> .el-input__inner {
color: #409EFF;
border: 1px rgb(232, 231, 231) solid;
padding: 0;
text-align: center;
height: 30px;
}
</style>

View File

@ -0,0 +1,261 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<schedulingRuleConfigAdd ref="classList" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import {
getGroupRulePage,
deleteGroupRule,
updateGroupRule,
getGroupRule,
} from '@/api/base/groupSchedulingRule';
import schedulingRuleConfigAdd from './components/schedulingRuleConfigAdd.vue';
import { formatDate } from '@/utils';
const tableProps = [
{
prop: 'enableTimeStr',
label: '排班日期',
minWidth: 200,
},
{
prop: 'planName',
label: '排班计划',
},
{
prop: 'str',
label: '排班规则',
minWidth: 100,
},
{
prop: 'enabled',
label: '状态',
filter: (val) => (val ? '正常' : '作废'),
},
];
export default {
name: 'schedulingRuleConfig',
components: { schedulingRuleConfigAdd },
data() {
return {
formConfig: [
{
type: 'input',
label: '班次',
placeholder: '班次',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:group-scheduling-rule:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-scheduling-rule:cancel')
? {
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'enabled',
value: 0,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:group-scheduling-rule:update')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'enabled',
value: 0,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:group-scheduling-rule:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
//
addOrEditTitle: '',
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
},
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.classesName = val.name || undefined;
this.getList();
break;
default:
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.classList.init();
});
}
},
/** 查询列表 */
getList() {
getGroupRulePage(this.queryParams).then((res) => {
if (res.code === 0 && res.data.list && res.data.list.length > 0) {
res.data.list.map((item) => {
item.enableTimeStr =
formatDate(item.startDay) +
'至' +
(item.endDay ? formatDate(item.endDay) : '永久');
item.str = item.strList.join(',');
});
this.list = res.data.list;
this.total = res.data.total;
} else {
this.list = [];
this.total = 0;
}
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.classList.init(val.data.id);
});
this.centervisible = true;
break;
case 'cancel':
this.discard(val.data);
break;
default:
this.handleDelete(val.data);
}
},
handleCancel() {
this.$refs.classList.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.classList.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
discard(row) {
let _this = this
this.$modal
.confirm('是否确认作废序号为"' + row._pageIndex + '"的数据项?')
.then(() => {
getGroupRule(row.id).then((response) => {
let datas = response.data;
datas.list = datas.sequenceList;
datas.enabled = 0;
updateGroupRule(datas).then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
});
});
})
.catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除序号为"' + row._pageIndex + '"的数据项?')
.then(function () {
return deleteGroupRule(row.id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
},
};
</script>

View File

@ -36,8 +36,8 @@ export default {
minWidth: 150
},
{
prop: 'workOrderList',
label: '生产工单'
prop: 'specifications',
label: '产品规格'
}
],
tableData: [],
@ -147,8 +147,8 @@ export default {
minWidth: 150
},
{
prop: 'workOrderList',
label: '生产工单'
prop: 'specifications',
label: '产品规格'
}
]
}

View File

@ -1,93 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-20 15:23:59
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废原因编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入报废原因编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废原因" prop="content">
<el-input v-model="dataForm.content" placeholder="请输入报废原因" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报废类型" prop="typeId">
<el-select v-model="dataForm.typeId" placeholder="请选择报废类型">
<el-option v-for="dict in typeList" :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="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import { createQualityScrapDet, updateQualityScrapDet, getQualityScrapDet, getCode } from "@/api/base/qualityScrapDet";
import { getList,} from "@/api/base/qualityScrapType";
// import { getMaterialList } from "@/api/base/material";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapDet,
updateURL: updateQualityScrapDet,
infoURL: getQualityScrapDet,
},
typeList:[],
dataForm: {
id: undefined,
code: undefined,
content: undefined,
typeId:null,
// description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
code: [{ required: true, message: "报废原因编码不能为空", trigger: "blur" }],
content: [{ required: true, message: "报废原因不能为空", trigger: "blur" }],
typeId: [{ required: true, message: "报废类型不能为空", trigger: "change" }],
}
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
},
methods: {
async getDict() {
//
const res = await getList();
this.typeList = res.data;
},
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -1,209 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-21 14:11:18
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="工单号" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号">
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组" prop="teamId">
<el-select v-model="dataForm.teamId" placeholder="请选择班组">
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="num">
<el-input v-model="dataForm.num" placeholder="请输入数量" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线">
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因">
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="来源" prop="source">
<el-select v-model="dataForm.source" placeholder="请选择来源">
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
import { getList,} from "@/api/base/qualityScrapType";
// import { getMaterialList } from "@/api/base/material";
import moment from 'moment';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: false,
// codeURL: getCode,
createURL: createQualityScrapLog,
updateURL: updateQualityScrapLog,
infoURL: getQualityScrapLog,
},
lineList:[],
typeList: [],
workOrderList: [],
detList:[],
teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
}
],
dataForm: {
id: undefined,
logTime: undefined,
source:1,
detId: undefined,
workOrderId: null,
teamId: undefined,
num: undefined,
lineId:undefined,
description:undefined,
// description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
}
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
this.getCurrentTime()
},
methods: {
getCurrentTime() {
// new Date().Format("yyyy-MM-dd HH:mm:ss")
this.dataForm.logTime = new Date()
// this.dataForm.logTime = year + "-" + month + "-" + day;
console.log(this.dataForm.logTime);
},
async getDict() {
//
const res = await getList()
this.typeList = res.data
getWorkOrderList().then((res) => {
console.log(res);
// console.log(response);
this.workOrderList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
getLineList().then((res) => {
console.log(res);
// console.log(response);
this.lineList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
getDetList().then((res) => {
console.log(res);
// console.log(response);
this.detList = res.data.map((item) => {
return {
name: item.content,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
getTeamList().then((res) => {
console.log(res);
// console.log(response);
this.teamList = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -1,222 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-07 19:38:13
* @LastEditors: zhp
* @Description:
-->
<template>
<el-dialog :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<small-title slot="title" :no-padding="true">
{{ '详情' }}
</small-title>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="auto">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="工单号" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号" disabled>
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组" prop="teamId">
<el-select v-model="dataForm.teamId" placeholder="请选择班组" disabled>
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="sum">
<el-input v-model="dataForm.sum" placeholder="请输入数量" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线" disabled>
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" disabled>
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" disabled
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="来源" prop="source">
<el-select v-model="dataForm.source" placeholder="请选择来源" disabled>
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" disabled />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
import { getList,} from "@/api/base/qualityScrapType";
import SmallTitle from './SmallTitle';
export default {
components: {
SmallTitle,
},
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: false,
// codeURL: getCode,
createURL: createQualityScrapLog,
updateURL: updateQualityScrapLog,
infoURL: getQualityScrapLog,
},
lineList:[],
typeList: [],
workOrderList: [],
detList:[],
teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
}
],
dialogVisible:false,
dataForm: {
id: undefined,
logTime: undefined,
source:1,
detId: undefined,
workOrderId: null,
teamId: undefined,
num: undefined,
lineId:undefined,
description:undefined,
// description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
}
};
},
mounted() {
// this.getDict()
console.log('我看看', this.dataForm)
this.getCurrentTime()
},
methods: {
init() {
this.dialogVisible = true
},
getCurrentTime() {
// new Date().Format("yyyy-MM-dd HH:mm:ss")
this.dataForm.logTime = new Date()
// this.dataForm.logTime = year + "-" + month + "-" + day;
console.log(this.dataForm.logTime);
},
// async getDict() {
// //
// const res = await getList()
// this.typeList = res.data
// getWorkOrderList().then((res) => {
// console.log(res);
// // console.log(response);
// this.workOrderList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getLineList().then((res) => {
// console.log(res);
// // console.log(response);
// this.lineList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getDetList().then((res) => {
// console.log(res);
// // console.log(response);
// this.workOrderList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getTeamList().then((res) => {
// console.log(res);
// // console.log(response);
// this.teamList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// },
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -1,213 +0,0 @@
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
@pagination="getDataList" />
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel" width="50%">
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update>
</base-dialog>
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import DetailOrUpdate from './detail-or-updata';
import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter';
import {
getQualityScrapLogPage,
deleteQualityScrapLog,
getWorkOrderList,
getTeamList
} from '@/api/base/qualityScrapLog';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'workOrderName',
label: '工单'
},
{
prop: 'teamId',
label: '班组'
},
{
prop: 'detContent',
label: '报废原因'
},
{
prop: 'logTime',
label: '报废时间',
filter: parseTime
},
{
prop: 'num',
label: '数量'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getQualityScrapLogPage,
deleteURL: deleteQualityScrapLog,
// exportURL: exportFactoryExcel,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:quality-scrap-log:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:quality-scrap-log:detail`)
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`base:quality-scrap-log:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
detailOrUpdateVisible:false,
formConfig: [
{
type: 'select',
label: '工单',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
},
{
type: 'select',
label: '班组',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'teamId',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
DetailOrUpdate
},
created() {
this.getDict()
},
methods: {
otherMethods(val) {
if (val.type === 'detail') {
this.detailOrUpdateVisible = true;
// this.addOrEditTitle = "";
this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id, true);
});
}
},
//
getDict() {
getWorkOrderList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[0].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
getTeamList().then((res) => {
console.log(res);
// console.log(response);
this.formConfig[1].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
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.workOrderId = val.workOrderId ? val.workOrderId : undefined;
this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -1,86 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-24 08:42:18
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="报废类型编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废类型" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="描述类型" prop="description">
<el-input v-model="dataForm.description" clearable placeholder="描述类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../../core/mixins/basic-add';
import { createQualityScrapType, updateQualityScrapType, getQualityScrapType, getCode } from "@/api/base/qualityScrapType";
// import { getMaterialList } from "@/api/base/material";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createQualityScrapType,
updateURL: updateQualityScrapType,
infoURL: getQualityScrapType,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
code: [{ required: true, message: "报废类型编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "报废类型不能为空", trigger: "blur" }],
}
};
},
mounted() {
// this.getDict()
console.log('我看看', this.dataForm)
},
methods: {
// async getDict() {
// //
// const res = await getMaterialList();
// this.materialList = res.data;
// },
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -7,23 +7,39 @@
<template>
<div style="flex: 1; display: flex; background: #f2f4f9">
<div class="app-container" style="
<div
class="app-container"
style="
margin-right: 12px;
border-radius: 8px;
background: #fff;
padding: 0;
">
<div class="factory-list__selector" style="margin: 12px" title="点击切换工厂" @mouseenter="factoryListOpen = true"
<div
class="factory-list__selector"
style="margin: 12px"
title="点击切换工厂"
@mouseenter="factoryListOpen = true"
@mouseleave="factoryListOpen = false">
{{ currentFactory?.label || '点我选择设备' }}
<div class="factory-list__wrapper" :class="{ open: factoryListOpen }">
<ul class="factory-list" v-if="sidebarContent.length" @click.prevent="factoryChangeHandler">
<li v-for="fc in sidebarContent" :key="fc.id" :data-value="fc.id" class="factory-list__item"
<ul
class="factory-list"
v-if="sidebarContent.length"
@click.prevent="factoryChangeHandler">
<li
v-for="fc in sidebarContent"
:key="fc.id"
:data-value="fc.id"
class="factory-list__item"
:class="{ 'is-current': fc.id == currentFactory?.id }">
<span>
{{ fc.label }}
</span>
<svg-icon v-if="fc.id == currentFactory?.id" icon-class="Confirm" style="height: 14px; width: 14px" />
<svg-icon
v-if="fc.id == currentFactory?.id"
icon-class="Confirm"
style="height: 14px; width: 14px" />
</li>
</ul>
<div v-else style="color: #0008; width: 128px; text-align: center">
@ -33,8 +49,13 @@
</div>
<!-- side bar -->
<div class="side-bar__left" style="width: 240px; height: 100%">
<el-tree class="custom-tree-class" :data="currentFactory?.children" :props="treeProps" :empty-text="''"
icon-class="custom-icon-class" @node-click="handleSidebarItemClick">
<el-tree
class="custom-tree-class"
:data="currentFactory?.children"
:props="treeProps"
:empty-text="''"
icon-class="custom-icon-class"
@node-click="handleSidebarItemClick">
<!-- <div class="custom-tree-node" slot-scope="{ node, data }">
<span class="icon"></span>
<span>{{ node.label }}</span>
@ -42,30 +63,46 @@
</el-tree>
</div>
</div>
<div class="app-container equipment-process-amount" style="flex: 1; border-radius: 8px; background: #fff">
<div
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">
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick"
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick"
@select-changed="handleSearchBarChanged" />
<el-row>
<el-col class="custom-tabs">
<div v-if="tableList.length" class="tables">
<div class="custom-table" v-for="table in tableList" :key="table.key">
<div
class="custom-table"
v-for="table in tableList"
:key="table.key">
<!-- {{ JSON.stringify(spanMethod) }} -->
<base-table :key="table.key + '__basetable'" :table-props="table.tableProps"
:table-data="table.dataManager?.dataList ?? []" :span-method="spanMethod"
<base-table
:key="table.key + '__basetable'"
:table-props="table.tableProps"
:table-data="table.dataManager?.dataList ?? []"
:span-method="spanMethod"
@emitFun="(val) => handleEmitFun(table, val)"></base-table>
<pagination :key="table.key + '__pagination'" v-show="table.total > 0" :total="table.total"
:page.sync="table.pageNo" :limit.sync="table.pageSize" :page-size="table.pageSize"
:page-sizes="[1, 3, 5, 10, 20]" @pagination="
<pagination
:key="table.key + '__pagination'"
v-show="table.total > 0"
:total="table.total"
:page.sync="table.pageNo"
:limit.sync="table.pageSize"
:page-size="table.pageSize"
:page-sizes="[1, 3, 5, 10, 20]"
@pagination="
({ page, limit, current }) =>
getListFor(table, { page, limit, current })
" />
</div>
</div>
<div v-else class="no-data-bg">
</div>
<div v-else class="no-data-bg"></div>
</el-col>
</el-row>
@ -77,10 +114,7 @@
<script>
// import Graph from './graph.vue';
import {
getWorkOrderList,
getTreeData
} from '@/api/quality/deviceParameters';
import { getWorkOrderList, getTreeData } from '@/api/quality/deviceParameters';
export default {
name: 'EquipmentProcessAmount',
// components: { Graph },
@ -203,6 +237,7 @@ export default {
valueField: 'id',
param: 'workOrderId',
onchange: true,
filterable: true,
},
{
type: 'datePicker',
@ -223,9 +258,9 @@ export default {
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
{
type: 'separate',
},
// {
// type: 'button',
// btnName: '',
@ -240,12 +275,15 @@ export default {
// plain: true,
// color: 'warning',
// },
// {
// type: this.$auth.hasPermi('base:equipment-group:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
{
type: this.$auth.hasPermi('base:equipment-group:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
plain: true,
color: 'success',
},
],
tableProps: [
{ prop: 'lineName', label: '产线' },
@ -286,7 +324,7 @@ export default {
// },
},
mounted() {
this.getDict()
this.getDict();
// if (this.id) this.$set(this.queryParams, 'id', this.id);
// if (this.code)
// this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code);
@ -303,7 +341,7 @@ export default {
}
switch (param) {
case 'workOrderId':
this.getTree(value)
this.getTree(value);
break;
}
},
@ -325,12 +363,12 @@ export default {
this.searchBarFormConfig[0].selectOptions = res.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
},
buildProps(table) {
console.log('building props', table);
@ -365,7 +403,8 @@ export default {
prop: item.name,
width: 128,
});
firstLineData[item.name] = `${item.minValue ?? ''}-${item.maxValue ?? ''
firstLineData[item.name] = `${item.minValue ?? ''}-${
item.maxValue ?? ''
}${item.defaultValue != null ? '/' + item.defaultValue : ''}`;
});
return { props, firstLineData };
@ -486,17 +525,16 @@ export default {
},
async getTree(id) {
getTreeData({id:id}).then((res) => {
getTreeData({ id: id }).then((res) => {
console.log(res.data);
this.sidebarContent = res.data;
this.buildTree(res.data);
console.log('tree', this.sidebarContent);
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
// const { data } = await this.$axios('/base/core-factory/getTreeByWorkOrder');
// console.log(data)
},
handleTabClick(tab, event) {
@ -511,7 +549,7 @@ export default {
},
handleSidebarItemClick({ label, id, type }) {
this.equipmentId = id
this.equipmentId = id;
console.log('label clicked!', label, id, type);
switch (type) {
case '设备':
@ -534,13 +572,13 @@ export default {
}
},
handleEmitFun() { },
handleEmitFun() {},
},
};
</script>
<style scoped>
.side-bar__left>>>.is-current {
.side-bar__left >>> .is-current {
padding: 0;
color: #111;
/* background: #f2f4f7; */
@ -565,13 +603,13 @@ export default {
transform: translateY(0);
}
.custom-tabs>>>.el-tabs__header {
.custom-tabs >>> .el-tabs__header {
margin-bottom: 8px;
display: inline-block;
transform: translateY(-12px);
}
.custom-tabs>>>.el-tabs__item {
.custom-tabs >>> .el-tabs__item {
padding-left: 0px !important;
padding-right: 0px !important;
line-height: 36px !important;
@ -673,21 +711,24 @@ li {
font-weight: bold;
} */
.custom-tree-class>>>.el-tree-node__content {
.custom-tree-class >>> .el-tree-node__content {
width: 100%;
height: auto !important;
padding: 8px 12px !important;
}
.custom-tree-class>>>.el-tree-node__content:hover {
.custom-tree-class >>> .el-tree-node__content:hover {
background: #e3efff;
}
.custom-tree-class>>>.el-tree-node__children .el-tree-node__content {
.custom-tree-class >>> .el-tree-node__children .el-tree-node__content {
padding: 8px 18px !important;
}
.custom-tree-class>>>.el-tree-node__children .el-tree-node__children .el-tree-node__content {
.custom-tree-class
>>> .el-tree-node__children
.el-tree-node__children
.el-tree-node__content {
padding: 8px 24px !important;
}
</style>
@ -697,7 +738,8 @@ li {
margin-right: 8px;
width: 20px;
height: 20px;
background: url('../../../../assets/images/Qian.png') center center / contain no-repeat;
background: url('../../../../assets/images/Qian.png') center center / contain
no-repeat;
}
.custom-icon-class.el-tree-node__expand-icon.expanded {
@ -705,7 +747,8 @@ li {
}
.el-tree-node__children .custom-icon-class {
background: url('../../../../assets/images/tree-icon-2.png') 100% / contain no-repeat;
background: url('../../../../assets/images/tree-icon-2.png') 100% / contain
no-repeat;
}
.el-tree-node__children .el-tree-node__children .custom-icon-class {

View File

@ -1,10 +1,3 @@
<!--
filename: index.vue
author: liubin
date: 2023-09-04 09:34:52
description: 设备效率分析
-->
<template>
<div class="app-container allow-overflow">
<!-- 搜索工作栏 -->
@ -15,10 +8,7 @@
<el-row>
<el-col class="custom-tabs">
<el-tabs
v-model="activeName"
:stretch="true"
@tab-click="handleTabClick">
<el-tabs v-model="activeName" :stretch="true">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<!-- 列表 -->
<base-table
@ -27,7 +17,7 @@
:page="1"
:limit="10"
:table-data="list"
@emitFun="handleEmitFun"></base-table>
:max-height="tableH"></base-table>
</el-tab-pane>
<el-tab-pane
:label="'\u3000可视化\u3000'"
@ -74,7 +64,6 @@
v-for="item in list"
:key="item.id"
:value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div>
</div>
</div>
@ -86,40 +75,43 @@
</template>
<script>
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import PieChart from './components/pieChart.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'EfficiencyAnalysis',
mixins: [basicPageMixin],
mixins: [basicPageMixin, tableHeightMixin],
components: { PieChart },
props: {},
data() {
return {
activeName: 'table',
open: false,
visualizationOpen: false,
trendOpen: false,
// tableBtn: [
// this.$auth.hasPermi('base:equipment-group:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('base:equipment-group:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
// ].filter((v) => v),
tableProps: [
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' },
{
prop: 'factoryName',
label: '工厂',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'lineName',
label: '产线',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'sectionName',
label: '工段',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'equipmentName',
label: '设备',
minWidth: 120,
showOverflowtooltip: true,
},
{
label: '有效时间',
children: [
@ -127,12 +119,13 @@ export default {
width: 128,
prop: 'workTime',
label: '工作时长[h]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'workRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
],
},
@ -143,8 +136,14 @@ export default {
width: 128,
prop: 'stopTime',
label: '停机时长[h]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'stopRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{ width: 128, prop: 'stopRate', label: '百分比[%]' },
],
},
{
@ -154,14 +153,19 @@ export default {
width: 128,
prop: 'downTime',
label: '故障时长[h]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'downRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{ width: 128, prop: 'downRate', label: '百分比[%]' },
{
width: 128,
prop: 'timeEfficiency',
label: '时间开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
],
},
@ -172,91 +176,36 @@ export default {
width: 128,
prop: 'realProcSpeed',
label: '实际加工速度',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'designProcSpeed',
label: '理论加工速度',
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
{
width: 128,
prop: 'peEfficiency',
label: '速度开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +val.toFixed(2) : '-'),
},
],
},
{
prop: 'oee',
label: 'OEE',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
{
prop: 'teep',
label: 'TEEP',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
// {
// _action: 'view-trend',
// label: '',
// ,
// subcomponent: {
// props: ['injectData'],
// render: function (h) {
// const _this = this;
// return h(
// 'el-button',
// {
// props: { type: 'text' },
// on: {
// click: function () {
// console.log('inejctdata', _this.injectData);
// _this.$emit('emitData', {
// action: _this.injectData._action,
// // value: _this.injectData.id,
// value: _this.injectData,
// });
// },
// },
// },
// ''
// );
// },
// },
// },
],
searchBarFormConfig: [
{
type: 'select',
label: '工单',
placeholder: '请选择工单',
label: '工单名称',
param: 'workOrderId',
selectOptions: [],
filterable: true,
},
// {
// type: 'select',
// label: '线',
// placeholder: '线',
// param: 'lineId',
// selectOptions: [],
// },
//
// {
// type: 'select',
// label: '',
// param: 'dateFilterType',
// defaultSelect: 0,
// selectOptions: [
// { id: 0, name: '' },
// { id: 1, name: '' },
// ],
// index: 2,
// extraOptions: [
{
// parent: 'dateFilterType',
//
type: 'datePicker',
// label: '',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
@ -264,57 +213,27 @@ export default {
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timerange',
param: 'recordTime',
},
// {
// parent: 'dateFilterType',
// //
// type: 'datePicker',
// // label: '',
// dateType: 'date',
// placeholder: '',
// format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd',
// param: 'timeday',
// },
// ],
// },
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'visualization',
// plain: true,
// color: 'success',
// },
// {
// type: 'button',
// btnName: 'OEE',
// name: 'add',
// plain: true,
// color: 'success',
// },
// {
// type: 'button',
// btnName: 'TEEP',
// name: 'add',
// plain: true,
// color: 'warning',
// },
{
type: 'separate',
},
{
type: 'button',
btnName: '导出',
name: 'export',
plain: true,
color: 'success',
},
],
//
open: false,
//
queryParams: {
// lineId: null,
workOrderId: null,
recordTime: [],
},
@ -324,20 +243,17 @@ export default {
};
},
created() {
this.getWorkOrder()
// this.getLine();
this.getWorkOrder();
this.getList();
},
methods: {
/** 准备工厂数据 */
async getWorkOrder() {
console.log(1111);
const { code, data } = await this.$axios({
url: '/base/core-work-order/listbyfilter',
method: 'get',
});
if (code == 0) {
console.log('1111', data);
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
return {
name: item.name,
@ -346,33 +262,6 @@ export default {
});
}
},
// /** 线 */
// async getLine() {
// const { code, data } = await this.$axios({
// url: '/base/production-line/listAll',
// method: 'get',
// });
// if (code == 0) {
// this.searchBarFormConfig[1].selectOptions = data.map((item) => {
// return {
// name: item.name,
// id: item.id,
// };
// });
// }
// },
/** 覆盖 handleEmitFun 的默认实现 */
handleEmitFun({ action, value }) {
switch (action) {
case 'view-trend':
const { id } = value;
this.open = true;
this.trendOpen = true;
break;
}
},
/** 查询列表 */
async getList() {
this.loading = true;
@ -387,41 +276,17 @@ export default {
},
handleSearchBarBtnClick({ btnName, ...payload }) {
console.log('handleSearchBarBtnClick', btnName, payload);
if (btnName == 'visualization') {
//
this.visualizationOpen = true;
this.open = true;
}
console.log(btnName);
console.log(payload);
if (btnName == 'search') {
this.queryParams.workOrderId = payload.workOrderId || null;
// this.queryParams.lineId = payload.lineId || null;
if (0 == payload.dateFilterType) {
this.queryParams.recordTime = payload.timerange;
} else if (1 == payload.dateFilterType) {
this.queryParams.recordTime = [
`${payload.timeday} 00:00:00`,
`${payload.timeday} 23:59:59`,
];
}
this.queryParams.recordTime = payload.recordTime || undefined;
this.getList();
} else {
this.queryParams.recordTime = null;
console.log('导出');
}
this.getList();
},
cancel() {
this.open = false;
},
closed() {
this.visualizationOpen = false;
this.trendOpen = false;
},
submitForm() {},
handleTabClick() {},
},
};
</script>

View File

@ -1,84 +1,87 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-11-24 10:55:54
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list"
:max-height="tableH"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template>
<script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import {
getMaterialUseLogPage,
getWorkOrderList,
exportEnergyPlcExcel
exportEnergyPlcExcel,
} from '@/api/quality/materialTraceability';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'materialName',
label: '物料名称'
label: '物料名称',
showOverflowtooltip: true,
},
{
prop: 'materialCode',
label: '物料编码'
label: '物料编码',
showOverflowtooltip: true,
minWidth: 120,
},
{
prop: 'dateName',
label: '物料批次'
label: '物料批次',
showOverflowtooltip: true,
},
{
prop: 'equipName',
label: '使用设备'
label: '使用设备',
showOverflowtooltip: true,
},
{
prop: 'num',
label: '使用数量'
label: '使用数量',
showOverflowtooltip: true,
},
{
prop: 'useTime',
label: '使用时间',
filter: parseTime
filter: parseTime,
width: 160,
},
{
prop: 'userName',
label: '操作人'
label: '操作人',
showOverflowtooltip: true,
},
{
prop: 'source',
label: '数据来源',
filter: (val) => val == 1 ? '内部' : '外部'
filter: (val) => (val == 1 ? '内部' : '外部'),
},
{
prop: 'remark',
label: '备注'
}
label: '备注',
showOverflowtooltip: true,
},
];
export default {
// mixins: [basicPage],
mixins: [tableHeightMixin],
data() {
return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
heightNum: 220,
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`)
@ -93,7 +96,6 @@ export default {
btnName: '删除',
}
: undefined,
].filter((v) => v),
list: [],
listQuery: {
@ -102,66 +104,47 @@ export default {
total: 0,
workOrderId: undefined,
startTime: undefined,
endTime:undefined,
endTime: undefined,
},
formConfig: [
{
type: 'select',
label: '工单',
label: '工单名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId'
param: 'workOrderId',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
width: 250,
},
{
type: 'button',
btnName: '搜索',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
{
type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
type: this.$auth.hasPermi('monitoring:materiel-date-from:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
plain: true,
color: 'success',
},
],
};
@ -170,73 +153,60 @@ export default {
// AddOrUpdate,
},
created() {
this.getList()
this.getDict()
this.getList();
this.getDict();
},
methods: {
getList() {
getMaterialUseLogPage({ ...this.listQuery }).then(res => {
this.list = res.data || []
this.listQuery.total = res.data.total || 0
})
getMaterialUseLogPage({ ...this.listQuery }).then((res) => {
this.list = res.data || [];
this.listQuery.total = res.data.total || 0;
});
},
getDict() {
//
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
// getModelList().then((response) => {
// console.log(response);
// this.modelList = response.data
// // this.listQuery.total = response.data.total;
// })
getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
id: item.id,
};
});
console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
},
handleExport() {
//
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.$modal
.confirm('是否确认导出所有数据项?')
.then(() => {
this.exportLoading = true;
return exportEnergyPlcExcel(params);
}).then(response => {
})
.then((response) => {
this.$download.excel(response, '物料信息追溯 ');
this.exportLoading = false;
}).catch(() => { });
})
.catch(() => {});
},
buttonClick(val) {
console.log(val)
console.log(val);
if (val.btnName === 'search') {
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
// this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length != 0 ) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
this.listQuery.workOrderId = val.workOrderId
? val.workOrderId
: undefined;
if (val.timeVal && val.timeVal.length != 0) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
} else {
this.listQuery.startTime = undefined
this.listQuery.endTime = undefined
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
this.getList()
this.getList();
} else {
this.handleExport()
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
this.handleExport();
}
},
otherMethods(val) {

View File

@ -1,118 +1,126 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-11-28 10:51:44
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template>
<script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import {
getProcessTraceabilityPage,
getWorkOrderList,
getCoreProduct
// exportEnergyPlcExcel
getCoreProduct,
} from '@/api/quality/processTraceability';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [
{
prop: 'name',
label: '工单名称'
label: '工单名称',
showOverflowtooltip: true,
minWidth: 120,
},
{
prop: 'code',
label: '工单编码'
label: '工单编码',
showOverflowtooltip: true,
minWidth: 120,
},
{
prop: 'planProductName',
label: '产品名'
label: '产品名',
showOverflowtooltip: true,
},
{
prop: 'status',
label: '状态',
filter: (val) => val == 1 ? '等待' : val == 2 ? '激活' : val == 3 ? '暂停' : val == 4 ? '完成' : '作废',
filter: (val) =>
val == 1
? '等待'
: val == 2
? '激活'
: val == 3
? '暂停'
: val == 4
? '完成'
: '作废',
},
{
prop: 'startProduceTime',
label: '开始生产时间',
filter: parseTime
filter: parseTime,
width: 160,
},
{
prop: 'finishProduceTime',
label: '结束生产时间',
filter: parseTime
filter: parseTime,
width: 160,
},
{
prop: 'actualQuantity',
label: '生产数量'
label: '生产数量',
},
{
prop: 'planProductUnit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'processFlowName',
label: '工艺名称'
filter: publicFormatter('unit_dict'),
},
{
prop: 'yield',
label: '合格率'
}
label: '合格率',
filter: (val) => (val ? val.toFixed(2) + '%' : '-'),
align: 'center',
},
{
prop: 'processFlowName',
label: '工艺名称',
showOverflowtooltip: true,
},
];
export default {
// mixins: [basicPage],
mixins: [tableHeightMixin],
data() {
return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
tableProps,
tableBtn: [
// this.$auth.hasPermi(`base:packaging-print-log:update`)
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
{
type: 'processDetail',
btnName: '查看工艺详情',
},
].filter((v) => v),
list: [],
listQuery: {
pageSize: 10,
pageNo: 1,
// total: 0,
// orderName: '',
// startTime: undefined,
// endTime:undefined,
},
formConfig: [
{
type: 'select',
label: '工单',
label: '工单名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
@ -124,71 +132,40 @@ export default {
label: '工单开始时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
width: 250,
},
{
type: 'button',
btnName: '搜索',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
this.getList()
this.getDict()
this.getList();
this.getDict();
},
methods: {
getList() {
getProcessTraceabilityPage(this.listQuery).then(res => {
this.list = res.data.list || []
this.listQuery.total = res.data.total || 0
})
getProcessTraceabilityPage(this.listQuery).then((res) => {
this.list = res.data.list || [];
this.listQuery.total = res.data.total || 0;
});
},
handleClick(val) {
if (val.type === "processDetail") {
if (val.type === 'processDetail') {
console.log(val);
let specificationsData =''
let specificationsData = '';
getCoreProduct(val.data.planProductId).then((res) => {
console.log(res)
console.log(res);
this.$router.push({
path: 'process-traceability-detail',
@ -199,72 +176,34 @@ export default {
specifications: res.data.specifications,
productName: val.data.planProductName,
processFlowName: val.data.processFlowName,
// planProductId: val.data.planProductId
// equipmentName,
},
});
})
// this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
});
}
},
getDict() {
//
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
// getModelList().then((response) => {
// console.log(response);
// this.modelList = response.data
// // this.listQuery.total = response.data.total;
// })
getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => {
return {
name: item.name,
id: item.name
}
})
id: item.name,
};
});
console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
});
},
// handleExport() {
// //
// let params = { ...this.listQuery };
// params.pageNo = undefined;
// params.pageSize = undefined;
// this.$modal.confirm('?').then(() => {
// this.exportLoading = true;
// return exportEnergyPlcExcel(params);
// }).then(response => {
// this.$download.excel(response, ' ');
// this.exportLoading = false;
// }).catch(() => { });
// },
buttonClick(val) {
console.log(val)
console.log(val);
if (val.btnName === 'search') {
this.listQuery.orderName = val.orderName ? val.orderName :undefined
// this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length != 0 ) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
this.listQuery.orderName = val.orderName ? val.orderName : undefined;
if (val.timeVal && val.timeVal.length != 0) {
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
} else {
this.listQuery.startTime = undefined
this.listQuery.endTime = undefined
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
this.getList()
} else {
// this.handleExport()
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
this.getList();
}
},
otherMethods(val) {

Some files were not shown because too many files have changed in this diff Show More