订单管理

This commit is contained in:
朱菊兰 2024-02-23 17:01:48 +08:00
parent 2ee2b2bfc7
commit 71fc98b0bb
14 changed files with 786 additions and 862 deletions

View File

@ -14,15 +14,13 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.20:48080'
# VUE_APP_BASE_API = 'http://192.168.1.20:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'

View File

@ -51,4 +51,22 @@ export function orderGroupDetail(query) {
method: 'get',
params: query
})
}
}
// 创建集团订单与厂务订单表关联表 一对多
export function orderConGroupOrder(data) {
return request({
url: '/base/order-con-group-order/create',
method: 'post',
data: data
})
}
// 订单监控
export function orderGroupMonitor(query) {
return request({
url: '/base/order-group/orderGroupMonitor',
method: 'get',
params: query
})
}

View File

@ -8,6 +8,23 @@ export function orderList(query) {
})
}
// 获得订单列表
export function getOrderList(query) {
return request({
url: '/base/order/list',
method: 'get',
params: query
})
}
// 获得订单列表
export function getFreeOrderList() {
return request({
url: '/base/order/getFreeOrderList',
method: 'get'
})
}
// 条件获得工单列表
export function workOrderList(query) {
return request({
@ -113,24 +130,6 @@ export function getWorkOrderById(query) {
})
}
// 订单监控
export function orderMonitor(query) {
return request({
url: '/base/order/orderMonitor',
method: 'get',
params: query
})
}
// 获取订单绑定的工单和数量信息可传订单id列表map索引为订单id
export function orderAssignmentList(query) {
return request({
url: '/base/order/orderAssignmentList',
method: 'get',
params: query
})
}
// 获得所有客户列表
export function customerList() {
return request({

View File

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

View File

@ -48,9 +48,9 @@
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="交货时间" prop="finishProduceTime">
<el-form-item label="交货时间" prop="deliveTime">
<el-date-picker
v-model="form.finishProduceTime"
v-model="form.deliveTime"
type="datetime"
style="width: 100%;"
value-format="timestamp"
@ -97,7 +97,7 @@ export default {
specifications: '',
customerId: '',
planQuantity: '',
finishProduceTime: '',
deliveTime: '',
packReq:'',
remark: ''
},
@ -106,7 +106,7 @@ export default {
code: [{ required: true, message: "订单编码不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
finishProduceTime: [{ required: true, message: "交货时间不能为空", trigger: "change" }]
deliveTime: [{ required: true, message: "交货时间不能为空", trigger: "change" }]
},
productList: [],
customerList: [],
@ -124,12 +124,14 @@ export default {
this.form.name = res.data.name
this.form.code = res.data.code
this.form.planProductId = res.data.planProductId
this.getSpecifications(this.form.planProductId)
this.form.customerId = res.data.customerId
this.form.planQuantity = res.data.planQuantity
this.form.finishProduceTime = res.data.finishProduceTime ? res.data.finishProduceTime : null
this.form.deliveTime = res.data.deliveTime ? res.data.deliveTime : null
this.form.packReq = res.data.packReq ? res.data.packReq+'' : ''
this.form.remark = res.data.remark
setTimeout(() => {
this.getSpecifications(this.form.planProductId)
}, 300);
}
})
} else {
@ -153,7 +155,6 @@ export default {
},
//
getSpecifications(val) {
console.log(val)
for (let i of this.productList) {
if (i.id === val) {
this.form.specifications = i.specifications

View File

@ -43,21 +43,21 @@
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
:dialogTitle="workIssueTitle"
:dialogVisible="addWorkOrdervisible"
@cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel"
width='70%'
dialogTitle="绑定厂务订单"
:dialogVisible="bindOrderVisible"
@cancel="bindOrderCancel"
@confirm="bindOrderConfirm"
:before-close="bindOrderCancel"
width='60%'
>
<add-work-order ref="bindOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
<bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup'
import { orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
import { customerList } from '@/api/base/orderManage'
import OrderGroupAdd from './components/orderGroupAdd'
import BindOrder from './components/bindOrder'
import { publicFormatter } from '@/utils/dict'
@ -71,13 +71,13 @@ const tableProps = [
{
prop: 'name',
label: '订单名称',
minWidth: 120,
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 180
minWidth: 150
},
{
prop: 'customerId',
@ -88,9 +88,17 @@ const tableProps = [
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},{
},
{
prop: 'productName',
label: '产品名称',
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'specifications',
label: '产品规格',
minWidth: 120,
showOverflowtooltip: true
},
{
@ -109,14 +117,16 @@ const tableProps = [
width: 100
},
{
prop: 'finishProduceTime',
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'productName2',
prop: 'packReq',
label: '包装要求',
filter: publicFormatter('pack_spec'),
minWidth: 120,
showOverflowtooltip: true
},
{
@ -163,10 +173,10 @@ export default {
color: 'primary'
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
@ -179,131 +189,104 @@ export default {
pageSize: 20,
name: null,
status: null,
lastIssuedTime: []
planFinishTime: []
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:bind')
? {
type: 'bind',
btnName: '绑定',
showTip: '绑定工单',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showTip: '厂务订单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:termination')
? {
type: 'termination',
btnName: '终止',
showTip: '终止',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:cancel')
? {
type: 'cancel',
btnName: '作废',
showTip: '作废',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined,
this.$auth.hasPermi('base:order-manage:edit')
{
type: 'detail',
btnName: '详情'
},
this.$auth.hasPermi('base:order-group:edit')
? {
type: 'edit',
btnName: '编辑',
// showParam: {
// type: '&',
// data: [
// {
// type: 'equal',
// name: 'triggerOrigin',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 1
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined
].filter((v) => v),
@ -311,7 +294,7 @@ export default {
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
addWorkOrdervisible: false,
bindOrderVisible: false,
orderDetailVisible: false
}
},
@ -325,7 +308,7 @@ export default {
methods: {
getList() {
getOrderGroupPage({...this.queryParams}).then(res => {
let arr = res.data.list || []
let arr = res.data.records || []
this.total = res.data.total || 0
if (arr.length > 0) {
customerList().then(result => {
@ -337,7 +320,6 @@ export default {
item.customerId = i.name
}
}
item.price = item.price?.toFixed(2)
})
this.list = arr
}
@ -353,10 +335,10 @@ export default {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.lastIssuedTime = []
this.queryParams.planFinishTime = []
}
this.getList()
} else {
@ -388,9 +370,9 @@ export default {
break
case 'bind':
this.workIssueTitle = '绑定工单'
this.addWorkOrdervisible = true
this.bindOrderVisible = true
this.$nextTick(() => {
this.$refs.bindOrder.init(val.data, 'bind')
this.$refs.bindOrder.init(val.data)
})
break
case 'complete':
@ -401,12 +383,38 @@ export default {
},
// ,
handleEditStatus(val, tip, status) {
this.$modal.confirm('是否确认'+tip+'"' + val.name + '"?').then(function() {
console.log(val)
if (val.orderIdNum > 0) {//
this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步'
}).then(function() {
console.log('同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
})
}).catch(action => {
if (action === 'cancel') {
console.log('不同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
})
}else {
return console.log('关闭')
}
})
}else{//
this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() {
return groupOrderStatusSet({ id: val.id, status: status})
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
}
},
handleCancel() {
this.$refs.orderGroupAdd.formClear()
@ -421,15 +429,15 @@ export default {
this.getList()
},
//
addWorkOrderCancel() {
bindOrderCancel() {
this.$refs.bindOrder.formClear()
this.addWorkOrdervisible = false
this.bindOrderVisible = false
},
addWorkOrderConfirm() {
this.$refs.bindOrder.addWorkOrderSubmit()
bindOrderConfirm() {
this.$refs.bindOrder.bindOrderSubmit()
},
addWorkOrderSubmit() {
this.addWorkOrderCancel()
bindOrderSubmit() {
this.bindOrderCancel()
this.getList()
}
}

View File

@ -10,11 +10,11 @@
<el-row>
<el-col :span='4'>
<div class="blodTip">订单名称</div>
<div class="lightTip">{{orderGroupMsg.name}}</div>
<div class="lightTip" :title='orderGroupMsg.name'>{{orderGroupMsg.name}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip">{{orderGroupMsg.productName}}</div>
<div class="lightTip" :title="orderGroupMsg.productName">{{orderGroupMsg.productName}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品规格</div>
@ -26,25 +26,17 @@
</el-col>
<el-col :span='4'>
<div class="blodTip">包装要求</div>
<div class="lightTip">接口没有该字段</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.PACK_SPEC, orderGroupMsg.packReq)}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">交货时间</div>
<div class="lightTip">需要确认时哪个字段</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.deliveTime)}}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.triggerTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划开始时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.planStartTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划完成时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.planFinishTime) }}</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.createTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划加工数量</div>
@ -52,14 +44,12 @@
</el-col>
<el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">接口没有该字段</div>
<div class="lightTip">{{orderGroupMsg.actualArea}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderGroupMsg.status)}}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.startProduceTime) }}</div>
@ -68,9 +58,11 @@
<div class="blodTip">实际完成时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.finishProduceTime) }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderGroupMsg.actualquantity }}</div>
<div class="lightTip">{{orderGroupMsg.actualquantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">完成比%</div>
@ -78,81 +70,81 @@
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">接口未看到该字段</div>
<div class="lightTip">该字段未绑定</div>
</el-col>
</el-row>
</div>
</div>
<div class="box2">
<div class="box2" v-for="(item, index) in orderMsg" :key='index'>
<div class="boxTitle">
<span class="blueTitle"></span>
<span>厂务订单编码: 64656563453543</span>
<span>厂务订单编码: {{item.code}}</span>
</div>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='4'>
<div class="blodTip">订单名称</div>
<div class="lightTip">测试订单1</div>
<div class="lightTip" :title="item.name">{{item.name}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip">测试产品</div>
<div class="lightTip" :title="item.productName">{{item.productName}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品规格</div>
<div class="lightTip">测试产品规格</div>
<div class="lightTip">{{item.specifications}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.createTime) }}</div>
<div class="lightTip">{{ parseTime(item.createTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划开始时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.planStartTime) }}</div>
<div class="lightTip">{{ parseTime(item.planStartTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划完成时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.planFinishTime) }}</div>
<div class="lightTip">{{ parseTime(item.planFinishTime) }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{orderGroupMsg.planQuantity}}</div>
<div class="lightTip">{{item.planQuantity}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{orderGroupMsg.planArea}}</div>
<div class="lightTip">{{item.actualArea}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">预计用时</div>
<div class="lightTip">10</div>
<div class="blodTip">预计用时()</div>
<div class="lightTip">{{item.expectTime}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderGroupMsg.status)}}</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, item.status)}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.startProduceTime) }}</div>
<div class="lightTip">{{ parseTime(item.startProduceTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际完成时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.finishProduceTime) }}</div>
<div class="lightTip">{{ parseTime(item.finishProduceTime) }}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderGroupMsg.actualQuantity }}</div>
<div class="lightTip">{{item.actualQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{orderGroupMsg.completeProp}}</div>
<div class="lightTip">{{item.completeProp}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">100</div>
<div class="lightTip">该字段未绑定</div>
</el-col>
</el-row>
</div>
@ -165,7 +157,7 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:table-data="item.coreWorkOrderRespVOS || []"
:max-height="tableH"
/>
</div>
@ -174,7 +166,6 @@
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { getProcessFlowList } from '@/api/base/orderManage'
import { orderGroupDetail } from '@/api/base/orderGroup'
const tableProps = [
{
@ -186,7 +177,7 @@ const tableProps = [
{
prop: 'name',
label: '工单名',
minWidth: 100,
minWidth: 150,
showOverflowtooltip: true
},
{
@ -195,12 +186,13 @@ const tableProps = [
minWidth: 150
},
{
prop: 'code1',
prop: 'roomNameDict',
label: '负责车间',
minWidth: 150
minWidth: 120,
filter: publicFormatter('workshop')
},
{
prop: 'planAssignmentQuantity',
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
@ -239,29 +231,29 @@ const tableProps = [
},
{
prop: 'workers',
label: '负责人'
label: '负责人',
showOverflowtooltip: true
},
{
prop: 'remark',
label: '备注'
label: '备注',
showOverflowtooltip: true
}
]
import { bomUseNum } from '@/api/base/orderManage'
export default {
name: 'orderGroupDetailData',
data() {
return {
orderGroupId: '',
tableProps,
list: [{remark: 111},{remark: 111},{remark: 111}],
orderMsg: [],
tableH: this.tableHeight(510) / 2,
//
queryParams: {
pageNo: 1,
pageSize: 500
},
orderGroupMsg: {},
processFlowName: ''
orderGroupMsg: {}
}
},
mounted() {
@ -271,49 +263,17 @@ export default {
this.orderGroupId = location.href.split('?')[1].split('=')[1]
this.getMsg()
},
watch: {
$route: 'initData'
},
methods: {
initData(to) {
if (to.name === 'orderGroupDetailData') {
this.orderGroupId = location.href.split('?')[1].split('=')[1]
this.getMsg()
}
},
getMsg() {
orderGroupDetail({
id: this.orderGroupId
}).then(res => {
this.orderGroupMsg = res.data
// this.list = res.data.coreWorkOrderRespVOS
// bomUseNum({
// productId: this.orderGroupMsg.planProductId
// }).then(res2 => {
// if (res2.data && res2.data.length > 0) {
// let arr = res2.data
// arr.map(item => {
// if (item) {
// let a = item.num * this.orderGroupMsg.remainingQuantity
// item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
// }
// })
// this.list2 = arr
// }else {
// this.list2 = []
// }
// })
//
getProcessFlowList().then(res => {
let arr = res.data || []
if (arr.length > 0) {
arr.map(item => {
if (item.id === this.orderGroupMsg.processFlowId) {
this.processFlowName = item.name
}
})
}
})
if ( res.data.orderIdNum && res.data.orderIdNum > 0) {
this.orderMsg = res.data.orderDetailVOS
}else{
this.orderMsg = []
}
})
},
//
@ -344,6 +304,9 @@ export default {
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.box2 {

View File

@ -27,14 +27,19 @@
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name+' | '+item.specifications"
:label="item.name"
:value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="产品规格" prop="specifications">
<el-input v-model="form.specifications" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="计划开始时间">
<el-date-picker
@ -47,8 +52,6 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="计划完成时间">
<el-date-picker
@ -71,9 +74,11 @@
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<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="isBind" style="width: 100%;">
<el-option
v-for="item in processFlowList"
:key="item.id"
@ -83,11 +88,9 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled>
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" :disabled="isBind" @change='selectMethod'>
<el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select>
@ -117,42 +120,42 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers" :disabled="isBind"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="负责车间" prop="roomNameDict">
<el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers" :disabled="isBind"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
@ -171,6 +174,7 @@ export default {
name: '',
code: '',
planProductId: '',
specifications: '',
planStartTime: '',
planFinishTime: '',
planAssignQuantity: 0,
@ -179,6 +183,7 @@ export default {
materialMethod: 1,
priority: '',
productLineId: [],
roomNameDict: '',
type: '',
workers: '',
planAssignmentQuantity: ''
@ -188,7 +193,9 @@ export default {
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }],
productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
roomNameDict: [{ required: true, message: "负责车间不能为空", trigger: "change" }],
planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
},
productList: [],
@ -214,8 +221,8 @@ export default {
this.form.code = res.data || ''
})
this.form.planProductId = data.planProductId
this.form.processFlowId = data.processFlowId
this.form.materialMethod = data.materialMethod
// this.form.processFlowId = data.processFlowId
// this.form.materialMethod = data.materialMethod
}else{//
this.isBind = true
}
@ -224,6 +231,9 @@ export default {
//
getProductAll().then(res => {
this.productList = res.data || []
if (this.form.planProductId) {
this.getSpecifications(this.form.planProductId)
}
})
// 线
getLineAll().then(res => {
@ -240,44 +250,60 @@ export default {
this.workOrderList = res.data || []
})
},
//
selectMethod(val) {
if (val === 2 && !this.form.processFlowId ) {
this.form.materialMethod = 1
this.$modal.msgError("请先选择关联工艺");
}else if (val === 1) {
this.form.processFlowId = ''
}
},
addWorkOrderSubmit() {
this.$refs['addWorkOrder'].validate((valid) => {
if (valid) {
if (this.isBind) {
//
orderIssue({
workOrderId: this.form.workOrderId,
orderId: this.form.orderId,
planAssignmentQuantity: this.form.planAssignmentQuantity
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功")
this.$emit('addWorkOrderSubmit')
}
})
} else {
//
let _this = this
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
orderIssue({ ..._this.form }).then(res => {
if (res.code === 0) {
_this.$modal.msgSuccess("操作成功")
let name = this.form.name
_this.$emit('addWorkOrderSubmit')
// 使
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
_this.$router.push({
path: '/core/core-work-order?workOrderName='+encodeURI(name)
})
})
}
})
}
} else {
if (this.isBind) {//
if (!this.form.workOrderId) {
this.$modal.msgError("工单名称不能为空");
return false
}
})
if (!this.form.planAssignmentQuantity) {
this.$modal.msgError("计划分配订单量不能为空");
return false
}
orderIssue({
workOrderId: this.form.workOrderId,
orderId: this.form.orderId,
planAssignmentQuantity: this.form.planAssignmentQuantity
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功")
this.$emit('addWorkOrderSubmit')
}
})
}else{//
this.$refs['addWorkOrder'].validate((valid) => {
if (valid) {
//
let _this = this
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
orderIssue({ ..._this.form }).then(res => {
if (res.code === 0) {
_this.$modal.msgSuccess("操作成功")
let name = this.form.name
_this.$emit('addWorkOrderSubmit')
// 使
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
_this.$router.push({
path: '/core/core-work-order?workOrderName='+encodeURI(name)
})
})
}
})
} else {
return false
}
})
}
},
formClear() {
this.$refs.addWorkOrder.resetFields()
@ -307,9 +333,23 @@ export default {
this.form.productLineId = res.data.productLineIds
this.form.type = res.data.type
this.form.workers = res.data.workers
this.form.roomNameDict = (res.data.roomNameDict || res.data.roomNameDict === 0) ? res.data.roomNameDict + '' : ''
setTimeout(() => {
this.getSpecifications(this.form.planProductId)
}, 300);
}
})
}
},
//
getSpecifications(val) {
for (let i of this.productList) {
if (i.id === val) {
this.form.specifications = i.specifications
return
}
}
this.form.specifications = ''
}
}
}

View File

@ -7,7 +7,7 @@
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="订单" prop="code">
<el-form-item label="订单编码" prop="code">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
@ -36,17 +36,15 @@
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name+' | '+(item.specifications || '')"
:label="item.name"
:value="item.id">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="产品规格" prop="specifications">
<el-input v-model="form.specifications"></el-input>
<el-input v-model="form.specifications" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
@ -126,9 +124,11 @@ export default {
this.form.planProductId = res.data.planProductId
this.form.priority = res.data.priority ? res.data.priority + '' : ''
this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
this.getSpecifications(this.form.planProductId)
this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
this.form.remark = res.data.remark
setTimeout(() => {
this.getSpecifications(this.form.planProductId)
}, 300);
}
})
} else {

View File

@ -0,0 +1,108 @@
<template>
<div class="topTab">
<div class="arr leftArr" @click='toLeft'></div>
<div class="arr rightArr" @click='toRight'></div>
<el-scrollbar ref="groupTeamScroll" :vertical="false" class="scrollTab">
<ul class="tabBox">
<li :class="{'active':orderId===item.id}" v-for="(item, index) in orderIdList" :key='index' @click='toggleName(item.id)'>{{item.name}}</li>
</ul>
</el-scrollbar>
</div>
</template>
<script>
export default {
name: 'TopTab',
data() {
return {
}
},
props:['orderIdList','orderId'],
computed: {
scrollWrapper() {
return this.$refs.groupTeamScroll.$refs.wrap
}
},
methods:{
toLeft() {
const container = this.scrollWrapper
container.scrollLeft-=100
},
toRight() {
const container = this.scrollWrapper
container.scrollLeft+=100
},
toggleName(val) {
this.$emit('emitFun',val)
}
}
}
</script>
<style lang="scss" scoped>
.topTab {
height: 56px;
padding: 0px 48px 0px 56px;
position: relative;
.arr {
position: absolute;
width: 48px;
height: 48px;
line-height: 48px;
background-color: #fff;
border-radius: 8px;
cursor: pointer;
}
.leftArr{
left: 0;
padding-left: 10px;
}
.leftArr::before{
display: inline-block;
content: '';
width: 0;
height: 0;
border-width: 8px;
border-style: solid;
border-color: transparent #0B58FF transparent transparent;
}
.rightArr{
right: 0;
top:0;
padding-left: 22px;
}
.rightArr::before{
display: inline-block;
content: '';
width: 0;
height: 0;
border-width: 8px;
border-style: solid;
border-color: transparent transparent transparent #0B58FF;
}
.scrollTab{
white-space: nowrap;
overflow: hidden;
font-size: 16px;
width: 100%;
height: 100%;
ul,li{
list-style: none;
margin: 0;
padding: 0;
}
.tabBox >.active {
border-bottom: 4px solid #0B58FF;
}
.tabBox>li {
display: inline-block;
height: 48px;
line-height: 48px;
background: #FFFFFF;
border-radius: 8px;
padding: 0px 10px;
margin-right: 8px;
cursor: pointer;
}
}
}
</style>

View File

@ -70,17 +70,13 @@ const tableProps = [
{
prop: 'name',
label: '订单名称',
minWidth: 120,
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 180
},
{
prop: 'customerId',
label: '客户',
minWidth: 150,
showOverflowtooltip: true
},
{
@ -111,6 +107,7 @@ const tableProps = [
{
prop: 'productName',
label: '产品',
width: 200,
showOverflowtooltip: true
},
{
@ -187,7 +184,7 @@ export default {
},
total: 0,
tableProps,
list: [{name: '111111'}],
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder')
@ -195,26 +192,16 @@ export default {
type: 'add',
btnName: '新增',
showTip: '新增工单',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
@ -222,41 +209,26 @@ export default {
type: 'bind',
btnName: '绑定',
showTip: '绑定工单',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-manage:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '|',
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
@ -266,16 +238,43 @@ export default {
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
this.$auth.hasPermi('base:order-manage:termination')
? {
type: 'termination',
btnName: '终止'
btnName: '终止',
showTip: '终止',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
this.$auth.hasPermi('base:order-manage:cancel')
? {
type: 'cancel',
btnName: '作废'
btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
@ -292,14 +291,9 @@ export default {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
type: 'less',
name: 'status',
value: 1
value: 3
}
]
}
@ -319,7 +313,7 @@ export default {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
// this.getList()
this.getList()
},
methods: {
getList() {
@ -336,7 +330,7 @@ export default {
item.customerId = i.name
}
}
item.price = item.price.toFixed(2)
item.price = item.price ? item.price.toFixed(2) : '0.00'
})
this.list = arr
}
@ -407,12 +401,38 @@ export default {
},
// ,
handleEditStatus(val, tip, status) {
this.$modal.confirm('是否确认'+tip+'"' + val.name + '"?').then(function() {
return orderStatusSet({ id: val.id })
console.log(val)
if (val.workOrderNum > 0) {//
this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步'
}).then(function() {
console.log('同步')
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
})
}).catch(action => {
if (action === 'cancel') {
console.log('不同步')
orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
})
}else {
return console.log('关闭')
}
})
}else{//
this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
return orderStatusSet({ id: val.id, status: status})
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
}
},
//
handleCancel() {

View File

@ -1,11 +1,15 @@
<template>
<div class="orderDetailData">
<div v-show="!isSingle" style="position: relative;padding-right: 90px;">
<TopTab :orderIdList='orderIdList' :orderId="orderId" @emitFun='toggleName'/>
<el-button type="primary" plain size="small" style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
</div>
<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>
<el-button v-show="isSingle" 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='4'>
@ -70,7 +74,7 @@
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">{{orderMsg.nokQuantity}}</div>
<div class="lightTip">该字段未绑定</div>
</el-col>
</el-row>
</div>
@ -89,26 +93,13 @@
:max-height="tableH"
/>
</div>
<div class="box3">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>预计用料信息</span>
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps2"
:table-data="list2"
:max-height="tableH"
/>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { getProcessFlowList } from '@/api/base/orderManage'
import TopTab from './components/topTab'
const tableProps1 = [
{
prop: 'issueTime',
@ -119,7 +110,7 @@ const tableProps1 = [
{
prop: 'name',
label: '工单名',
minWidth: 100,
minWidth: 160,
showOverflowtooltip: true
},
{
@ -134,7 +125,7 @@ const tableProps1 = [
filter: publicFormatter('workshop')
},
{
prop: 'planAssignmentQuantity',
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
@ -173,39 +164,26 @@ const tableProps1 = [
},
{
prop: 'workers',
label: '负责人'
label: '负责人',
showOverflowtooltip: true
},
{
prop: 'remark',
label: '备注'
label: '备注',
showOverflowtooltip: true
}
]
const tableProps2 = [
{
prop: 'materialName',
label: '物料名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'num',
label: '剩余生产预计消耗'
}
]
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
import { orderDetail, getOrderList } from '@/api/base/orderManage'
export default {
name: 'OrderDetailData',
data() {
return {
orderId: '',
orderIdList: [], //
isSingle: true,//false
tableProps1,
tableProps2,
list1: [],
list2: [],
tableH: this.tableHeight(510) / 2,
tableH: this.tableHeight(420),
//
queryParams: {
pageNo: 1,
@ -215,45 +193,38 @@ export default {
processFlowName: ''
}
},
components:{ TopTab },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2
})
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg()
},
watch: {
$route: 'initData'
if (this.$route.query.orderIdString && this.$route.query.orderIdString!=='undefined') {
getOrderList({ids:this.$route.query.orderIdString}).then(res => {
this.orderIdList = res.data.map(item => {
return {
id: item.id,
name: item.name
}
})
this.orderId = this.orderIdList[0].id
this.getMsg()
})
this.isSingle = false
console.log('aaaaa')
}else{
this.orderId = this.$route.query.orderId
this.isSingle = true
this.getMsg()
console.log('bbbbbbbbbb')
}
},
methods: {
initData(to) {
if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg()
}
},
getMsg() {
orderDetail({
id: this.orderId
}).then(res => {
this.orderMsg = res.data
this.list1 = res.data.coreWorkOrderRespVOS
bomUseNum({
productId: this.orderMsg.planProductId
}).then(res2 => {
if (res2.data && res2.data.length > 0) {
let arr = res2.data
arr.map(item => {
if (item) {
let a = item.num * this.orderMsg.remainingQuantity
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
}
})
this.list2 = arr
}else {
this.list2 = []
}
})
//
getProcessFlowList().then(res => {
let arr = res.data || []
@ -269,7 +240,12 @@ export default {
},
//
returnOrderManage() {
this.$router.push({path: '/order/base/order-manage'})
this.$router.go(-1)
},
// tab
toggleName(val) {
this.orderId = val
this.getMsg()
}
}
}
@ -277,14 +253,14 @@ export default {
<style lang='scss' scoped>
.orderDetailData {
background-color: rgb(242, 244, 249);
.box1, .box2, .box3 {
.box1, .box2{
background-color: #fff;
border-radius: 9px;
}
.box2 {
height: calc((100vh - 360px) / 2);
height: calc(100vh - 351px);
padding: 12px 16px 0;
margin: 8px 0;
margin-top: 8px;
}
.box1 {
height: 215px;
@ -304,10 +280,6 @@ export default {
margin-bottom: 12px;
}
}
.box3 {
padding: 16px;
height: calc((100vh - 360px) / 2);
}
.boxTitle {
display: inline-block;
font-size: 16px;

View File

@ -2,13 +2,13 @@
<div>
<div class="boxTitle">
<span class="blueTitle"></span>
<span>订单环形图</span>
<span>集团订单环形图</span>
</div>
<div class="chartBox" id='orderChartBox' v-show='chartList.length'>
<div class="chartItem" v-for="(item, index) in chartList" :key='index' :style="{width: 388*beilv+'px',height: 286*beilv+'px',padding:14*beilv+'px',marginRight:9*beilv+'px',marginBottom:9*beilv+'px'}">
<div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}">
<svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/>
<span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderName}}</span>
<span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderGroupName}}</span>
<span>订单计划数量{{item.num}}</span>
</div>
<div
@ -16,7 +16,7 @@
:style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}"
></div>
<div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}">
<div class="legendItem" v-for="(subItem, i) in item.workOrder" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
<div class="legendItem" v-for="(subItem, i) in item.order" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
<span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span>
<div>
<span class="itemName" :style="{fontSize: 14 * beilv + 'px'}">
@ -78,7 +78,7 @@ export default {
var chartDom = document.getElementById(this.chartList[i].id);
this.myChart[i] = echarts.init(chartDom);
let colorList = []
this.chartList[i].workOrder.map(item => {
this.chartList[i].order.map(item => {
colorList.push(item.color)
})
let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0)
@ -118,7 +118,7 @@ export default {
labelLine: {
show: false
},
data: this.chartList[i].workOrder
data: this.chartList[i].order
}
]
};

View File

@ -13,13 +13,13 @@
<!-- -->
<div v-if="activeName === 'dataList'">
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:page="1"
:limit="1000000000000"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
row-key="id"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
:tree-props="{children: 'orderMonitorVOS', hasChildren: 'hasChildren'}"
>
<method-btn
v-if="tableBtn.length"
@ -30,42 +30,33 @@
@clickBtn="handleClick"
/>
</base-table>
<!-- <el-table
:data="list"
style="width: 100%;margin-bottom: 20px;"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
v-for='item in tableProps'
:key='item.id'
:prop="item.prop"
:label="item.label"
:width="item.minWidth?item.minWidth:120">
</el-table-column>
</el-table> -->
</div>
<!-- -->
<monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList'/>
<pagination
<!-- <pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getPage"
/>
/> -->
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { orderMonitor, orderAssignmentList } from '@/api/base/orderManage'
import { orderGroupMonitor } from '@/api/base/orderGroup'
import MonitoringRingCharts from './../components/monitoringRingCharts'
import moment from "moment"
const tableProps = [
{
prop: 'name',
label: '订单名称'
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'orderType',
label: '订单类型'
},
{
prop: 'customerName',
@ -73,7 +64,9 @@ const tableProps = [
},
{
prop: 'productname',
label: '产品'
label: '产品',
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'planStartTime',
@ -104,6 +97,12 @@ const tableProps = [
filter: parseTime,
minWidth: 160
},
{
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'lineNames',
label: '加工线',
@ -126,8 +125,8 @@ const tableProps = [
width: 100
},
{
prop: 'workOrderNum',
label: '关联工单数量',
prop: 'orderNum',
label: '关联订单/工单数量',
width: 110
}
]
@ -138,7 +137,7 @@ export default {
formConfig: [
{
type: 'input',
label: '订单名称',
label: '集团订单名称',
param: 'name'
},
{
@ -164,10 +163,8 @@ export default {
activeName: 'dataList',
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
startProduceTime: []
deliveTime: []
},
tableProps,
list: [],
@ -177,14 +174,14 @@ export default {
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
? {
type: 'orderDetail',
btnName: '工单',
showTip: '工单详情',
btnName: '详情',
showTip: '订单/工单详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'workOrderNum',
name: 'orderNum',
value: 1
}
]
@ -201,8 +198,13 @@ export default {
data: [
{
type: 'more',
name: 'workOrderNum',
name: 'orderNum',
value: 1
},
{
type: 'unequal',
name: 'woIdString',
value: ''
}
]
}
@ -237,141 +239,78 @@ export default {
let start = moment().subtract(30, 'days').format('yyyy-MM-DD')
let end = moment().format('yyyy-MM-DD')
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startProduceTime[0] = start + ' 00:00:00'
this.queryParams.startProduceTime[1] = end + ' 23:59:59'
this.queryParams.deliveTime[0] = start + ' 00:00:00'
this.queryParams.deliveTime[1] = end + ' 23:59:59'
this.getPage()
},
methods: {
getPage() {
this.list = [
{
name: '11111',
id: '1',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '1-11111', id: '11',}
]
},
{
name: '2222222',
id: '2',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '2-222222', id: '22'}
]
},
{
name: '3333333',
id: '3',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '3-333333', id: '33'}
]
},
{
name: '44444',
id: '4',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '4-44444', id: '44'}
]
},
{
name: '555555',
id: '5',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '5-55555', id: '55'}
]
},
{
name: '6',
id: '6',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '6-66666', id: '66'}
]
},
{
name: '7777777',
id: '7',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '7-77777', id: '77'}
]
},
{
name: '888888',
id: '8',
finishProduceTime: '2023-11-11T12:12:12',
children:[
{name: '8-888888', id: '88'}
]
orderGroupMonitor({...this.queryParams}).then(res => {
let arr = res.data || []
if (arr.length > 0) {
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
let arr2 = []
arr.map(item => {
item.orderType = '集团订单'//
let woIdString = ''//str
//=========
let arr3 = []
let obj = {}
obj.orderGroupName = item.name
obj.id = item.id
obj.num = item.planQuantity || 0
let sunNum = 0
if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) {
for(let i = 0; i < item.orderMonitorVOS.length; i++) {
item.orderMonitorVOS[i].orderType = '厂务订单'//
item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid
item.orderMonitorVOS[i].orderNum = item.orderMonitorVOS[i].workOrderNum
woIdString+=item.orderMonitorVOS[i].woIdString?item.orderMonitorVOS[i].woIdString:''
//==============
let subObj = {}
subObj.value = item.orderMonitorVOS[i].actualquantity
subObj.name = item.orderMonitorVOS[i].name
if (i < 5) {
subObj.color = color[i]
} else {
subObj.color = color[i%5]
}
sunNum+=(item.orderMonitorVOS[i].actualquantity || 0)
arr3.push(subObj)
}
}
item.woIdString = woIdString
arr3.push({
value: item.planQuantity - sunNum > 0 ? item.planQuantity - sunNum : 0,
name: '未生产',
color: '#F5F5F5'
})
obj.sunNum = sunNum
obj.order = arr3
arr2.push(obj)
})
this.chartList = arr2
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart()
})
}
}else{
//
this.chartList = []
}
]
// //
// orderMonitor({...this.queryParams}).then(res => {
// this.list = res.data.records || []
// this.total = res.data.total || 0
// if (this.list.length > 0) {
// let orderIdList = []
// this.list.map(item => {
// orderIdList.push(item.orderid)
// })
// //
// orderAssignmentList({orderIdList:orderIdList}).then(res => {
// let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
// let tempArr = res.data || {}
// let tempArr2 = []
// for (let key in tempArr) {
// let tempArr3 = []
// let obj = {}
// obj.orderName = tempArr[key][0].orderName
// obj.id = key
// obj.num = tempArr[key][0].planQuantity
// let sunNum = 0
// for (let i = 0; i < tempArr[key].length; i++) {
// let subObj = {}
// subObj.value = tempArr[key][i].actualAssignmentQuantity
// subObj.name = tempArr[key][i].woName
// if (i < 5) {
// subObj.color = color[i]
// } else {
// subObj.color = color[i%5]
// }
// sunNum+=tempArr[key][i].actualAssignmentQuantity
// tempArr3.push(subObj)
// }
// tempArr3.push({
// value: tempArr[key][0].planQuantity - sunNum > 0 ? tempArr[key][0].planQuantity - sunNum : 0,
// name: '',
// color: '#F5F5F5'
// })
// obj.sunNum = sunNum
// obj.workOrder = tempArr3
// tempArr2.push(obj)
// }
// this.chartList = tempArr2
// if (this.activeName === 'barChart' && this.chartList.length > 0) {
// this.$nextTick(() => {
// this.$refs.monitoringRingCharts.initChart()
// })
// }
// })
// }else{
// //
// this.chartList = []
// }
// })
console.log(arr)
this.list = arr
})
},
//
buttonClick(val) {
this.queryParams.name = val.name
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.startProduceTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.startProduceTime[1] = val.timeVal[1] + ' 23:59:59'
this.queryParams.deliveTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.deliveTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.startProduceTime = []
this.queryParams.deliveTime = []
}
this.getPage()
},
@ -379,9 +318,15 @@ export default {
console.log(val)
switch (val.type) {
case 'orderDetail':
this.$router.push({
path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
})
if (val.data.orderType === '集团订单') {
this.$router.push({//
path: '/order/base/order-manage/order-detail-data?orderIdString='+ val.data.orderIds.join(',')
})
}else{
this.$router.push({//
path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
})
}
break
case 'qualityDetail':
this.$router.push({
@ -389,9 +334,9 @@ export default {
})
break
default:
this.$router.push({
path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
})
// this.$router.push({
// path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
// })
}
},
toggleTab() {