projects/mesxc-zjl #204
54
src/api/base/orderGroup.js
Normal file
54
src/api/base/orderGroup.js
Normal file
@ -0,0 +1,54 @@
|
||||
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
|
||||
})
|
||||
}
|
@ -86,6 +86,15 @@ export function orderDelete(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改订单状态,结束-终止-作废用
|
||||
export function orderStatusSet(data) {
|
||||
return request({
|
||||
url: '/base/order/orderStatusSet',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 下发订单,绑定的穿工单id,新建不传
|
||||
export function orderIssue(data) {
|
||||
return request({
|
||||
|
304
src/views/order/base/orderGroup/components/bindOrder.vue
Normal file
304
src/views/order/base/orderGroup/components/bindOrder.vue
Normal file
@ -0,0 +1,304 @@
|
||||
<template>
|
||||
<el-form ref="addWorkOrder" :rules="rules" label-width="130px" :model="form" label-position='top'>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="工单名称" prop="name" v-if='!isBind'>
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
|
||||
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg">
|
||||
<el-option
|
||||
v-for="item in workOrderList"
|
||||
: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="code">
|
||||
<el-input v-model="form.code" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
:label="item.name+' | '+item.specifications"
|
||||
:value="item.id">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划开始时间">
|
||||
<el-date-picker
|
||||
v-model="planStartTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%;"
|
||||
placeholder="选择日期"
|
||||
:disabled="isBind">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划完成时间">
|
||||
<el-date-picker
|
||||
v-model="planFinishTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%;"
|
||||
placeholder="选择日期"
|
||||
:disabled="isBind">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
||||
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划生产数量" prop="planQuantity">
|
||||
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="关联工艺" prop="processFlowId">
|
||||
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in processFlowList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled>
|
||||
<el-option label="产品基础BOM" :value="1"></el-option>
|
||||
<el-option label="工艺扩展BOM" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-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.ORDER_PRIORITY)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
v-for="item in workOrderTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="关联产线" prop="productLineId">
|
||||
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="form.workers" :disabled="isBind"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
|
||||
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getProductAll } from '@/api/base/product'
|
||||
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
|
||||
import { getLineAll } from '@/api/base/productionLine'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'bindOrder',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
workOrderId: '',
|
||||
orderId: '',
|
||||
name: '',
|
||||
code: '',
|
||||
planProductId: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
planAssignQuantity: 0,
|
||||
planQuantity: 0,
|
||||
processFlowId: '',
|
||||
materialMethod: 1,
|
||||
priority: '',
|
||||
productLineId: [],
|
||||
type: '',
|
||||
workers: '',
|
||||
planAssignmentQuantity: ''
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
|
||||
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
|
||||
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
|
||||
productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
|
||||
planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
|
||||
},
|
||||
productList: [],
|
||||
processFlowList: [],
|
||||
productLineList: [],
|
||||
workOrderTypeList: [
|
||||
{id: 1,name:'标准工单'},
|
||||
{id: 2, name:'特殊工单'}
|
||||
],
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
isBind: false,
|
||||
workOrderList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(data, param) {
|
||||
this.form.orderId = data.id
|
||||
this.getList()
|
||||
if (param === 'add') {
|
||||
this.isBind = false
|
||||
getWorkOrderCode().then(res => {
|
||||
this.form.code = res.data || ''
|
||||
})
|
||||
this.form.planProductId = data.planProductId
|
||||
this.form.processFlowId = data.processFlowId
|
||||
this.form.materialMethod = data.materialMethod
|
||||
}else{//绑定
|
||||
this.isBind = true
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 产品
|
||||
getProductAll().then(res => {
|
||||
this.productList = res.data || []
|
||||
})
|
||||
// 产线
|
||||
getLineAll().then(res => {
|
||||
this.productLineList = res.data || []
|
||||
})
|
||||
// 工艺
|
||||
getProcessFlowList().then(res => {
|
||||
this.processFlowList = res.data || []
|
||||
})
|
||||
// 工单list
|
||||
workOrderList({
|
||||
status: 1
|
||||
}).then(res => {
|
||||
this.workOrderList = res.data || []
|
||||
})
|
||||
},
|
||||
addWorkOrderSubmit() {
|
||||
this.$refs['addWorkOrder'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.isBind) {
|
||||
//绑定工单
|
||||
orderIssue({
|
||||
workOrderId: this.form.workOrderId,
|
||||
orderId: this.form.orderId,
|
||||
planAssignmentQuantity: this.form.planAssignmentQuantity
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功")
|
||||
this.$emit('addWorkOrderSubmit')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 新增工单
|
||||
let _this = this
|
||||
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
|
||||
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
|
||||
orderIssue({ ..._this.form }).then(res => {
|
||||
if (res.code === 0) {
|
||||
_this.$modal.msgSuccess("操作成功")
|
||||
let name = this.form.name
|
||||
_this.$emit('addWorkOrderSubmit')
|
||||
// 询问是否添加预使用主原料
|
||||
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
|
||||
_this.$router.push({
|
||||
path: '/core/core-work-order?workOrderName='+encodeURI(name)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.addWorkOrder.resetFields()
|
||||
this.form.materialMethod = 1
|
||||
this.form.planAssignQuantity = 0
|
||||
this.form.planQuantity = 0
|
||||
this.planFinishTime = ''
|
||||
this.planStartTime = ''
|
||||
this.form.planFinishTime = ''
|
||||
this.form.planStartTime = ''
|
||||
this.isBind = false
|
||||
},
|
||||
// 绑定工单,选择工单时获取工单信息
|
||||
getWorkOrderMsg() {
|
||||
if (this.form.workOrderId) {
|
||||
getWorkOrderById({id:this.form.workOrderId}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form.code = res.data.code
|
||||
this.form.planProductId = res.data.planProductId
|
||||
this.planStartTime = res.data.planStartTime ? moment.unix(res.data.planStartTime).format('YYYY-MM-DD HH:mm:ss') : null
|
||||
this.planFinishTime = res.data.planFinishTime ? moment.unix(res.data.planFinishTime).format('YYYY-MM-DD HH:mm:ss') : null
|
||||
this.form.planAssignQuantity = res.data.planAssignQuantity
|
||||
this.form.planQuantity = res.data.planQuantity
|
||||
this.form.processFlowId = res.data.processFlowId
|
||||
this.form.materialMethod = res.data.materialMethod
|
||||
this.form.priority = res.data.priority ? res.data.priority + '' : ''
|
||||
this.form.productLineId = res.data.productLineIds
|
||||
this.form.type = res.data.type
|
||||
this.form.workers = res.data.workers
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
196
src/views/order/base/orderGroup/components/orderGroupAdd.vue
Normal file
196
src/views/order/base/orderGroup/components/orderGroupAdd.vue
Normal file
@ -0,0 +1,196 @@
|
||||
<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="finishProduceTime">
|
||||
<el-date-picker
|
||||
v-model="form.finishProduceTime"
|
||||
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: '',
|
||||
finishProduceTime: '',
|
||||
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" }],
|
||||
finishProduceTime: [{ 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.getSpecifications(this.form.planProductId)
|
||||
this.form.customerId = res.data.customerId
|
||||
this.form.planQuantity = res.data.planQuantity
|
||||
this.form.finishProduceTime = res.data.finishProduceTime ? res.data.finishProduceTime : null
|
||||
this.form.packReq = res.data.packReq ? res.data.packReq+'' : ''
|
||||
this.form.remark = res.data.remark
|
||||
}
|
||||
})
|
||||
} 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) {
|
||||
console.log(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>
|
437
src/views/order/base/orderGroup/index.vue
Normal file
437
src/views/order/base/orderGroup/index.vue
Normal file
@ -0,0 +1,437 @@
|
||||
<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="workIssueTitle"
|
||||
:dialogVisible="addWorkOrdervisible"
|
||||
@cancel="addWorkOrderCancel"
|
||||
@confirm="addWorkOrderConfirm"
|
||||
:before-close="addWorkOrderCancel"
|
||||
width='70%'
|
||||
>
|
||||
<add-work-order ref="bindOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup'
|
||||
import { orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
|
||||
import 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: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '订单编码',
|
||||
minWidth: 180
|
||||
},
|
||||
{
|
||||
prop: 'customerId',
|
||||
label: '客户',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '订单状态',
|
||||
filter: publicFormatter('order_status')
|
||||
},{
|
||||
prop: 'specifications',
|
||||
label: '产品规格',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'actualquantity',
|
||||
label: '实际加工量',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'finishProduceTime',
|
||||
label: '交货时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'productName2',
|
||||
label: '包装要求',
|
||||
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-manage:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
status: null,
|
||||
lastIssuedTime: []
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
showTip: '绑定工单',
|
||||
// showParam: {
|
||||
// type: '|',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 1
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 2
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 3
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
showTip: '完成订单',
|
||||
// showParam: {
|
||||
// type: '|',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 2
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 3
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
? {
|
||||
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-manage:bindWorkOrder')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showTip: '作废',
|
||||
// showParam: {
|
||||
// type: '|',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 2
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 3
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:edit')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
// showParam: {
|
||||
// type: '&',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'triggerOrigin',
|
||||
// value: 1
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 1
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
|
||||
workIssueTitle: '',
|
||||
addWorkOrdervisible: 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.list || []
|
||||
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
|
||||
}
|
||||
}
|
||||
item.price = item.price?.toFixed(2)
|
||||
})
|
||||
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.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
|
||||
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
|
||||
} else {
|
||||
this.queryParams.lastIssuedTime = []
|
||||
}
|
||||
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.addWorkOrdervisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.bindOrder.init(val.data, 'bind')
|
||||
})
|
||||
break
|
||||
case 'complete':
|
||||
this.handleEditStatus(val.data, '完成', '4')
|
||||
break
|
||||
default:
|
||||
}
|
||||
},
|
||||
// 完成,终止,作废
|
||||
handleEditStatus(val, tip, status) {
|
||||
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()
|
||||
},
|
||||
// 下发新增
|
||||
addWorkOrderCancel() {
|
||||
this.$refs.bindOrder.formClear()
|
||||
this.addWorkOrdervisible = false
|
||||
},
|
||||
addWorkOrderConfirm() {
|
||||
this.$refs.bindOrder.addWorkOrderSubmit()
|
||||
},
|
||||
addWorkOrderSubmit() {
|
||||
this.addWorkOrderCancel()
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
376
src/views/order/base/orderGroup/orderGroupDetailData.vue
Normal file
376
src/views/order/base/orderGroup/orderGroupDetailData.vue
Normal file
@ -0,0 +1,376 @@
|
||||
<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">{{orderGroupMsg.name}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">产品名称</div>
|
||||
<div class="lightTip">{{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">接口没有该字段</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">交货时间</div>
|
||||
<div class="lightTip">需要确认时哪个字段</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">创建时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderGroupMsg.triggerTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">计划开始时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderGroupMsg.planStartTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">计划完成时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderGroupMsg.planFinishTime) }}</div>
|
||||
</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">接口没有该字段</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">状态</div>
|
||||
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderGroupMsg.status)}}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">实际开始时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderGroupMsg.startProduceTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">实际完成时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderGroupMsg.finishProduceTime) }}</div>
|
||||
</el-col>
|
||||
<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">
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>厂务订单编码: 64656563453543</span>
|
||||
</div>
|
||||
<div style="padding-left: 14px;">
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">订单名称</div>
|
||||
<div class="lightTip">测试订单1</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">产品名称</div>
|
||||
<div class="lightTip">测试产品</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">产品规格</div>
|
||||
<div class="lightTip">测试产品规格</div>
|
||||
</el-col>
|
||||
<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">{{ parseTime(orderGroupMsg.planStartTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">计划完成时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderGroupMsg.planFinishTime) }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<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.planArea}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">预计用时</div>
|
||||
<div class="lightTip">10</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.completeProp}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">废片数量</div>
|
||||
<div class="lightTip">100</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="list"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { getProcessFlowList } from '@/api/base/orderManage'
|
||||
import { orderGroupDetail } from '@/api/base/orderGroup'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'issueTime',
|
||||
label: '下发时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '工单名',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '工单编码',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'code1',
|
||||
label: '负责车间',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'planAssignmentQuantity',
|
||||
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: '负责人'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
}
|
||||
]
|
||||
import { bomUseNum } from '@/api/base/orderManage'
|
||||
export default {
|
||||
name: 'orderGroupDetailData',
|
||||
data() {
|
||||
return {
|
||||
orderGroupId: '',
|
||||
tableProps,
|
||||
list: [{remark: 111},{remark: 111},{remark: 111}],
|
||||
tableH: this.tableHeight(510) / 2,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 500
|
||||
},
|
||||
orderGroupMsg: {},
|
||||
processFlowName: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(510) / 2
|
||||
})
|
||||
this.orderGroupId = location.href.split('?')[1].split('=')[1]
|
||||
this.getMsg()
|
||||
},
|
||||
watch: {
|
||||
$route: 'initData'
|
||||
},
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'orderGroupDetailData') {
|
||||
this.orderGroupId = location.href.split('?')[1].split('=')[1]
|
||||
this.getMsg()
|
||||
}
|
||||
},
|
||||
getMsg() {
|
||||
orderGroupDetail({
|
||||
id: this.orderGroupId
|
||||
}).then(res => {
|
||||
this.orderGroupMsg = res.data
|
||||
// this.list = res.data.coreWorkOrderRespVOS
|
||||
// bomUseNum({
|
||||
// productId: this.orderGroupMsg.planProductId
|
||||
// }).then(res2 => {
|
||||
// if (res2.data && res2.data.length > 0) {
|
||||
// let arr = res2.data
|
||||
// arr.map(item => {
|
||||
// if (item) {
|
||||
// let a = item.num * this.orderGroupMsg.remainingQuantity
|
||||
// item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
|
||||
// }
|
||||
// })
|
||||
// this.list2 = arr
|
||||
// }else {
|
||||
// this.list2 = []
|
||||
// }
|
||||
// })
|
||||
// 工艺
|
||||
getProcessFlowList().then(res => {
|
||||
let arr = res.data || []
|
||||
if (arr.length > 0) {
|
||||
arr.map(item => {
|
||||
if (item.id === this.orderGroupMsg.processFlowId) {
|
||||
this.processFlowName = item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 返回
|
||||
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;
|
||||
}
|
||||
}
|
||||
.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>
|
@ -117,6 +117,20 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="关联产线" prop="productLineId">
|
||||
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
|
||||
@ -129,8 +143,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="form.workers" :disabled="isBind"></el-input>
|
||||
|
@ -16,39 +16,6 @@
|
||||
<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="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-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable>
|
||||
@ -61,43 +28,25 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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 :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="form.workers"></el-input>
|
||||
</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-form-item label="产品名称" prop="planProductId">
|
||||
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable @change="getSpecifications">
|
||||
<el-option
|
||||
v-for="item in processFlowList"
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
: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-col :span='6'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" @change='materialMethodChange'>
|
||||
<el-option label="产品基础BOM" :value="1"></el-option>
|
||||
<el-option label="工艺扩展BOM" :value="2"></el-option>
|
||||
</el-select>
|
||||
<el-form-item label="产品规格" prop="specifications">
|
||||
<el-input v-model="form.specifications"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
@ -112,8 +61,6 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="订单计划完成时间" prop="planFinishTime">
|
||||
<el-date-picker
|
||||
@ -126,25 +73,19 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
</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-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>
|
||||
</template>
|
||||
<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 { getCustomerList } from '@/api/base/customer'
|
||||
export default {
|
||||
name: 'OrderAdd',
|
||||
data() {
|
||||
@ -155,15 +96,9 @@ export default {
|
||||
code: '',
|
||||
planQuantity: '',
|
||||
planProductId: '',
|
||||
price: '',
|
||||
customerId: '',
|
||||
priority: '',
|
||||
packSpec: '',
|
||||
workers: '',
|
||||
processFlowId: '',
|
||||
materialMethod: 1,
|
||||
specifications: '',
|
||||
remark: '',
|
||||
// description: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: ''
|
||||
},
|
||||
@ -174,8 +109,6 @@ export default {
|
||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
|
||||
},
|
||||
productList: [],
|
||||
customerList: [],
|
||||
processFlowList: [],
|
||||
isEdit: false //是否是编辑
|
||||
}
|
||||
},
|
||||
@ -191,17 +124,11 @@ export default {
|
||||
this.form.code = res.data.code
|
||||
this.form.planQuantity = res.data.planQuantity
|
||||
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.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.getSpecifications(this.form.planProductId)
|
||||
this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
|
||||
this.form.remark = res.data.remark
|
||||
// this.form.description = res.data.description
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -218,14 +145,17 @@ export default {
|
||||
getProductAll().then(res => {
|
||||
this.productList = res.data || []
|
||||
})
|
||||
// 客户
|
||||
getCustomerList().then(res => {
|
||||
this.customerList = res.data || []
|
||||
})
|
||||
// 工艺
|
||||
getProcessFlowList().then(res => {
|
||||
this.processFlowList = res.data || []
|
||||
})
|
||||
},
|
||||
// 获取产品规格
|
||||
getSpecifications(val) {
|
||||
console.log(val)
|
||||
for (let i of this.productList) {
|
||||
if (i.id === val) {
|
||||
this.form.specifications = i.specifications
|
||||
return
|
||||
}
|
||||
}
|
||||
this.form.specifications = ''
|
||||
},
|
||||
timeChange() {
|
||||
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() {
|
||||
this.$refs['orderAddForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
@ -257,7 +173,6 @@ export default {
|
||||
return false
|
||||
}
|
||||
}
|
||||
// console.log(this.form)
|
||||
if (this.isEdit) {
|
||||
//编辑
|
||||
orderUpdate({ ...this.form }).then((res) => {
|
||||
@ -283,8 +198,6 @@ export default {
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.orderAddForm.resetFields()
|
||||
this.form.materialMethod = 1
|
||||
this.form.price = 0.00
|
||||
this.form.planQuantity = 0
|
||||
this.isEdit = false
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="240"
|
||||
:width="290"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
@ -56,7 +56,7 @@
|
||||
</template>
|
||||
<script>
|
||||
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 AddWorkOrder from './components/addWorkOrder'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
@ -187,7 +187,7 @@ export default {
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
list: [{name: '111111'}],
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-manage:addWorkOrder')
|
||||
@ -195,26 +195,26 @@ export default {
|
||||
type: 'add',
|
||||
btnName: '新增',
|
||||
showTip: '新增工单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
// showParam: {
|
||||
// type: '|',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 1
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 2
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 3
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
@ -222,26 +222,26 @@ export default {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
showTip: '绑定工单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
// showParam: {
|
||||
// type: '|',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 1
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 2
|
||||
// },
|
||||
// {
|
||||
// type: 'equal',
|
||||
// name: 'status',
|
||||
// value: 3
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
@ -266,6 +266,18 @@ export default {
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
? {
|
||||
type: 'termination',
|
||||
btnName: '终止'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
@ -292,27 +304,6 @@ export default {
|
||||
]
|
||||
}
|
||||
}
|
||||
: 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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
addOrEditTitle: '',
|
||||
@ -328,7 +319,7 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList()
|
||||
// this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
@ -385,8 +376,11 @@ export default {
|
||||
this.$refs.orderAdd.init(val.data.id)
|
||||
})
|
||||
break
|
||||
case 'delete':
|
||||
this.handleDelete(val.data)
|
||||
case 'cancel':
|
||||
this.handleEditStatus(val.data, '作废', '6')
|
||||
break
|
||||
case 'termination':
|
||||
this.handleEditStatus(val.data, '终止', '5')
|
||||
break
|
||||
case 'detail':
|
||||
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
|
||||
@ -406,24 +400,15 @@ export default {
|
||||
})
|
||||
break
|
||||
case 'complete':
|
||||
this.handleComplete(val.data)
|
||||
this.handleEditStatus(val.data, '完成', '4')
|
||||
break
|
||||
default:
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(val) {
|
||||
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
||||
return orderDelete({ id: val.id })
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 完成
|
||||
handleComplete(val) {
|
||||
this.$modal.confirm('是否确认完成订单"' + val.name + '"?').then(function() {
|
||||
return orderFinish({ id: val.id })
|
||||
// 完成,终止,作废
|
||||
handleEditStatus(val, tip, status) {
|
||||
this.$modal.confirm('是否确认'+tip+'"' + val.name + '"?').then(function() {
|
||||
return orderStatusSet({ id: val.id })
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
|
@ -8,90 +8,70 @@
|
||||
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||
<div style="padding-left: 14px;">
|
||||
<el-row>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">订单名</div>
|
||||
<div class="lightTip">{{orderMsg.name}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">产品信息</div>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">产品名称</div>
|
||||
<div class="lightTip">{{orderMsg.productName}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">产品规格</div>
|
||||
<div class="lightTip">{{orderMsg.specifications}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">客户</div>
|
||||
<div class="lightTip">{{orderMsg.customerName}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">包装规格</div>
|
||||
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">物料计算方式</div>
|
||||
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">创建时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">计划开始时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">计划完成时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">计划加工数量</div>
|
||||
<div class="lightTip">{{orderMsg.planQuantity}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">加工平方数(平方米)</div>
|
||||
<div class="lightTip">{{orderMsg.planArea}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">预计用时(时)</div>
|
||||
<div class="lightTip">{{ orderMsg.expectTime }}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">状态</div>
|
||||
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">实际开始时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">实际完成时间</div>
|
||||
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">实际生产数量</div>
|
||||
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">完成比%</div>
|
||||
<div class="lightTip">{{orderMsg.completeProp}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">废片数量</div>
|
||||
<div class="lightTip">{{orderMsg.nokQuantity}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">负责人</div>
|
||||
<div class="lightTip">{{orderMsg.workers}}</div>
|
||||
</el-col>
|
||||
<el-col :span='3'>
|
||||
<div class="blodTip">关联工艺</div>
|
||||
<div class="lightTip">{{processFlowName}}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
@ -147,6 +127,12 @@ const tableProps1 = [
|
||||
label: '工单编码',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '负责车间',
|
||||
minWidth: 150,
|
||||
filter: publicFormatter('workshop')
|
||||
},
|
||||
{
|
||||
prop: 'planAssignmentQuantity',
|
||||
label: '计划加工量',
|
||||
|
@ -18,6 +18,8 @@
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
row-key="id"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
@ -28,6 +30,21 @@
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<!-- <el-table
|
||||
:data="list"
|
||||
style="width: 100%;margin-bottom: 20px;"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column
|
||||
v-for='item in tableProps'
|
||||
:key='item.id'
|
||||
:prop="item.prop"
|
||||
:label="item.label"
|
||||
:width="item.minWidth?item.minWidth:120">
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
</div>
|
||||
<!-- 图 -->
|
||||
<monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList'/>
|
||||
@ -226,60 +243,126 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getPage() {
|
||||
// 表数据
|
||||
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 = []
|
||||
this.list = [
|
||||
{
|
||||
name: '11111',
|
||||
id: '1',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '1-11111', id: '11',}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '2222222',
|
||||
id: '2',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '2-222222', id: '22'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '3333333',
|
||||
id: '3',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '3-333333', id: '33'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '44444',
|
||||
id: '4',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '4-44444', id: '44'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '555555',
|
||||
id: '5',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '5-55555', id: '55'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '6',
|
||||
id: '6',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '6-66666', id: '66'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '7777777',
|
||||
id: '7',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '7-77777', id: '77'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '888888',
|
||||
id: '8',
|
||||
finishProduceTime: '2023-11-11T12:12:12',
|
||||
children:[
|
||||
{name: '8-888888', id: '88'}
|
||||
]
|
||||
}
|
||||
})
|
||||
]
|
||||
// // 表数据
|
||||
// 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user