projects/mes-zhp #395

Merged
juzi merged 6 commits from projects/mes-zhp into projects/mes-test 2024-09-11 14:28:12 +08:00
3 changed files with 177 additions and 183 deletions
Showing only changes of commit 9581d91c52 - Show all commits

View File

@ -6,12 +6,9 @@
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'> <el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg"> <el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable
<el-option @change="getWorkOrderMsg">
v-for="item in workOrderList" <el-option v-for="item in workOrderList" :key="item.id" :label="item.name" :value="item.id">
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -24,10 +21,7 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId"> <el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;"> <el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
<el-option <el-option v-for="item in productList" :key="item.id" :label="item.name+' | '+item.specifications"
v-for="item in productList"
:key="item.id"
:label="item.name+' | '+item.specifications"
:value="item.id"> :value="item.id">
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
@ -37,13 +31,8 @@
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划开始时间"> <el-form-item label="计划开始时间">
<el-date-picker <el-date-picker v-model="planStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
v-model="planStartTime" style="width: 100%;" placeholder="选择日期" :disabled="isBind">
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -51,34 +40,27 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划完成时间"> <el-form-item label="计划完成时间">
<el-date-picker <el-date-picker v-model="planFinishTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
v-model="planFinishTime" style="width: 100%;" placeholder="选择日期" :disabled="isBind">
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划投入数量" prop="planAssignQuantity"> <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-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind"
style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划生产数量" prop="planQuantity"> <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-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind"
style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId"> <el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;"> <el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
<el-option <el-option v-for="item in processFlowList" :key="item.id" :label="item.name" :value="item.id">
v-for="item in processFlowList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -96,10 +78,7 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="优先级" prop="priority"> <el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind"> <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option <el-option v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" :key="item.value" :label="item.label"
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
@ -108,11 +87,7 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="工单类型" prop="type"> <el-form-item label="工单类型" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind"> <el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option <el-option v-for="item in workOrderTypeList" :key="item.id" :label="item.name" :value="item.id">
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -120,11 +95,7 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="关联产线" prop="productLineId"> <el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind"> <el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option <el-option v-for="item in productLineList" :key="item.id" :label="item.name" :value="item.id">
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -136,9 +107,18 @@
<el-input v-model="form.workers" :disabled="isBind"></el-input> <el-input v-model="form.workers" :disabled="isBind"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'>
<el-form-item label="负责部门" prop="deptId">
<el-select v-model="form.deptId" placeholder="请选择关联产线" style="width: 100%;">
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity"> <el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number> <el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;">
</el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -148,6 +128,7 @@
import { getProductAll } from '@/api/base/product' import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage' import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
import { getLineAll } from '@/api/base/productionLine' import { getLineAll } from '@/api/base/productionLine'
import { listDept } from '@/api/system/dept';
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'AddWorkOrder', name: 'AddWorkOrder',
@ -162,6 +143,7 @@ export default {
planStartTime: '', planStartTime: '',
planFinishTime: '', planFinishTime: '',
planAssignQuantity: 0, planAssignQuantity: 0,
deptId:undefined,
planQuantity: 0, planQuantity: 0,
processFlowId: '', processFlowId: '',
materialMethod: 1, materialMethod: 1,
@ -171,6 +153,7 @@ export default {
workers: '', workers: '',
planAssignmentQuantity: '' planAssignmentQuantity: ''
}, },
deptList:[],
rules: { rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }], name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }], planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
@ -209,6 +192,9 @@ export default {
} }
}, },
getList() { getList() {
listDept().then(res => {
this.deptList = res.data || []
})
// //
getProductAll().then(res => { getProductAll().then(res => {
this.productList = res.data || [] this.productList = res.data || []

View File

@ -13,12 +13,9 @@
</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%;" filterable @change="selectProduct"> <el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" filterable
<el-option @change="selectProduct">
v-for="item in productList" <el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id">
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -32,23 +29,15 @@
</el-col> </el-col>
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="计划开始时间"> <el-form-item label="计划开始时间">
<el-date-picker <el-date-picker v-model="dataForm.planStartTime" type="datetime" value-format="timestamp" style="width: 100%;"
v-model="dataForm.planStartTime"
type="datetime"
value-format="timestamp"
style="width: 100%;"
placeholder="请选择计划开始时间"> placeholder="请选择计划开始时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="计划完成时间"> <el-form-item label="计划完成时间">
<el-date-picker <el-date-picker v-model="dataForm.planFinishTime" type="datetime" value-format="timestamp"
v-model="dataForm.planFinishTime" style="width: 100%;" placeholder="请选择计划完成时间">
type="datetime"
value-format="timestamp"
style="width: 100%;"
placeholder="请选择计划完成时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -56,22 +45,21 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="计划投入数量" prop="planAssignQuantity"> <el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划投入数量"></el-input-number> <el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"
placeholder="请输入计划投入数量"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="计划生产数量" prop="planQuantity"> <el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划生产数量"></el-input-number> <el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"
placeholder="请输入计划生产数量"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="关联工艺" prop="processFlowId"> <el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange"> <el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;"
<el-option @change="processFlowIdChange">
v-for="item in processFlowList" <el-option v-for="item in processFlowList" :key="item.id" :label="item.name" :value="item.id">
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -84,7 +72,8 @@
<el-radio :label="1">产品基础BOM</el-radio> <el-radio :label="1">产品基础BOM</el-radio>
<el-radio :label="2">工艺扩展BOM</el-radio> <el-radio :label="2">工艺扩展BOM</el-radio>
</el-radio-group> --> </el-radio-group> -->
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange"> <el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;"
@change="materialMethodChange">
<el-option key="1" label="产品基础BOM" :value="1" /> <el-option key="1" label="产品基础BOM" :value="1" />
<el-option key="2" label="工艺扩展BOM" :value="2" /> <el-option key="2" label="工艺扩展BOM" :value="2" />
</el-select> </el-select>
@ -93,10 +82,7 @@
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="优先级" prop="priority"> <el-form-item label="优先级" prop="priority">
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;"> <el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
<el-option <el-option v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" :key="item.value" :label="item.label"
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
@ -105,11 +91,7 @@
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="工单类型" prop="type"> <el-form-item label="工单类型" prop="type">
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;"> <el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
<el-option <el-option v-for="item in workOrderTypeList" :key="item.id" :label="item.name" :value="item.id">
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -119,11 +101,15 @@
<el-col :span='8'> <el-col :span='8'>
<el-form-item label="关联产线" prop="productLineIds"> <el-form-item label="关联产线" prop="productLineIds">
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;"> <el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
<el-option <el-option v-for="item in productLineList" :key="item.id" :label="item.name" :value="item.id">
v-for="item in productLineList" </el-option>
:key="item.id" </el-select>
:label="item.name" </el-form-item>
:value="item.id"> </el-col>
<el-col :span='8'>
<el-form-item label="负责部门" prop="deptId">
<el-select v-model="dataForm.deptId" placeholder="请选择关联产线" style="width: 100%;">
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -149,7 +135,7 @@ import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder' import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
import { getLineAll } from '@/api/base/productionLine' import { getLineAll } from '@/api/base/productionLine'
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
import { listDept } from '@/api/system/dept';
export default { export default {
name: 'AddWorkOrder', name: 'AddWorkOrder',
mixins: [basicAdd], mixins: [basicAdd],
@ -167,6 +153,7 @@ export default {
workOrderId: '', workOrderId: '',
name: '', name: '',
code: '', code: '',
deptId:undefined,
planProductId: '', planProductId: '',
specifications: '', specifications: '',
planStartTime: '', planStartTime: '',
@ -192,6 +179,7 @@ export default {
productList: [], productList: [],
processFlowList: [], processFlowList: [],
productLineList: [], productLineList: [],
deptList:[],
workOrderTypeList: [ workOrderTypeList: [
{id: 1,name:'普通'}, {id: 1,name:'普通'},
{id: 2, name:'特殊'} {id: 2, name:'特殊'}
@ -296,6 +284,9 @@ export default {
getLineAll().then(res => { getLineAll().then(res => {
this.productLineList = res.data || [] this.productLineList = res.data || []
}) })
listDept().then(res => {
this.deptList = res.data || []
})
// //
getProcessFlowList().then(res => { getProcessFlowList().then(res => {
this.processFlowList = res.data || [] this.processFlowList = res.data || []

View File

@ -60,68 +60,9 @@ import {
getConOrderList, getConOrderList,
getCoreWOList getCoreWOList
} from '@/api/base/coreWorkOrder'; } from '@/api/base/coreWorkOrder';
import { listDept } from '@/api/system/dept';
const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'name',
label: '工单名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '工单编码',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'workers',
label: '负责人',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'triggerOrigin',
label: '来源',
filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
},
{
prop: 'status',
label: '工单状态',
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'planQuantity',
label: '计划生产数量',
minWidth: 120,
},
{
prop: 'actualQuantity',
label: '实际生产数量',
minWidth: 120,
}
];
export default { export default {
mixins: [basicPage], mixins: [basicPage],
components: { components: {
@ -135,36 +76,37 @@ export default {
getDataListURL: getCoreWOPage, getDataListURL: getCoreWOPage,
deleteURL: deleteCoreWO deleteURL: deleteCoreWO
}, },
departments:[],
detailVisible: false, detailVisible: false,
departmentsLoaded: false,
materialVisible: false, materialVisible: false,
allocationVisible: false, allocationVisible: false,
tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:core-work-order:material`) // this.$auth.hasPermi(`base:core-work-order:material`)
? { // ? {
type: 'material', // type: 'material',
btnName: '原料信息', // btnName: '',
} // }
: undefined, // : undefined,
{ // {
type: 'active', // type: 'active',
btnName: '激活', // btnName: '',
showParam: { // showParam: {
type: '|', // type: '|',
data: [ // data: [
{ // {
name: 'status', // name: 'status',
type: 'equal', // type: 'equal',
value: 1 // value: 1
}, // },
{ // {
name: 'status', // name: 'status',
type: 'equal', // type: 'equal',
value: 3 // value: 3
} // }
] // ]
} // }
}, // },
{ {
type: 'pause', type: 'pause',
btnName: '暂停', btnName: '暂停',
@ -323,6 +265,77 @@ export default {
}, },
], ],
}; };
},
computed: {
tableProps() {
return [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'name',
label: '工单名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '工单编码',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'deptId',
label: '负责部门',
minWidth: 100,
showOverflowtooltip: true,
filter: (val) => {
if (this.departmentsLoaded) {
const department = this.departments.find((dept) => dept.id === val);
return department ? department.name : '';
} else {
return '';
}
},
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'triggerOrigin',
label: '来源',
filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
},
{
prop: 'status',
label: '工单状态',
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'planQuantity',
label: '计划生产数量',
minWidth: 120,
},
{
prop: 'actualQuantity',
label: '实际生产数量',
minWidth: 120,
}
];
}
}, },
mounted() { mounted() {
console.log(this.$route.query.workOrderName) console.log(this.$route.query.workOrderName)
@ -330,6 +343,10 @@ 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;
} }
listDept().then(res => {
this.departments = res.data || []
this.departmentsLoaded = true;
})
// this.getWorkOrder() // this.getWorkOrder()
this.getDataList() this.getDataList()
}, },