projects/mes-zhp #395

Merged
juzi merged 6 commits from projects/mes-zhp into projects/mes-test 2024-09-11 14:28:12 +08:00
7 changed files with 149 additions and 140 deletions
Showing only changes of commit d65dcb8712 - Show all commits

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-08-02 16:01:31
# @LastEditTime: 2024-09-02 09:07:05
# @LastEditors: zhp
# @Description:
###
@ -13,7 +13,7 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.81:48082'
@ -22,7 +22,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.64:48082'
# VUE_APP_BASE_API = 'http://192.168.1.99:48082'
VUE_APP_BASE_API = 'http://192.168.1.20:48082'

View File

@ -1,41 +1,23 @@
<!--
* @Date: 2020-12-14 09:07:03
* @LastEditors: zhp
* @LastEditTime: 2023-11-14 10:11:09
* @LastEditTime: 2024-09-05 09:50:14
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue
* @Description:
-->
<template>
<div class="visual-base-table-container">
<el-table
v-loading="isLoading"
:header-cell-style="{background:'rgba(4, 74, 132, .19)',color:'#fff'}"
:row-style="setRowStyle"
:data="renderData"
border
style="width: 100%; background: transparent"
>
<el-table-column
v-if="page && limit && showIndex"
prop="_pageIndex"
:label="'tableHeader.index' | i18nFilter"
:width="70"
align="center"
/>
<el-table-column
v-for="item in renderTableHeadList"
:key="item.prop"
:show-overflow-tooltip="showOverflow"
v-bind="item"
>
<el-table v-loading="isLoading"
:header-cell-style="{background:'rgba(4, 74, 132, .19)',color:'#fff'}" :row-style="setRowStyle" :data="renderData"
border style="width: 100%; background: transparent">
<el-table-column v-if="page && limit && showIndex" prop="_pageIndex" :label="'tableHeader.index' | i18nFilter"
:width="70" align="center" />
<el-table-column v-for="item in renderTableHeadList" :key="item.prop" :show-overflow-tooltip="showOverflow"
v-bind="item">
<template slot-scope="scope">
<component
:is="item.subcomponent"
v-if="item.subcomponent"
:inject-data="{...scope.row, ...item}"
@emitData="emitData"
/>
<component :is="item.subcomponent" v-if="item.subcomponent" :inject-data="{...scope.row, ...item}"
@emitData="emitData" />
<span v-else>{{ scope.row[item.prop] | commonFilter(item.filter) }}</span>
</template>

View File

@ -254,11 +254,11 @@ export default {
let name = this.form.name
_this.$emit('addWorkOrderSubmit')
// 使
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
_this.$router.push({
path: '/core/core-work-order?workOrderName='+encodeURI(name)
})
})
// _this.$modal.confirm('使?').then(function() {
// _this.$router.push({
// path: '/core/core-work-order?workOrderName='+encodeURI(name)
// })
// })
}
})
}

View File

