projects/mesxc-lb #205

Merged
gtz217 merged 38 commits from projects/mesxc-lb into projects/mesxc-test 2024-02-26 02:14:07 +08:00
14 changed files with 1750 additions and 472 deletions
Showing only changes of commit 2997f4b7b9 - Show all commits

View File

@ -14,16 +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.4.173: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.30:8888'
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.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'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082'

View File

@ -0,0 +1,72 @@
import request from '@/utils/request'
// 获得集团订单分页
export function getOrderGroupPage(query) {
return request({
url: '/base/order-group/page',
method: 'get',
params: query
})
}
// 获得集团订单
export function getOrderGroup(query) {
return request({
url: '/base/order-group/get',
method: 'get',
params: query
})
}
// 更新集团订单
export function updateOrderGroup(data) {
return request({
url: '/base/order-group/update',
method: 'put',
data: data
})
}
// 创建集团订单
export function createOrderGroup(data) {
return request({
url: '/base/order-group/create',
method: 'post',
data: data
})
}
// 修改集团订单状态,结束-终止-作废用
export function groupOrderStatusSet(data) {
return request({
url: '/base/order-group/groupOrderStatusSet',
method: 'put',
data: data
})
}
// 获得集团订单详情
export function orderGroupDetail(query) {
return request({
url: '/base/order-group/getDetail',
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) { export function workOrderList(query) {
return request({ return request({
@ -86,6 +103,15 @@ export function orderDelete(query) {
}) })
} }
// 修改订单状态,结束-终止-作废用
export function orderStatusSet(data) {
return request({
url: '/base/order/orderStatusSet',
method: 'put',
data: data
})
}
// 下发订单绑定的穿工单id新建不传 // 下发订单绑定的穿工单id新建不传
export function orderIssue(data) { export function orderIssue(data) {
return request({ return request({
@ -104,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

@ -0,0 +1,156 @@
<template>
<el-form ref="bindOrder" :rules="rules" label-width="130px" :model="form">
<el-row :gutter="20">
<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 orderList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<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='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='12'>
<el-form-item label="优先级" prop="priority">
<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"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<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='12'>
<el-form-item label="产品规格" prop="specifications">
<el-input v-model="form.specifications" disabled></el-input>
</el-form-item>
</el-col>
<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='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'
export default {
name: 'bindOrder',
data() {
return {
form: {
groupOrderId: '',
orderId: '',
code: '',
planQuantity: '',
priority: '',
productName: '',
specifications: '',
remark: '',
planStartTime: '',
planFinishTime: ''
},
rules: {
orderId: [{ required: true, message: "厂务订单名称不能为空", trigger: "change" }]
},
orderList: []
}
},
methods: {
init(data) {
this.form.groupOrderId = data.id
this.getList()
},
getList() {
// list
getFreeOrderList().then(res => {
this.orderList = res.data || []
})
},
bindOrderSubmit() {
this.$refs['bindOrder'].validate((valid) => {
if (valid) {
//
orderConGroupOrder({
groupOrderId: this.form.groupOrderId,
orderId: this.form.orderId
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功")
this.$emit('bindOrderSubmit')
}
})
} else {
return false
}
})
},
formClear() {
this.$refs.bindOrder.resetFields()
this.form.planQuantity = 0
},
//
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
})
}
}
}
</script>

View File

@ -0,0 +1,197 @@
<template>
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="订单名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="订单编码" prop="code">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable @change="getSpecifications">
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-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="客户" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;" clearable filterable>
<el-option
v-for="item in customerList"
: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="planQuantity">
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="交货时间" prop="deliveTime">
<el-date-picker
v-model="form.deliveTime"
type="datetime"
style="width: 100%;"
value-format="timestamp"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="包装要求" prop="packReq">
<el-select v-model="form.packReq" placeholder="请选择" style="width: 100%;" clearable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.PACK_SPEC)"
: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='24'>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getOrderCode } from '@/api/base/orderManage'
import { getOrderGroup, updateOrderGroup, createOrderGroup } from '@/api/base/orderGroup'
import { getProductAll } from '@/api/base/product'
import { getCustomerList } from '@/api/base/customer'
export default {
name: 'OrderGroupAdd',
data() {
return {
form: {
id: '',
name: '',
code: '',
planProductId: '',
specifications: '',
customerId: '',
planQuantity: '',
deliveTime: '',
packReq:'',
remark: ''
},
rules: {
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "订单编码不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
deliveTime: [{ required: true, message: "交货时间不能为空", trigger: "change" }]
},
productList: [],
customerList: [],
isEdit: false //
}
},
methods: {
init(id) {
this.getList()
if (id) {
this.isEdit = true
this.form.id = id
getOrderGroup({id: this.form.id}).then(res => {
if (res.code === 0) {
this.form.name = res.data.name
this.form.code = res.data.code
this.form.planProductId = res.data.planProductId
this.form.customerId = res.data.customerId
this.form.planQuantity = res.data.planQuantity
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 {
this.isEdit = false
this.form.id = ''
//
getOrderCode().then(res => {
this.form.code = res.data || ''
})
}
},
getList() {
//
getProductAll().then(res => {
this.productList = res.data || []
})
//
getCustomerList().then(res => {
this.customerList = res.data || []
})
},
//
getSpecifications(val) {
for (let i of this.productList) {
if (i.id === val) {
this.form.specifications = i.specifications
return
}
}
this.form.specifications = ''
},
submitForm() {
this.$refs['orderAddForm'].validate((valid) => {
if (valid) {
if (this.isEdit) {
//
updateOrderGroup({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
createOrderGroup({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.orderAddForm.resetFields()
this.form.planQuantity = 0
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,445 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="240"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='60%'
>
<order-group-add ref="orderGroupAdd" @successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
dialogTitle="绑定厂务订单"
:dialogVisible="bindOrderVisible"
@cancel="bindOrderCancel"
@confirm="bindOrderConfirm"
:before-close="bindOrderCancel"
width='60%'
>
<bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup'
import { customerList } from '@/api/base/orderManage'
import OrderGroupAdd from './components/orderGroupAdd'
import BindOrder from './components/bindOrder'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 150
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},
{
prop: 'productName',
label: '产品名称',
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'specifications',
label: '产品规格',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualquantity',
label: '实际加工量',
width: 100
},
{
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'packReq',
label: '包装要求',
filter: publicFormatter('pack_spec'),
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'orderIdNum',
label: '订单数量'
}
]
export default {
name: 'OrderGroup',
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
placeholder: '订单名称',
param: 'name'
},
{
type: 'select',
label: '状态',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'status'
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null,
planFinishTime: []
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-group:bind')
? {
type: 'bind',
btnName: '绑定',
showTip: '厂务订单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-group:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
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
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-group:cancel')
? {
type: 'cancel',
btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined,
{
type: 'detail',
btnName: '详情'
},
this.$auth.hasPermi('base:order-group:edit')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
bindOrderVisible: false,
orderDetailVisible: false
}
},
components: { OrderGroupAdd, BindOrder },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
},
methods: {
getList() {
getOrderGroupPage({...this.queryParams}).then(res => {
let arr = res.data.records || []
this.total = res.data.total || 0
if (arr.length > 0) {
customerList().then(result => {
let tempData = result.data || []
if (tempData.length > 0) {
arr.map(item => {
for (let i of tempData) {
if (item.customerId === i.id) {
item.customerId = i.name
}
}
})
this.list = arr
}
})
}else {
this.list = arr
}
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.planFinishTime = []
}
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderGroupAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderGroupAdd.init(val.data.id)
})
break
case 'cancel':
this.handleEditStatus(val.data, '作废', '6')
break
case 'detail':
this.$router.push({path: '/order/base/order-group/order-group-detail-data?orderGroupId='+ val.data.id})
break
case 'termination':
this.handleEditStatus(val.data, '终止', '5')
break
case 'bind':
this.workIssueTitle = '绑定工单'
this.bindOrderVisible = true
this.$nextTick(() => {
this.$refs.bindOrder.init(val.data)
})
break
case 'complete':
this.handleEditStatus(val.data, '完成', '4')
break
default:
}
},
// ,
handleEditStatus(val, tip, status) {
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()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.orderGroupAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
//
bindOrderCancel() {
this.$refs.bindOrder.formClear()
this.bindOrderVisible = false
},
bindOrderConfirm() {
this.$refs.bindOrder.bindOrderSubmit()
},
bindOrderSubmit() {
this.bindOrderCancel()
this.getList()
}
}
}
</script>

View File

@ -0,0 +1,339 @@
<template>
<div class="orderGroupDetailData">
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>集团编码: {{orderGroupMsg.code}}</span>
</div>
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='4'>
<div class="blodTip">订单名称</div>
<div class="lightTip" :title='orderGroupMsg.name'>{{orderGroupMsg.name}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip" :title="orderGroupMsg.productName">{{orderGroupMsg.productName}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品规格</div>
<div class="lightTip">{{orderGroupMsg.specifications}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">客户</div>
<div class="lightTip">{{orderGroupMsg.customerName}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">包装要求</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">{{ parseTime(orderGroupMsg.deliveTime)}}</div>
</el-col>
</el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.createTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{orderGroupMsg.planQuantity}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</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-col :span='4'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.startProduceTime) }}</div>
</el-col>
<el-col :span='4'>
<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>
</el-col>
<el-col :span='4'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{orderGroupMsg.completeRate}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">该字段未绑定</div>
</el-col>
</el-row>
</div>
</div>
<div class="box2" v-for="(item, index) in orderMsg" :key='index'>
<div class="boxTitle">
<span class="blueTitle"></span>
<span>厂务订单编码: {{item.code}}</span>
</div>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='4'>
<div class="blodTip">订单名称</div>
<div class="lightTip" :title="item.name">{{item.name}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip" :title="item.productName">{{item.productName}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品规格</div>
<div class="lightTip">{{item.specifications}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(item.createTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划开始时间</div>
<div class="lightTip">{{ parseTime(item.planStartTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划完成时间</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">{{item.planQuantity}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{item.actualArea}}</div>
</el-col>
<el-col :span='4'>
<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, item.status)}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(item.startProduceTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际完成时间</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">{{item.actualQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{item.completeProp}}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">该字段未绑定</div>
</el-col>
</el-row>
</div>
<!-- 列表 -->
<div class="boxTitle">
<span class="blueTitle"></span>
<span>工单信息</span>
</div>
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="item.coreWorkOrderRespVOS || []"
:max-height="tableH"
/>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { orderGroupDetail } from '@/api/base/orderGroup'
const tableProps = [
{
prop: 'issueTime',
label: '下发时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '工单名',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'code',
label: '工单编码',
minWidth: 150
},
{
prop: 'roomNameDict',
label: '负责车间',
minWidth: 120,
filter: publicFormatter('workshop')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
},
{
prop: 'actualArea',
label: '加工平方数',
width: 100
},
{
prop: 'status',
label: '状态',
filter: publicFormatter('work_order_status')
},
{
prop: 'startProduceTime',
label: '开始时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'finishProduceTime',
label: '结束时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'productLineNames',
label: '关联产线',
filter: (val) => val ? val.join(',') : '',
showOverflowtooltip: true
},
{
prop: 'workers',
label: '负责人',
showOverflowtooltip: true
},
{
prop: 'remark',
label: '备注',
showOverflowtooltip: true
}
]
export default {
name: 'orderGroupDetailData',
data() {
return {
orderGroupId: '',
tableProps,
orderMsg: [],
tableH: this.tableHeight(510) / 2,
//
queryParams: {
pageNo: 1,
pageSize: 500
},
orderGroupMsg: {}
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2
})
this.orderGroupId = location.href.split('?')[1].split('=')[1]
this.getMsg()
},
methods: {
getMsg() {
orderGroupDetail({
id: this.orderGroupId
}).then(res => {
this.orderGroupMsg = res.data
if ( res.data.orderIdNum && res.data.orderIdNum > 0) {
this.orderMsg = res.data.orderDetailVOS
}else{
this.orderMsg = []
}
})
},
//
returnOrderManage() {
this.$router.push({path: '/order/base/order-group'})
}
}
}
</script>
<style lang='scss' scoped>
.orderGroupDetailData {
height: calc(100vh - 120px - 8px);
background-color: rgb(242, 244, 249);
overflow: auto;
.box1, .box2 {
background-color: #fff;
border-radius: 9px;
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.box2 {
height: 415px;
padding: 12px 16px 0;
margin: 8px 0;
}
.box1 {
height: 215px;
padding: 16px 16px 0 16px;
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

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,6 +120,8 @@
</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="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">
@ -129,8 +134,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='6'>
<el-row :gutter="20"> <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-col :span='6'>
<el-form-item label="负责人" prop="workers"> <el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers" :disabled="isBind"></el-input> <el-input v-model="form.workers" :disabled="isBind"></el-input>
@ -159,6 +174,7 @@ export default {
name: '', name: '',
code: '', code: '',
planProductId: '', planProductId: '',
specifications: '',
planStartTime: '', planStartTime: '',
planFinishTime: '', planFinishTime: '',
planAssignQuantity: 0, planAssignQuantity: 0,
@ -167,6 +183,7 @@ export default {
materialMethod: 1, materialMethod: 1,
priority: '', priority: '',
productLineId: [], productLineId: [],
roomNameDict: '',
type: '', type: '',
workers: '', workers: '',
planAssignmentQuantity: '' planAssignmentQuantity: ''
@ -176,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: [],
@ -202,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
} }
@ -212,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 => {
@ -228,11 +250,25 @@ 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("工单名称不能为空");
// return false
}
if (!this.form.planAssignmentQuantity) {
this.$modal.msgError("计划分配订单量不能为空");
return false
}
orderIssue({ orderIssue({
workOrderId: this.form.workOrderId, workOrderId: this.form.workOrderId,
orderId: this.form.orderId, orderId: this.form.orderId,
@ -243,7 +279,9 @@ export default {
this.$emit('addWorkOrderSubmit') this.$emit('addWorkOrderSubmit')
} }
}) })
} else { }else{//
this.$refs['addWorkOrder'].validate((valid) => {
if (valid) {
// //
let _this = this let _this = this
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : '' _this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
@ -261,11 +299,11 @@ export default {
}) })
} }
}) })
}
} else { } else {
return false return false
} }
}) })
}
}, },
formClear() { formClear() {
this.$refs.addWorkOrder.resetFields() this.$refs.addWorkOrder.resetFields()
@ -295,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>
@ -16,39 +16,6 @@
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number> <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable>
<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-col>
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="单价" prop="price">
<el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="客户" prop="customerId">
<el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;" clearable filterable>
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="优先级" prop="priority"> <el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable> <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable>
@ -61,30 +28,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'>
<el-form-item label="包装规格" prop="packSpec">
<el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.PACK_SPEC)"
: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="workers"> <el-form-item label="产品名称" prop="planProductId">
<el-input v-model="form.workers"></el-input> <el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable @change="getSpecifications">
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;" clearable filterable @change="processFlowIdChange">
<el-option <el-option
v-for="item in processFlowList" v-for="item in productList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
@ -93,11 +43,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod"> <el-form-item label="产品规格" prop="specifications">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" @change='materialMethodChange'> <el-input v-model="form.specifications" disabled></el-input>
<el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
@ -112,8 +59,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="订单计划完成时间" prop="planFinishTime"> <el-form-item label="订单计划完成时间" prop="planFinishTime">
<el-date-picker <el-date-picker
@ -126,25 +71,19 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> </el-row>
<el-row :gutter="20">
<el-col :span='24'>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input> <el-input v-model="form.remark"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row>
<el-col :span='24'>
<el-form-item label="描述信息" prop="description">
<el-input v-model="form.description"></el-input>
</el-form-item>
</el-col>
</el-row> -->
</el-form> </el-form>
</template> </template>
<script> <script>
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage' import { getOrderCode, getOrderById, orderUpdate, orderCreate } from '@/api/base/orderManage'
import { getProductAll } from '@/api/base/product' import { getProductAll } from '@/api/base/product'
import { getCustomerList } from '@/api/base/customer'
export default { export default {
name: 'OrderAdd', name: 'OrderAdd',
data() { data() {
@ -155,15 +94,9 @@ export default {
code: '', code: '',
planQuantity: '', planQuantity: '',
planProductId: '', planProductId: '',
price: '',
customerId: '',
priority: '', priority: '',
packSpec: '', specifications: '',
workers: '',
processFlowId: '',
materialMethod: 1,
remark: '', remark: '',
// description: '',
planStartTime: '', planStartTime: '',
planFinishTime: '' planFinishTime: ''
}, },
@ -174,8 +107,6 @@ export default {
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }] planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
}, },
productList: [], productList: [],
customerList: [],
processFlowList: [],
isEdit: false // isEdit: false //
} }
}, },
@ -191,17 +122,13 @@ export default {
this.form.code = res.data.code this.form.code = res.data.code
this.form.planQuantity = res.data.planQuantity this.form.planQuantity = res.data.planQuantity
this.form.planProductId = res.data.planProductId this.form.planProductId = res.data.planProductId
this.form.price = res.data.price
this.form.customerId = res.data.customerId
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.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
this.form.workers = res.data.workers
this.form.processFlowId = res.data.processFlowId
this.form.materialMethod = res.data.materialMethod
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
// this.form.description = res.data.description setTimeout(() => {
this.getSpecifications(this.form.planProductId)
}, 300);
} }
}) })
} else { } else {
@ -218,14 +145,17 @@ export default {
getProductAll().then(res => { getProductAll().then(res => {
this.productList = res.data || [] this.productList = res.data || []
}) })
// },
getCustomerList().then(res => { //
this.customerList = res.data || [] getSpecifications(val) {
}) console.log(val)
// for (let i of this.productList) {
getProcessFlowList().then(res => { if (i.id === val) {
this.processFlowList = res.data || [] this.form.specifications = i.specifications
}) return
}
}
this.form.specifications = ''
}, },
timeChange() { timeChange() {
if (this.form.planStartTime && this.form.planFinishTime) { if (this.form.planStartTime && this.form.planFinishTime) {
@ -234,20 +164,6 @@ export default {
} }
} }
}, },
//
materialMethodChange(val) {
if (val === 2 && !this.form.processFlowId) {
this.form.materialMethod = 1
this.$modal.msgError("请先选择关联工艺");
}
},
//
processFlowIdChange(val) {
console.log(val)
if (!val) {
this.form.materialMethod = 1
}
},
submitForm() { submitForm() {
this.$refs['orderAddForm'].validate((valid) => { this.$refs['orderAddForm'].validate((valid) => {
if (valid) { if (valid) {
@ -257,7 +173,6 @@ export default {
return false return false
} }
} }
// console.log(this.form)
if (this.isEdit) { if (this.isEdit) {
// //
orderUpdate({ ...this.form }).then((res) => { orderUpdate({ ...this.form }).then((res) => {
@ -283,8 +198,6 @@ export default {
}, },
formClear() { formClear() {
this.$refs.orderAddForm.resetFields() this.$refs.orderAddForm.resetFields()
this.form.materialMethod = 1
this.form.price = 0.00
this.form.planQuantity = 0 this.form.planQuantity = 0
this.isEdit = false this.isEdit = false
} }

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

@ -17,7 +17,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="240" :width="290"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick"
@ -56,7 +56,7 @@
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import { getOrderPage, orderDelete, customerList, orderFinish } from '@/api/base/orderManage' import { getOrderPage, orderStatusSet, customerList, orderFinish } from '@/api/base/orderManage'
import OrderAdd from './components/orderAdd' import OrderAdd from './components/orderAdd'
import AddWorkOrder from './components/addWorkOrder' import AddWorkOrder from './components/addWorkOrder'
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict'
@ -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
}, },
{ {
@ -196,20 +193,10 @@ export default {
btnName: '新增', btnName: '新增',
showTip: '新增工单', showTip: '新增工单',
showParam: { showParam: {
type: '|', type: '&',
data: [ data: [
{ {
type: 'equal', type: 'less',
name: 'status',
value: 1
},
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status', name: 'status',
value: 3 value: 3
} }
@ -223,13 +210,42 @@ export default {
btnName: '绑定', btnName: '绑定',
showTip: '绑定工单', showTip: '绑定工单',
showParam: { showParam: {
type: '|', type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '&',
data: [ data: [
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
value: 1 value: 3
}, }
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:termination')
? {
type: 'termination',
btnName: '终止',
showTip: '终止',
showParam: {
type: '|',
data: [
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
@ -244,23 +260,18 @@ export default {
} }
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder') this.$auth.hasPermi('base:order-manage:cancel')
? { ? {
type: 'complete', 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
} }
] ]
} }
@ -280,35 +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
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:delete')
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
name: 'status',
value: 1
} }
] ]
} }
@ -345,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
} }
@ -385,8 +370,11 @@ export default {
this.$refs.orderAdd.init(val.data.id) this.$refs.orderAdd.init(val.data.id)
}) })
break break
case 'delete': case 'cancel':
this.handleDelete(val.data) this.handleEditStatus(val.data, '作废', '6')
break
case 'termination':
this.handleEditStatus(val.data, '终止', '5')
break break
case 'detail': case 'detail':
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id}) this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
@ -406,28 +394,45 @@ export default {
}) })
break break
case 'complete': case 'complete':
this.handleComplete(val.data) this.handleEditStatus(val.data, '完成', '4')
break break
default: default:
} }
}, },
// // ,
handleDelete(val) { handleEditStatus(val, tip, status) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() { console.log(val)
return orderDelete({ id: val.id }) if (val.workOrderNum > 0) {//
}).then(() => { this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
this.getList(); type: 'warning',
this.$modal.msgSuccess("操作成功"); distinguishCancelAndClose: true,
}).catch(() => {}); confirmButtonText: '同步',
}, cancelButtonText: '不同步'
// }).then(function() {
handleComplete(val) { console.log('同步')
this.$modal.confirm('是否确认完成订单"' + val.name + '"?').then(function() { orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
return orderFinish({ id: val.id }) 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,96 +1,80 @@
<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='3'> <el-col :span='4'>
<div class="blodTip">订单名</div> <div class="blodTip">订单名</div>
<div class="lightTip">{{orderMsg.name}}</div> <div class="lightTip">{{orderMsg.name}}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">产品信息</div> <div class="blodTip">产品名称</div>
<div class="lightTip">{{orderMsg.productName}}</div> <div class="lightTip">{{orderMsg.productName}}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">产品规格</div> <div class="blodTip">产品规格</div>
<div class="lightTip">{{orderMsg.specifications}}</div> <div class="lightTip">{{orderMsg.specifications}}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">客户</div>
<div class="lightTip">{{orderMsg.customerName}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">包装规格</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">物料计算方式</div>
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">创建时间</div> <div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div> <div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">计划开始时间</div> <div class="blodTip">计划开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div> <div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
</el-col> </el-col>
</el-row> <el-col :span='4'>
<el-row>
<el-col :span='3'>
<div class="blodTip">计划完成时间</div> <div class="blodTip">计划完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div> <div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
</el-col> </el-col>
<el-col :span='3'> </el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">计划加工数量</div> <div class="blodTip">计划加工数量</div>
<div class="lightTip">{{orderMsg.planQuantity}}</div> <div class="lightTip">{{orderMsg.planQuantity}}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</div> <div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{orderMsg.planArea}}</div> <div class="lightTip">{{orderMsg.planArea}}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">预计用时()</div> <div class="blodTip">预计用时()</div>
<div class="lightTip">{{ orderMsg.expectTime }}</div> <div class="lightTip">{{ orderMsg.expectTime }}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">状态</div> <div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div> <div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">实际开始时间</div> <div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div> <div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
</el-col> </el-col>
<el-col :span='3'> <el-col :span='4'>
<div class="blodTip">实际完成时间</div> <div class="blodTip">实际完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div> <div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
</el-col> </el-col>
<el-col :span='3'> </el-row>
<el-row>
<el-col :span='4'>
<div class="blodTip">实际生产数量</div> <div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div> <div class="lightTip">{{orderMsg.actualQuantity }}</div>
</el-col> </el-col>
</el-row> <el-col :span='4'>
<el-row>
<el-col :span='3'>
<div class="blodTip">完成比%</div> <div class="blodTip">完成比%</div>
<div class="lightTip">{{orderMsg.completeProp}}</div> <div class="lightTip">{{orderMsg.completeProp}}</div>
</el-col> </el-col>
<el-col :span='3'> <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 :span='3'>
<div class="blodTip">负责人</div>
<div class="lightTip">{{orderMsg.workers}}</div>
</el-col>
<el-col :span='3'>
<div class="blodTip">关联工艺</div>
<div class="lightTip">{{processFlowName}}</div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -109,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',
@ -139,7 +110,7 @@ const tableProps1 = [
{ {
prop: 'name', prop: 'name',
label: '工单名', label: '工单名',
minWidth: 100, minWidth: 160,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
@ -148,7 +119,13 @@ const tableProps1 = [
minWidth: 150 minWidth: 150
}, },
{ {
prop: 'planAssignmentQuantity', prop: 'roomNameDict',
label: '负责车间',
minWidth: 150,
filter: publicFormatter('workshop')
},
{
prop: 'planQuantity',
label: '计划加工量', label: '计划加工量',
width: 100 width: 100
}, },
@ -187,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,
@ -229,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') {
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.getMsg()
}, })
watch: { this.isSingle = false
$route: 'initData' console.log('aaaaa')
}, }else{
methods: { this.orderId = this.$route.query.orderId
initData(to) { this.isSingle = true
if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('?')[1].split('=')[1]
this.getMsg() this.getMsg()
console.log('bbbbbbbbbb')
} }
}, },
methods: {
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 || []
@ -283,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()
} }
} }
} }
@ -291,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;
@ -318,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,11 +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"
:tree-props="{children: 'orderMonitorVOS', hasChildren: 'hasChildren'}"
> >
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -31,24 +33,30 @@
</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',
@ -56,7 +64,9 @@ const tableProps = [
}, },
{ {
prop: 'productname', prop: 'productname',
label: '产品' label: '产品',
minWidth: 200,
showOverflowtooltip: true
}, },
{ {
prop: 'planStartTime', prop: 'planStartTime',
@ -87,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: '加工线',
@ -109,8 +125,8 @@ const tableProps = [
width: 100 width: 100
}, },
{ {
prop: 'workOrderNum', prop: 'orderNum',
label: '关联工单数量', label: '关联订单/工单数量',
width: 110 width: 110
} }
] ]
@ -121,7 +137,7 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '订单名称', label: '集团订单名称',
param: 'name' param: 'name'
}, },
{ {
@ -147,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: [],
@ -160,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
} }
] ]
@ -184,8 +198,13 @@ export default {
data: [ data: [
{ {
type: 'more', type: 'more',
name: 'workOrderNum', name: 'orderNum',
value: 1 value: 1
},
{
type: 'unequal',
name: 'woIdString',
value: ''
} }
] ]
} }
@ -220,75 +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() {
// orderGroupMonitor({...this.queryParams}).then(res => {
orderMonitor({...this.queryParams}).then(res => { let arr = res.data || []
this.list = res.data.records || [] if (arr.length > 0) {
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 color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
let tempArr = res.data || {} let arr2 = []
let tempArr2 = [] arr.map(item => {
for (let key in tempArr) { item.orderType = '集团订单'//
let tempArr3 = [] let woIdString = ''//str
//=========
let arr3 = []
let obj = {} let obj = {}
obj.orderName = tempArr[key][0].orderName obj.orderGroupName = item.name
obj.id = key obj.id = item.id
obj.num = tempArr[key][0].planQuantity obj.num = item.planQuantity || 0
let sunNum = 0 let sunNum = 0
for (let i = 0; i < tempArr[key].length; i++) { 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 = {} let subObj = {}
subObj.value = tempArr[key][i].actualAssignmentQuantity subObj.value = item.orderMonitorVOS[i].actualquantity
subObj.name = tempArr[key][i].woName subObj.name = item.orderMonitorVOS[i].name
if (i < 5) { if (i < 5) {
subObj.color = color[i] subObj.color = color[i]
} else { } else {
subObj.color = color[i%5] subObj.color = color[i%5]
} }
sunNum+=tempArr[key][i].actualAssignmentQuantity sunNum+=(item.orderMonitorVOS[i].actualquantity || 0)
tempArr3.push(subObj) arr3.push(subObj)
} }
tempArr3.push({ }
value: tempArr[key][0].planQuantity - sunNum > 0 ? tempArr[key][0].planQuantity - sunNum : 0, item.woIdString = woIdString
name: '未下发', arr3.push({
value: item.planQuantity - sunNum > 0 ? item.planQuantity - sunNum : 0,
name: '未生产',
color: '#F5F5F5' color: '#F5F5F5'
}) })
obj.sunNum = sunNum obj.sunNum = sunNum
obj.workOrder = tempArr3 obj.order = arr3
tempArr2.push(obj) arr2.push(obj)
} })
this.chartList = tempArr2 this.chartList = arr2
if (this.activeName === 'barChart' && this.chartList.length > 0) { if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart() this.$refs.monitoringRingCharts.initChart()
}) })
} }
})
}else{ }else{
// //
this.chartList = [] this.chartList = []
} }
console.log(arr)
this.list = arr
}) })
}, },
// //
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()
}, },
@ -296,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 === '集团订单') {
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 path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
}) })
}
break break
case 'qualityDetail': case 'qualityDetail':
this.$router.push({ this.$router.push({
@ -306,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() {