Merge branch 'projects/mes-test' into projects/mes-zhp

This commit is contained in:
‘937886381’ 2025-01-08 16:11:12 +08:00
commit 97acb4faac
28 changed files with 223 additions and 2257 deletions

View File

@ -27,7 +27,7 @@ export function getWorkOrderList(query) {
export function getCoreProduct(id) { export function getCoreProduct(id) {
return request({ return request({
url: '/base/core-product/get?id=' + id, url: '/base/core-product-material/get?id=' + id,
method: 'get' method: 'get'
}) })
} }

View File

@ -44,11 +44,7 @@ export function updateRole(data) {
} }
// 角色状态修改 // 角色状态修改
export function changeRoleStatus(id, status) { export function changeRoleStatus(data) {
const data = {
id,
status
}
return request({ return request({
url: '/system/role/update-status', url: '/system/role/update-status',
method: 'put', method: 'put',

View File

@ -23,7 +23,7 @@ const permission = {
state.topbarRouters = routes state.topbarRouters = routes
}, },
SET_SIDEBAR_ROUTERS: (state, routes) => { SET_SIDEBAR_ROUTERS: (state, routes) => {
console.log('==SET_SIDEBAR_ROUTERS==:',routes) // console.log('==SET_SIDEBAR_ROUTERS==:',routes)
state.sidebarRouters = routes state.sidebarRouters = routes
}, },
}, },

View File

@ -13,60 +13,6 @@
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item
label="产线"
prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<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-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-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="按钮盒识别码"
prop="buttonId"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入整数',
trigger: 'blur',
transform: (val) => Number.isInteger(Number(val)) && Number(val),
},
]">
<el-input
v-model="dataForm.buttonId"
@change="$emit('update', dataForm)"
placeholder="请输入整数" />
</el-form-item>
<el-form-item <el-form-item
label="产线" label="产线"
prop="productionLineId" prop="productionLineId"
@ -130,13 +76,22 @@
placeholder="请输入整数" /> placeholder="请输入整数" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item
label="按钮盒模式"
prop="model">
<el-input
v-model="dataForm.model"
@change="$emit('update', dataForm)"
placeholder="请输入按钮盒模式" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="按钮值" label="按钮值"
prop="keyValue" prop="keyValue"
:rules="[ :rules="[
{ required: true, message: '不能为空', trigger: 'blur' }, { required: true, message: '按钮值不能为空', trigger: 'blur' },
{ {
type: 'number', type: 'number',
message: '请输入100以内的整数', message: '请输入100以内的整数',
@ -154,17 +109,22 @@
min="0" min="0"
max="100" max="100"
@change="$emit('update', dataForm)" @change="$emit('update', dataForm)"
placeholder="请输入按钮盒模式" /> placeholder="请输入按钮" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检测内容" prop="inspectionDetId"> <el-form-item
label="检测内容"
prop="inspectionDetId"
:rules="[
{ required: true, message: '检测内容不能为空', trigger: 'blur' },
]">
<el-select <el-select
v-model="dataForm.inspectionDetId" v-model="dataForm.inspectionDetId"
placeholder="请选择检测内容" placeholder="请选择检测内容"
filterable filterable
@change="$emit('update', dataForm)"> @change="handleInspectionDetChange">
<el-option <el-option
v-for="opt in inspectionDetList" v-for="opt in inspectionDetList"
:key="opt.value" :key="opt.value"
@ -203,14 +163,9 @@ export default {
mounted() { mounted() {
this.getProductionLineList(); this.getProductionLineList();
this.getQualityInspectionDetList(); this.getQualityInspectionDetList();
// this.getWorksectionList(); if (this.dataForm.productionLineId) {
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => { this.getWorksectionList(this.dataForm.productionLineId);
// this.formLoading = false; }
// this.$emit('update', {
// ...this.dataForm,
// code,
// });
// });
}, },
watch: { watch: {
'dataForm.productionId': { 'dataForm.productionId': {
@ -279,11 +234,18 @@ export default {
this.dataForm.sectionId = null; this.dataForm.sectionId = null;
this.$emit('update', this.dataForm); this.$emit('update', this.dataForm);
}, },
async getCode(url) { async getCode(url) {
const response = await this.$axios(url); const response = await this.$axios(url);
return response.data; return response.data;
}, },
handleInspectionDetChange(id) {
this.inspectionDetList.forEach((item) => {
if (item.value == id) {
this.dataForm.inspectionDetContent = item.label;
}
});
this.$emit('update', this.dataForm);
}
}, },
}; };
</script> </script>

View File

@ -40,7 +40,7 @@
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> <DialogForm v-if="open" ref="form" v-model="form"/>
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@ -65,78 +65,6 @@ export default {
components: { DialogForm }, components: { DialogForm },
data() { data() {
return { return {
rows: [
[
{
select: true,
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionId',
rules: [
{ required: true, message: '产线不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
},
{
select: true,
label: '工段',
url: '/base/workshop-section/listAll',
prop: 'sectionId',
rules: [
{ required: true, message: '工段不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
},
],
[
{
input: true,
label: '按钮盒识别码',
prop: 'buttonId',
rules: [
{
type: 'number',
message: '请输入整数',
trigger: 'blur',
transform: (val) =>
Number.isInteger(Number(val)) && Number(val),
},
],
},
{ input: true, label: '按钮盒模式', prop: 'model' },
],
[
{
input: true,
label: '按钮值',
prop: 'keyValue',
rules: [
{
type: 'number',
message: '请输入100以内的整数',
trigger: 'blur',
transform: (val) =>
Number(val) <= 100 && Number.isInteger(+val) && Number(val),
},
],
bind: { type: 'number', min: 0, max: 100 },
},
{
select: true,
label: '检测内容',
url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
bind: {
filterable: true,
},
},
],
],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'input', type: 'input',
@ -230,6 +158,7 @@ export default {
id: null, id: null,
buttonId: null, buttonId: null,
inspectionDetId: null, inspectionDetId: null,
inspectionDetContent: null,
productionLineId: null, productionLineId: null,
sectionId: null, sectionId: null,
model: null, model: null,
@ -256,12 +185,13 @@ export default {
this.form = { this.form = {
id: null, id: null,
buttonId: null, buttonId: null,
inspectionDetId: null,
inspectionDetContent: null, inspectionDetContent: null,
productionId: null, productionLineId: null,
sectionId: null, sectionId: null,
model: null, model: null,
keyValue: null, keyValue: null,
}; },
this.resetForm('form'); this.resetForm('form');
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */

View File

@ -28,7 +28,6 @@ import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items' import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items'
import showDetail from './showDetail.vue' import showDetail from './showDetail.vue'
import { publicFormatter } from '@/utils/dict';
export default { export default {
name: 'PlanConfig', name: 'PlanConfig',

View File

@ -125,13 +125,15 @@ export default {
addButtonShow: '', addButtonShow: '',
planArr: [], // planArr: [], //
rules: { rules: {
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
startDay: [ startDay: [
{ required: true, message: '请选择排班开始时间', trigger: 'change' }, { required: true, message: '请选择排班开始时间', trigger: 'change' },
], ],
endDay: [ endDay: [
{ required: true, message: '请选择排班结束时间', trigger: 'change' }, { required: true, message: '请选择排班结束时间', trigger: 'change' },
], ],
planId:[
{ required: true, message: '请选择排班计划', trigger: 'change' },
]
}, },
}; };
}, },
@ -231,6 +233,10 @@ export default {
}; };
list.push(obj); list.push(obj);
}); });
if (list.length === 0) {
this.$modal.msgError('班组上班顺序不能为空');
return false;
}
this.form.list = list; this.form.list = list;
updateGroupRule({ ...this.form }).then((res) => { updateGroupRule({ ...this.form }).then((res) => {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess('操作成功');
@ -246,6 +252,10 @@ export default {
}; };
list.push(obj); list.push(obj);
}); });
if (list.length === 0) {
this.$modal.msgError('班组上班顺序不能为空');
return false;
}
this.form.list = list; this.form.list = list;
createGroupRule({ ...this.form }).then((res) => { createGroupRule({ ...this.form }).then((res) => {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess('操作成功');
@ -268,13 +278,8 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
.min-title::before { .min-title::before {
content: ''; content: "*";
display: inline-block; color: #ff5454;
vertical-align: middle; margin-right: 4px;
width: 6px;
height: 6px;
border-radius: 50%;
margin: auto 5px;
background-color: #0b58ff;
} }
</style> </style>

View File

@ -176,7 +176,6 @@ import {
} from "@/utils/constants"; } from "@/utils/constants";
import { getSpuSimpleList } from "@/api/mall/product/spu"; import { getSpuSimpleList } from "@/api/mall/product/spu";
import { parseTime } from "@/utils/ruoyi"; import { parseTime } from "@/utils/ruoyi";
import {changeRoleStatus} from "@/api/system/role";
export default { export default {
name: "PromotionCouponTemplate", name: "PromotionCouponTemplate",

View File

@ -1,304 +0,0 @@
<template>
<el-form ref="addWorkOrder" :rules="rules" label-width="130px" :model="form" label-position='top'>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="工单名称" prop="name" v-if='!isBind'>
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg">
<el-option
v-for="item in workOrderList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="工单编码" prop="code">
<el-input v-model="form.code" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name+' | '+item.specifications"
:value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划开始时间">
<el-date-picker
v-model="planStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="计划完成时间">
<el-date-picker
v-model="planFinishTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
<el-option
v-for="item in processFlowList"
: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='6'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled>
<el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="工单类型" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in productLineList"
: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='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers" :disabled="isBind"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
import { getLineAll } from '@/api/base/productionLine'
import moment from 'moment'
export default {
name: 'AddWorkOrder',
data() {
return {
form: {
workOrderId: '',
orderId: '',
name: '',
code: '',
planProductId: '',
planStartTime: '',
planFinishTime: '',
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
priority: '',
productLineId: [],
type: '',
workers: '',
planAssignmentQuantity: ''
},
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
},
productList: [],
processFlowList: [],
productLineList: [],
workOrderTypeList: [
{id: 1,name:'标准工单'},
{id: 2, name:'特殊工单'}
],
planStartTime: '',
planFinishTime: '',
isBind: false,
workOrderList: []
}
},
methods: {
init(data, param) {
this.form.orderId = data.id
this.getList()
if (param === 'add') {
this.isBind = false
getWorkOrderCode().then(res => {
this.form.code = res.data || ''
})
this.form.planProductId = data.planProductId
this.form.processFlowId = data.processFlowId
this.form.materialMethod = data.materialMethod
}else{//
this.isBind = true
}
},
getList() {
//
getProductAll().then(res => {
this.productList = res.data || []
})
// 线
getLineAll().then(res => {
this.productLineList = res.data || []
})
//
getProcessFlowList().then(res => {
this.processFlowList = res.data || []
})
// list
workOrderList({
status: 1
}).then(res => {
this.workOrderList = res.data || []
})
},
addWorkOrderSubmit() {
this.$refs['addWorkOrder'].validate((valid) => {
if (valid) {
if (this.isBind) {
//
orderIssue({
workOrderId: this.form.workOrderId,
orderId: this.form.orderId,
planAssignmentQuantity: this.form.planAssignmentQuantity
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功")
this.$emit('addWorkOrderSubmit')
}
})
} else {
//
let _this = this
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
orderIssue({ ..._this.form }).then(res => {
if (res.code === 0) {
_this.$modal.msgSuccess("操作成功")
let name = this.form.name
_this.$emit('addWorkOrderSubmit')
// 使
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
_this.$router.push({
path: '/core/core-work-order?workOrderName='+encodeURI(name)
})
})
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.addWorkOrder.resetFields()
this.form.materialMethod = 1
this.form.planAssignQuantity = 0
this.form.planQuantity = 0
this.planFinishTime = ''
this.planStartTime = ''
this.form.planFinishTime = ''
this.form.planStartTime = ''
this.isBind = false
},
//
getWorkOrderMsg() {
if (this.form.workOrderId) {
getWorkOrderById({id:this.form.workOrderId}).then(res => {
if (res.code === 0) {
this.form.code = res.data.code
this.form.planProductId = res.data.planProductId
this.planStartTime = res.data.planStartTime ? moment.unix(res.data.planStartTime).format('YYYY-MM-DD HH:mm:ss') : null
this.planFinishTime = res.data.planFinishTime ? moment.unix(res.data.planFinishTime).format('YYYY-MM-DD HH:mm:ss') : null
this.form.planAssignQuantity = res.data.planAssignQuantity
this.form.planQuantity = res.data.planQuantity
this.form.processFlowId = res.data.processFlowId
this.form.materialMethod = res.data.materialMethod
this.form.priority = res.data.priority ? res.data.priority + '' : ''
this.form.productLineId = res.data.productLineIds
this.form.type = res.data.type
this.form.workers = res.data.workers
}
})
}
}
}
}
</script>

View File

@ -1,293 +0,0 @@
<template>
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="订单名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="订单号" prop="code">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划加工数量" prop="planQuantity">
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable>
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name+' | '+(item.specifications || '')"
:value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="单价" prop="price">
<el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="客户" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;" clearable filterable>
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="包装规格" prop="packSpec">
<el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.PACK_SPEC)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;" clearable filterable @change="processFlowIdChange">
<el-option
v-for="item in processFlowList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" @change='materialMethodChange'>
<el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="订单计划开始时间" prop="planStartTime">
<el-date-picker
v-model="form.planStartTime"
type="datetime"
style="width: 100%;"
value-format="timestamp"
@change="timeChange"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="订单计划完成时间" prop="planFinishTime">
<el-date-picker
v-model="form.planFinishTime"
type="datetime"
style="width: 100%;"
value-format="timestamp"
@change="timeChange"
placeholder="选择日期">
</el-date-picker>
</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-row>
<!-- <el-row>
<el-col :span='24'>
<el-form-item label="描述信息" prop="description">
<el-input v-model="form.description"></el-input>
</el-form-item>
</el-col>
</el-row> -->
</el-form>
</template>
<script>
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage'
import { getProductAll } from '@/api/base/product'
import { getCustomerList } from '@/api/base/customer'
export default {
name: 'OrderAdd',
data() {
return {
form: {
id: '',
name: '',
code: '',
planQuantity: '',
planProductId: '',
price: '',
customerId: '',
priority: '',
packSpec: '',
workers: '',
processFlowId: '',
materialMethod: 1,
remark: '',
// description: '',
planStartTime: '',
planFinishTime: ''
},
rules: {
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
},
productList: [],
customerList: [],
processFlowList: [],
isEdit: false //
}
},
methods: {
init(id) {
this.getList()
if (id) {
this.isEdit = true
this.form.id = id
getOrderById({id: this.form.id}).then(res => {
if (res.code === 0) {
this.form.name = res.data.name
this.form.code = res.data.code
this.form.planQuantity = res.data.planQuantity
this.form.planProductId = res.data.planProductId
this.form.price = res.data.price
this.form.customerId = res.data.customerId
this.form.priority = res.data.priority ? res.data.priority + '' : ''
this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
this.form.workers = res.data.workers
this.form.processFlowId = res.data.processFlowId
this.form.materialMethod = res.data.materialMethod
this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
this.form.remark = res.data.remark
// this.form.description = res.data.description
}
})
} else {
this.isEdit = false
this.form.id = ''
//
getOrderCode().then(res => {
this.form.code = res.data || ''
})
}
},
getList() {
//
getProductAll().then(res => {
this.productList = res.data || []
})
//
getCustomerList().then(res => {
this.customerList = res.data || []
})
//
getProcessFlowList().then(res => {
this.processFlowList = res.data || []
})
},
timeChange() {
if (this.form.planStartTime && this.form.planFinishTime) {
if (this.form.planStartTime > this.form.planFinishTime) {
this.$modal.msgError('计划开始时间不能大于结束时间')
}
}
},
//
materialMethodChange(val) {
if (val === 2 && !this.form.processFlowId) {
this.form.materialMethod = 1
this.$modal.msgError("请先选择关联工艺");
}
},
//
processFlowIdChange(val) {
console.log(val)
if (!val) {
this.form.materialMethod = 1
}
},
submitForm() {
this.$refs['orderAddForm'].validate((valid) => {
if (valid) {
if (this.form.planStartTime && this.form.planFinishTime) {
if (this.form.planStartTime > this.form.planFinishTime) {
this.$modal.msgError('计划开始时间不能大于结束时间')
return false
}
}
// console.log(this.form)
if (this.isEdit) {
//
orderUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
this.form.status = 1
this.form.triggerOrigin = 1
orderCreate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.orderAddForm.resetFields()
this.form.materialMethod = 1
this.form.price = 0.00
this.form.planQuantity = 0
this.isEdit = false
}
}
}
</script>

View File

@ -1,470 +0,0 @@
<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="240"
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='60%'
>
<order-add ref="orderAdd" @successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
:dialogTitle="workIssueTitle"
:dialogVisible="addWorkOrdervisible"
@cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel"
width='70%'
>
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderPage, orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
import OrderAdd from './components/orderAdd'
import AddWorkOrder from './components/addWorkOrder'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '订单名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 180
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true
},
{
prop: 'triggerOrigin',
label: '来源',
filter: publicFormatter('order_Origin')
},
{
prop: 'priority',
label: '优先级',
filter: publicFormatter('order_priority')
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
},
{
prop: 'productName',
label: '产品',
showOverflowtooltip: true
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'price',
label: '单价(元)',
align: 'right'
},
{
prop: 'workOrderNum',
label: '工单数量'
}
]
export default {
name: 'OrderManage',
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
placeholder: '订单名称',
param: 'name'
},
{
type: 'select',
label: '状态',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'status'
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null,
lastIssuedTime: []
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder')
? {
type: 'add',
btnName: '新增',
showTip: '新增工单',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 1
},
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'bind',
btnName: '绑定',
showTip: '绑定工单',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 1
},
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined,
this.$auth.hasPermi('base:order-manage:edit')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
name: 'status',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:delete')
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
name: 'status',
value: 1
}
]
}
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
addWorkOrdervisible: false,
orderDetailVisible: false
}
},
components: { OrderAdd, AddWorkOrder },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
},
methods: {
getList() {
getOrderPage({...this.queryParams}).then(res => {
let arr = res.data.records || []
this.total = res.data.total || 0
if (arr.length > 0) {
customerList().then(result => {
let tempData = result.data || []
if (tempData.length > 0) {
arr.map(item => {
for (let i of tempData) {
if (item.customerId === i.id) {
item.customerId = i.name
}
}
item.price = item.price.toFixed(2)
})
this.list = arr
}
})
}else {
this.list = arr
}
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.lastIssuedTime = []
}
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderAdd.init(val.data.id)
})
break
case 'delete':
this.handleDelete(val.data)
break
case 'detail':
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
break
case 'add':
this.workIssueTitle = '新增工单'
this.addWorkOrdervisible = true
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'add')
})
break
case 'bind':
this.workIssueTitle = '绑定工单'
this.addWorkOrdervisible = true
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'bind')
})
break
case 'complete':
this.handleComplete(val.data)
break
default:
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return orderDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleComplete(val) {
this.$modal.confirm('是否确认完成订单"' + val.name + '"?').then(function() {
return orderFinish({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.orderAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.orderAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
//
addWorkOrderCancel() {
this.$refs.addWorkOrder.formClear()
this.addWorkOrdervisible = false
},
addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit()
},
addWorkOrderSubmit() {
this.addWorkOrderCancel()
this.getList()
}
// bindWorkOrderCancel() {
// this.$refs.bindWorkOrder.formClear()
// this.bindWorkOrdervisible = false
// },
// bindWorkOrderConfirm() {
// this.$refs.bindWorkOrder.bindWorkOrderSubmit()
// },
// bindWorkOrderSubmit() {
// this.bindWorkOrderCancel()
// this.getList()
// }
}
}
</script>

View File

@ -1,343 +0,0 @@
<template>
<div class="orderDetailData">
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>订单编码: {{orderMsg.code}}</span>
</div>
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='3'>
<div class="blodTip">订单名</div>
<div class="lightTip">{{orderMsg.name}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">产品信息</div>
<div class="lightTip">{{orderMsg.productName}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">产品规格</div>
<div class="lightTip">{{orderMsg.specifications}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">客户</div>
<div class="lightTip">{{orderMsg.customerName}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">包装规格</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">物料计算方式</div>
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">计划开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='3'>
<div class="blodTip">计划完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{orderMsg.planQuantity}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{orderMsg.planArea}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">预计用时()</div>
<div class="lightTip">{{ orderMsg.expectTime }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">实际完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='3'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{orderMsg.completeProp}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">废片数量</div>
<div class="lightTip">{{orderMsg.nokQuantity}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">负责人</div>
<div class="lightTip">{{orderMsg.workers}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">关联工艺</div>
<div class="lightTip">{{processFlowName}}</div>
</el-col>
</el-row>
</div>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>工单信息</span>
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps1"
:table-data="list1"
:max-height="tableH"
/>
</div>
<div class="box3">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>预计用料信息</span>
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps2"
:table-data="list2"
:max-height="tableH"
/>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { getProcessFlowList } from '@/api/base/orderManage'
const tableProps1 = [
{
prop: 'issueTime',
label: '下发时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '工单名',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'code',
label: '工单编码',
minWidth: 150
},
{
prop: 'planAssignmentQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
},
{
prop: 'actualArea',
label: '加工平方数',
width: 100
},
{
prop: 'status',
label: '状态',
filter: publicFormatter('order_status')
},
{
prop: 'startProduceTime',
label: '开始时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'finishProduceTime',
label: '结束时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'productLineNames',
label: '关联产线',
filter: (val) => val ? val.join(',') : '',
showOverflowtooltip: true
},
{
prop: 'workers',
label: '负责人'
},
{
prop: 'remark',
label: '备注'
}
]
const tableProps2 = [
{
prop: 'materialName',
label: '物料名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'num',
label: '剩余生产预计消耗'
}
]
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
export default {
name: 'OrderDetailData',
data() {
return {
orderId: '',
tableProps1,
tableProps2,
list1: [],
list2: [],
tableH: this.tableHeight(510) / 2,
//
queryParams: {
pageNo: 1,
pageSize: 500
},
orderMsg: {},
processFlowName: ''
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2
})
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg()
},
watch: {
$route: 'initData'
},
methods: {
initData(to) {
if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg()
}
},
getMsg() {
orderDetail({
id: this.orderId
}).then(res => {
this.orderMsg = res.data
this.list1 = res.data.coreWorkOrderRespVOS
bomUseNum({
productId: this.orderMsg.planProductId
}).then(res2 => {
if (res2.data && res2.data.length > 0) {
let arr = res2.data
arr.map(item => {
if (item) {
let a = item.num * this.orderMsg.remainingQuantity
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
}
})
this.list2 = arr
}else {
this.list2 = []
}
})
//
getProcessFlowList().then(res => {
let arr = res.data || []
if (arr.length > 0) {
arr.map(item => {
if (item.id === this.orderMsg.processFlowId) {
this.processFlowName = item.name
}
})
}
})
})
},
//
returnOrderManage() {
this.$router.go(-1);
}
}
}
</script>
<style lang='scss' scoped>
.orderDetailData {
background-color: rgb(242, 244, 249);
.box1, .box2, .box3 {
background-color: #fff;
border-radius: 9px;
}
.box2 {
height: calc((100vh - 360px) / 2);
padding: 12px 16px 0;
margin: 8px 0;
}
.box1 {
height: 215px;
padding: 16px 16px 0 16px;
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
}
}
.box3 {
padding: 16px;
height: calc((100vh - 360px) / 2);
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -1,168 +0,0 @@
<template>
<div>
<div class="boxTitle">
<span class="blueTitle"></span>
<span>各订单环形图</span>
</div>
<div class="chartBox" id='orderChartBox' v-show='chartList.length'>
<div class="chartItem" v-for="(item, index) in chartList" :key='index' :style="{width: 388*beilv+'px',height: 286*beilv+'px',padding:14*beilv+'px',marginRight:9*beilv+'px',marginBottom:9*beilv+'px'}">
<div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}">
<svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/>
<span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderName}}</span>
<span>订单计划数量{{item.num}}</span>
</div>
<div
:id="item.id"
:style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}"
></div>
<div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}">
<div class="legendItem" v-for="(subItem, i) in item.workOrder" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
<span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span>
<div>
<span class="itemName" :style="{fontSize: 14 * beilv + 'px'}">
<span class="smallBlock" :style="{backgroundColor:subItem.color,width:8*beilv+'px',height:8*beilv+'px'}"></span>
{{subItem.name}}
</span>
</div>
</div>
</div>
</div>
</div>
<!-- 空图 -->
<div class="no-data-bg" v-show='!chartList.length'></div>
</div>
</template>
<script>
import * as echarts from 'echarts'
import { debounce } from '@/utils/debounce'
export default {
name: 'MonitoringRingCharts',
props: {
chartList: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
myChart: [],
beilv: 1,
canvasReset: ''
}
},
mounted() {
this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610
this.canvasReset = debounce(() => {
this.initChart()
}, 500)
window.addEventListener('resize', () => {
this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610
this.canvasReset()
})
},
methods: {
//
initChart() {
if (this.chartList.length <= 0) {
return false
}
//
for (let j = 0;j < this.chartList.length; j++) {
if (this.myChart[j]) {
this.myChart[j].dispose() // Dom
}
}
for (let i = 0; i < this.chartList.length; i++) {
var chartDom = document.getElementById(this.chartList[i].id);
this.myChart[i] = echarts.init(chartDom);
let colorList = []
this.chartList[i].workOrder.map(item => {
colorList.push(item.color)
})
let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0)
var option = {
color: colorList,
series: [
{
name: 'Access From',
type: 'pie',
radius: ['75%', '95%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 5,
borderColor: '#fff',
borderWidth: 2
},
label: {
show: true,
position: 'center',
color: '#000',
formatter: [
'{a|'+percentage+'%}',
'{b|生产'+this.chartList[i].sunNum+'}'
].join('\n\n'),
rich: {
a: {
fontSize: this.beilv*24 +'px'
},
b: {
fontSize: this.beilv*12 +'px'
}
}
},
emphasis: {
disabled: true
},
labelLine: {
show: false
},
data: this.chartList[i].workOrder
}
]
};
option && this.myChart[i].setOption(option)
}
}
}
}
</script>
<style lang='scss' scoped>
.chartBox {
width: 100%;
padding-right: 6px;
height: calc(100vh - 310px);
display: flex;
flex-flow: row wrap;
overflow: auto;
align-content: flex-start;
.chartItem {
border-radius: 8px;
border: 1px solid #CACACA;
.topTitle {
margin-bottom: 10px;
.orderName {
border-right: 1px solid #CACACA;
}
}
.legend {
text-align: center;
white-space: nowrap;
overflow: auto;
.legendItem {
display: inline-block;
border-right: 1px solid #E8E8E8;
.itemName {
.smallBlock {
display: inline-block;
}
}
}
.legendItem:last-child {
border: none;
}
}
}
}
</style>

View File

@ -1,371 +0,0 @@
<template>
<div class="app-container orderMonitoring">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<el-tabs v-model="activeName" @tab-click="toggleTab">
<el-tab-pane label="数据列表" name="dataList"></el-tab-pane>
<el-tab-pane label="环形图" name="barChart"></el-tab-pane>
</el-tabs>
<!-- -->
<div v-if="activeName === 'dataList'">
<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="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getPage"
/>
</div>
<!-- -->
<monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList'/>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { orderMonitor, orderAssignmentList } from '@/api/base/orderManage'
import MonitoringRingCharts from './../components/monitoringRingCharts'
import moment from "moment"
const tableProps = [
{
prop: 'name',
label: '订单名称'
},
{
prop: 'customerName',
label: '客户'
},
{
prop: 'productname',
label: '产品'
},
{
prop: 'planStartTime',
label: '计划开始时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},
{
prop: 'startProduceTime',
label: '实际开始时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'finishProduceTime',
label: '实际完成时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'lineNames',
label: '加工线',
filter: (val) => val ? val.join(',') : '',
minWidth: 180
},
{
prop: 'planQuantity',
label: '计划生产量',
width: 100
},
{
prop: 'actualquantity',
label: '实际产出量',
width: 100
},
{
prop: 'completeRate',
label: '订单完成率',
width: 100
},
{
prop: 'workOrderNum',
label: '关联工单数量',
width: 110
}
]
export default {
name: 'OrderCompletionMonitoring',
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
param: 'name'
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
activeName: 'dataList',
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
startProduceTime: []
},
tableProps,
list: [],
tableH: this.tableHeight(305),
total: 0,
tableBtn: [
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
? {
type: 'orderDetail',
btnName: '工单',
showTip: '工单详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'workOrderNum',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
? {
type: 'qualityDetail',
btnName: '质量',
showTip: '质量详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'workOrderNum',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
? {
type: 'sendOutDetail',
btnName: '发货',
showTip: '发货详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'workOrderNum',
value: 1
}
]
}
}
: undefined
].filter((v) => v),
chartList: []
}
},
components: { MonitoringRingCharts },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(305)
})
let start = moment().subtract(30, 'days').format('yyyy-MM-DD')
let end = moment().format('yyyy-MM-DD')
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startProduceTime[0] = start + ' 00:00:00'
this.queryParams.startProduceTime[1] = end + ' 23:59:59'
this.getPage()
},
methods: {
getPage() {
//
orderMonitor({...this.queryParams}).then(res => {
this.list = res.data.records || []
this.total = res.data.total || 0
if (this.list.length > 0) {
let orderIdList = []
this.list.map(item => {
orderIdList.push(item.orderid)
})
//
orderAssignmentList({orderIdList:orderIdList}).then(res => {
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
let tempArr = res.data || {}
let tempArr2 = []
for (let key in tempArr) {
let tempArr3 = []
let obj = {}
obj.orderName = tempArr[key][0].orderName
obj.id = key
obj.num = tempArr[key][0].planQuantity
let sunNum = 0
for (let i = 0; i < tempArr[key].length; i++) {
let subObj = {}
subObj.value = tempArr[key][i].actualAssignmentQuantity
subObj.name = tempArr[key][i].woName
if (i < 5) {
subObj.color = color[i]
} else {
subObj.color = color[i%5]
}
sunNum+=tempArr[key][i].actualAssignmentQuantity
tempArr3.push(subObj)
}
tempArr3.push({
value: tempArr[key][0].planQuantity - sunNum > 0 ? tempArr[key][0].planQuantity - sunNum : 0,
name: '未下发',
color: '#F5F5F5'
})
obj.sunNum = sunNum
obj.workOrder = tempArr3
tempArr2.push(obj)
}
this.chartList = tempArr2
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart()
})
}
})
}else{
//
this.chartList = []
}
})
},
//
buttonClick(val) {
this.queryParams.name = val.name
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.startProduceTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.startProduceTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.startProduceTime = []
}
this.getPage()
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'orderDetail':
this.$router.push({
path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
})
break
case 'qualityDetail':
this.$router.push({
path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString='+val.data.woIdString
})
break
default:
this.$router.push({
path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
})
}
},
toggleTab() {
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart()
})
}
}
}
}
</script>
<style lang='scss'>
.orderMonitoring {
.el-tabs__nav::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: #e4e7ed;
}
.el-tabs__nav-wrap::after {
width: 0;
}
.el-tabs__item {
padding: 0 10px;
}
.el-tabs__item:hover {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item.is-active {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item {
color: rgba(0, 0, 0, 0.45);
}
.searchBarBox {
margin-bottom: 0;
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 16px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -172,6 +172,7 @@ export default {
query: { query: {
id: val.data.processFlowId, id: val.data.processFlowId,
orderId: val.data.id, orderId: val.data.id,
lineId: val.data.lineId,
name: val.data.name, name: val.data.name,
specifications: res.data.specifications, specifications: res.data.specifications,
productName: val.data.planProductName, productName: val.data.planProductName,

View File

@ -8,9 +8,6 @@
<template> <template>
<section class="process-bom"> <section class="process-bom">
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- <small-title :no-padding="true">
设备名称: {{ name }}
</small-title> -->
<div class="btns" style=" <div class="btns" style="
text-align: right; text-align: right;
position: absolute; position: absolute;
@ -18,14 +15,7 @@
right: 20px; right: 20px;
display: flex; display: flex;
"> ">
<!-- <el-input icon="el-icon-search" placeholder="搜索" v-model="searchText" style="margin-left: 20px">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input>
<el-button type="primary" plain :disabled="currentDet == null" class="btn-create" icon="el-icon-plus">
分配设备
</el-button> -->
</div> </div>
<!-- 列表 --> <!-- 列表 -->
<el-row> <el-row>
<div style="margin-bottom: 10px;font-size: 16px;">设备名称{{ name }}</div> <div style="margin-bottom: 10px;font-size: 16px;">设备名称{{ name }}</div>
@ -51,7 +41,6 @@
</template> </template>
<script> <script>
// import SmallTitle from './SmallTitle';
import { import {
getDetMaterial, getDetMaterial,
getDetValue getDetValue
@ -59,9 +48,6 @@ import {
import StatusBtn from './statusBtn.vue' import StatusBtn from './statusBtn.vue'
export default { export default {
name: 'ProcessBom', name: 'ProcessBom',
components: {
// SmallTitle
},
props: { props: {
currentDet: { currentDet: {
type: Object, type: Object,
@ -77,7 +63,6 @@ export default {
type: 'datePicker', type: 'datePicker',
label: '时间段', label: '时间段',
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
@ -94,13 +79,6 @@ export default {
color: 'primary', color: 'primary',
},], },],
materialTableProps: [ materialTableProps: [
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'name', label: '物料名称' }, { prop: 'name', label: '物料名称' },
{ prop: 'planNum', label: '预计使用数量' }, { prop: 'planNum', label: '预计使用数量' },
{ prop: 'actualNum', label: '实际使用数量' }, { prop: 'actualNum', label: '实际使用数量' },
@ -181,22 +159,13 @@ export default {
methods: { methods: {
handleSearchBarBtnClick(val) { handleSearchBarBtnClick(val) {
console.log(val) console.log(val)
getDetMaterial({ this.queryParams.startTime = val.timeVal.length > 0 ? val.timeVal[0] : ''
pageNo: 1, this.queryParams.endTime = val.timeVal.length > 0 ? val.timeVal[1] : ''
pageSize: 10, if (this.activeName === 'material') {
orderId: this.$route.query.orderId, this.getDetMaterialMes()
flowDetId: [this.detId], }else {
// orderId: this.$route.query.orderId, this.getDetValueMes()
}
},).then((res) => {
console.log(res);
})
// if (timeVal && timeVal.length > 0) {
// this.queryParams.time = timeVal;
// } else {
// this.queryParams.time = [];
// }
// await this.handleQuery();
}, },
handleEmitFun() { }, handleEmitFun() { },
handleTableBtnClick() { }, handleTableBtnClick() { },
@ -220,35 +189,37 @@ export default {
data: method !== 'get' ? payload : null, data: method !== 'get' ? payload : null,
}) })
}, },
handleTabClick() {
// getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
// console.log('get list')
// },
handleTabClick(val) {
// console.log(this.activeName);
if (this.activeName === 'material') { if (this.activeName === 'material') {
this.getDetMaterialMes()
} else {
this.getDetValueMes()
}
},
getList(val) {
this.getDetMaterialMes()
},
clearList() {
this.list = [];
},
getDetMaterialMes() {
getDetMaterial({ getDetMaterial({
pageNo: 1,
pageSize: 10,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
lineId: this.$route.query.lineId,
flowDetId: [this.detId], flowDetId: [this.detId],
// orderId: this.$route.query.orderId, ...this.queryParams
}).then((res) => {
},).then((res) => {
if (res.data.length != []) { if (res.data.length != []) {
this.materialList = res.data[0].data this.materialList = res.data[0].data
this.name = res.data[0].name this.name = res.data[0].name
} }
}) })
} else { },
getDetValueMes() {
getDetValue({ getDetValue({
pageNo: 1,
pageSize: 10,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
flowDetId: [this.detId], flowDetId: [this.detId],
// orderId: this.$route.query.orderId, ...this.queryParams
}).then((res) => { }).then((res) => {
if (res.data.length != []) { if (res.data.length != []) {
this.valueList = res.data[0].data this.valueList = res.data[0].data
@ -257,25 +228,6 @@ export default {
}) })
} }
}, },
getList(val) {
console.log(val);
getDetMaterial({
pageNo: 1,
pageSize: 10,
orderId: this.$route.query.orderId,
flowDetId: [this.detId],
}).then((res) => {
console.log(res);
if (res.data.length != []) {
this.materialList = res.data[0].data
this.name = res.data[0].name
}
})
},
clearList() {
this.list = [];
}
},
}; };
</script> </script>

View File

@ -71,7 +71,9 @@ export default {
}, },
mounted() { mounted() {
this.getInfo() this.getInfo()
console.log(this.$route.query) },
activated() {
this.getInfo()
}, },
computed: {}, computed: {},
methods: { methods: {

View File

@ -85,7 +85,7 @@ export default {
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '检测时间',
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
@ -182,7 +182,7 @@ export default {
checkPerson: undefined, checkPerson: undefined,
workOrderId: undefined, workOrderId: undefined,
checkTime: undefined, checkTime: undefined,
source: undefined, source: 1,
workOrderId: undefined, workOrderId: undefined,
remark: undefined, remark: undefined,
}, },
@ -257,7 +257,7 @@ export default {
sectionId: undefined, sectionId: undefined,
checkPerson: undefined, checkPerson: undefined,
checkTime: undefined, checkTime: undefined,
source: undefined, source: 1,
workOrderId: undefined, workOrderId: undefined,
remark: undefined, remark: undefined,
productionLineId: undefined, productionLineId: undefined,

View File

@ -133,8 +133,6 @@ import {
getDetList, getDetList,
getLineList, getLineList,
} from '@/api/base/qualityScrapLog'; } from '@/api/base/qualityScrapLog';
// import { getList } from '@/api/base/qualityScrapType';
import moment from 'moment';
export default { export default {
data() { data() {
return { return {
@ -166,16 +164,14 @@ export default {
}, },
dataRule: { dataRule: {
workOrderId: [ workOrderId: [
{ required: true, message: '工单不能为空', trigger: 'change' }, { required: true, message: '工单名称不能为空', trigger: 'change' },
], ],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }], num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
detId: [ detId: [
{ required: true, message: '报废原因不能为空', trigger: 'change' }, { required: true, message: '报废原因不能为空', trigger: 'change' },
], ],
logTime: [ logTime: [{ required: true, message: '报废时间不能为空', trigger: 'change' }],
{ required: true, message: '报废时间不能为空', trigger: 'change' },
],
}, },
showDetail: false, showDetail: false,
}; };
@ -193,10 +189,9 @@ export default {
console.log(res); console.log(res);
this.dataForm = res.data; this.dataForm = res.data;
this.dataForm.logTime = res.data.logTime || null; this.dataForm.logTime = res.data.logTime || null;
console.log('==================');
}); });
} else { } else {
this.dataForm.logTime = moment().format('yyyy-MM-DD hh:mm:ss'); this.dataForm.logTime = Date.now();
} }
}, },
// //

View File

@ -5,6 +5,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
export default { export default {
name: "StatusBtn2", name: "StatusBtn2",
props: { props: {
@ -15,7 +16,14 @@ export default {
}, },
computed: { computed: {
state() { state() {
return this.injectData.status === 1 ? "关闭" : "开启"; let label = ''
getDictDatas(DICT_TYPE.COMMON_STATUS).forEach((item) => {
if (parseInt(item.value) === this.injectData.status) {
label = item.label;
}
})
return label
// return this.injectData.status === 1 ? "" : "";
}, },
}, },
}; };

View File

@ -21,12 +21,12 @@
<el-table-column <el-table-column
prop="name" prop="name"
label="部门名称" label="部门名称"
width="260"></el-table-column> min-width="260"></el-table-column>
<el-table-column <el-table-column
prop="leader" prop="leader"
label="负责人" label="负责人"
:formatter="userNicknameFormat" :formatter="userNicknameFormat"
width="120" /> min-width="120" />
<el-table-column prop="sort" label="排序" width="200"></el-table-column> <el-table-column prop="sort" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100"> <el-table-column prop="status" label="状态" width="100">
<template v-slot="scope"> <template v-slot="scope">
@ -37,7 +37,7 @@
label="创建时间" label="创建时间"
align="center" align="center"
prop="createTime" prop="createTime"
width="200"> min-width="200">
<template v-slot="scope"> <template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
@ -45,32 +45,38 @@
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
width="160"
class-name="small-padding fixed-width"> class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini"
type="text" type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dept:update']">
修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)" @click="handleAdd(scope.row)"
v-hasPermi="['system:dept:create']"> v-hasPermi="['system:dept:create']">
新增 新增
</el-button> </el-button>
<span
v-hasPermi="['system:dept:update']"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
>|</span
>
<el-button
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dept:update']">
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
</el-button>
<span
v-if="scope.row.parentId !== 0"
v-hasPermi="['system:dept:delete']"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
>|</span
>
<el-button <el-button
v-if="scope.row.parentId !== 0" v-if="scope.row.parentId !== 0"
size="mini"
type="text" type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:dept:delete']"> v-hasPermi="['system:dept:delete']">
删除 <svg-icon icon-class="table_delete"></svg-icon>
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -117,9 +123,9 @@
style="width: 100%"> style="width: 100%">
<el-option <el-option
v-for="item in users" v-for="item in users"
:key="parseInt(item.id)" :key="item.id"
:label="item.nickname" :label="item.nickname"
:value="parseInt(item.id)" /> :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -316,7 +322,7 @@ export default {
return '未设置'; return '未设置';
} }
for (const user of this.users) { for (const user of this.users) {
if (row.leaderUserId === user.id) { if (row.leaderUserId == user.id) {
return user.nickname; return user.nickname;
} }
} }

View File

@ -32,10 +32,23 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button
v-hasPermi="['system:dict:update']">修改</el-button> type="text"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:delete']">删除</el-button> v-hasPermi="['system:dict:update']">
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
</el-button>
<span
v-hasPermi="['system:dict:delete']"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
>|</span
>
<el-button
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:delete']">
<svg-icon icon-class="table_delete"></svg-icon>
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -33,12 +33,25 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='100'>
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button
v-hasPermi="['system:dict:update']">修改</el-button> type="text"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:delete']">删除</el-button> v-hasPermi="['system:dict:update']">
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
</el-button>
<span
v-hasPermi="['system:dict:delete']"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
>|</span
>
<el-button
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:delete']">
<svg-icon icon-class="table_delete"></svg-icon>
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -52,31 +52,36 @@
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
width="160"
class-name="small-padding fixed-width"> class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini"
type="text" type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:menu:update']">
修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)" @click="handleAdd(scope.row)"
v-hasPermi="['system:menu:create']"> v-hasPermi="['system:menu:create']">
新增 新增
</el-button> </el-button>
<span
v-hasPermi="['system:menu:update']"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
>|</span
>
<el-button
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:menu:update']">
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
</el-button>
<span
v-hasPermi="['system:menu:delete']"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
>|</span
>
<el-button <el-button
size="mini"
type="text" type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:menu:delete']"> v-hasPermi="['system:menu:delete']">
删除 <svg-icon icon-class="table_delete"></svg-icon>
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -27,12 +27,25 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='100'>
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button
v-hasPermi="['system:post:update']">修改</el-button> type="text"
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:post:delete']">删除</el-button> v-hasPermi="['system:post:update']">
<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
</el-button>
<span
v-hasPermi="['system:post:delete']"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
>|</span
>
<el-button
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['system:post:delete']">
<svg-icon icon-class="table_delete"></svg-icon>
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -26,7 +26,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="状态" prop="status" v-if="isEdit"> <el-form-item label="状态" prop="status" v-if="isEdit">
<el-switch v-model="form.status"> </el-switch> <el-switch v-model="form.status" @change='changeStatus'> </el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -38,7 +38,7 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { addRole, getRole, updateRole } from "@/api/system/role"; import { addRole, getRole, updateRole,changeRoleStatus } from "@/api/system/role";
export default { export default {
name: "RoleAdd", name: "RoleAdd",
data() { data() {
@ -124,6 +124,18 @@ export default {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.isEdit = false; this.isEdit = false;
}, },
//
changeStatus(val) {
//
changeRoleStatus({
id: this.form.id,
status: val ? 0 : 1,
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
}
})
}
}, },
}; };
</script> </script>

View File

@ -39,7 +39,7 @@
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="50%">
<role-add ref="roleAdd" @successSubmit="successSubmit" /> <role-add ref="roleAdd" @successSubmit="successSubmit"/>
</base-dialog> </base-dialog>
<!-- 菜单权限 --> <!-- 菜单权限 -->
<base-dialog <base-dialog
@ -246,6 +246,7 @@ export default {
this.$refs.roleAdd.formClear(); this.$refs.roleAdd.formClear();
this.centervisible = false; this.centervisible = false;
this.addOrEditTitle = ''; this.addOrEditTitle = '';
this.getList();
}, },
handleConfirm() { handleConfirm() {
this.$refs.roleAdd.submitForm(); this.$refs.roleAdd.submitForm();

View File

@ -242,8 +242,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitRole"> </el-button>
<el-button @click="cancelRole"> </el-button> <el-button @click="cancelRole"> </el-button>
<el-button type="primary" @click="submitRole"> </el-button>
</div> </div>
</base-dialog> </base-dialog>
</div> </div>
@ -297,7 +297,7 @@ const tableProps = [
prop: 'dept', prop: 'dept',
label: '部门', label: '部门',
minWidth: 120, minWidth: 120,
filter: (item) => item.name || '', filter: (item) => item?.name || '',
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
@ -496,6 +496,9 @@ export default {
username: [ username: [
{ required: true, message: '用户名称不能为空', trigger: 'blur' }, { required: true, message: '用户名称不能为空', trigger: 'blur' },
], ],
deptId: [
{ required: true, message: '归属部门不能为空', trigger: 'change' },
],
nickname: [ nickname: [
{ required: true, message: '用户昵称不能为空', trigger: 'blur' }, { required: true, message: '用户昵称不能为空', trigger: 'blur' },
], ],