@ -19,7 +19,7 @@
</el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable>
<el-select @change="getSpec" 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>
@ -64,6 +64,11 @@
<el-row :gutter="20">
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="产品规格" prop="specifications">
<el-input v-model="form.specifications"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
@ -86,6 +91,7 @@ export default {
code: '',
planQuantity: '',
planProductId: '',
specifications:undefined,
price: '',
customerId: '',
priority: '',
@ -110,6 +116,14 @@ export default {
}
},
methods: {
getSpec(val) {
console.log(val)
this.productList.forEach((ele) => {
if (ele.id === val) {
this.form.specifications = ele.specifications
}
})
},
init(id) {
this.getList()
if (id) {

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-08-01 16:27:30
* @LastEditTime: 2024-08-02 15:27:58
* @LastEditTime: 2024-09-04 15:56:53
* @LastEditors: zhp
* @Description:
-->
@ -17,7 +17,7 @@
</el-form-item>
<!-- </el-col> -->
<!-- </el-row> -->
<base-table @emitFun="inputChange" :table-props="tableProps" :table-data="list" :max-height="tableH">
<base-table :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>
@ -25,10 +25,7 @@
</template>
<script>
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate, orderSplit } from '@/api/base/orderManage'
import { getProductAll } from '@/api/base/product'
import { getCustomerList } from '@/api/base/customer'
import { parseTime } from '@/utils/ruoyi'
// import { publicFormatter } from '@/utils/dict'
import inputArea from './inputArea.vue'
const tableProps = [
{
@ -144,36 +141,38 @@ export default {
},
init(obj) {
// this.getList()
if (obj) {
this.isEdit = true
this.form.id = obj.id
getOrderById({id: this.form.id}).then(res => {
if (res.code === 0) {
this.form.name = res.data.name
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
}
})
} else {
this.isEdit = false
this.form.id = ''
//
getOrderCode().then(res => {
this.form.code = res.data || ''
})
}
// if (obj) {
this.isEdit = true
this.form = {}
this.list = []
this.form.id = obj.id
// getOrderById({id: this.form.id}).then(res => {
// if (res.code === 0) {
// this.form.name = res.data.name
// 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
// }
// })
// } else {
// this.isEdit = false
// this.form.id = ''
// //
// getOrderCode().then(res => {
// this.form.code = res.data || ''
// })
// }
},
// getList() {
// //
@ -211,12 +210,12 @@ export default {
// }
// },
submitForm() {
Promise.all(this.list.forEach((ele) => {
orderCreate(ele)
Promise.all(this.list.map((ele) => {
return orderCreate(ele);
})).then((res) => {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
})
this.$emit('splitWorkOrderSubmit');
});
// this.$refs['orderAddForm'].validate((valid) => {
// if (valid) {
@ -252,10 +251,6 @@ export default {
},
formClear() {
this.$refs.orderAddForm.resetFields()
this.form.materialMethod = 1
this.form.price = 0.00
this.form.planQuantity = 0
this.isEdit = false
}
}
}

View File

@ -3,7 +3,9 @@
<!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
<base-table ref="table" @row-click="handleRowClick" row-key="id"
:tree-props="{ children: 'children'}"
: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" />
@ -307,6 +309,7 @@ export default {
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
expandedRowKeys:[],
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
addWorkOrdervisible: false,
@ -321,6 +324,34 @@ export default {
this.getList()
},
methods: {
async handleRowClick(row) {
console.log(row)
if (!row.children) {
const queryParams = {
pageNo: this.queryParams.pageNo,
pageSize: this.queryParams.pageSize,
name: this.queryParams.name,
status: this.queryParams.status,
lastIssuedTime: this.queryParams.lastIssuedTime,
parentId: row.parentId
}
const response = await getOrderPage(queryParams)
row.children = response.data.records
// this.list.forEach((ele) => {
// if (ele.parentId === row.parentId) {
this.$set(this.list[row._pageIndex-1], 'children', response.data.records); //
// }
// })
row.hasChildren = true;
this.$set(row, 'expanded', true); //
} else {
row.expanded = !row.expanded; // /
}
// this.$nextTick(() => {
// const tableInstance = this.$refs.table.getTableRef();
// tableInstance.toggleRowExpansion(row);
// })
},
getList() {
getOrderPage({...this.queryParams}).then(res => {
let arr = res.data.records || []
@ -380,7 +411,7 @@ export default {
this.handleDelete(val.data)
break
case 'detail':
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
this.$router.push({path: 'order-detail-data?orderId='+ val.data.id})
break
case 'add':
this.workIssueTitle = '新增工单'
@ -453,10 +484,6 @@ export default {
this.$refs.addWorkOrder.formClear()
this.addWorkOrdervisible = false
},
splitWorkOrderCancel() {
this.$refs.splitWorkOrder.formClear()
this.splitWorkOrdervisible = false
},
addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit()
},
@ -464,8 +491,12 @@ export default {
this.addWorkOrderCancel()
this.getList()
},
splitWorkOrderCancel() {
this.$refs.splitWorkOrder.formClear()
this.splitWorkOrdervisible = false
},
splitWorkOrderConfirm() {
this.$refs.splitWorkOrder.splitWorkOrderSubmit()
this.$refs.splitWorkOrder.submitForm()
},
splitWorkOrderSubmit() {
this.splitWorkOrderCancel()

View File

@ -5,7 +5,9 @@
<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 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'>
@ -28,10 +30,11 @@
<div class="blodTip">包装规格</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
</el-col>
<el-col :span='3'>
<!-- <el-col :span='3'>
<div class="blodTip">物料计算方式</div>
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
</el-col>
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}
</div>
</el-col> -->
<el-col :span='3'>
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
@ -72,7 +75,7 @@
</el-col>
<el-col :span='3'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
</el-col>
</el-row>
<el-row>
@ -88,40 +91,27 @@
<div class="blodTip">负责人</div>
<div class="lightTip">{{orderMsg.workers}}</div>
</el-col>
<el-col :span='3'>
<!-- <el-col :span='3'>
<div class="blodTip">关联工艺</div>
<div class="lightTip">{{processFlowName}}</div>
</el-col>
</el-col> -->
</el-row>
</div>
</div>
<div class="box2">
<div class="boxTitle">
<!-- <div class="boxTitle">
<span class="blueTitle"></span>
<span>工单信息</span>
</div> -->
<div class="toggleTabBox">
<div :class="{ active: activeModule === 'orderInfo' }" @click="toggleTab('orderInfo')">子订单信息</div>
<!-- <div :class="{ active: activeModule === 'useInfo' }" @click="toggleTab('useInfo')">用料信息</div> -->
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps1"
:table-data="list1"
: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"
/>
<base-table v-show="activeModule === 'orderInfo'" :page="queryParams.pageNo" :limit="queryParams.pageSize"
:table-props="tableProps1" :table-data="list1" :max-height="tableH" />
<!-- <base-table v-show="activeModule === 'useInfo'" :page="queryParams.pageNo" :limit="queryParams.pageSize"
:table-props="tableProps2" :table-data="list2" :max-height="tableH" /> -->
</div>
</div>
</template>
@ -216,6 +206,7 @@ export default {
return {
orderId: '',
tableProps1,
activeModule:'orderInfo',
tableProps2,
list1: [],
list2: [],
@ -240,6 +231,9 @@ export default {
$route: 'initData'
},
methods: {
toggleTab(val) {
this.activeModule = val
},
initData(to) {
if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('?')[1].split('=')[1]
@ -283,7 +277,7 @@ export default {
},
//
returnOrderManage() {
this.$router.push({path: '/order/base/order-manage'})
this.$router.go(-1);
}
}
}
@ -296,9 +290,23 @@ export default {
border-radius: 9px;
}
.box2 {
height: calc((100vh - 360px) / 2);
height: calc((100vh - 360px));
padding: 12px 16px 0;
margin: 8px 0;
.toggleTabBox {
display: inline-block;
div {
display: inline-block;
padding: 0 8px 4px;
color: rgba(102, 102, 102, 0.5);
border-bottom: 2px solid rgba(242, 244, 249, 1);
cursor: pointer;
}
.active {
color: rgba(0, 0, 0, 0.85);
border-bottom-color: #0B58FF;
}
}
}
.box1 {
height: 215px;
@ -318,26 +326,5 @@ export default {
margin-bottom: 12px;
}
}
.box3 {
padding: 16px;
height: calc((100vh - 360px) / 2);
}
.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>
</style>