This commit is contained in:
helloDy 2023-11-28 18:08:39 +08:00
parent c76078214e
commit 4873f750d8
7 changed files with 158 additions and 251 deletions

View File

@ -2,23 +2,23 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-24 18:20:26 * @LastEditTime: 2023-11-28 14:09:09
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="false" :wrapper-closable="true"
class="drawer" class="drawer"
size="50%"> size="50%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ '预使用主原料信息' }} {{ '工单名称:' + dataForm.name }}
</small-title> </small-title>
<div class="content"> <div class="content">
<div style="height: 10vh"> <!-- <div style="height: 10vh">
<div style="font-size: 18px;">工单名{{ dataForm.name }}</div> <div style="font-size: 18px;">工单名{{ dataForm.name }}</div>
</div> </div> -->
<div class="attr-list"> <div class="attr-list">
<small-title <small-title
@ -30,7 +30,7 @@
<div class="action_btn"> <div class="action_btn">
<template> <template>
<span style="display: inline-block;"> <span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button> <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
</span> </span>
</template> </template>
</div> </div>
@ -55,9 +55,9 @@
@pagination="getList" /> @pagination="getList" />
</div> </div>
<div class="drawer-body__footer"> <!-- <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
</div> </div> -->
</div> </div>
<attr-add <attr-add

View File

