订单管理

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://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080' # 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.1.20:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173: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.49:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8: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.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082' # 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.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082'

View File

@ -51,4 +51,22 @@ export function orderGroupDetail(query) {
method: 'get', method: 'get',
params: query 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) { export function workOrderList(query) {
return request({ 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() { export function customerList() {
return request({ return request({

View File

@ -1,14 +1,11 @@
<template> <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-row :gutter="20">
<el-col :span='6'> <el-col :span='12'>
<el-form-item label="工单名称" prop="name" v-if='!isBind'> <el-form-item label="厂务订单名称" prop="orderId">
<el-input v-model="form.name"></el-input> <el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;" filterable @change="getOrderMsg">
</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-option <el-option
v-for="item in workOrderList" v-for="item in orderList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
@ -16,86 +13,19 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='12'>
<el-form-item label="单编码" prop="code"> <el-form-item label="单编码" prop="code">
<el-input v-model="form.code" disabled></el-input> <el-input v-model="form.code" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='12'>
<el-form-item label="产品名称" prop="planProductId"> <el-form-item label="计划加工数量" prop="planQuantity">
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;"> <el-input-number v-model="form.planQuantity" style="width: 100%;" disabled></el-input-number>
<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-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='12'>
<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-form-item label="优先级" prop="priority"> <el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind"> <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" disabled>
<el-option <el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value" :key="item.value"
@ -105,199 +35,121 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='12'>
<el-form-item label="工单类型" prop="type"> <el-form-item label="产品名称" prop="productName">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind"> <el-input v-model="form.productName" disabled></el-input>
<el-option
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='12'>
<el-form-item label="关联产线" prop="productLineId"> <el-form-item label="产品规格" prop="specifications">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind"> <el-input v-model="form.specifications" disabled></el-input>
<el-option
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='12'>
<el-row :gutter="20"> <el-form-item label="订单计划开始时间" prop="planStartTime">
<el-col :span='6'> <el-date-picker
<el-form-item label="负责人" prop="workers"> v-model="form.planStartTime"
<el-input v-model="form.workers" :disabled="isBind"></el-input> type="datetime"
style="width: 100%;"
value-format="timestamp"
disabled
placeholder="选择日期">
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='12'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity"> <el-form-item label="订单计划完成时间" prop="planFinishTime">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
<script> <script>
import { orderDetail, getFreeOrderList } from '@/api/base/orderManage'
import { orderConGroupOrder } from '@/api/base/orderGroup'
import { getProductAll } from '@/api/base/product' 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 { export default {
name: 'bindOrder', name: 'bindOrder',
data() { data() {
return { return {
form: { form: {
workOrderId: '', groupOrderId: '',
orderId: '', orderId: '',
name: '',
code: '', code: '',
planProductId: '', planQuantity: '',
planStartTime: '',
planFinishTime: '',
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
priority: '', priority: '',
productLineId: [], productName: '',
type: '', specifications: '',
workers: '', remark: '',
planAssignmentQuantity: '' planStartTime: '',
planFinishTime: ''
}, },
rules: { rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }], orderId: [{ required: true, message: "厂务订单名称不能为空", trigger: "change" }]
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" }]
}, },
productList: [], orderList: []
processFlowList: [],
productLineList: [],
workOrderTypeList: [
{id: 1,name:'标准工单'},
{id: 2, name:'特殊工单'}
],
planStartTime: '',
planFinishTime: '',
isBind: false,
workOrderList: []
} }
}, },
methods: { methods: {
init(data, param) { init(data) {
this.form.orderId = data.id this.form.groupOrderId = data.id
this.getList() 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() { getList() {
// // list
getProductAll().then(res => { getFreeOrderList().then(res => {
this.productList = res.data || [] this.orderList = 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 || []
}) })
}, },
addWorkOrderSubmit() { bindOrderSubmit() {
this.$refs['addWorkOrder'].validate((valid) => { this.$refs['bindOrder'].validate((valid) => {
if (valid) { if (valid) {
if (this.isBind) { //
// orderConGroupOrder({
orderIssue({ groupOrderId: this.form.groupOrderId,
workOrderId: this.form.workOrderId, orderId: this.form.orderId
orderId: this.form.orderId,
planAssignmentQuantity: this.form.planAssignmentQuantity
}).then((res) => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess("操作成功") 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 { } else {
return false return false
} }
}) })
}, },
formClear() { formClear() {
this.$refs.addWorkOrder.resetFields() this.$refs.bindOrder.resetFields()
this.form.materialMethod = 1
this.form.planAssignQuantity = 0
this.form.planQuantity = 0 this.form.planQuantity = 0
this.planFinishTime = ''
this.planStartTime = ''
this.form.planFinishTime = ''
this.form.planStartTime = ''
this.isBind = false
}, },
// //
getWorkOrderMsg() { getOrderMsg(val) {
if (this.form.workOrderId) { orderDetail({
getWorkOrderById({id:this.form.workOrderId}).then(res => { id: val
if (res.code === 0) { }).then(res => {
this.form.code = res.data.code this.form.code = res.data.code
this.form.planProductId = res.data.planProductId this.form.planQuantity = res.data.planQuantity
this.planStartTime = res.data.planStartTime ? moment.unix(res.data.planStartTime).format('YYYY-MM-DD HH:mm:ss') : null this.form.productName = res.data.productName
this.planFinishTime = res.data.planFinishTime ? moment.unix(res.data.planFinishTime).format('YYYY-MM-DD HH:mm:ss') : null this.form.specifications = res.data.specifications
this.form.planAssignQuantity = res.data.planAssignQuantity this.form.priority = res.data.priority ? res.data.priority + '' : ''
this.form.planQuantity = res.data.planQuantity this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
this.form.processFlowId = res.data.processFlowId this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
this.form.materialMethod = res.data.materialMethod this.form.remark = res.data.remark
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
}
})
}
} }
} }
} }

View File

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

View File

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

View File

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

View File

@ -27,14 +27,19 @@
<el-option <el-option
v-for="item in productList" v-for="item in productList"
:key="item.id" :key="item.id"
:label="item.name+' | '+item.specifications" :label="item.name"
:value="item.id"> :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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-col :span='6'>
<el-form-item label="计划开始时间"> <el-form-item label="计划开始时间">
<el-date-picker <el-date-picker
@ -47,8 +52,6 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划完成时间"> <el-form-item label="计划完成时间">
<el-date-picker <el-date-picker
@ -71,9 +74,11 @@
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number> <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId"> <el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;"> <el-select v-model="form.processFlowId" placeholder="请选择" :disabled="isBind" style="width: 100%;">
<el-option <el-option
v-for="item in processFlowList" v-for="item in processFlowList"
:key="item.id" :key="item.id"
@ -83,11 +88,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod"> <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="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option> <el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select> </el-select>
@ -117,42 +120,42 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="关联产线" prop="productLineId"> <el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind"> <el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option <el-option
v-for="item in productLineList" v-for="item in productLineList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="负责人" prop="workers"> <el-form-item label="负责车间" prop="roomNameDict">
<el-input v-model="form.workers" :disabled="isBind"></el-input> <el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" :disabled="isBind">
</el-form-item> <el-option
</el-col> v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
<el-col :span='6'> :key="item.value"
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity"> :label="item.label"
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number> :value="item.value">
</el-form-item> </el-option>
</el-col> </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-row>
</el-form> </el-form>
</template> </template>
@ -171,6 +174,7 @@ export default {
name: '', name: '',
code: '', code: '',
planProductId: '', planProductId: '',
specifications: '',
planStartTime: '', planStartTime: '',
planFinishTime: '', planFinishTime: '',
planAssignQuantity: 0, planAssignQuantity: 0,
@ -179,6 +183,7 @@ export default {
materialMethod: 1, materialMethod: 1,
priority: '', priority: '',
productLineId: [], productLineId: [],
roomNameDict: '',
type: '', type: '',
workers: '', workers: '',
planAssignmentQuantity: '' planAssignmentQuantity: ''
@ -188,7 +193,9 @@ export default {
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }], planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }], planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }], planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }],
productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }], productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
roomNameDict: [{ required: true, message: "负责车间不能为空", trigger: "change" }],
planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }] planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
}, },
productList: [], productList: [],
@ -214,8 +221,8 @@ export default {
this.form.code = res.data || '' this.form.code = res.data || ''
}) })
this.form.planProductId = data.planProductId this.form.planProductId = data.planProductId
this.form.processFlowId = data.processFlowId // this.form.processFlowId = data.processFlowId
this.form.materialMethod = data.materialMethod // this.form.materialMethod = data.materialMethod
}else{// }else{//
this.isBind = true this.isBind = true
} }
@ -224,6 +231,9 @@ export default {
// //
getProductAll().then(res => { getProductAll().then(res => {
this.productList = res.data || [] this.productList = res.data || []
if (this.form.planProductId) {
this.getSpecifications(this.form.planProductId)
}
}) })
// 线 // 线
getLineAll().then(res => { getLineAll().then(res => {
@ -240,44 +250,60 @@ export default {
this.workOrderList = res.data || [] 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() { addWorkOrderSubmit() {
this.$refs['addWorkOrder'].validate((valid) => { if (this.isBind) {//
if (valid) { if (!this.form.workOrderId) {
if (this.isBind) { this.$modal.msgError("工单名称不能为空");
//
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 {
return false 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() { formClear() {
this.$refs.addWorkOrder.resetFields() this.$refs.addWorkOrder.resetFields()
@ -307,9 +333,23 @@ export default {
this.form.productLineId = res.data.productLineIds this.form.productLineId = res.data.productLineIds
this.form.type = res.data.type this.form.type = res.data.type
this.form.workers = res.data.workers 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-form-item>
</el-col> </el-col>
<el-col :span='6'> <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-input v-model="form.code"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -36,17 +36,15 @@
<el-option <el-option
v-for="item in productList" v-for="item in productList"
:key="item.id" :key="item.id"
:label="item.name+' | '+(item.specifications || '')" :label="item.name"
:value="item.id"> :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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="产品规格" prop="specifications"> <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-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
@ -126,9 +124,11 @@ export default {
this.form.planProductId = res.data.planProductId this.form.planProductId = res.data.planProductId
this.form.priority = res.data.priority ? res.data.priority + '' : '' this.form.priority = res.data.priority ? res.data.priority + '' : ''
this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null 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.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
this.form.remark = res.data.remark this.form.remark = res.data.remark
setTimeout(() => {
this.getSpecifications(this.form.planProductId)
}, 300);
} }
}) })
} else { } 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', prop: 'name',
label: '订单名称', label: '订单名称',
minWidth: 120, minWidth: 140,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'code', prop: 'code',
label: '订单编码', label: '订单编码',
minWidth: 180 minWidth: 150,
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
@ -111,6 +107,7 @@ const tableProps = [
{ {
prop: 'productName', prop: 'productName',
label: '产品', label: '产品',
width: 200,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
@ -187,7 +184,7 @@ export default {
}, },
total: 0, total: 0,
tableProps, tableProps,
list: [{name: '111111'}], list: [],
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder') this.$auth.hasPermi('base:order-manage:addWorkOrder')
@ -195,26 +192,16 @@ export default {
type: 'add', type: 'add',
btnName: '新增', btnName: '新增',
showTip: '新增工单', showTip: '新增工单',
// showParam: { showParam: {
// type: '|', type: '&',
// data: [ data: [
// { {
// type: 'equal', type: 'less',
// name: 'status', name: 'status',
// value: 1 value: 3
// }, }
// { ]
// type: 'equal', }
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder') this.$auth.hasPermi('base:order-manage:bindWorkOrder')
@ -222,41 +209,26 @@ export default {
type: 'bind', type: 'bind',
btnName: '绑定', btnName: '绑定',
showTip: '绑定工单', showTip: '绑定工单',
// showParam: { showParam: {
// type: '|', type: '&',
// data: [ data: [
// { {
// type: 'equal', type: 'less',
// name: 'status', name: 'status',
// value: 1 value: 3
// }, }
// { ]
// type: 'equal', }
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder') this.$auth.hasPermi('base:order-manage:complete')
? { ? {
type: 'complete', type: 'complete',
btnName: '完成', btnName: '完成',
showTip: '完成订单', showTip: '完成订单',
showParam: { showParam: {
type: '|', type: '&',
data: [ data: [
{
type: 'equal',
name: 'status',
value: 2
},
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
@ -266,16 +238,43 @@ export default {
} }
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:detail') this.$auth.hasPermi('base:order-manage:termination')
? { ? {
type: 'termination', type: 'termination',
btnName: '终止' btnName: '终止',
showTip: '终止',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:detail') this.$auth.hasPermi('base:order-manage:cancel')
? { ? {
type: 'cancel', type: 'cancel',
btnName: '作废' btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:detail') this.$auth.hasPermi('base:order-manage:detail')
@ -292,14 +291,9 @@ export default {
type: '&', type: '&',
data: [ data: [
{ {
type: 'equal', type: 'less',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
name: 'status', name: 'status',
value: 1 value: 3
} }
] ]
} }
@ -319,7 +313,7 @@ export default {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
}) })
// this.getList() this.getList()
}, },
methods: { methods: {
getList() { getList() {
@ -336,7 +330,7 @@ export default {
item.customerId = i.name item.customerId = i.name
} }
} }
item.price = item.price.toFixed(2) item.price = item.price ? item.price.toFixed(2) : '0.00'
}) })
this.list = arr this.list = arr
} }
@ -407,12 +401,38 @@ export default {
}, },
// , // ,
handleEditStatus(val, tip, status) { handleEditStatus(val, tip, status) {
this.$modal.confirm('是否确认'+tip+'"' + val.name + '"?').then(function() { console.log(val)
return orderStatusSet({ id: val.id }) 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(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess("操作成功");
}).catch(() => {}); }).catch(() => {});
}
}, },
// //
handleCancel() { handleCancel() {

View File

@ -1,11 +1,15 @@
<template> <template>
<div class="orderDetailData"> <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="box1">
<div class="boxTitle"> <div class="boxTitle">
<span class="blueTitle"></span> <span class="blueTitle"></span>
<span>订单编码: {{orderMsg.code}}</span> <span>订单编码: {{orderMsg.code}}</span>
</div> </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;"> <div style="padding-left: 14px;">
<el-row> <el-row>
<el-col :span='4'> <el-col :span='4'>
@ -70,7 +74,7 @@
</el-col> </el-col>
<el-col :span='4'> <el-col :span='4'>
<div class="blodTip">废片数量</div> <div class="blodTip">废片数量</div>
<div class="lightTip">{{orderMsg.nokQuantity}}</div> <div class="lightTip">该字段未绑定</div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -89,26 +93,13 @@
:max-height="tableH" :max-height="tableH"
/> />
</div> </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> </div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict'
import { getProcessFlowList } from '@/api/base/orderManage' import { getProcessFlowList } from '@/api/base/orderManage'
import TopTab from './components/topTab'
const tableProps1 = [ const tableProps1 = [
{ {
prop: 'issueTime', prop: 'issueTime',
@ -119,7 +110,7 @@ const tableProps1 = [
{ {
prop: 'name', prop: 'name',
label: '工单名', label: '工单名',
minWidth: 100, minWidth: 160,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
@ -134,7 +125,7 @@ const tableProps1 = [
filter: publicFormatter('workshop') filter: publicFormatter('workshop')
}, },
{ {
prop: 'planAssignmentQuantity', prop: 'planQuantity',
label: '计划加工量', label: '计划加工量',
width: 100 width: 100
}, },
@ -173,39 +164,26 @@ const tableProps1 = [
}, },
{ {
prop: 'workers', prop: 'workers',
label: '负责人' label: '负责人',
showOverflowtooltip: true
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注' label: '备注',
showOverflowtooltip: true
} }
] ]
const tableProps2 = [ import { orderDetail, getOrderList } from '@/api/base/orderManage'
{
prop: 'materialName',
label: '物料名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'num',
label: '剩余生产预计消耗'
}
]
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
export default { export default {
name: 'OrderDetailData', name: 'OrderDetailData',
data() { data() {
return { return {
orderId: '', orderId: '',
orderIdList: [], //
isSingle: true,//false
tableProps1, tableProps1,
tableProps2,
list1: [], list1: [],
list2: [], tableH: this.tableHeight(420),
tableH: this.tableHeight(510) / 2,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@ -215,45 +193,38 @@ export default {
processFlowName: '' processFlowName: ''
} }
}, },
components:{ TopTab },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2 this.tableH = this.tableHeight(510) / 2
}) })
this.orderId = location.href.split('?')[1].split('=')[1] if (this.$route.query.orderIdString && this.$route.query.orderIdString!=='undefined') {
this.getMsg() getOrderList({ids:this.$route.query.orderIdString}).then(res => {
}, this.orderIdList = res.data.map(item => {
watch: { return {
$route: 'initData' 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: { methods: {
initData(to) {
if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg()
}
},
getMsg() { getMsg() {
orderDetail({ orderDetail({
id: this.orderId id: this.orderId
}).then(res => { }).then(res => {
this.orderMsg = res.data this.orderMsg = res.data
this.list1 = res.data.coreWorkOrderRespVOS 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 => { getProcessFlowList().then(res => {
let arr = res.data || [] let arr = res.data || []
@ -269,7 +240,12 @@ export default {
}, },
// //
returnOrderManage() { 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> <style lang='scss' scoped>
.orderDetailData { .orderDetailData {
background-color: rgb(242, 244, 249); background-color: rgb(242, 244, 249);
.box1, .box2, .box3 { .box1, .box2{
background-color: #fff; background-color: #fff;
border-radius: 9px; border-radius: 9px;
} }
.box2 { .box2 {
height: calc((100vh - 360px) / 2); height: calc(100vh - 351px);
padding: 12px 16px 0; padding: 12px 16px 0;
margin: 8px 0; margin-top: 8px;
} }
.box1 { .box1 {
height: 215px; height: 215px;
@ -304,10 +280,6 @@ export default {
margin-bottom: 12px; margin-bottom: 12px;
} }
} }
.box3 {
padding: 16px;
height: calc((100vh - 360px) / 2);
}
.boxTitle { .boxTitle {
display: inline-block; display: inline-block;
font-size: 16px; font-size: 16px;

View File

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

View File

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