订单拆分

yangwl
zhaoxiaolin 1 year ago
parent 0ebb2136cb
commit fcbf8f911c

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询订单列表
export function listOrder(query) {
return request({
url: '/mes/order/list',
method: 'get',
params: query
});
}
// 查询订单详细
export function getOrder(id) {
return request({
url: '/mes/order/' + id,
method: 'get'
});
}
// 新增订单
export function addOrder(data) {
return request({
url: '/mes/order',
method: 'post',
data: data
});
}
// 修改订单
export function updateOrder(data) {
return request({
url: '/mes/order',
method: 'put',
data: data
});
}
// 删除订单
export function delOrder(id) {
return request({
url: '/mes/order/' + id,
method: 'delete'
});
}

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询工艺线体关联列表
export function listLine(query) {
return request({
url: '/mes/pro/routeprodline/list',
method: 'get',
params: query
});
}
// 查询工艺线体关联详细
export function getLine(recordId) {
return request({
url: '/mes/pro/routeprodline/' + recordId,
method: 'get'
});
}
// 新增工艺线体关联
export function addLine(data) {
return request({
url: '/mes/pro/routeprodline',
method: 'post',
data: data
});
}
// 修改工艺线体关联
export function updateLine(data) {
return request({
url: '/mes/pro/routeprodline',
method: 'put',
data: data
});
}
// 删除工艺线体关联
export function delLine(recordId) {
return request({
url: '/mes/pro/routeprodline/' + recordId,
method: 'delete'
});
}
// 查询工艺线体关联列表
export function getListLine(query) {
return request({
url: '/mes/pro/routeprodline/getList',
method: 'get',
params: query
});
}