@ -13,7 +13,7 @@
</el-col> </el-col>
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="产品名称" prop="planProductId"> <el-form-item label="产品名称" prop="planProductId">
<el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" @change="selectProduct"> <el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" filterable @change="selectProduct">
<el-option <el-option
v-for="item in productList" v-for="item in productList"
:key="item.id" :key="item.id"
@ -175,6 +175,7 @@ export default {
planQuantity: 0, planQuantity: 0,
processFlowId: '', processFlowId: '',
materialMethod: 1, materialMethod: 1,
triggerOrigin: 1,
priority: '', priority: '',
productLineIds: [], productLineIds: [],
type: '', type: '',

View File

@ -1,7 +1,7 @@
<template> <template>
<el-dialog <el-dialog
:visible.sync="visible" :visible.sync="visible"
:width="'35%'" :width="'50%'"
:append-to-body="true" :append-to-body="true"
:close-on-click-modal="false" :close-on-click-modal="false"
class="dialog"> class="dialog">
@ -17,73 +17,92 @@
ref="dataForm" ref="dataForm"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
label-width="100px" label-width="80px"
@keyup.enter.native="dataFormSubmit()"> @keyup.enter.native="dataFormSubmit()">
<el-form-item label="原料" prop="material"> <el-row :gutter="20">
<el-select <el-col :span="12">
v-model="dataForm.material" <el-form-item label="原料" prop="material">
filterable <el-select
style="width: 100%" v-model="dataForm.material"
placeholder="请选择原料"> filterable
<el-option style="width: 100%"
v-for="dict in getDictDatas('material')" placeholder="请选择原料">
:key="dict.value" <el-option
:label="dict.label" v-for="dict in getDictDatas('material')"
:value="dict.value" /> :key="dict.value"
</el-select> :label="dict.label"
</el-form-item> :value="dict.value" />
<el-form-item label="来源" prop="origin"> </el-select>
<el-select </el-form-item>
v-model="dataForm.origin" </el-col>
filterable <el-col :span="12">
style="width: 100%" <el-form-item label="来源" prop="origin">
placeholder="请选择来源"> <el-select
<el-option v-model="dataForm.origin"
v-for="dict in originList" filterable
:key="dict.value" style="width: 100%"
:label="dict.label" placeholder="请选择来源">
:value="dict.value" /> <el-option
</el-select> v-for="dict in originList"
</el-form-item> :key="dict.value"
<el-form-item label="供应商" prop="supplierId"> :label="dict.label"
<el-select :value="dict.value" />
v-model="dataForm.supplierId" </el-select>
filterable </el-form-item>
style="width: 100%" </el-col>
placeholder="请选择供应商"> </el-row>
<el-option <el-row :gutter="20">
v-for="dict in supplierList" <el-col :span="12">
:key="dict.id" <el-form-item label="供应商" prop="supplierId">
:label="dict.name" <el-select
:value="dict.id" /> v-model="dataForm.supplierId"
</el-select> filterable
</el-form-item> style="width: 100%"
<el-form-item label="批次号" prop="batch"> placeholder="请选择供应商">
<el-input <el-option
v-model="dataForm.batch" v-for="dict in supplierList"
clearable :key="dict.id"
placeholder="请输入批次号" /> :label="dict.name"
</el-form-item> :value="dict.id" />
<el-form-item label="数量" prop="num"> </el-select>
<el-input-number </el-form-item>
v-model="dataForm.num" </el-col>
clearable <el-col :span="12">
style="width: 100%" <el-form-item label="批次号" prop="batch">
placeholder="请输入数量" /> <el-input
</el-form-item> v-model="dataForm.batch"
<el-form-item label="单位" prop="unit"> clearable
<el-select placeholder="请输入批次号" />
v-model="dataForm.unit" </el-form-item>
filterable </el-col>
style="width: 100%" </el-row>
placeholder="请选择单位"> <el-row :gutter="20">
<el-option <el-col :span="12">
v-for="dict in getDictDatas('unit_dict')" <el-form-item label="数量" prop="num">
:key="dict.value" <el-input-number
:label="dict.label" v-model="dataForm.num"
:value="dict.value" /> clearable
</el-select> controls-position="right"
</el-form-item> style="width: 100%"
placeholder="请输入数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
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-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">

View File

@ -13,7 +13,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="300" :width="350"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -57,7 +57,8 @@ import {
getCoreWOPage, getCoreWOPage,
deleteCoreWO, deleteCoreWO,
statusChange, statusChange,
getConOrderList getConOrderList,
getCoreWOList
} from '@/api/base/coreWorkOrder'; } from '@/api/base/coreWorkOrder';
@ -66,19 +67,26 @@ const tableProps = [
prop: 'createTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
filter: parseTime, filter: parseTime,
'show-overflow-tooltip': true minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'name', prop: 'name',
label: '工单名称' label: '工单名称',
minWidth: 120,
showOverflowtooltip: true
}, },
{ {
prop: 'code', prop: 'code',
label: '工单编码' label: '工单编码',
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'workers', prop: 'workers',
label: '负责人' label: '负责人',
minWidth: 100,
showOverflowtooltip: true
}, },
{ {
prop: 'priority', prop: 'priority',
@ -88,7 +96,7 @@ const tableProps = [
{ {
prop: 'triggerOrigin', prop: 'triggerOrigin',
label: '来源', label: '来源',
filter: (val) => ['', 'MES', 'ERP'][val] filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
}, },
{ {
prop: 'status', prop: 'status',
@ -98,15 +106,19 @@ const tableProps = [
{ {
prop: 'planFinishTime', prop: 'planFinishTime',
label: '计划完成时间', label: '计划完成时间',
filter: parseTime filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'planQuantity', prop: 'planQuantity',
label: '计划生产数量' label: '计划生产数量',
minWidth: 120,
}, },
{ {
prop: 'actualQuantity', prop: 'actualQuantity',
label: '实际生产数量' label: '实际生产数量',
minWidth: 120,
} }
]; ];
@ -251,6 +263,16 @@ export default {
].filter((v)=>v), ].filter((v)=>v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'name',
// defaultSelect: '',
// selectOptions: [],
// allowCreate: true,
// filterable: true
// },
{ {
type: 'input', type: 'input',
label: '工单名称', label: '工单名称',
@ -308,9 +330,20 @@ export default {
this.listQuery.name = this.$route.query.workOrderName; this.listQuery.name = this.$route.query.workOrderName;
this.formConfig[0].defaultSelect = this.$route.query.workOrderName; this.formConfig[0].defaultSelect = this.$route.query.workOrderName;
} }
// this.getWorkOrder()
this.getDataList() this.getDataList()
}, },
methods: { methods: {
getWorkOrder() {
getCoreWOList().then(res => {
this.formConfig[0].selectOptions = res.data.map(item => {
return {
name: item.name,
id: item.name
}
})
})
},
refreshWorkOrder(val) { refreshWorkOrder(val) {
console.log(val) console.log(val)
if (val) { if (val) {

View File

@ -10,7 +10,7 @@
ref="drawer" ref="drawer"
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="false" :wrapper-closable="isdetail"
class="drawer" class="drawer"
size="60%"> size="60%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
@ -85,6 +85,19 @@
placeholder="选择巡检时间" /> placeholder="选择巡检时间" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="数据来源" prop="origin">
<el-select
v-model="dataForm.origin"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择数据来源">
<el-option key="1" label="手动" :value="1" />
<el-option key="2" label="自动" :value="2" />
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-form-item label="巡检内容"> <el-form-item label="巡检内容">
<base-table <base-table
@ -102,12 +115,9 @@
</el-form> </el-form>
<div class="drawer-body__footer"> <div v-if="!isdetail" class="drawer-body__footer">
<el-button type="primary" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button> <el-button type="primary" @click="goback()">取消</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
编辑
</el-button> -->
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
@ -174,6 +184,7 @@ export default {
actualTime: undefined, actualTime: undefined,
responsible: undefined, responsible: undefined,
description: undefined, description: undefined,
origin: undefined,
files: [] files: []
}, },
list: [], list: [],
@ -227,15 +238,6 @@ export default {
return this.$refs.dataForm.resetFields(args); return this.$refs.dataForm.resetFields(args);
}, },
initData() { initData() {
this.dataForm = {
id: undefined,
configId: undefined,
equipmentId: undefined,
actualTime: undefined,
responsible: undefined,
description: undefined,
files: []
}
this.list = [] this.list = []
this.file = '' this.file = ''
this.fileName = '' this.fileName = ''

View File

@ -1,148 +0,0 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
: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="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="备品备件" prop="sparePartId">
<el-select
v-model="dataForm.sparePartId"
filterable
style="width: 100%"
placeholder="请选择备品备件">
<el-option
v-for="dict in partList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</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 {
createConfigDet,
getSparePartList
} from '@/api/equipment/base/spare-parts/config';
export default {
props: {
configId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
sparePartId: ''
},
partList: [],
dataRule: {
sparePartId: [{ required: true, message: '备品备件不能为空', trigger: 'change' }]
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
const res = await getSparePartList()
this.partList = res.data
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
// this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// if (this.dataForm.id) {
// getCoreProductAttr({
// id: this.dataForm.id
// }).then((res) => {
// const { name, value } = res.data;
// this.dataForm.name = name;
// this.dataForm.value = value;
// });
// }
// });
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
// if (this.dataForm.id) {
// updateCoreProductAttr({
// ...this.dataForm,
// productId: this.productId,
// }).then((response) => {
// this.$modal.msgSuccess('');
// this.visible = false;
// this.$emit('refreshDataList');
// });
// return;
// }
//
createConfigDet({
...this.dataForm,
configId: this.configId,
}).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

@ -93,7 +93,7 @@ export default {
tableProps: [ tableProps: [
{ prop: 'configName', label: '配置名称' }, { prop: 'configName', label: '配置名称' },
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
// { prop: 'lineName', label: '' }, { prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', '自动'][val] },
// { prop: 'sectionName', label: '' }, // { prop: 'sectionName', label: '' },
{ prop: 'actualTime', label: '实际巡检时间', filter: parseTime }, { prop: 'actualTime', label: '实际巡检时间', filter: parseTime },
// { prop: 'maintenanceDetail', label: '' }, // { prop: 'maintenanceDetail', label: '' },