更新
This commit is contained in:
@@ -1,357 +1,411 @@
|
||||
<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="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; margin-top: -10px"
|
||||
@click="returnOrderManage">
|
||||
<svg-icon icon-class="return" />
|
||||
返回
|
||||
</el-button>
|
||||
<div style="padding-left: 14px; margin-top: 20px">
|
||||
<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'>
|
||||
<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">
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box2">
|
||||
<!-- <div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>工单信息</span>
|
||||
</div> -->
|
||||
<div class="toggleTabBox">
|
||||
<div :class="{ active: activeModule === 'orderInfo' }" @click="toggleTab('orderInfo')">子订单信息</div>
|
||||
<!-- <div :class="{ active: activeModule === 'useInfo' }" @click="toggleTab('useInfo')">用料信息</div> -->
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<el-row v-show="activeModule === 'orderInfo'">
|
||||
<el-col :span="6">
|
||||
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps1"
|
||||
:table-data="list1" :max-height="tableH" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <base-table v-show="activeModule === 'useInfo'" :page="queryParams.pageNo" :limit="queryParams.pageSize"
|
||||
:table-props="tableProps2" :table-data="list2" :max-height="tableH" /> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="toggleTabBox">
|
||||
<div
|
||||
:class="{ active: activeModule === 'orderInfo' }"
|
||||
@click="toggleTab('orderInfo')">
|
||||
子订单信息
|
||||
</div>
|
||||
<div
|
||||
:class="{ active: activeModule === 'useInfo' }"
|
||||
@click="toggleTab('useInfo')">
|
||||
用料信息
|
||||
</div>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<el-row v-show="activeModule === 'orderInfo'">
|
||||
<el-col :span="6">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick"></el-tree>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps1"
|
||||
:table-data="list1"
|
||||
:max-height="tableH" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<base-table
|
||||
v-show="activeModule === 'useInfo'"
|
||||
: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'
|
||||
import { orderDetail, bomUseNum, getDetailTree, getDetailTreeInfo } from '@/api/base/orderManage'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {
|
||||
getProcessFlowList,
|
||||
getOrderRemainNum,
|
||||
getMaterialCostOrder,
|
||||
} from '@/api/base/orderManage';
|
||||
import {
|
||||
orderDetail,
|
||||
bomUseNum,
|
||||
getDetailTree,
|
||||
getDetailTreeInfo,
|
||||
} 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: '备注'
|
||||
}
|
||||
]
|
||||
{
|
||||
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: '剩余生产预计消耗'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '物料名称',
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict'),
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '剩余生产预计消耗',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'OrderDetailData',
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
tableProps1,
|
||||
treeData:undefined,
|
||||
activeModule:'orderInfo',
|
||||
tableProps2,
|
||||
list1: [],
|
||||
list2: [],
|
||||
tableH: this.tableHeight(510) / 2,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 500
|
||||
},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
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: {
|
||||
toggleTab(val) {
|
||||
this.activeModule = val
|
||||
},
|
||||
handleNodeClick(val) {
|
||||
console.log(val)
|
||||
getDetailTreeInfo({
|
||||
id: val.id
|
||||
}).then(res => {
|
||||
this.list1 = res.data.order
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
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 = []
|
||||
}
|
||||
})
|
||||
getDetailTree({
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.treeData =res.data
|
||||
})
|
||||
// 工艺
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'OrderDetailData',
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
tableProps1,
|
||||
treeData: undefined,
|
||||
activeModule: 'orderInfo',
|
||||
tableProps2,
|
||||
list1: [],
|
||||
list2: [],
|
||||
tableH: this.tableHeight(510) / 2,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 500,
|
||||
},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
},
|
||||
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: {
|
||||
toggleTab(val) {
|
||||
this.activeModule = val;
|
||||
},
|
||||
handleNodeClick(val) {
|
||||
console.log(val);
|
||||
getDetailTreeInfo({
|
||||
id: val.id,
|
||||
}).then((res) => {
|
||||
this.list1 = res.data.order;
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
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;
|
||||
|
||||
getOrderRemainNum(this.orderId).then((resNum) => {
|
||||
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 * resNum.data;
|
||||
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : '';
|
||||
}
|
||||
});
|
||||
this.list2 = arr;
|
||||
this.getMaterialCostOrder(this.orderId);
|
||||
} else {
|
||||
this.list2 = [];
|
||||
}
|
||||
});
|
||||
});
|
||||
getDetailTree({
|
||||
id: this.orderId,
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.treeData = res.data;
|
||||
});
|
||||
// 工艺
|
||||
getProcessFlowList().then((res) => {
|
||||
let arr = res.data || [];
|
||||
if (arr.length > 0) {
|
||||
arr.map((item) => {
|
||||
if (item.id === this.orderMsg.processFlowId) {
|
||||
this.processFlowName = item.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getMaterialCostOrder(id) {
|
||||
getMaterialCostOrder({ id }).then((res) => {
|
||||
this.list2.push(...res.data);
|
||||
});
|
||||
},
|
||||
// 返回
|
||||
returnOrderManage() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
<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));
|
||||
padding: 12px 16px 0;
|
||||
margin: 8px 0;
|
||||
.toggleTabBox {
|
||||
display: inline-block;
|
||||
div {
|
||||
display: inline-block;
|
||||
padding: 0 8px 4px;
|
||||
color: rgba(102, 102, 102, 0.5);
|
||||
border-bottom: 2px solid rgba(242, 244, 249, 1);
|
||||
cursor: pointer;
|
||||
}
|
||||
.active {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
border-bottom-color: #0B58FF;
|
||||
}
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
background-color: rgb(242, 244, 249);
|
||||
.box1,
|
||||
.box2,
|
||||
.box3 {
|
||||
background-color: #fff;
|
||||
border-radius: 9px;
|
||||
}
|
||||
.box2 {
|
||||
height: calc((100vh - 360px));
|
||||
padding: 12px 16px 0;
|
||||
margin: 8px 0;
|
||||
.toggleTabBox {
|
||||
display: inline-block;
|
||||
div {
|
||||
display: inline-block;
|
||||
padding: 0 8px 4px;
|
||||
color: rgba(102, 102, 102, 0.5);
|
||||
border-bottom: 2px solid rgba(242, 244, 249, 1);
|
||||
cursor: pointer;
|
||||
}
|
||||
.active {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
border-bottom-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,315 +1,484 @@
|
||||
<template>
|
||||
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm" label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="工单名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="请输入工单名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="工单编码" prop="code">
|
||||
<el-input v-model="dataForm.code" disabled placeholder="请输入工单编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" filterable
|
||||
@change="selectProduct">
|
||||
<el-option v-for="item in productList" :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='8'>
|
||||
<el-form-item label="产品规格" prop="specifications">
|
||||
<el-input v-model="dataForm.specifications" placeholder="请输入产品规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="计划开始时间">
|
||||
<el-date-picker v-model="dataForm.planStartTime" type="datetime" value-format="timestamp" style="width: 100%;"
|
||||
placeholder="请选择计划开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="计划完成时间">
|
||||
<el-date-picker v-model="dataForm.planFinishTime" type="datetime" value-format="timestamp"
|
||||
style="width: 100%;" placeholder="请选择计划完成时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
||||
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"
|
||||
placeholder="请输入计划投入数量"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<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-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="关联工艺" prop="processFlowId">
|
||||
<el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;"
|
||||
@change="processFlowIdChange">
|
||||
<el-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='8'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<!-- <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange">
|
||||
<el-radio :label="1">产品基础BOM</el-radio>
|
||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||
</el-radio-group> -->
|
||||
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;"
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:rules="rules"
|
||||
label-width="130px"
|
||||
:model="dataForm"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
placeholder="请输入工单名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
disabled
|
||||
placeholder="请输入工单编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select
|
||||
v-model="dataForm.planProductId"
|
||||
placeholder="请选择产品"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
@change="selectProduct">
|
||||
<el-option
|
||||
v-for="item in productList"
|
||||
: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="8">
|
||||
<el-form-item label="产品规格" prop="specifications">
|
||||
<el-input
|
||||
v-model="dataForm.specifications"
|
||||
placeholder="请输入产品规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划开始时间">
|
||||
<el-date-picker
|
||||
v-model="dataForm.planStartTime"
|
||||
type="datetime"
|
||||
value-format="timestamp"
|
||||
style="width: 100%"
|
||||
placeholder="请选择计划开始时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划完成时间">
|
||||
<el-date-picker
|
||||
v-model="dataForm.planFinishTime"
|
||||
type="datetime"
|
||||
value-format="timestamp"
|
||||
style="width: 100%"
|
||||
placeholder="请选择计划完成时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
||||
<el-input-number
|
||||
v-model="dataForm.planAssignQuantity"
|
||||
:min="0"
|
||||
:max="9999999999999"
|
||||
style="width: 100%"
|
||||
placeholder="请输入计划投入数量"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<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-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select
|
||||
v-model="dataForm.priority"
|
||||
placeholder="请选择优先级"
|
||||
style="width: 100%">
|
||||
<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-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select
|
||||
v-model="dataForm.type"
|
||||
placeholder="请选择工单类型"
|
||||
style="width: 100%">
|
||||
<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="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-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input
|
||||
v-model="dataForm.workers"
|
||||
placeholder="请输入负责人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<span style="margin: 0 20px 15px 0; display: inline-block">
|
||||
物料计算方式
|
||||
</span>
|
||||
<el-radio-group
|
||||
v-model="dataForm.materialMethod"
|
||||
@change="materialMethodChange">
|
||||
<el-radio :label="1">产品基础BOM</el-radio>
|
||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- <el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;"
|
||||
@change="materialMethodChange">
|
||||
<el-option key="1" label="产品基础BOM" :value="1" />
|
||||
<el-option key="2" label="工艺扩展BOM" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
|
||||
<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='8'>
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
|
||||
<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-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="关联产线" prop="productLineIds">
|
||||
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-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-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-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
</el-select> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="dataForm.materialMethod === 1">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<span style="margin: 8px 0; display: inline-block">关联产线</span>
|
||||
<el-button style="margin-left: 20px" type="text" @click="addBind">
|
||||
新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row
|
||||
:gutter="20"
|
||||
v-for="(item, index) in dataForm.productLineIds"
|
||||
:key="index + 'line'"
|
||||
style="margin-bottom: 8px">
|
||||
<el-col :span="8">
|
||||
<el-select
|
||||
v-model="item.lineId"
|
||||
placeholder="请选择产线"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
v-model="item.num"
|
||||
placeholder="请输入数量"
|
||||
:step="1"
|
||||
:min="0"
|
||||
step-strictly />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<span style="margin: 8px 0; display: inline-block">
|
||||
关联产线及工艺
|
||||
</span>
|
||||
<el-button style="margin-left: 20px" type="text" @click="addBind">
|
||||
新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row
|
||||
:gutter="20"
|
||||
v-for="(item, index) in dataForm.productLineIds"
|
||||
:key="index + 'process'"
|
||||
style="margin-bottom: 8px">
|
||||
<el-col :span="8">
|
||||
<el-select
|
||||
v-model="item.lineId"
|
||||
placeholder="请选择产线"
|
||||
style="width: 100%"
|
||||
@change="processLineIdChange">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-select
|
||||
v-model="item.processId"
|
||||
placeholder="请选择工艺"
|
||||
filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in processFlowList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
v-model="item.num"
|
||||
:step="1"
|
||||
:min="0"
|
||||
step-strictly />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<!-- <el-row>
|
||||
<el-col :span='12'>
|
||||
<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>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getProductAll } from '@/api/base/product'
|
||||
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
|
||||
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
|
||||
import { getLineAll } from '@/api/base/productionLine'
|
||||
import { getProductAll } from '@/api/base/product';
|
||||
import { getProcessFlowPage, workOrderList } from '@/api/base/orderManage';
|
||||
import {
|
||||
createCoreWO,
|
||||
updateCoreWO,
|
||||
getCode,
|
||||
getCoreWO,
|
||||
} from '@/api/base/coreWorkOrder';
|
||||
import { getLineAll } from '@/api/base/productionLine';
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { listDept } from '@/api/system/dept';
|
||||
export default {
|
||||
name: 'AddWorkOrder',
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
name: 'AddWorkOrder',
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createCoreWO,
|
||||
updateURL: updateCoreWO,
|
||||
infoURL: getCoreWO
|
||||
infoURL: getCoreWO,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
workOrderId: '',
|
||||
name: '',
|
||||
code: '',
|
||||
deptId:undefined,
|
||||
planProductId: '',
|
||||
specifications: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
planAssignQuantity: 0,
|
||||
planQuantity: 0,
|
||||
processFlowId: '',
|
||||
materialMethod: 1,
|
||||
triggerOrigin: 1,
|
||||
priority: '',
|
||||
productLineIds: [],
|
||||
type: '',
|
||||
workers: '',
|
||||
status: 1
|
||||
},
|
||||
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" }],
|
||||
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }]
|
||||
},
|
||||
productList: [],
|
||||
processFlowList: [],
|
||||
productLineList: [],
|
||||
deptList:[],
|
||||
workOrderTypeList: [
|
||||
{id: 1,name:'普通'},
|
||||
{id: 2, name:'特殊'}
|
||||
],
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
isBind: false,
|
||||
workOrderList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
// 工艺变更
|
||||
materialMethodChange(val) {
|
||||
if (val === 2 && !this.dataForm.processFlowId) {
|
||||
this.dataForm.materialMethod = 1
|
||||
this.$modal.msgError("请先选择关联工艺");
|
||||
}
|
||||
},
|
||||
// 工艺变更
|
||||
processFlowIdChange(val) {
|
||||
console.log(val)
|
||||
if (!val) {
|
||||
this.dataForm.materialMethod = 1
|
||||
}
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
this.planStartTime = ''
|
||||
this.planFinishTime = ''
|
||||
if (this.dataForm.id) {
|
||||
getCoreWO(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
if (this.dataForm.priority !== undefined) {
|
||||
this.dataForm.priority = String(this.dataForm.priority)
|
||||
}
|
||||
this.dataForm.priority
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
workOrderId: '',
|
||||
name: '',
|
||||
code: '',
|
||||
deptId: undefined,
|
||||
planProductId: '',
|
||||
specifications: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
planAssignQuantity: 0,
|
||||
planQuantity: 0,
|
||||
materialMethod: 1,
|
||||
triggerOrigin: 1,
|
||||
priority: '',
|
||||
productLineIds: [{ lineId: null, processId: null, num: null }],
|
||||
type: '',
|
||||
workers: '',
|
||||
status: 1,
|
||||
},
|
||||
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' },
|
||||
],
|
||||
},
|
||||
productList: [],
|
||||
processFlowList: [],
|
||||
productLineList: [],
|
||||
deptList: [],
|
||||
workOrderTypeList: [
|
||||
{ id: 1, name: '普通' },
|
||||
{ id: 2, name: '特殊' },
|
||||
],
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
isBind: false,
|
||||
workOrderList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
// 工艺变更
|
||||
materialMethodChange(val) {
|
||||
console.log(val);
|
||||
this.processFlowList = [];
|
||||
this.dataForm.productLineIds = [];
|
||||
const obj = { lineId: null, processId: null, num: null };
|
||||
this.dataForm.productLineIds.push(obj);
|
||||
// if (val === 2 && !this.dataForm.processFlowId) {
|
||||
// this.dataForm.materialMethod = 1;
|
||||
// this.$modal.msgError('请先选择关联工艺');
|
||||
// }
|
||||
},
|
||||
// 产线工艺关联
|
||||
processLineIdChange(val) {
|
||||
const params = {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
lineId: val,
|
||||
};
|
||||
// 工艺
|
||||
getProcessFlowPage(params).then((res) => {
|
||||
this.processFlowList = res.data.list || [];
|
||||
});
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr();
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
this.planStartTime = '';
|
||||
this.planFinishTime = '';
|
||||
if (this.dataForm.id) {
|
||||
getCoreWO(id).then((response) => {
|
||||
this.dataForm = response.data;
|
||||
if (this.dataForm.priority !== undefined) {
|
||||
this.dataForm.priority = String(this.dataForm.priority);
|
||||
}
|
||||
this.dataForm.priority;
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$confirm('是否添加预使用主原料信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log('121', this.dataForm.name)
|
||||
this.$emit("refreshDataList", {
|
||||
id: response.data,
|
||||
name: this.dataForm.name
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.urlOptions.codeURL()
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
let isContinue = true;
|
||||
if (this.dataForm.materialMethod === 1) {
|
||||
this.dataForm.productLineIds.forEach((item) => {
|
||||
if (!item.lineId) {
|
||||
this.$message('关联产线不能为空');
|
||||
isContinue = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.dataForm.productLineIds.forEach((item) => {
|
||||
if (!item.lineId || !item.processId) {
|
||||
this.$message('关联产线及工艺不能为空');
|
||||
isContinue = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id && isContinue) {
|
||||
this.urlOptions.updateURL(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
if (isContinue) {
|
||||
this.urlOptions.createURL(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$confirm('是否添加预使用主原料信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.log('121', this.dataForm.name);
|
||||
this.$emit('refreshDataList', {
|
||||
id: response.data,
|
||||
name: this.dataForm.name,
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.urlOptions
|
||||
.codeURL()
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.code = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
getDict() {
|
||||
// 产品
|
||||
getProductAll().then(res => {
|
||||
this.productList = res.data || []
|
||||
})
|
||||
// 产线
|
||||
getLineAll().then(res => {
|
||||
this.productLineList = res.data || []
|
||||
})
|
||||
listDept().then(res => {
|
||||
this.deptList = res.data || []
|
||||
})
|
||||
// 工艺
|
||||
getProcessFlowList().then(res => {
|
||||
this.processFlowList = res.data || []
|
||||
})
|
||||
// 工单list
|
||||
workOrderList({
|
||||
status: 1
|
||||
}).then(res => {
|
||||
this.workOrderList = res.data || []
|
||||
})
|
||||
},
|
||||
// 选产品带出规格
|
||||
selectProduct(val) {
|
||||
if (val) {
|
||||
this.productList.map(item => {
|
||||
if (val === item.id) {
|
||||
this.dataForm.specifications = item.specifications
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.dataForm.specifications = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
getDict() {
|
||||
// 产品
|
||||
getProductAll().then((res) => {
|
||||
this.productList = res.data || [];
|
||||
});
|
||||
// 产线
|
||||
getLineAll().then((res) => {
|
||||
this.productLineList = res.data || [];
|
||||
});
|
||||
listDept().then((res) => {
|
||||
this.deptList = res.data || [];
|
||||
});
|
||||
// 工单list
|
||||
workOrderList({
|
||||
status: 1,
|
||||
}).then((res) => {
|
||||
this.workOrderList = res.data || [];
|
||||
});
|
||||
},
|
||||
// 选产品带出规格
|
||||
selectProduct(val) {
|
||||
if (val) {
|
||||
this.productList.map((item) => {
|
||||
if (val === item.id) {
|
||||
this.dataForm.specifications = item.specifications;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.dataForm.specifications = '';
|
||||
}
|
||||
},
|
||||
addBind() {
|
||||
const obj = { lineId: null, processId: null, num: null };
|
||||
this.dataForm.productLineIds.push(obj);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-09-11 10:27:13
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-10-15 16:16:22
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -157,7 +157,7 @@
|
||||
|
||||
<script>
|
||||
// import basicAdd from '../../core/mixins/basic-add';
|
||||
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
|
||||
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById,getMaterialCostWorkOrder } from "@/api/base/coreWorkOrder";
|
||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||
import { getOrderEnergyData } from "@/api/monitoring/orderEnergy";
|
||||
// import { orderList } from "@/api/base/orderManage";
|
||||
@@ -215,7 +215,7 @@ const tableProps1 = [
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
prop: 'remainingNum',
|
||||
label: '剩余生产预计消耗'
|
||||
},
|
||||
];
|
||||
@@ -390,8 +390,8 @@ export default {
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
}else if (this.activeName === 'material') {
|
||||
getConOrderList({
|
||||
workOrderId: this.dataForm.id,
|
||||
getMaterialCostWorkOrder({
|
||||
id: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.materialList = response.data;
|
||||
// this.listQuery.total = response.data.total;
|
||||
|
||||
Reference in New Issue
Block a user