Merge pull request 'projects/mesxc-zjl' (#204) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #204
Этот коммит содержится в:
Коммит
38bb5a31e7
5
.env.dev
5
.env.dev
@ -14,16 +14,13 @@ VUE_APP_TITLE = MES系统
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.20:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.0.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.1.62:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
|
72
src/api/base/orderGroup.js
Обычный файл
72
src/api/base/orderGroup.js
Обычный файл
@ -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
|
||||
})
|
||||
}
|
@ -8,6 +8,23 @@ export function orderList(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单列表
|
||||
export function getOrderList(query) {
|
||||
return request({
|
||||
url: '/base/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单列表
|
||||
export function getFreeOrderList() {
|
||||
return request({
|
||||
url: '/base/order/getFreeOrderList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 条件获得工单列表
|
||||
export function workOrderList(query) {
|
||||
return request({
|
||||
@ -86,6 +103,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({
|
||||
@ -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() {
|
||||
return request({
|
||||
|
156
src/views/order/base/orderGroup/components/bindOrder.vue
Обычный файл
156
src/views/order/base/orderGroup/components/bindOrder.vue
Обычный файл
@ -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>
|
197
src/views/order/base/orderGroup/components/orderGroupAdd.vue
Обычный файл
197
src/views/order/base/orderGroup/components/orderGroupAdd.vue
Обычный файл
@ -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>
|
445
src/views/order/base/orderGroup/index.vue
Обычный файл
445
src/views/order/base/orderGroup/index.vue
Обычный файл
@ -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>
|
339
src/views/order/base/orderGroup/orderGroupDetailData.vue
Обычный файл
339
src/views/order/base/orderGroup/orderGroupDetailData.vue
Обычный файл
@ -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>
|
@ -27,14 +27,19 @@
|
||||
<el-option
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
:label="item.name+' | '+item.specifications"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="产品规格" prop="specifications">
|
||||
<el-input v-model="form.specifications" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划开始时间">
|
||||
<el-date-picker
|
||||
@ -47,8 +52,6 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划完成时间">
|
||||
<el-date-picker
|
||||
@ -71,9 +74,11 @@
|
||||
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="关联工艺" prop="processFlowId">
|
||||
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
|
||||
<el-select v-model="form.processFlowId" placeholder="请选择" :disabled="isBind" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in processFlowList"
|
||||
:key="item.id"
|
||||
@ -83,11 +88,9 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled>
|
||||
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" :disabled="isBind" @change='selectMethod'>
|
||||
<el-option label="产品基础BOM" :value="1"></el-option>
|
||||
<el-option label="工艺扩展BOM" :value="2"></el-option>
|
||||
</el-select>
|
||||
@ -117,30 +120,42 @@
|
||||
</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-form-item label="关联产线" prop="productLineId">
|
||||
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="负责车间" prop="roomNameDict">
|
||||
<el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="form.workers" :disabled="isBind"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
|
||||
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
@ -159,6 +174,7 @@ export default {
|
||||
name: '',
|
||||
code: '',
|
||||
planProductId: '',
|
||||
specifications: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
planAssignQuantity: 0,
|
||||
@ -167,6 +183,7 @@ export default {
|
||||
materialMethod: 1,
|
||||
priority: '',
|
||||
productLineId: [],
|
||||
roomNameDict: '',
|
||||
type: '',
|
||||
workers: '',
|
||||
planAssignmentQuantity: ''
|
||||
@ -176,7 +193,9 @@ export default {
|
||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
|
||||
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
|
||||
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
|
||||
materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }],
|
||||
productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
|
||||
roomNameDict: [{ required: true, message: "负责车间不能为空", trigger: "change" }],
|
||||
planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
|
||||
},
|
||||
productList: [],
|
||||
@ -202,8 +221,8 @@ export default {
|
||||
this.form.code = res.data || ''
|
||||
})
|
||||
this.form.planProductId = data.planProductId
|
||||
this.form.processFlowId = data.processFlowId
|
||||
this.form.materialMethod = data.materialMethod
|
||||
// this.form.processFlowId = data.processFlowId
|
||||
// this.form.materialMethod = data.materialMethod
|
||||
}else{//绑定
|
||||
this.isBind = true
|
||||
}
|
||||
@ -212,6 +231,9 @@ export default {
|
||||
// 产品
|
||||
getProductAll().then(res => {
|
||||
this.productList = res.data || []
|
||||
if (this.form.planProductId) {
|
||||
this.getSpecifications(this.form.planProductId)
|
||||
}
|
||||
})
|
||||
// 产线
|
||||
getLineAll().then(res => {
|
||||
@ -228,44 +250,60 @@ export default {
|
||||
this.workOrderList = res.data || []
|
||||
})
|
||||
},
|
||||
// 物料变动
|
||||
selectMethod(val) {
|
||||
if (val === 2 && !this.form.processFlowId ) {
|
||||
this.form.materialMethod = 1
|
||||
this.$modal.msgError("请先选择关联工艺");
|
||||
}else if (val === 1) {
|
||||
this.form.processFlowId = ''
|
||||
}
|
||||
},
|
||||
addWorkOrderSubmit() {
|
||||
this.$refs['addWorkOrder'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.isBind) {
|
||||
//绑定工单
|
||||
orderIssue({
|
||||
workOrderId: this.form.workOrderId,
|
||||
orderId: this.form.orderId,
|
||||
planAssignmentQuantity: this.form.planAssignmentQuantity
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功")
|
||||
this.$emit('addWorkOrderSubmit')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 新增工单
|
||||
let _this = this
|
||||
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
|
||||
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
|
||||
orderIssue({ ..._this.form }).then(res => {
|
||||
if (res.code === 0) {
|
||||
_this.$modal.msgSuccess("操作成功")
|
||||
let name = this.form.name
|
||||
_this.$emit('addWorkOrderSubmit')
|
||||
// 询问是否添加预使用主原料
|
||||
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
|
||||
_this.$router.push({
|
||||
path: '/core/core-work-order?workOrderName='+encodeURI(name)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (this.isBind) {//绑定工单
|
||||
if (!this.form.workOrderId) {
|
||||
this.$modal.msgError("工单名称不能为空");
|
||||
return false
|
||||
}
|
||||
})
|
||||
if (!this.form.planAssignmentQuantity) {
|
||||
this.$modal.msgError("计划分配订单量不能为空");
|
||||
return false
|
||||
}
|
||||
orderIssue({
|
||||
workOrderId: this.form.workOrderId,
|
||||
orderId: this.form.orderId,
|
||||
planAssignmentQuantity: this.form.planAssignmentQuantity
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功")
|
||||
this.$emit('addWorkOrderSubmit')
|
||||
}
|
||||
})
|
||||
}else{// 新增工单
|
||||
this.$refs['addWorkOrder'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 新增工单
|
||||
let _this = this
|
||||
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
|
||||
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
|
||||
orderIssue({ ..._this.form }).then(res => {
|
||||
if (res.code === 0) {
|
||||
_this.$modal.msgSuccess("操作成功")
|
||||
let name = this.form.name
|
||||
_this.$emit('addWorkOrderSubmit')
|
||||
// 询问是否添加预使用主原料
|
||||
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
|
||||
_this.$router.push({
|
||||
path: '/core/core-work-order?workOrderName='+encodeURI(name)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.addWorkOrder.resetFields()
|
||||
@ -295,9 +333,23 @@ export default {
|
||||
this.form.productLineId = res.data.productLineIds
|
||||
this.form.type = res.data.type
|
||||
this.form.workers = res.data.workers
|
||||
this.form.roomNameDict = (res.data.roomNameDict || res.data.roomNameDict === 0) ? res.data.roomNameDict + '' : ''
|
||||
setTimeout(() => {
|
||||
this.getSpecifications(this.form.planProductId)
|
||||
}, 300);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取产品规格
|
||||
getSpecifications(val) {
|
||||
for (let i of this.productList) {
|
||||
if (i.id === val) {
|
||||
this.form.specifications = i.specifications
|
||||
return
|
||||
}
|
||||
}
|
||||
this.form.specifications = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
<el-form-item label="订单号" prop="code">
|
||||
<el-form-item label="订单编码" prop="code">
|
||||
<el-input v-model="form.code"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -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,30 +28,13 @@
|
||||
</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"
|
||||
:value="item.id">
|
||||
@ -93,11 +43,8 @@
|
||||
</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" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='6'>
|
||||
@ -112,8 +59,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 +71,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 +94,9 @@ export default {
|
||||
code: '',
|
||||
planQuantity: '',
|
||||
planProductId: '',
|
||||
price: '',
|
||||
customerId: '',
|
||||
priority: '',
|
||||
packSpec: '',
|
||||
workers: '',
|
||||
processFlowId: '',
|
||||
materialMethod: 1,
|
||||
specifications: '',
|
||||
remark: '',
|
||||
// description: '',
|
||||
planStartTime: '',
|
||||
planFinishTime: ''
|
||||
},
|
||||
@ -174,8 +107,6 @@ export default {
|
||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
|
||||
},
|
||||
productList: [],
|
||||
customerList: [],
|
||||
processFlowList: [],
|
||||
isEdit: false //是否是编辑
|
||||
}
|
||||
},
|
||||
@ -191,17 +122,13 @@ 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.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
|
||||
this.form.remark = res.data.remark
|
||||
// this.form.description = res.data.description
|
||||
setTimeout(() => {
|
||||
this.getSpecifications(this.form.planProductId)
|
||||
}, 300);
|
||||
}
|
||||
})
|
||||
} 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
|
||||
}
|
||||
|
108
src/views/order/base/orderManage/components/topTab.vue
Обычный файл
108
src/views/order/base/orderManage/components/topTab.vue
Обычный файл
@ -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>
|
@ -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'
|
||||
@ -70,17 +70,13 @@ const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '订单名称',
|
||||
minWidth: 120,
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '订单编码',
|
||||
minWidth: 180
|
||||
},
|
||||
{
|
||||
prop: 'customerId',
|
||||
label: '客户',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
@ -111,6 +107,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'productName',
|
||||
label: '产品',
|
||||
width: 200,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
@ -196,20 +193,10 @@ export default {
|
||||
btnName: '新增',
|
||||
showTip: '新增工单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
@ -223,20 +210,10 @@ export default {
|
||||
btnName: '绑定',
|
||||
showTip: '绑定工单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 3
|
||||
}
|
||||
@ -244,19 +221,14 @@ export default {
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
this.$auth.hasPermi('base:order-manage:complete')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
showTip: '完成订单',
|
||||
showParam: {
|
||||
type: '|',
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'status',
|
||||
@ -266,6 +238,45 @@ export default {
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage: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-manage:cancel')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
showTip: '作废',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
@ -280,35 +291,9 @@ export default {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'triggerOrigin',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'equal',
|
||||
type: 'less',
|
||||
name: 'status',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: 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
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -345,7 +330,7 @@ export default {
|
||||
item.customerId = i.name
|
||||
}
|
||||
}
|
||||
item.price = item.price.toFixed(2)
|
||||
item.price = item.price ? item.price.toFixed(2) : '0.00'
|
||||
})
|
||||
this.list = arr
|
||||
}
|
||||
@ -385,8 +370,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,28 +394,45 @@ 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) {
|
||||
console.log(val)
|
||||
if (val.workOrderNum > 0) {//有下级工单
|
||||
this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '同步',
|
||||
cancelButtonText: '不同步'
|
||||
}).then(function() {
|
||||
console.log('同步')
|
||||
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}).catch(action => {
|
||||
if (action === 'cancel') {
|
||||
console.log('不同步')
|
||||
orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}else {
|
||||
return console.log('关闭')
|
||||
}
|
||||
})
|
||||
}else{// 无下级工单
|
||||
this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
|
||||
return orderStatusSet({ id: val.id, status: status})
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
|
@ -1,96 +1,80 @@
|
||||
<template>
|
||||
<div class="orderDetailData">
|
||||
<div v-show="!isSingle" style="position: relative;padding-right: 90px;">
|
||||
<TopTab :orderIdList='orderIdList' :orderId="orderId" @emitFun='toggleName'/>
|
||||
<el-button type="primary" plain size="small" style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||
</div>
|
||||
<div class="box1">
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>订单编码: {{orderMsg.code}}</span>
|
||||
</div>
|
||||
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||
<el-button v-show="isSingle" type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||
<div style="padding-left: 14px;">
|
||||
<el-row>
|
||||
<el-col :span='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>
|
||||
<div class="lightTip">该字段未绑定</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -109,26 +93,13 @@
|
||||
:max-height="tableH"
|
||||
/>
|
||||
</div>
|
||||
<div class="box3">
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>预计用料信息</span>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps2"
|
||||
:table-data="list2"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { getProcessFlowList } from '@/api/base/orderManage'
|
||||
import TopTab from './components/topTab'
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'issueTime',
|
||||
@ -139,7 +110,7 @@ const tableProps1 = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '工单名',
|
||||
minWidth: 100,
|
||||
minWidth: 160,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
@ -148,7 +119,13 @@ const tableProps1 = [
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'planAssignmentQuantity',
|
||||
prop: 'roomNameDict',
|
||||
label: '负责车间',
|
||||
minWidth: 150,
|
||||
filter: publicFormatter('workshop')
|
||||
},
|
||||
{
|
||||
prop: 'planQuantity',
|
||||
label: '计划加工量',
|
||||
width: 100
|
||||
},
|
||||
@ -187,39 +164,26 @@ const tableProps1 = [
|
||||
},
|
||||
{
|
||||
prop: 'workers',
|
||||
label: '负责人'
|
||||
label: '负责人',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
showOverflowtooltip: true
|
||||
}
|
||||
]
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '物料名称'
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '剩余生产预计消耗'
|
||||
}
|
||||
]
|
||||
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
|
||||
import { orderDetail, getOrderList } from '@/api/base/orderManage'
|
||||
export default {
|
||||
name: 'OrderDetailData',
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
orderIdList: [], //订单监控跳转过来
|
||||
isSingle: true,//单个详情,false是多个详情
|
||||
tableProps1,
|
||||
tableProps2,
|
||||
list1: [],
|
||||
list2: [],
|
||||
tableH: this.tableHeight(510) / 2,
|
||||
tableH: this.tableHeight(420),
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
@ -229,45 +193,38 @@ export default {
|
||||
processFlowName: ''
|
||||
}
|
||||
},
|
||||
components:{ TopTab },
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(510) / 2
|
||||
})
|
||||
this.orderId = location.href.split('?')[1].split('=')[1]
|
||||
this.getMsg()
|
||||
},
|
||||
watch: {
|
||||
$route: 'initData'
|
||||
if (this.$route.query.orderIdString && this.$route.query.orderIdString!=='undefined') {
|
||||
getOrderList({ids:this.$route.query.orderIdString}).then(res => {
|
||||
this.orderIdList = res.data.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name
|
||||
}
|
||||
})
|
||||
this.orderId = this.orderIdList[0].id
|
||||
this.getMsg()
|
||||
})
|
||||
this.isSingle = false
|
||||
console.log('aaaaa')
|
||||
}else{
|
||||
this.orderId = this.$route.query.orderId
|
||||
this.isSingle = true
|
||||
this.getMsg()
|
||||
console.log('bbbbbbbbbb')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'OrderDetailData') {
|
||||
this.orderId = location.href.split('?')[1].split('=')[1]
|
||||
this.getMsg()
|
||||
}
|
||||
},
|
||||
getMsg() {
|
||||
orderDetail({
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
this.orderMsg = res.data
|
||||
this.list1 = res.data.coreWorkOrderRespVOS
|
||||
bomUseNum({
|
||||
productId: this.orderMsg.planProductId
|
||||
}).then(res2 => {
|
||||
if (res2.data && res2.data.length > 0) {
|
||||
let arr = res2.data
|
||||
arr.map(item => {
|
||||
if (item) {
|
||||
let a = item.num * this.orderMsg.remainingQuantity
|
||||
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
|
||||
}
|
||||
})
|
||||
this.list2 = arr
|
||||
}else {
|
||||
this.list2 = []
|
||||
}
|
||||
})
|
||||
// 工艺
|
||||
getProcessFlowList().then(res => {
|
||||
let arr = res.data || []
|
||||
@ -283,7 +240,12 @@ export default {
|
||||
},
|
||||
// 返回
|
||||
returnOrderManage() {
|
||||
this.$router.push({path: '/order/base/order-manage'})
|
||||
this.$router.go(-1)
|
||||
},
|
||||
// 切换tab获取订单详情
|
||||
toggleName(val) {
|
||||
this.orderId = val
|
||||
this.getMsg()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -291,14 +253,14 @@ export default {
|
||||
<style lang='scss' scoped>
|
||||
.orderDetailData {
|
||||
background-color: rgb(242, 244, 249);
|
||||
.box1, .box2, .box3 {
|
||||
.box1, .box2{
|
||||
background-color: #fff;
|
||||
border-radius: 9px;
|
||||
}
|
||||
.box2 {
|
||||
height: calc((100vh - 360px) / 2);
|
||||
height: calc(100vh - 351px);
|
||||
padding: 12px 16px 0;
|
||||
margin: 8px 0;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.box1 {
|
||||
height: 215px;
|
||||
@ -318,10 +280,6 @@ export default {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
.box3 {
|
||||
padding: 16px;
|
||||
height: calc((100vh - 360px) / 2);
|
||||
}
|
||||
.boxTitle {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
|
@ -2,13 +2,13 @@
|
||||
<div>
|
||||
<div class="boxTitle">
|
||||
<span class="blueTitle"></span>
|
||||
<span>各订单环形图</span>
|
||||
<span>各集团订单环形图</span>
|
||||
</div>
|
||||
<div class="chartBox" id='orderChartBox' v-show='chartList.length'>
|
||||
<div class="chartItem" v-for="(item, index) in chartList" :key='index' :style="{width: 388*beilv+'px',height: 286*beilv+'px',padding:14*beilv+'px',marginRight:9*beilv+'px',marginBottom:9*beilv+'px'}">
|
||||
<div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}">
|
||||
<svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/>
|
||||
<span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderName}}</span>
|
||||
<span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderGroupName}}</span>
|
||||
<span>订单计划数量{{item.num}}</span>
|
||||
</div>
|
||||
<div
|
||||
@ -16,7 +16,7 @@
|
||||
:style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}"
|
||||
></div>
|
||||
<div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}">
|
||||
<div class="legendItem" v-for="(subItem, i) in item.workOrder" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
|
||||
<div class="legendItem" v-for="(subItem, i) in item.order" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
|
||||
<span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span>
|
||||
<div>
|
||||
<span class="itemName" :style="{fontSize: 14 * beilv + 'px'}">
|
||||
@ -78,7 +78,7 @@ export default {
|
||||
var chartDom = document.getElementById(this.chartList[i].id);
|
||||
this.myChart[i] = echarts.init(chartDom);
|
||||
let colorList = []
|
||||
this.chartList[i].workOrder.map(item => {
|
||||
this.chartList[i].order.map(item => {
|
||||
colorList.push(item.color)
|
||||
})
|
||||
let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0)
|
||||
@ -118,7 +118,7 @@ export default {
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
data: this.chartList[i].workOrder
|
||||
data: this.chartList[i].order
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@ -13,11 +13,13 @@
|
||||
<!-- 表 -->
|
||||
<div v-if="activeName === 'dataList'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:page="1"
|
||||
:limit="1000000000000"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
row-key="id"
|
||||
:tree-props="{children: 'orderMonitorVOS', hasChildren: 'hasChildren'}"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
@ -31,24 +33,30 @@
|
||||
</div>
|
||||
<!-- 图 -->
|
||||
<monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList'/>
|
||||
<pagination
|
||||
<!-- <pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getPage"
|
||||
/>
|
||||
/> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { orderMonitor, orderAssignmentList } from '@/api/base/orderManage'
|
||||
import { orderGroupMonitor } from '@/api/base/orderGroup'
|
||||
import MonitoringRingCharts from './../components/monitoringRingCharts'
|
||||
import moment from "moment"
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '订单名称'
|
||||
label: '订单名称',
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'orderType',
|
||||
label: '订单类型'
|
||||
},
|
||||
{
|
||||
prop: 'customerName',
|
||||
@ -56,7 +64,9 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'productname',
|
||||
label: '产品'
|
||||
label: '产品',
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'planStartTime',
|
||||
@ -87,6 +97,12 @@ const tableProps = [
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'deliveTime',
|
||||
label: '交货时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'lineNames',
|
||||
label: '加工线',
|
||||
@ -109,8 +125,8 @@ const tableProps = [
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNum',
|
||||
label: '关联工单数量',
|
||||
prop: 'orderNum',
|
||||
label: '关联订单/工单数量',
|
||||
width: 110
|
||||
}
|
||||
]
|
||||
@ -121,7 +137,7 @@ export default {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '订单名称',
|
||||
label: '集团订单名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
@ -147,10 +163,8 @@ export default {
|
||||
activeName: 'dataList',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
startProduceTime: []
|
||||
deliveTime: []
|
||||
},
|
||||
tableProps,
|
||||
list: [],
|
||||
@ -160,14 +174,14 @@ export default {
|
||||
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
|
||||
? {
|
||||
type: 'orderDetail',
|
||||
btnName: '工单',
|
||||
showTip: '工单详情',
|
||||
btnName: '详情',
|
||||
showTip: '订单/工单详情',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'more',
|
||||
name: 'workOrderNum',
|
||||
name: 'orderNum',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
@ -184,8 +198,13 @@ export default {
|
||||
data: [
|
||||
{
|
||||
type: 'more',
|
||||
name: 'workOrderNum',
|
||||
name: 'orderNum',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'unequal',
|
||||
name: 'woIdString',
|
||||
value: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -220,75 +239,78 @@ export default {
|
||||
let start = moment().subtract(30, 'days').format('yyyy-MM-DD')
|
||||
let end = moment().format('yyyy-MM-DD')
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.startProduceTime[0] = start + ' 00:00:00'
|
||||
this.queryParams.startProduceTime[1] = end + ' 23:59:59'
|
||||
this.queryParams.deliveTime[0] = start + ' 00:00:00'
|
||||
this.queryParams.deliveTime[1] = end + ' 23:59:59'
|
||||
this.getPage()
|
||||
},
|
||||
methods: {
|
||||
getPage() {
|
||||
// 表数据
|
||||
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++) {
|
||||
orderGroupMonitor({...this.queryParams}).then(res => {
|
||||
let arr = res.data || []
|
||||
if (arr.length > 0) {
|
||||
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
|
||||
let arr2 = []
|
||||
arr.map(item => {
|
||||
item.orderType = '集团订单'//前端写死订单类型
|
||||
let woIdString = ''//集团订单层添加工单str跳转质量用
|
||||
//=========图数据
|
||||
let arr3 = []
|
||||
let obj = {}
|
||||
obj.orderGroupName = item.name
|
||||
obj.id = item.id
|
||||
obj.num = item.planQuantity || 0
|
||||
let sunNum = 0
|
||||
if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) {
|
||||
for(let i = 0; i < item.orderMonitorVOS.length; i++) {
|
||||
item.orderMonitorVOS[i].orderType = '厂务订单'//前端写死订单类型
|
||||
item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid
|
||||
item.orderMonitorVOS[i].orderNum = item.orderMonitorVOS[i].workOrderNum
|
||||
woIdString+=item.orderMonitorVOS[i].woIdString?item.orderMonitorVOS[i].woIdString:''
|
||||
//==============图数据
|
||||
let subObj = {}
|
||||
subObj.value = tempArr[key][i].actualAssignmentQuantity
|
||||
subObj.name = tempArr[key][i].woName
|
||||
subObj.value = item.orderMonitorVOS[i].actualquantity
|
||||
subObj.name = item.orderMonitorVOS[i].name
|
||||
if (i < 5) {
|
||||
subObj.color = color[i]
|
||||
} else {
|
||||
subObj.color = color[i%5]
|
||||
}
|
||||
sunNum+=tempArr[key][i].actualAssignmentQuantity
|
||||
tempArr3.push(subObj)
|
||||
sunNum+=(item.orderMonitorVOS[i].actualquantity || 0)
|
||||
arr3.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()
|
||||
})
|
||||
}
|
||||
item.woIdString = woIdString
|
||||
arr3.push({
|
||||
value: item.planQuantity - sunNum > 0 ? item.planQuantity - sunNum : 0,
|
||||
name: '未生产',
|
||||
color: '#F5F5F5'
|
||||
})
|
||||
obj.sunNum = sunNum
|
||||
obj.order = arr3
|
||||
arr2.push(obj)
|
||||
})
|
||||
this.chartList = arr2
|
||||
if (this.activeName === 'barChart' && this.chartList.length > 0) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.monitoringRingCharts.initChart()
|
||||
})
|
||||
}
|
||||
}else{
|
||||
// 显示无数据的图片
|
||||
this.chartList = []
|
||||
}
|
||||
console.log(arr)
|
||||
this.list = arr
|
||||
})
|
||||
},
|
||||
// 查询
|
||||
buttonClick(val) {
|
||||
this.queryParams.name = val.name
|
||||
if (val.timeVal && val.timeVal.length > 0) {
|
||||
this.queryParams.startProduceTime[0] = val.timeVal[0] + ' 00:00:00'
|
||||
this.queryParams.startProduceTime[1] = val.timeVal[1] + ' 23:59:59'
|
||||
this.queryParams.deliveTime[0] = val.timeVal[0] + ' 00:00:00'
|
||||
this.queryParams.deliveTime[1] = val.timeVal[1] + ' 23:59:59'
|
||||
} else {
|
||||
this.queryParams.startProduceTime = []
|
||||
this.queryParams.deliveTime = []
|
||||
}
|
||||
this.getPage()
|
||||
},
|
||||
@ -296,9 +318,15 @@ export default {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'orderDetail':
|
||||
this.$router.push({
|
||||
path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
|
||||
})
|
||||
if (val.data.orderType === '集团订单') {
|
||||
this.$router.push({// 去厂务订单详情
|
||||
path: '/order/base/order-manage/order-detail-data?orderIdString='+ val.data.orderIds.join(',')
|
||||
})
|
||||
}else{
|
||||
this.$router.push({// 去工单详情
|
||||
path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
|
||||
})
|
||||
}
|
||||
break
|
||||
case 'qualityDetail':
|
||||
this.$router.push({
|
||||
@ -306,9 +334,9 @@ export default {
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.$router.push({
|
||||
path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
|
||||
})
|
||||
// this.$router.push({
|
||||
// path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
|
||||
// })
|
||||
}
|
||||
},
|
||||
toggleTab() {
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user