@ -0,0 +1,401 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="计划工厂编码" prop="planFactoryCode" label-width="100px">
<el-input
v-model="queryParams.planFactoryCode"
placeholder="请输入计划工厂编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料号" prop="prodCode">
<el-input
v-model="queryParams.prodCode"
placeholder="请输入物料号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="prodDesc">
<el-input
v-model="queryParams.prodDesc"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:pro:order:add']"
>SAP同步</el-button>
</el-col>
<!--
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['order:order:add']"
>新增</el-button>
-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:pro:order:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="orderList"
row-key="orderCode"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="订单号" align="center" prop="orderCode" width="100"/>
<el-table-column label="物料号" align="center" prop="prodCode" width="100"/>
<el-table-column label="物料名称" align="center" prop="prodDesc" width="100"/>
<el-table-column label="订单数量" align="center" prop="quantity" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="任务清单" align="center" prop="workerOrder" width="100"/>
<el-table-column label="计划生产日期" align="center" prop="planProDate" width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planProDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划完成日期" align="center" prop="planComplete" width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planComplete, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" prop="status" />
<el-table-column label="计划工厂编码" prop="planFactoryCode" width="100px"/>
<el-table-column label="订单类型" align="center" prop="orderType" />
<el-table-column label="产品类型" align="center" prop="prodType" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['mes:pro:order:add']"
v-if="scope.row.parentOrder == 0"
>拆分</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改订单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="计划工厂编码" prop="planFactoryCode">
<el-input v-model="form.planFactoryCode" placeholder="请输入计划工厂编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订单号" prop="orderCode">
<el-input v-model="form.orderCode" placeholder="请输入订单号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物料号" prop="prodCode">
<el-input v-model="form.prodCode" placeholder="请输入物料号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料名称" prop="prodDesc">
<el-input v-model="form.prodDesc" placeholder="请输入物料名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="订单数量" prop="quantity">
<el-input v-model="form.quantity" placeholder="请输入订单数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="任务清单" prop="workerOrder">
<el-input v-model="form.workerOrder" placeholder="请输入任务清单" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上级工单" prop="parentOrder">
<treeselect v-model="form.parentOrder" :options="orderOptions" :normalizer="normalizer" placeholder="请选择上级工单" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="计划生产日期" prop="planProDate">
<el-date-picker clearable
v-model="form.planProDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择计划生产日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划完成日期" prop="planComplete">
<el-date-picker clearable
v-model="form.planComplete"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择计划完成日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/mes/pro/order";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Order",
components: {
Treeselect
},
data() {
return {
//
loading: true,
//
showSearch: true,
//
orderList: [],
//
orderOptions: [],
//
title: "",
//
open: false,
//
isExpandAll: true,
//
refreshTable: true,
//
queryParams: {
planFactoryCode: null,
orderType: null,
orderCode: null,
prodCode: null,
prodDesc: null,
quantity: null,
unit: null,
workerOrder: null,
planProDate: null,
planComplete: null,
atrr1: null,
atrr2: null,
atrr3: null,
status: null,
parentOrder: null,
prodType: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询订单列表 */
getList() {
this.loading = true;
listOrder(this.queryParams).then(response => {
this.orderList = this.handleTree(response.data, "orderCode", "parentOrder");
this.loading = false;
});
},
/** 转换订单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.orderCode,
label: node.orderCode,
children: node.children
};
},
/** 查询订单下拉树结构 */
getTreeselect() {
listOrder().then(response => {
this.orderOptions = [];
const data = { orderCode: 0, orderCode: '顶级节点', children: [] };
data.children = this.handleTree(response.data, "orderCode", "parentOrder");
this.orderOptions.push(data);
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
planFactoryCode: null,
orderType: null,
orderCode: null,
prodCode: null,
prodDesc: null,
quantity: null,
unit: null,
workerOrder: null,
planProDate: null,
planComplete: null,
atrr1: null,
atrr2: null,
atrr3: null,
status: null,
parentOrder: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
prodType: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
if (row != null && row.orderCode) {
this.form.parentOrder = row.orderCode;
} else {
this.form.parentOrder = 0;
}
this.open = true;
this.title = "添加订单";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
if (row != null) {
this.form.parentOrder = row.orderCode;
}
getOrder(row.id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改订单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除订单编号为"' + row.id + '"的数据项?').then(function() {
return delOrder(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
};
</script>

@ -74,6 +74,16 @@
v-hasPermi="['mes:pro:proroute:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:pro:proroute:add']"
>SAP同步</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -90,6 +100,7 @@
</el-table-column>
<el-table-column label="工艺路线名称" align="center" prop="routeName" />
<el-table-column label="工艺路线说明" align="center" prop="routeDesc" />
<el-table-column label="工艺路线版本" align="center" prop="routeVersion" />
<el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
@ -191,6 +202,9 @@
<el-tab-pane label="组成工序">
<Routeprocess v-if="form.routeId !=null" :optType="optType" :routeId="form.routeId"></Routeprocess>
</el-tab-pane>
<el-tab-pane label="关联线体">
<Routeprodline v-if="form.routeId !=null" :optType="optType" :routeId="form.routeId"></Routeprodline>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'"></el-button>
@ -204,10 +218,11 @@
<script>
import { listProroute, getProroute, delProroute, addProroute, updateProroute } from "@/api/mes/pro/proroute";
import Routeprocess from "./routeprocess";
import Routeprodline from "./routeprodline";
export default {
name: "Proroute",
dicts: ['sys_yes_no'],
components: {Routeprocess},
components: {Routeprocess,Routeprodline},
data() {
return {
optType: undefined,

@ -0,0 +1,123 @@
<template>
<el-transfer v-model="rightList" :data="leftList" :titles="titles" :filterable=true
@change="handleChange"
></el-transfer>
</template>
<script>
import { getListLine, addLine , updateLine, getLine, delLine} from "@/api/mes/pro/routeprodline";
export default {
name: "Routeprodline",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 线
routeproductList: [],
//
processList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
routeId: this.routeId,
itemId: null,
itemCode: null,
itemName: null,
specification: null,
unitOfMeasure: null,
quantity: null,
productionTime: null,
timeUnitType: null,
},
//
form: {},
//--------------------->
leftList: [],
rightList: [],
titles:['未关联线体','已关联线体']
};
},
props :{
routeId: undefined,
optType: undefined
},
created() {
this.getList();
},
methods: {
/** 查询未分配线体列表 */
getList() {
debugger
this.loading = true;
getListLine(this.queryParams).then(response => {
this.leftList = response.unSelect;
const dataright = [];
for(let i in response.selected){
// 穿
dataright.push(response.selected[i].key)
}
this.rightList = dataright;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
recordId: null,
routeId: this.routeId,
itemId: null,
itemCode: null,
itemName: null,
specification: null,
unitOfMeasure: null,
quantity: null,
productionTime: null,
timeUnitType: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
},
/** 提交按钮 */
handleChange(value, direction, movedKeys) {
if (this.queryParams.routeId != null) {
this.queryParams.selectedValues= value;
addLine(this.queryParams).then(response => {
this.$modal.msgSuccess("关联成功");
});
}
}
}
};
</script>

@ -120,6 +120,7 @@
<el-col :span="24">
<el-form-item label="菜单类型" prop="menuType">
<el-radio-group v-model="form.menuType">
<el-radio label="A">系统</el-radio>
<el-radio label="M">目录</el-radio>
<el-radio label="C">菜单</el-radio>
<el-radio label="F">按钮</el-radio>

Loading…
Cancel
Save