Compare commits
No commits in common. "9699e90ab39531204720261ceb0e0817a3267651" and "cee303fd20d014fc9169d7cde369737f468c4692" have entirely different histories.
9699e90ab3
...
cee303fd20
4
.env.dev
4
.env.dev
@ -1,7 +1,7 @@
|
|||||||
###
|
###
|
||||||
# @Author: Do not edit
|
# @Author: Do not edit
|
||||||
# @Date: 2023-08-29 09:40:39
|
# @Date: 2023-08-29 09:40:39
|
||||||
# @LastEditTime: 2024-09-02 09:07:05
|
# @LastEditTime: 2024-07-31 14:57:31
|
||||||
# @LastEditors: zhp
|
# @LastEditors: zhp
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
@ -22,7 +22,7 @@ VUE_APP_TITLE = MES系统
|
|||||||
# VUE_APP_BASE_API = 'http://192.168.1.56: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.4.159:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.64:48082'
|
# VUE_APP_BASE_API = 'http://192.168.1.64:48082'
|
||||||
VUE_APP_BASE_API = 'http://192.168.1.20:48082'
|
VUE_APP_BASE_API = 'http://192.168.1.99:48082'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
/*
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2024-06-28 17:03:29
|
|
||||||
* @LastEditors: zwq
|
|
||||||
* @LastEditTime: 2024-09-27 09:24:09
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 获取走势分析数据
|
// 获取走势分析数据
|
||||||
@ -24,15 +17,6 @@ export function exportTrend(data) {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 导出对比分析数据
|
|
||||||
export function exportCompare(data) {
|
|
||||||
return request({
|
|
||||||
url: '/analysis/energy-analysis/exportCompare',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取对比分析数据
|
// 获取对比分析数据
|
||||||
export function getCompare(data) {
|
export function getCompare(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -51,24 +35,6 @@ export function getYoy(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出同比分析数据
|
|
||||||
export function exportYoy(data) {
|
|
||||||
return request({
|
|
||||||
url: '/analysis/energy-analysis/exportYoy',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 导出环比分析数据
|
|
||||||
export function exportChain(data) {
|
|
||||||
return request({
|
|
||||||
url: '/analysis/energy-analysis/exportChain',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取环比分析数据(1:月,2:周,3:日)
|
// 获取环比分析数据(1:月,2:周,3:日)
|
||||||
export function getQoq(data) {
|
export function getQoq(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* @Date: 2023-10-21 11:50:46
|
* @Date: 2023-10-21 11:50:46
|
||||||
* @LastEditTime: 2023-11-15 17:19:19
|
* @LastEditTime: 2023-11-15 17:19:19
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
@ -16,14 +16,6 @@ export function createCoreWO(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取工艺模式工单预计消耗物料
|
|
||||||
export function getMaterialCostWorkOrder(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/process-retrospect/getMaterialCostWorkOrder',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 更新工单
|
// 更新工单
|
||||||
export function updateCoreWO(data) {
|
export function updateCoreWO(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -50,22 +50,6 @@ export function getOrderById(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 订单进度-获取普通模式订单剩余数量
|
|
||||||
export function getOrderRemainNum(id) {
|
|
||||||
return request({
|
|
||||||
url: '/base/order/getOrderRemainNum?id=' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 订单进度-获取工艺模式订单预计消耗物料(计算后)
|
|
||||||
export function getMaterialCostOrder(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/process-retrospect/getMaterialCostOrder',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得工艺流程列表
|
// 获得工艺流程列表
|
||||||
export function getProcessFlowList() {
|
export function getProcessFlowList() {
|
||||||
@ -75,16 +59,6 @@ export function getProcessFlowList() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获得工艺流程列表
|
|
||||||
export function getProcessFlowPage(query) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/process-flow/page',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建订单
|
// 创建订单
|
||||||
export function orderCreate(data) {
|
export function orderCreate(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -191,34 +165,3 @@ export function orderVoid(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function orderSplit(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/order/split',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getDetailTree(data) {
|
|
||||||
return request({
|
|
||||||
url: 'base/order/getDetailTree',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function getDetailTreeInfo(data) {
|
|
||||||
return request({
|
|
||||||
url: 'base/order/getDetailTreeInfoById',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function orderStop(data) {
|
|
||||||
return request({
|
|
||||||
url: 'base/order/stop',
|
|
||||||
method: 'post',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<svg width="72px" height="72px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>rollback</title>
|
|
||||||
<defs>
|
|
||||||
<filter x="-1.1%" y="-5.8%" width="102.1%" height="115.3%" filterUnits="objectBoundingBox" id="filter-1">
|
|
||||||
<feOffset dx="0" dy="5" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
|
||||||
<feGaussianBlur stdDeviation="6" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
|
||||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0926573427 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
|
|
||||||
<feMerge>
|
|
||||||
<feMergeNode in="shadowMatrixOuter1"></feMergeNode>
|
|
||||||
<feMergeNode in="SourceGraphic"></feMergeNode>
|
|
||||||
</feMerge>
|
|
||||||
</filter>
|
|
||||||
</defs>
|
|
||||||
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<g id="页内多种导航方式" transform="translate(-1914.000000, -745.000000)" fill-rule="nonzero">
|
|
||||||
<g id="编组-16" filter="url(#filter-1)" transform="translate(94.000000, 641.000000)">
|
|
||||||
<g id="编组-3备份" transform="translate(1816.000000, 96.000000)">
|
|
||||||
<g id="rollback" transform="translate(16.000000, 15.000000)">
|
|
||||||
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="20" height="20"></rect>
|
|
||||||
<path d="M11.390625,3.78125 L5.71875,3.78125 L5.71875,2.625 C5.71875,2.5203125 5.5984375,2.4625 5.5171875,2.5265625 L3.2984375,4.2765625 C3.234375,4.3265625 3.234375,4.4234375 3.2984375,4.4734375 L5.5171875,6.2234375 C5.5984375,6.2875 5.71875,6.2296875 5.71875,6.125 L5.71875,4.96875 L11.203125,4.96875 C11.7554097,4.96875 12.203125,5.41646525 12.203125,5.96875 L12.203125,11.3125 C12.203125,11.8647847 11.7554097,12.3125 11.203125,12.3125 L2.93775156,12.3125 L2.93775156,12.3125 C2.55569144,12.3125 2.36466138,12.4938859 2.36466138,12.8566576 C2.36466138,13.5 2.93775156,13.5 2.93775156,13.5 C2.93775156,13.5 5.75537604,13.5 11.390625,13.5 C13,13.5 13.390625,12.8986083 13.390625,11.9909216 L13.390625,4.96875 C13.390625,4.06071182 13,3.78125 11.390625,3.78125 Z" id="路径" fill="#0B58FF"></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 2.4 KiB |
@ -1,23 +1,41 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Date: 2020-12-14 09:07:03
|
* @Date: 2020-12-14 09:07:03
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2024-09-05 09:50:14
|
* @LastEditTime: 2023-11-14 10:11:09
|
||||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue
|
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="visual-base-table-container">
|
<div class="visual-base-table-container">
|
||||||
<el-table v-loading="isLoading"
|
<el-table
|
||||||
:header-cell-style="{background:'rgba(4, 74, 132, .19)',color:'#fff'}" :row-style="setRowStyle" :data="renderData"
|
v-loading="isLoading"
|
||||||
border style="width: 100%; background: transparent">
|
:header-cell-style="{background:'rgba(4, 74, 132, .19)',color:'#fff'}"
|
||||||
<el-table-column v-if="page && limit && showIndex" prop="_pageIndex" :label="'tableHeader.index' | i18nFilter"
|
:row-style="setRowStyle"
|
||||||
:width="70" align="center" />
|
:data="renderData"
|
||||||
<el-table-column v-for="item in renderTableHeadList" :key="item.prop" :show-overflow-tooltip="showOverflow"
|
border
|
||||||
v-bind="item">
|
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">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<component :is="item.subcomponent" v-if="item.subcomponent" :inject-data="{...scope.row, ...item}"
|
<component
|
||||||
@emitData="emitData" />
|
: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>
|
<span v-else>{{ scope.row[item.prop] | commonFilter(item.filter) }}</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
@ -150,10 +150,6 @@
|
|||||||
<el-button type="primary" size="small" @click="search">查询</el-button>
|
<el-button type="primary" size="small" @click="search">查询</el-button>
|
||||||
<span class="separateStyle"></span>
|
<span class="separateStyle"></span>
|
||||||
<el-button size="small" @click="resetBtn">重置</el-button>
|
<el-button size="small" @click="resetBtn">重置</el-button>
|
||||||
<span class="separateStyle"></span>
|
|
||||||
<el-button type="primary" size="small" @click="exportData" plain>
|
|
||||||
导出
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span v-if="isFold" class="foldClass" @click='switchMode'>
|
<span v-if="isFold" class="foldClass" @click='switchMode'>
|
||||||
@ -330,16 +326,8 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查询
|
|
||||||
search() {
|
|
||||||
if (this.validateData()) {
|
|
||||||
this.queryParams.startTime = this.queryParams.startTime + '';
|
|
||||||
this.queryParams.endTime = this.queryParams.endTime + '';
|
|
||||||
this.$emit('submit', this.queryParams);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 查询
|
// 查询
|
||||||
validateData() {
|
search() {
|
||||||
if (!this.queryParams.energyTypeId) {
|
if (!this.queryParams.energyTypeId) {
|
||||||
this.$modal.msgError('请选择能源类型')
|
this.$modal.msgError('请选择能源类型')
|
||||||
return false
|
return false
|
||||||
@ -409,7 +397,10 @@ export default {
|
|||||||
this.$modal.msgError('请选择对象')
|
this.$modal.msgError('请选择对象')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true;
|
this.queryParams.startTime = this.queryParams.startTime + ''
|
||||||
|
this.queryParams.endTime = this.queryParams.endTime + ''
|
||||||
|
console.log(this.queryParams)
|
||||||
|
this.$emit('submit', this.queryParams)
|
||||||
},
|
},
|
||||||
resetBtn() {
|
resetBtn() {
|
||||||
this.queryParams.energyTypeId = null
|
this.queryParams.energyTypeId = null
|
||||||
@ -445,14 +436,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
element.classList.add('divHeight')
|
element.classList.add('divHeight')
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
exportData() {
|
|
||||||
if (this.validateData()) {
|
|
||||||
this.queryParams.startTime = this.queryParams.startTime + '';
|
|
||||||
this.queryParams.endTime = this.queryParams.endTime + '';
|
|
||||||
this.$emit('exportD', this.queryParams);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -510,4 +494,4 @@ export default {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container contrastAnalysisBox" id="contrastAnalysisBox">
|
<div class="app-container contrastAnalysisBox" id="contrastAnalysisBox">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<search-area :isFold="isFold" @submit="getList" @exportD="exportData"/>
|
<search-area :isFold="isFold" @submit="getList"/>
|
||||||
<div v-show="chartData.length">
|
<div v-show="chartData.length">
|
||||||
<bar-chart
|
<bar-chart
|
||||||
ref="analysisBarChart"
|
ref="analysisBarChart"
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getCompare ,exportCompare} from "@/api/analysis/energyAnalysis"
|
import { getCompare } from "@/api/analysis/energyAnalysis"
|
||||||
import SearchArea from "./components/searchArea"
|
import SearchArea from "./components/searchArea"
|
||||||
import BarChart from "./components/barChart"
|
import BarChart from "./components/barChart"
|
||||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
@ -85,17 +85,32 @@ export default {
|
|||||||
}
|
}
|
||||||
this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX);
|
this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX);
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
// 导出
|
||||||
exportData(val) {
|
exportExl() {
|
||||||
// 处理查询参数
|
if (this.list.length > 0) {
|
||||||
this.$modal.confirm('是否确认导出对比分析数据?').then(() => {
|
var wb = XLSX.utils.table_to_book(
|
||||||
this.exportLoading = true;
|
document.querySelector('.contrast-out-table')
|
||||||
return exportCompare(val);
|
);
|
||||||
}).then(response => {
|
let fileName = '对比分析.xlsx';
|
||||||
this.$download.excel(response, '对比分析数据.xlsx');
|
var wbout = XLSX.write(wb, {
|
||||||
this.exportLoading = false;
|
bookType: 'xlsx',
|
||||||
}).catch(() => {});
|
bookSST: true,
|
||||||
}
|
type: 'array',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
FileSaver.saveAs(
|
||||||
|
new Blob([wbout], { type: 'application/octet-stream' }),
|
||||||
|
fileName
|
||||||
|
);
|
||||||
|
this.$message.success('导出成功');
|
||||||
|
} catch (e) {
|
||||||
|
if (typeof console !== 'undefined') console.log(e, wbout);
|
||||||
|
}
|
||||||
|
return wbout;
|
||||||
|
} else {
|
||||||
|
this.$modal.msgWarning('暂无数据导出');
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -158,33 +158,14 @@ export default {
|
|||||||
this.$emit('submit', this.queryParams)
|
this.$emit('submit', this.queryParams)
|
||||||
},
|
},
|
||||||
exportData() {
|
exportData() {
|
||||||
if (this.objArr.length === 0) {
|
let name
|
||||||
this.$modal.msgError('请选择对象')
|
if (this.queryParams.objId) {
|
||||||
return false
|
name = this.getObjName(this.objList, this.queryParams.objId)
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.objId = this.objArr[this.objArr.length-1]
|
this.$modal.msgWarning("对象不能为空")
|
||||||
}
|
|
||||||
if (!this.queryParams.type) {
|
|
||||||
this.$modal.msgError('请选择时间维度')
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (!this.queryParams.searchTime) {
|
this.$emit('exportD', {name: name})
|
||||||
this.$modal.msgError('请选择时间')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
switch (this.queryParams.type) {
|
|
||||||
case 1:
|
|
||||||
this.queryParams.searchTime = this.transformTime(this.monthValue)
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
let value = moment(this.weekValue).day(6).format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
this.queryParams.searchTime = new Date(value).getTime()
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
let value2 = moment(this.dateValue).format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
this.queryParams.searchTime = new Date(value2).getTime()
|
|
||||||
}
|
|
||||||
this.$emit('exportD', this.queryParams)
|
|
||||||
},
|
},
|
||||||
// 递归取对象name
|
// 递归取对象name
|
||||||
getObjName(list, id) {
|
getObjName(list, id) {
|
||||||
@ -248,4 +229,4 @@ export default {
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getQoq,exportChain } from "@/api/analysis/energyAnalysis"
|
import { getQoq } from "@/api/analysis/energyAnalysis"
|
||||||
import SearchArea from "./components/searchArea"
|
import SearchArea from "./components/searchArea"
|
||||||
import LineChart from "./components/lineChart"
|
import LineChart from "./components/lineChart"
|
||||||
import FileSaver from "file-saver"
|
import FileSaver from "file-saver"
|
||||||
@ -89,14 +89,26 @@ export default {
|
|||||||
this.chartData = this.list
|
this.chartData = this.list
|
||||||
},
|
},
|
||||||
exportData(val) {
|
exportData(val) {
|
||||||
// 处理查询参数
|
if (this.list.length > 0) {
|
||||||
this.$modal.confirm('是否确认导出环比分析数据?').then(() => {
|
var wb = XLSX.utils.table_to_book(document.querySelector(".qoq-out-table"))
|
||||||
this.exportLoading = true;
|
let fileName = val.name + "环比分析.xlsx"
|
||||||
return exportChain(val);
|
var wbout = XLSX.write(wb, {
|
||||||
}).then(response => {
|
bookType: "xlsx",
|
||||||
this.$download.excel(response, '环比分析数据.xlsx');
|
bookSST: true,
|
||||||
this.exportLoading = false;
|
type: "array"
|
||||||
}).catch(() => {});
|
})
|
||||||
|
try {
|
||||||
|
FileSaver.saveAs(
|
||||||
|
new Blob([wbout], { type: "application/octet-stream" }),
|
||||||
|
fileName
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
if (typeof console !== "undefined") console.log(e, wbout);
|
||||||
|
}
|
||||||
|
return wbout
|
||||||
|
} else {
|
||||||
|
this.$modal.msgWarning("暂无数据导出")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,4 +129,4 @@ export default {
|
|||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -125,26 +125,14 @@ export default {
|
|||||||
this.$emit('submit', this.queryParams)
|
this.$emit('submit', this.queryParams)
|
||||||
},
|
},
|
||||||
exportData() {
|
exportData() {
|
||||||
if (this.objArr.length === 0) {
|
let name
|
||||||
this.$modal.msgError('请选择对象')
|
if (this.queryParams.objId) {
|
||||||
return false
|
name = this.getObjName(this.objList, this.queryParams.objId)
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.objId = this.objArr[this.objArr.length-1]
|
this.$modal.msgWarning("对象不能为空")
|
||||||
}
|
|
||||||
if (!this.queryParams.type) {
|
|
||||||
this.$modal.msgError('请选择时间维度')
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (!this.queryParams.searchTime) {
|
this.$emit('exportD', {name: name})
|
||||||
this.$modal.msgError('请选择时间')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.queryParams.type === 3) {
|
|
||||||
this.queryParams.searchTime = this.transformTime(this.yearMonth) + ''
|
|
||||||
} else {
|
|
||||||
this.queryParams.searchTime = this.transformYear(this.yearValue) + ''
|
|
||||||
}
|
|
||||||
this.$emit('exportD', this.queryParams)
|
|
||||||
},
|
},
|
||||||
// 递归取对象name
|
// 递归取对象name
|
||||||
getObjName(list, id) {
|
getObjName(list, id) {
|
||||||
@ -214,4 +202,4 @@ export default {
|
|||||||
background: #E8E8E8;
|
background: #E8E8E8;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getYoy,exportYoy } from "@/api/analysis/energyAnalysis"
|
import { getYoy } from "@/api/analysis/energyAnalysis"
|
||||||
import subRate from "./components/subRate.vue"
|
import subRate from "./components/subRate.vue"
|
||||||
import SearchArea from "./components/searchArea"
|
import SearchArea from "./components/searchArea"
|
||||||
import LineChart from "./components/lineChart"
|
import LineChart from "./components/lineChart"
|
||||||
@ -101,14 +101,26 @@ export default {
|
|||||||
this.chartData = this.list
|
this.chartData = this.list
|
||||||
},
|
},
|
||||||
exportData(val) {
|
exportData(val) {
|
||||||
// 处理查询参数
|
if (this.list.length > 0) {
|
||||||
this.$modal.confirm('是否确认导出同比分析数据?').then(() => {
|
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table"))
|
||||||
this.exportLoading = true;
|
let fileName = val.name + "同比分析.xlsx"
|
||||||
return exportYoy(val);
|
var wbout = XLSX.write(wb, {
|
||||||
}).then(response => {
|
bookType: "xlsx",
|
||||||
this.$download.excel(response, '同比分析数据.xlsx');
|
bookSST: true,
|
||||||
this.exportLoading = false;
|
type: "array"
|
||||||
}).catch(() => {});
|
})
|
||||||
|
try {
|
||||||
|
FileSaver.saveAs(
|
||||||
|
new Blob([wbout], { type: "application/octet-stream" }),
|
||||||
|
fileName
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
if (typeof console !== "undefined") console.log(e, wbout);
|
||||||
|
}
|
||||||
|
return wbout
|
||||||
|
} else {
|
||||||
|
this.$modal.msgWarning("暂无数据导出")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,4 +140,4 @@ export default {
|
|||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,430 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: dialogForm.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-08-15 10:32:36
|
|
||||||
description: 弹窗的表单组件
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-form ref="form" :model="form" :label-width="`${labelWidth}px`" :size="size" :label-position="labelPosition"
|
|
||||||
v-loading="formLoading">
|
|
||||||
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
|
|
||||||
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
|
|
||||||
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
|
|
||||||
<el-input v-if="col.input" v-model="form[col.prop]" @change="$emit('update', form)"
|
|
||||||
:placeholder="`请输入${col.label}`" v-bind="col.bind" />
|
|
||||||
<el-input v-if="col.textarea" type="textarea" v-model="form[col.prop]" :disabled="disabled"
|
|
||||||
@change="$emit('update', form)" :placeholder="`请输入${col.label}`" v-bind="col.bind" />
|
|
||||||
<el-select v-if="col.select" v-model="form[col.prop]" :placeholder="`请选择${col.label}`"
|
|
||||||
@change="$emit('selectupdate', form)" v-bind="col.bind">
|
|
||||||
<el-option v-for="opt in optionListOf[col.prop]" :key="opt.value" :label="opt.label" :value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
<el-date-picker v-if="col.datetime" v-model="form[col.prop]" type="datetime"
|
|
||||||
:disabled="col.disabled ? col.disabled : disabled" :placeholder="`请选择${col.label}`" value-format="timestamp"
|
|
||||||
@change="$emit('update', form)" v-bind="col.bind">
|
|
||||||
</el-date-picker>
|
|
||||||
<el-switch v-if="col.switch" v-model="form[col.prop]" :disabled="disabled" active-color="#0b58ff"
|
|
||||||
inactive-color="#e1e1e1" @change="$emit('update', form)" v-bind="col.bind"></el-switch>
|
|
||||||
<component v-if="col.subcomponent" :key="col.key" :disabled="disabled" :read-only="disabled"
|
|
||||||
:is="col.subcomponent" v-model="form[col.prop]" :inlineStyle="col.style" @on-change="$emit('update', form)"
|
|
||||||
v-bind="col.bind"></component>
|
|
||||||
|
|
||||||
<div class="upload-area" :class="uploadOpen ? '' : 'height-48'" ref="uploadArea" :key="col.prop"
|
|
||||||
v-if="col.upload">
|
|
||||||
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
|
||||||
<el-button type="text" icon="el-icon-arrow-right" @click="handleFilesOpen" />
|
|
||||||
</span>
|
|
||||||
<!-- :file-list="uploadedFileList" -->
|
|
||||||
<el-upload class="upload-in-dialog" v-if="col.upload" :key="col.prop + '__el-upload'" :action="uploadUrl"
|
|
||||||
:headers="uploadHeaders" :show-file-list="false" icon="el-icon-upload2" :disabled="disabled"
|
|
||||||
:before-upload="beforeUpload" :on-success="
|
|
||||||
(response, file, fileList) => {
|
|
||||||
handleUploadSuccess(response, file, col.prop);
|
|
||||||
}
|
|
||||||
" v-bind="col.bind">
|
|
||||||
<el-button size="mini" :disabled="col.bind?.disabled || false">
|
|
||||||
<svg-icon icon-class="icon-upload" style="color: inherit"></svg-icon>
|
|
||||||
上传文件
|
|
||||||
</el-button>
|
|
||||||
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
|
||||||
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
|
|
||||||
</div>
|
|
||||||
</el-upload>
|
|
||||||
|
|
||||||
<uploadedFile class="file" v-for="file in form[col.prop]" :file="file" :key="file.fileUrl"
|
|
||||||
@delete="!disabled && handleDeleteFile(file, col.prop)" />
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAccessToken } from '@/utils/auth';
|
|
||||||
import tupleImg from '@/assets/images/tuple.png';
|
|
||||||
import cache from '@/utils/cache';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 找到最长的label
|
|
||||||
* @param {*} options
|
|
||||||
*/
|
|
||||||
function findMaxLabelWidth(rows) {
|
|
||||||
let max = 0;
|
|
||||||
rows.forEach((row) => {
|
|
||||||
row.forEach((opt) => {
|
|
||||||
// debugger;
|
|
||||||
if (!opt.label) return 0;
|
|
||||||
if (opt.label.length > max) {
|
|
||||||
max = opt.label.length;
|
|
||||||
if (opt.label.includes('(')) {
|
|
||||||
max = max - 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
const uploadedFile = {
|
|
||||||
name: 'UploadedFile',
|
|
||||||
props: ['file'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleDelete() {
|
|
||||||
this.$emit('delete', this.file);
|
|
||||||
},
|
|
||||||
async handleDownload() {
|
|
||||||
const data = await this.$axios({
|
|
||||||
url: this.file.fileUrl,
|
|
||||||
method: 'get',
|
|
||||||
responseType: 'blob',
|
|
||||||
});
|
|
||||||
|
|
||||||
await this.$message.success('开始下载');
|
|
||||||
// create download link
|
|
||||||
const url = window.URL.createObjectURL(data);
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = url;
|
|
||||||
link.download = this.file.fileName;
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {},
|
|
||||||
render: function (h) {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
title={this.file.fileName}
|
|
||||||
onClick={this.handleDownload}
|
|
||||||
style={{
|
|
||||||
background: `url(${tupleImg}) no-repeat`,
|
|
||||||
backgroundSize: '14px',
|
|
||||||
backgroundPosition: '0 55%',
|
|
||||||
paddingLeft: '20px',
|
|
||||||
paddingRight: '24px',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
overflow: 'hidden',
|
|
||||||
cursor: 'pointer',
|
|
||||||
display: 'inline-block',
|
|
||||||
}}>
|
|
||||||
{this.file.fileName}
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-close"
|
|
||||||
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
|
|
||||||
class="dialog__upload_component__close"
|
|
||||||
onClick={this.handleDelete}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'DialogForm',
|
|
||||||
model: {
|
|
||||||
prop: 'dataForm',
|
|
||||||
event: 'update',
|
|
||||||
},
|
|
||||||
emits: ['update'],
|
|
||||||
components: { uploadedFile },
|
|
||||||
props: {
|
|
||||||
rows: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
dataForm: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
hasFiles: {
|
|
||||||
type: Boolean | Array,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
labelPosition: {
|
|
||||||
type: String,
|
|
||||||
default: 'right',
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
uploadOpen: false,
|
|
||||||
form: {},
|
|
||||||
formLoading: true,
|
|
||||||
optionListOf: {},
|
|
||||||
uploadedFileList: [],
|
|
||||||
dataLoaded: false,
|
|
||||||
uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() },
|
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 上传有关的headers,url都是固定的
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
labelWidth() {
|
|
||||||
let max = findMaxLabelWidth(this.rows);
|
|
||||||
// 每个汉字占20px
|
|
||||||
return max * 20;
|
|
||||||
// return max * 20 + 'px';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
rows: {
|
|
||||||
handler() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.handleOptions('watch');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
immediate: false,
|
|
||||||
},
|
|
||||||
dataForm: {
|
|
||||||
handler(val) {
|
|
||||||
this.form = JSON.parse(JSON.stringify(val));
|
|
||||||
if (this.hasFiles) {
|
|
||||||
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
|
||||||
this.form.files = this.form.files ?? [];
|
|
||||||
} else if (Array.isArray(this.hasFiles)) {
|
|
||||||
this.hasFiles.forEach((prop) => {
|
|
||||||
this.form[prop] = this.form[prop] ?? [];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// 处理 options
|
|
||||||
this.handleOptions();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 模拟透传 ref */
|
|
||||||
validate(cb) {
|
|
||||||
return this.$refs.form.validate(cb);
|
|
||||||
},
|
|
||||||
resetFields(args) {
|
|
||||||
return this.$refs.form.resetFields(args);
|
|
||||||
},
|
|
||||||
// getCode
|
|
||||||
async getCode(url) {
|
|
||||||
const response = await this.$axios(url);
|
|
||||||
return response.data;
|
|
||||||
},
|
|
||||||
async handleOptions(trigger = 'monuted') {
|
|
||||||
console.log('[dialogForm:handleOptions]');
|
|
||||||
const promiseList = [];
|
|
||||||
this.rows.forEach((cols) => {
|
|
||||||
cols.forEach((opt) => {
|
|
||||||
if (opt.value && !this.form[opt.prop]) {
|
|
||||||
// 默认值
|
|
||||||
this.form[opt.prop] = opt.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opt.options) {
|
|
||||||
this.$set(this.optionListOf, opt.prop, opt.options);
|
|
||||||
} else if (opt.url) {
|
|
||||||
// 如果有 depends,则暂时先不获取,注册一个watcher
|
|
||||||
if (opt.depends) {
|
|
||||||
this.$watch(
|
|
||||||
() => this.form[opt.depends],
|
|
||||||
(id) => {
|
|
||||||
console.log('<', opt.depends, '>', 'changed', id);
|
|
||||||
if (id == null) return;
|
|
||||||
// 清空原有选项
|
|
||||||
this.form[opt.prop] = null;
|
|
||||||
// 获取新的选项
|
|
||||||
this.$axios({
|
|
||||||
url: `${opt.url}?id=${id}`,
|
|
||||||
}).then((res) => {
|
|
||||||
this.$set(
|
|
||||||
this.optionListOf,
|
|
||||||
opt.prop,
|
|
||||||
res.data.map((item) => ({
|
|
||||||
label: item[opt.labelKey ?? 'name'],
|
|
||||||
value: item[opt.valueKey ?? 'id'],
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: false,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 如果是下拉框,或者新增模式下的输入框,才去请求
|
|
||||||
if (opt.select || (opt.input && !this.form?.id)) {
|
|
||||||
promiseList.push(async () => {
|
|
||||||
const response = await this.$axios(opt.url, {
|
|
||||||
method: opt.method ?? 'get',
|
|
||||||
});
|
|
||||||
console.log('[dialogForm:handleOptions:response]', response);
|
|
||||||
if (opt.select) {
|
|
||||||
// 处理下拉框选项
|
|
||||||
const list =
|
|
||||||
'list' in response.data
|
|
||||||
? response.data.list
|
|
||||||
: response.data;
|
|
||||||
|
|
||||||
if (opt.cache) {
|
|
||||||
cache.store(opt.cache, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$set(
|
|
||||||
this.optionListOf,
|
|
||||||
opt.prop,
|
|
||||||
list.map((item) => ({
|
|
||||||
label: item[opt.labelKey ?? 'name'],
|
|
||||||
value: item[opt.valueKey ?? 'id'],
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
} else if (opt.input) {
|
|
||||||
console.log('setting code: ', response.data);
|
|
||||||
// 处理输入框数据
|
|
||||||
this.form[opt.prop] = response.data;
|
|
||||||
// 更新下外部的 dataForm,防止code字段有数据也报空的bug
|
|
||||||
this.$emit('update', this.form);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('[dialogForm:handleOptions] done!');
|
|
||||||
|
|
||||||
// 如果是 watch 触发的,不需要执行进一步的请求
|
|
||||||
if (trigger == 'watch') {
|
|
||||||
this.formLoading = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
await Promise.all(promiseList.map((fn) => fn()));
|
|
||||||
this.formLoading = false;
|
|
||||||
this.dataLoaded = true;
|
|
||||||
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
|
|
||||||
} catch (error) {
|
|
||||||
console.log('[dialogForm:handleOptions:error]', error);
|
|
||||||
this.formLoading = false;
|
|
||||||
}
|
|
||||||
if (!promiseList.length) this.formLoading = false;
|
|
||||||
},
|
|
||||||
// 上传成功的特殊处理
|
|
||||||
beforeUpload() {},
|
|
||||||
// 上传前的验证规则可通过 bind 属性传入
|
|
||||||
handleUploadSuccess(response, file, prop) {
|
|
||||||
console.log('[handleUploadSuccess]', response, file, prop);
|
|
||||||
this.form[prop].push({
|
|
||||||
fileName: file.name,
|
|
||||||
fileUrl: response.data,
|
|
||||||
fileType: prop == 'files' ? 2 : 1,
|
|
||||||
});
|
|
||||||
this.$modal.msgSuccess('上传成功');
|
|
||||||
this.$emit('update', this.form);
|
|
||||||
},
|
|
||||||
|
|
||||||
getFileName(fileUrl) {
|
|
||||||
return fileUrl.split('/').pop();
|
|
||||||
},
|
|
||||||
|
|
||||||
handleFilesOpen() {
|
|
||||||
this.uploadOpen = !this.uploadOpen;
|
|
||||||
},
|
|
||||||
|
|
||||||
handleDeleteFile(file, prop) {
|
|
||||||
this.form[prop] = this.form[prop].filter(
|
|
||||||
(item) => item.fileUrl != file.fileUrl
|
|
||||||
);
|
|
||||||
this.$emit('update', this.form);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.el-date-editor,
|
|
||||||
.el-select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.upload-area {
|
|
||||||
// background: #ccc;
|
|
||||||
// display: grid;
|
|
||||||
// grid-auto-rows: 34px;
|
|
||||||
// grid-template-columns: repeat(6, minmax(32px, max-content));
|
|
||||||
// gap: 8px;
|
|
||||||
// align-items: center;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: height 0.3s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.upload-in-dialog {
|
|
||||||
// display: inline-block;
|
|
||||||
margin-right: 24px;
|
|
||||||
// background: #ccc;
|
|
||||||
position: relative;
|
|
||||||
// top: -13px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-icon {
|
|
||||||
// background: #ccc;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 12px;
|
|
||||||
z-index: 100;
|
|
||||||
transition: transform 0.3s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-icon.open {
|
|
||||||
transform: rotateZ(90deg);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.dialog__upload_component__close {
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
.dialog__upload_component__close:hover {
|
|
||||||
/* color: #777; */
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.height-48 {
|
|
||||||
height: 35px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -37,14 +37,12 @@
|
|||||||
@close="cancel"
|
@close="cancel"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@confirm="submitForm">
|
@confirm="submitForm">
|
||||||
<DialogFormZ
|
<DialogForm
|
||||||
v-if="open"
|
v-if="open"
|
||||||
ref="form"
|
ref="form"
|
||||||
v-model="form"
|
v-model="form"
|
||||||
label-position="top"
|
|
||||||
:disabled="mode == 'detail'"
|
:disabled="mode == 'detail'"
|
||||||
:has-files="false"
|
:has-files="false"
|
||||||
@selectupdate="updateDialogFormZ"
|
|
||||||
:rows="rows" />
|
:rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</div>
|
</div>
|
||||||
@ -53,16 +51,14 @@
|
|||||||
<script>
|
<script>
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
import DialogFormZ from '../../../DialogFormZ.vue';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict';
|
||||||
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list';
|
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list';
|
||||||
import { getMaterialTree, getMaterialList } from '@/api/base/material';
|
|
||||||
|
|
||||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentSparePartsList',
|
name: 'EquipmentSparePartsList',
|
||||||
components: { DialogFormZ },
|
components: {},
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -133,44 +129,33 @@ export default {
|
|||||||
rows: [
|
rows: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
select: true,
|
input: true,
|
||||||
label: '备件名称',
|
label: '备件名称',
|
||||||
prop: 'productMaterialId',
|
prop: 'name',
|
||||||
options: [],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
clearable: false,
|
|
||||||
},
|
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{ required: true, message: '备件名称不能为空', trigger: 'blur' },
|
||||||
required: true,
|
|
||||||
message: '备件名称不能为空',
|
|
||||||
trigger: 'change',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '备件型号',
|
label: '备件编码',
|
||||||
prop: 'model',
|
prop: 'code',
|
||||||
|
url: '/base/equipment-spare-part/getCode',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '备件编码不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '备件编码',
|
label: '备件型号',
|
||||||
prop: 'code',
|
prop: 'model',
|
||||||
bind: {
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '规格',
|
label: '规格',
|
||||||
prop: 'specifications',
|
prop: 'specifications',
|
||||||
bind: {
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -180,32 +165,27 @@ export default {
|
|||||||
prop: 'supplierId',
|
prop: 'supplierId',
|
||||||
url: '/base/core-supplier/listAll', // TODO: 供应商
|
url: '/base/core-supplier/listAll', // TODO: 供应商
|
||||||
bind: {
|
bind: {
|
||||||
disabled: true,
|
filterable: true,
|
||||||
|
clearable: true,
|
||||||
},
|
},
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '供应商不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
select: true,
|
select: true,
|
||||||
label: '单位',
|
label: '物料类型',
|
||||||
prop: 'unit', // 数据字典
|
prop: 'type',
|
||||||
|
options: this.getDictDatas('material_type'),
|
||||||
|
// url: '/base/core-equipment/listAll', // TODO: 物料
|
||||||
bind: {
|
bind: {
|
||||||
disabled: true,
|
filterable: true,
|
||||||
|
clearable: true,
|
||||||
},
|
},
|
||||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
rules: [
|
||||||
|
{ required: true, message: '物料类型不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// select: true,
|
|
||||||
// label: '物料类型',
|
|
||||||
// prop: 'type',
|
|
||||||
// options: this.getDictDatas('material_type'),
|
|
||||||
// // url: '/base/core-equipment/listAll', // TODO: 物料
|
|
||||||
// bind: {
|
|
||||||
// filterable: true,
|
|
||||||
// clearable: true,
|
|
||||||
// },
|
|
||||||
// rules: [
|
|
||||||
// { required: true, message: '物料类型不能为空', trigger: 'blur' },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -221,6 +201,14 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '单位',
|
||||||
|
prop: 'unit', // 数据字典
|
||||||
|
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '备注',
|
label: '备注',
|
||||||
@ -237,23 +225,11 @@ export default {
|
|||||||
name: null,
|
name: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {},
|
||||||
id: null,
|
|
||||||
code: null,
|
|
||||||
name: null,
|
|
||||||
model: null,
|
|
||||||
specifications: null,
|
|
||||||
life: null,
|
|
||||||
type: null,
|
|
||||||
supplierId: null,
|
|
||||||
unit: null,
|
|
||||||
remark: null,
|
|
||||||
},
|
|
||||||
basePath: '/base/equipment-spare-part',
|
basePath: '/base/equipment-spare-part',
|
||||||
mode: null,
|
mode: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {},
|
|
||||||
created() {
|
created() {
|
||||||
// this.initSearchBar();
|
// this.initSearchBar();
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -291,8 +267,8 @@ export default {
|
|||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
productMaterialId: null,
|
|
||||||
code: null,
|
code: null,
|
||||||
|
name: null,
|
||||||
model: null,
|
model: null,
|
||||||
specifications: null,
|
specifications: null,
|
||||||
life: null,
|
life: null,
|
||||||
@ -318,7 +294,6 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加备品备件';
|
this.title = '添加备品备件';
|
||||||
this.getDict();
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@ -327,14 +302,13 @@ export default {
|
|||||||
this.info({ id }).then((response) => {
|
this.info({ id }).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
if (this.form.unit !== undefined) {
|
if (this.form.unit !== undefined) {
|
||||||
this.form.unit = String(this.form.unit);
|
this.form.unit = String(this.form.unit)
|
||||||
}
|
}
|
||||||
if (this.form.type !== undefined) {
|
if (this.form.type !== undefined) {
|
||||||
this.form.type = String(this.form.type);
|
this.form.type = String(this.form.type)
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改备品备件';
|
this.title = '修改备品备件';
|
||||||
this.getDict();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@ -381,7 +355,6 @@ export default {
|
|||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改备品备件';
|
this.title = '修改备品备件';
|
||||||
this.getDict();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
@ -402,30 +375,6 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
async getDict() {
|
|
||||||
const materRes = await getMaterialTree(); //
|
|
||||||
let typeId = materRes.data.find((item) => item.product === 2).id;
|
|
||||||
const listQuery = {
|
|
||||||
typeId: typeId,
|
|
||||||
};
|
|
||||||
const materData = await getMaterialList(listQuery);
|
|
||||||
this.rows[0][0].options = (materData.data || []).map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
...item
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
updateDialogFormZ(val) {
|
|
||||||
const selectData = this.rows[0][0].options.find(
|
|
||||||
(item) => item.id === val.productMaterialId
|
|
||||||
);
|
|
||||||
this.form.productMaterialId = selectData.id;
|
|
||||||
this.form.name = selectData.name;
|
|
||||||
this.form.code = selectData.code;
|
|
||||||
this.form.specifications = selectData.specifications;
|
|
||||||
this.form.supplierId = selectData.supplierId;
|
|
||||||
this.form.unit = selectData.unit;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2023-08-01 14:55:51
|
* @Date: 2023-08-01 14:55:51
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2024-10-15 15:59:48
|
* @LastEditTime: 2023-11-28 10:34:24
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@ -26,11 +26,9 @@ import { parseTime } from '../../core/mixins/code-filter';
|
|||||||
import {
|
import {
|
||||||
getProcessTraceabilityPage,
|
getProcessTraceabilityPage,
|
||||||
getWorkOrderList,
|
getWorkOrderList,
|
||||||
|
getCoreProduct
|
||||||
// exportEnergyPlcExcel
|
// exportEnergyPlcExcel
|
||||||
} from '@/api/quality/processTraceability';
|
} from '@/api/quality/processTraceability';
|
||||||
import {
|
|
||||||
getProductMaterial,
|
|
||||||
} from '@/api/base/material';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict';
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
@ -64,14 +62,6 @@ const tableProps = [
|
|||||||
prop: 'actualQuantity',
|
prop: 'actualQuantity',
|
||||||
label: '生产数量'
|
label: '生产数量'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
prop: 'lineName',
|
|
||||||
label: '产线名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'lineNum',
|
|
||||||
label: '产线预计产量'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
prop: 'planProductUnit',
|
prop: 'planProductUnit',
|
||||||
label: '单位',
|
label: '单位',
|
||||||
@ -197,7 +187,7 @@ export default {
|
|||||||
if (val.type === "processDetail") {
|
if (val.type === "processDetail") {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
let specificationsData =''
|
let specificationsData =''
|
||||||
getProductMaterial(val.data.planProductId).then((res) => {
|
getCoreProduct(val.data.planProductId).then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
@ -209,7 +199,6 @@ export default {
|
|||||||
specifications: res.data.specifications,
|
specifications: res.data.specifications,
|
||||||
productName: val.data.planProductName,
|
productName: val.data.planProductName,
|
||||||
processFlowName: val.data.processFlowName,
|
processFlowName: val.data.processFlowName,
|
||||||
lineId: val.data.lineId,
|
|
||||||
// planProductId: val.data.planProductId
|
// planProductId: val.data.planProductId
|
||||||
// equipmentName,
|
// equipmentName,
|
||||||
},
|
},
|
||||||
|
@ -185,7 +185,6 @@ export default {
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderId: this.$route.query.orderId,
|
orderId: this.$route.query.orderId,
|
||||||
lineId: this.$route.query.lineId,
|
|
||||||
flowDetId: [this.detId],
|
flowDetId: [this.detId],
|
||||||
// orderId: this.$route.query.orderId,
|
// orderId: this.$route.query.orderId,
|
||||||
|
|
||||||
@ -233,7 +232,6 @@ export default {
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderId: this.$route.query.orderId,
|
orderId: this.$route.query.orderId,
|
||||||
lineId: this.$route.query.lineId,
|
|
||||||
flowDetId: [this.detId],
|
flowDetId: [this.detId],
|
||||||
// orderId: this.$route.query.orderId,
|
// orderId: this.$route.query.orderId,
|
||||||
|
|
||||||
@ -265,7 +263,6 @@ export default {
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderId: this.$route.query.orderId,
|
orderId: this.$route.query.orderId,
|
||||||
lineId: this.$route.query.lineId,
|
|
||||||
flowDetId: [this.detId],
|
flowDetId: [this.detId],
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-10-14 09:26:29
|
* @LastEditTime: 2024-08-14 15:26:32
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@ -252,8 +252,10 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getDict() {
|
async getDict() {
|
||||||
const materRes = await getMaterialTree();//
|
const materRes = await getMaterialTree();
|
||||||
let typeId = materRes.data.find(item=>item.product === 1).id
|
let typeId = materRes.data[0].product
|
||||||
|
? materRes.data[0].id
|
||||||
|
: materRes.data[1].id;
|
||||||
const listQuery = {
|
const listQuery = {
|
||||||
typeId: typeId,
|
typeId: typeId,
|
||||||
};
|
};
|
||||||
|
@ -117,8 +117,8 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
async getDict() {
|
async getDict() {
|
||||||
// 物料列表
|
// 物料列表
|
||||||
const materRes = await getMaterialTree(); //
|
const materRes = await getMaterialTree();
|
||||||
let typeId = materRes.data.find(item=>item.product === 1).id
|
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id
|
||||||
const listQuery= {
|
const listQuery= {
|
||||||
typeId:typeId
|
typeId:typeId
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-10-14 09:26:53
|
* @LastEditTime: 2024-08-14 15:27:50
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@ -207,8 +207,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getDictData() {
|
async getDictData() {
|
||||||
const materRes = await getMaterialTree(); //
|
const materRes = await getMaterialTree();
|
||||||
let typeId = materRes.data.find(item=>item.product === 0).id
|
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id
|
||||||
const listQuery= {
|
const listQuery= {
|
||||||
typeId:typeId
|
typeId:typeId
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 返回
|
// 返回
|
||||||
returnOrderManage() {
|
returnOrderManage() {
|
||||||
this.$router.go(-1);
|
this.$router.push({path: '/order/base/order-manage'})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -340,4 +340,4 @@ export default {
|
|||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -5,10 +5,13 @@
|
|||||||
<el-form-item label="工单名称" prop="name" v-if='!isBind'>
|
<el-form-item label="工单名称" prop="name" v-if='!isBind'>
|
||||||
<el-input v-model="form.name"></el-input>
|
<el-input v-model="form.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
|
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
|
||||||
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable
|
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg">
|
||||||
@change="getWorkOrderMsg">
|
<el-option
|
||||||
<el-option v-for="item in workOrderList" :key="item.id" :label="item.name" :value="item.id">
|
v-for="item in workOrderList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -20,8 +23,11 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="产品名称" prop="planProductId">
|
<el-form-item label="产品名称" prop="planProductId">
|
||||||
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
|
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
|
||||||
<el-option v-for="item in productList" :key="item.id" :label="item.name+' | '+item.specifications"
|
<el-option
|
||||||
|
v-for="item in productList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name+' | '+item.specifications"
|
||||||
:value="item.id">
|
:value="item.id">
|
||||||
<span style="float: left">{{ item.name }}</span>
|
<span style="float: left">{{ item.name }}</span>
|
||||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
|
||||||
@ -31,8 +37,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="计划开始时间">
|
<el-form-item label="计划开始时间">
|
||||||
<el-date-picker v-model="planStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
<el-date-picker
|
||||||
style="width: 100%;" placeholder="选择日期" :disabled="isBind">
|
v-model="planStartTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="选择日期"
|
||||||
|
:disabled="isBind">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -40,27 +51,34 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="计划完成时间">
|
<el-form-item label="计划完成时间">
|
||||||
<el-date-picker v-model="planFinishTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
<el-date-picker
|
||||||
style="width: 100%;" placeholder="选择日期" :disabled="isBind">
|
v-model="planFinishTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="选择日期"
|
||||||
|
:disabled="isBind">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
||||||
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind"
|
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
|
||||||
style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="计划生产数量" prop="planQuantity">
|
<el-form-item label="计划生产数量" prop="planQuantity">
|
||||||
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind"
|
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
|
||||||
style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="关联工艺" prop="processFlowId">
|
<el-form-item label="关联工艺" prop="processFlowId">
|
||||||
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
|
<el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
|
||||||
<el-option v-for="item in processFlowList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option
|
||||||
|
v-for="item in processFlowList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -78,7 +96,10 @@
|
|||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="优先级" prop="priority">
|
<el-form-item label="优先级" prop="priority">
|
||||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||||
<el-option v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" :key="item.value" :label="item.label"
|
<el-option
|
||||||
|
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
:value="item.value">
|
:value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -87,7 +108,11 @@
|
|||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="工单类型" prop="type">
|
<el-form-item label="工单类型" prop="type">
|
||||||
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
|
||||||
<el-option v-for="item in workOrderTypeList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option
|
||||||
|
v-for="item in workOrderTypeList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -95,7 +120,11 @@
|
|||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="关联产线" prop="productLineId">
|
<el-form-item label="关联产线" prop="productLineId">
|
||||||
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
|
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
|
||||||
<el-option v-for="item in productLineList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option
|
||||||
|
v-for="item in productLineList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -107,18 +136,9 @@
|
|||||||
<el-input v-model="form.workers" :disabled="isBind"></el-input>
|
<el-input v-model="form.workers" :disabled="isBind"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='6'>
|
|
||||||
<el-form-item label="负责部门" prop="deptId">
|
|
||||||
<el-select v-model="form.deptId" placeholder="请选择关联产线" style="width: 100%;">
|
|
||||||
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
|
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
|
||||||
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;">
|
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||||
</el-input-number>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -128,7 +148,6 @@
|
|||||||
import { getProductAll } from '@/api/base/product'
|
import { getProductAll } from '@/api/base/product'
|
||||||
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
|
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
|
||||||
import { getLineAll } from '@/api/base/productionLine'
|
import { getLineAll } from '@/api/base/productionLine'
|
||||||
import { listDept } from '@/api/system/dept';
|
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
name: 'AddWorkOrder',
|
name: 'AddWorkOrder',
|
||||||
@ -143,7 +162,6 @@ export default {
|
|||||||
planStartTime: '',
|
planStartTime: '',
|
||||||
planFinishTime: '',
|
planFinishTime: '',
|
||||||
planAssignQuantity: 0,
|
planAssignQuantity: 0,
|
||||||
deptId:undefined,
|
|
||||||
planQuantity: 0,
|
planQuantity: 0,
|
||||||
processFlowId: '',
|
processFlowId: '',
|
||||||
materialMethod: 1,
|
materialMethod: 1,
|
||||||
@ -153,7 +171,6 @@ export default {
|
|||||||
workers: '',
|
workers: '',
|
||||||
planAssignmentQuantity: ''
|
planAssignmentQuantity: ''
|
||||||
},
|
},
|
||||||
deptList:[],
|
|
||||||
rules: {
|
rules: {
|
||||||
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
||||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
|
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
|
||||||
@ -192,9 +209,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
listDept().then(res => {
|
|
||||||
this.deptList = res.data || []
|
|
||||||
})
|
|
||||||
// 产品
|
// 产品
|
||||||
getProductAll().then(res => {
|
getProductAll().then(res => {
|
||||||
this.productList = res.data || []
|
this.productList = res.data || []
|
||||||
@ -240,11 +254,11 @@ export default {
|
|||||||
let name = this.form.name
|
let name = this.form.name
|
||||||
_this.$emit('addWorkOrderSubmit')
|
_this.$emit('addWorkOrderSubmit')
|
||||||
// 询问是否添加预使用主原料
|
// 询问是否添加预使用主原料
|
||||||
// _this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
|
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
|
||||||
// _this.$router.push({
|
_this.$router.push({
|
||||||
// path: '/core/core-work-order?workOrderName='+encodeURI(name)
|
path: '/core/core-work-order?workOrderName='+encodeURI(name)
|
||||||
// })
|
})
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="tableInner">
|
|
||||||
<el-input v-model="list[itemProp]" @blur="changeInput" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'InputArea',
|
|
||||||
props: {
|
|
||||||
injectData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({})
|
|
||||||
},
|
|
||||||
itemProp: {
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: this.injectData
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
changeInput() {
|
|
||||||
console.log(this.list)
|
|
||||||
this.$emit('emitData', this.list)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.tableInner .el-input__inner {
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
height: 33px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -19,7 +19,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='6'>
|
<el-col :span='6'>
|
||||||
<el-form-item label="产品名称" prop="planProductId">
|
<el-form-item label="产品名称" prop="planProductId">
|
||||||
<el-select @change="getSpec" v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable>
|
<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 || '')"
|
<el-option v-for="item in productList" :key="item.id" :label="item.name+' | '+(item.specifications || '')"
|
||||||
:value="item.id">
|
:value="item.id">
|
||||||
<span style="float: left">{{ item.name }}</span>
|
<span style="float: left">{{ item.name }}</span>
|
||||||
@ -64,11 +64,6 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<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-col :span='12'>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark"></el-input>
|
<el-input v-model="form.remark"></el-input>
|
||||||
@ -89,10 +84,8 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
code: '',
|
code: '',
|
||||||
grade:1,
|
|
||||||
planQuantity: '',
|
planQuantity: '',
|
||||||
planProductId: '',
|
planProductId: '',
|
||||||
specifications:undefined,
|
|
||||||
price: '',
|
price: '',
|
||||||
customerId: '',
|
customerId: '',
|
||||||
priority: '',
|
priority: '',
|
||||||
@ -117,14 +110,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getSpec(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.productList.forEach((ele) => {
|
|
||||||
if (ele.id === val) {
|
|
||||||
this.form.specifications = ele.specifications
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
init(id) {
|
init(id) {
|
||||||
this.getList()
|
this.getList()
|
||||||
if (id) {
|
if (id) {
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-09-06 14:44:06
|
|
||||||
* @LastEditTime: 2024-09-09 16:31:04
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-button @click="handleRoute" type="text"> {{ injectData.workOrderNum }} </el-button>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { orderAssignmentList } from '@/api/base/orderManage'
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
injectData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async handleRoute() {
|
|
||||||
const res = await orderAssignmentList({ orderIdList: [this.injectData.id] })
|
|
||||||
console.log(res.data);
|
|
||||||
let arr = []
|
|
||||||
res.data[this.injectData.id].forEach((ele) => {
|
|
||||||
arr.push(ele.workOrderId)
|
|
||||||
});
|
|
||||||
let woIdString = arr.join(',')
|
|
||||||
console.log(woIdString);
|
|
||||||
|
|
||||||
this.$router.push({
|
|
||||||
path: '/produce/core-work-order-detail?woIdString=' + woIdString
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -1,102 +1,29 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-08-01 16:27:30
|
* @Date: 2024-08-01 16:27:30
|
||||||
* @LastEditTime: 2024-09-04 15:56:53
|
* @LastEditTime: 2024-08-01 16:29:31
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="orderAddForm" :rules="rules" :model="form" :inline="true" class="demo-form-inline">
|
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'>
|
||||||
<!-- <el-row :gutter="20"> -->
|
<el-row :gutter="20">
|
||||||
<!-- <el-col :span='6'> -->
|
<el-col :span='6'>
|
||||||
<el-form-item label="拆分数量" prop="attr3">
|
<el-form-item label="订单名称" prop="name">
|
||||||
<el-input v-model.number="form.attr3" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
<el-input v-model="form.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
</el-col>
|
||||||
<el-button type="primary" @click="handleSplit">确定</el-button>
|
</el-row>
|
||||||
</el-form-item>
|
|
||||||
<!-- </el-col> -->
|
|
||||||
<!-- </el-row> -->
|
|
||||||
<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>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate, orderSplit } from '@/api/base/orderManage'
|
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage'
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
import { getProductAll } from '@/api/base/product'
|
||||||
import inputArea from './inputArea.vue'
|
import { getCustomerList } from '@/api/base/customer'
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '订单名称',
|
|
||||||
minWidth: 120,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'code',
|
|
||||||
label: '订单编码',
|
|
||||||
minWidth: 180,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'productName',
|
|
||||||
label: '产品',
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// prop: 'priority',
|
|
||||||
// label: '优先级',
|
|
||||||
// filter: publicFormatter('order_priority')
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
prop: 'planQuantity',
|
|
||||||
label: '计划加工量',
|
|
||||||
width: 100,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'deliveTime',
|
|
||||||
label: '交货日期',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'customerId',
|
|
||||||
label: '客户',
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'price',
|
|
||||||
label: '单价',
|
|
||||||
width: 100,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'packSpec',
|
|
||||||
label: '包装规格',
|
|
||||||
width: 100,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'remark',
|
|
||||||
label: '备注',
|
|
||||||
width: 100,
|
|
||||||
subcomponent: inputArea
|
|
||||||
},
|
|
||||||
]
|
|
||||||
export default {
|
export default {
|
||||||
name: 'OrderAdd',
|
name: 'OrderAdd',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableProps,
|
|
||||||
list: [],
|
|
||||||
tableH: this.tableHeight(260),
|
|
||||||
form: {
|
form: {
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
@ -105,7 +32,6 @@ export default {
|
|||||||
planProductId: '',
|
planProductId: '',
|
||||||
price: '',
|
price: '',
|
||||||
customerId: '',
|
customerId: '',
|
||||||
attr3:undefined,
|
|
||||||
priority: '',
|
priority: '',
|
||||||
packSpec: '',
|
packSpec: '',
|
||||||
workers: '',
|
workers: '',
|
||||||
@ -116,7 +42,10 @@ export default {
|
|||||||
planStartTime: '',
|
planStartTime: '',
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
attr3: [{ required: true, message: "拆分数量不能为空", trigger: "blur" }],
|
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
|
||||||
|
code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
|
||||||
|
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
|
||||||
|
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
|
||||||
},
|
},
|
||||||
productList: [],
|
productList: [],
|
||||||
customerList: [],
|
customerList: [],
|
||||||
@ -124,133 +53,114 @@ export default {
|
|||||||
isEdit: false //是否是编辑
|
isEdit: false //是否是编辑
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(260)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleSplit() {
|
init(id) {
|
||||||
let obj = {
|
this.getList()
|
||||||
attr3: this.form.attr3,
|
if (id) {
|
||||||
id:this.form.id
|
this.isEdit = true
|
||||||
|
this.form.id = 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 || ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
orderSplit(obj).then((res) => {
|
},
|
||||||
this.list = res.data
|
getList() {
|
||||||
|
// 产品
|
||||||
|
getProductAll().then(res => {
|
||||||
|
this.productList = res.data || []
|
||||||
|
})
|
||||||
|
// 客户
|
||||||
|
getCustomerList().then(res => {
|
||||||
|
this.customerList = res.data || []
|
||||||
|
})
|
||||||
|
// 工艺
|
||||||
|
getProcessFlowList().then(res => {
|
||||||
|
this.processFlowList = res.data || []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
init(obj) {
|
timeChange() {
|
||||||
// this.getList()
|
if (this.form.planStartTime && this.form.planFinishTime) {
|
||||||
// if (obj) {
|
if (this.form.planStartTime > this.form.planFinishTime) {
|
||||||
this.isEdit = true
|
this.$modal.msgError('计划开始时间不能大于结束时间')
|
||||||
this.form = {}
|
}
|
||||||
this.list = []
|
}
|
||||||
this.form.id = obj.id
|
},
|
||||||
// getOrderById({id: this.form.id}).then(res => {
|
// 工艺变更
|
||||||
// if (res.code === 0) {
|
materialMethodChange(val) {
|
||||||
// this.form.name = res.data.name
|
if (val === 2 && !this.form.processFlowId) {
|
||||||
// this.form.code = res.data.code
|
this.form.materialMethod = 1
|
||||||
// this.form.planQuantity = res.data.planQuantity
|
this.$modal.msgError("请先选择关联工艺");
|
||||||
// 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 + '' : ''
|
processFlowIdChange(val) {
|
||||||
// this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
|
console.log(val)
|
||||||
// this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
|
if (!val) {
|
||||||
// this.form.workers = res.data.workers
|
this.form.materialMethod = 1
|
||||||
// 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() {
|
|
||||||
// // 产品
|
|
||||||
// getProductAll().then(res => {
|
|
||||||
// this.productList = res.data || []
|
|
||||||
// })
|
|
||||||
// // 客户
|
|
||||||
// getCustomerList().then(res => {
|
|
||||||
// this.customerList = res.data || []
|
|
||||||
// })
|
|
||||||
// // 工艺
|
|
||||||
// getProcessFlowList().then(res => {
|
|
||||||
// this.processFlowList = res.data || []
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// timeChange() {
|
|
||||||
// if (this.form.planStartTime && this.form.planFinishTime) {
|
|
||||||
// if (this.form.planStartTime > this.form.planFinishTime) {
|
|
||||||
// this.$modal.msgError('计划开始时间不能大于结束时间')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// // 工艺变更
|
|
||||||
// materialMethodChange(val) {
|
|
||||||
// if (val === 2 && !this.form.processFlowId) {
|
|
||||||
// this.form.materialMethod = 1
|
|
||||||
// this.$modal.msgError("请先选择关联工艺");
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// // 工艺变更
|
|
||||||
// processFlowIdChange(val) {
|
|
||||||
// console.log(val)
|
|
||||||
// if (!val) {
|
|
||||||
// this.form.materialMethod = 1
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
Promise.all(this.list.map((ele) => {
|
this.$refs['orderAddForm'].validate((valid) => {
|
||||||
return orderCreate(ele);
|
if (valid) {
|
||||||
})).then((res) => {
|
if (this.form.planStartTime && this.form.planFinishTime) {
|
||||||
this.$modal.msgSuccess("操作成功");
|
if (this.form.planStartTime > this.form.planFinishTime) {
|
||||||
this.$emit('splitWorkOrderSubmit');
|
this.$modal.msgError('计划开始时间不能大于结束时间')
|
||||||
});
|
return false
|
||||||
|
}
|
||||||
// this.$refs['orderAddForm'].validate((valid) => {
|
}
|
||||||
// if (valid) {
|
// console.log(this.form)
|
||||||
// if (this.form.planStartTime && this.form.planFinishTime) {
|
if (this.isEdit) {
|
||||||
// if (this.form.planStartTime > this.form.planFinishTime) {
|
//编辑
|
||||||
// this.$modal.msgError('计划开始时间不能大于结束时间')
|
orderUpdate({ ...this.form }).then((res) => {
|
||||||
// return false
|
if (res.code === 0) {
|
||||||
// }
|
this.$modal.msgSuccess("操作成功");
|
||||||
// }
|
this.$emit('successSubmit')
|
||||||
// // console.log(this.form)
|
}
|
||||||
// if (this.isEdit) {
|
})
|
||||||
// //编辑
|
} else {
|
||||||
// orderUpdate({ ...this.form }).then((res) => {
|
this.form.status = 1
|
||||||
// if (res.code === 0) {
|
this.form.triggerOrigin = 1
|
||||||
// this.$modal.msgSuccess("操作成功");
|
orderCreate({ ...this.form }).then((res) => {
|
||||||
// this.$emit('successSubmit')
|
if (res.code === 0) {
|
||||||
// }
|
this.$modal.msgSuccess("操作成功");
|
||||||
// })
|
this.$emit('successSubmit')
|
||||||
// } else {
|
}
|
||||||
// this.form.status = 1
|
})
|
||||||
// this.form.triggerOrigin = 1
|
}
|
||||||
// orderCreate({ ...this.form }).then((res) => {
|
} else {
|
||||||
// if (res.code === 0) {
|
return false
|
||||||
// this.$modal.msgSuccess("操作成功");
|
}
|
||||||
// this.$emit('successSubmit')
|
})
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
formClear() {
|
formClear() {
|
||||||
this.$refs.orderAddForm.resetFields()
|
this.$refs.orderAddForm.resetFields()
|
||||||
|
this.form.materialMethod = 1
|
||||||
|
this.form.price = 0.00
|
||||||
|
this.form.planQuantity = 0
|
||||||
|
this.isEdit = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,40 +1,64 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick"
|
||||||
|
/>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table ref="table" @row-click="handleRowClick" row-key="id"
|
<base-table
|
||||||
:tree-props="{ children: 'children'}"
|
:page="queryParams.pageNo"
|
||||||
:page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
:limit="queryParams.pageSize"
|
||||||
:max-height="tableH">
|
:table-props="tableProps"
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="240" label="操作" :method-list="tableBtn"
|
:table-data="list"
|
||||||
@clickBtn="handleClick" />
|
:max-height="tableH"
|
||||||
|
>
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="240"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick"
|
||||||
|
/>
|
||||||
</base-table>
|
</base-table>
|
||||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
<pagination
|
||||||
@pagination="getList" />
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
<!-- 新增&编辑 -->
|
<!-- 新增&编辑 -->
|
||||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
|
<base-dialog
|
||||||
@confirm="handleConfirm" :before-close="handleCancel" width='60%'>
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="centervisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width='60%'
|
||||||
|
>
|
||||||
<order-add ref="orderAdd" @successSubmit="successSubmit" />
|
<order-add ref="orderAdd" @successSubmit="successSubmit" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
<!-- 查看详情 -->
|
<!-- 查看详情 -->
|
||||||
<!-- 新增工单 -->
|
<!-- 新增工单 -->
|
||||||
<base-dialog :dialogTitle="workIssueTitle" :dialogVisible="addWorkOrdervisible" @cancel="addWorkOrderCancel"
|
<base-dialog
|
||||||
@confirm="addWorkOrderConfirm" :before-close="addWorkOrderCancel" width='70%'>
|
:dialogTitle="workIssueTitle"
|
||||||
|
:dialogVisible="addWorkOrdervisible"
|
||||||
|
@cancel="addWorkOrderCancel"
|
||||||
|
@confirm="addWorkOrderConfirm"
|
||||||
|
:before-close="addWorkOrderCancel"
|
||||||
|
width='70%'
|
||||||
|
>
|
||||||
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
|
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
<base-dialog :dialogTitle="splitTitle" :dialogVisible="splitWorkOrdervisible" @cancel="splitWorkOrderCancel"
|
|
||||||
@confirm="splitWorkOrderConfirm" :before-close="splitWorkOrderCancel" width='70%'>
|
|
||||||
<order-split ref="splitWorkOrder" @splitWorkOrderSubmit="splitWorkOrderSubmit" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
import { getOrderPage, orderDelete, customerList, orderFinish, orderVoid, orderStop } from '@/api/base/orderManage'
|
import { getOrderPage, orderDelete, customerList, orderFinish, orderVoid } from '@/api/base/orderManage'
|
||||||
import OrderAdd from './components/orderAdd'
|
import OrderAdd from './components/orderAdd'
|
||||||
import orderSplit from './components/orderSplit'
|
import orderSplit from './components/orderSplit'
|
||||||
import orderNum from './components/orderNum.vue'
|
|
||||||
|
|
||||||
import AddWorkOrder from './components/addWorkOrder'
|
import AddWorkOrder from './components/addWorkOrder'
|
||||||
import { publicFormatter } from '@/utils/dict'
|
import { publicFormatter } from '@/utils/dict'
|
||||||
@ -99,8 +123,7 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'workOrderNum',
|
prop: 'workOrderNum',
|
||||||
label: '工单数量',
|
label: '工单数量'
|
||||||
subcomponent: orderNum,
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
@ -152,8 +175,6 @@ export default {
|
|||||||
plain: true
|
plain: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
splitTitle: '拆分订单',
|
|
||||||
splitWorkOrdervisible:false,
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -307,34 +328,17 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:order-manage:stop')
|
|
||||||
? {
|
|
||||||
type: 'stop',
|
|
||||||
btnName: '终止',
|
|
||||||
// showParam: {
|
|
||||||
// type: '&',
|
|
||||||
// data: [
|
|
||||||
// {
|
|
||||||
// type: 'equal',
|
|
||||||
// name: 'status',
|
|
||||||
// value: 1
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
: undefined
|
: undefined
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
addOrEditTitle: '',
|
addOrEditTitle: '',
|
||||||
centervisible: false,
|
centervisible: false,
|
||||||
expandedRowKeys:[],
|
|
||||||
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
|
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
|
||||||
workIssueTitle: '',
|
workIssueTitle: '',
|
||||||
addWorkOrdervisible: false,
|
addWorkOrdervisible: false,
|
||||||
orderDetailVisible: false
|
orderDetailVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: { OrderAdd, AddWorkOrder,orderSplit },
|
components: { OrderAdd, AddWorkOrder },
|
||||||
created() {
|
created() {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
@ -342,38 +346,11 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
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.id
|
|
||||||
}
|
|
||||||
const response = await getOrderPage(queryParams)
|
|
||||||
// row.children = response.data.records
|
|
||||||
this.list.forEach((ele) => {
|
|
||||||
if (ele.id === row.id) {
|
|
||||||
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() {
|
getList() {
|
||||||
getOrderPage({...this.queryParams}).then(res => {
|
getOrderPage({...this.queryParams}).then(res => {
|
||||||
let arr = res.data.records || []
|
let arr = res.data.records || []
|
||||||
this.total = res.data.total || 0
|
this.total = res.data.total || 0
|
||||||
|
console.log(11111);
|
||||||
// if (arr.length > 0) {
|
// if (arr.length > 0) {
|
||||||
// customerList().then(result => {
|
// customerList().then(result => {
|
||||||
// let tempData = result.data || []
|
// let tempData = result.data || []
|
||||||
@ -428,7 +405,7 @@ export default {
|
|||||||
this.handleDelete(val.data)
|
this.handleDelete(val.data)
|
||||||
break
|
break
|
||||||
case 'detail':
|
case 'detail':
|
||||||
this.$router.push({path: 'order-detail-data?orderId='+ val.data.id})
|
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
|
||||||
break
|
break
|
||||||
case 'add':
|
case 'add':
|
||||||
this.workIssueTitle = '新增工单'
|
this.workIssueTitle = '新增工单'
|
||||||
@ -442,16 +419,6 @@ export default {
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'split':
|
|
||||||
this.splitTitle = '拆分订单'
|
|
||||||
this.splitWorkOrdervisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.splitWorkOrder.init(val.data)
|
|
||||||
})
|
|
||||||
// orderVoid({ id: val.data.id }).then((res) => {
|
|
||||||
// console.log(res)
|
|
||||||
// })
|
|
||||||
break
|
|
||||||
case 'bind':
|
case 'bind':
|
||||||
this.workIssueTitle = '绑定工单'
|
this.workIssueTitle = '绑定工单'
|
||||||
this.addWorkOrdervisible = true
|
this.addWorkOrdervisible = true
|
||||||
@ -462,11 +429,6 @@ export default {
|
|||||||
case 'complete':
|
case 'complete':
|
||||||
this.handleComplete(val.data)
|
this.handleComplete(val.data)
|
||||||
break
|
break
|
||||||
case 'stop':
|
|
||||||
orderStop({ id: val.data.id }).then((res) => {
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
break
|
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -512,17 +474,6 @@ export default {
|
|||||||
addWorkOrderSubmit() {
|
addWorkOrderSubmit() {
|
||||||
this.addWorkOrderCancel()
|
this.addWorkOrderCancel()
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
|
||||||
splitWorkOrderCancel() {
|
|
||||||
this.$refs.splitWorkOrder.formClear()
|
|
||||||
this.splitWorkOrdervisible = false
|
|
||||||
},
|
|
||||||
splitWorkOrderConfirm() {
|
|
||||||
this.$refs.splitWorkOrder.submitForm()
|
|
||||||
},
|
|
||||||
splitWorkOrderSubmit() {
|
|
||||||
this.splitWorkOrderCancel()
|
|
||||||
this.getList()
|
|
||||||
}
|
}
|
||||||
// bindWorkOrderCancel() {
|
// bindWorkOrderCancel() {
|
||||||
// this.$refs.bindWorkOrder.formClear()
|
// this.$refs.bindWorkOrder.formClear()
|
||||||
|
@ -1,411 +1,343 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="orderDetailData">
|
<div class="orderDetailData">
|
||||||
<div class="box1">
|
<div class="box1">
|
||||||
<div class="boxTitle">
|
<div class="boxTitle">
|
||||||
<span class="blueTitle"></span>
|
<span class="blueTitle"></span>
|
||||||
<span>订单编码: {{ orderMsg.code }}</span>
|
<span>订单编码: {{orderMsg.code}}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
|
||||||
type="primary"
|
<div style="padding-left: 14px;">
|
||||||
plain
|
<el-row>
|
||||||
size="small"
|
<el-col :span='3'>
|
||||||
style="float: right; margin-top: -10px"
|
<div class="blodTip">订单名</div>
|
||||||
@click="returnOrderManage">
|
<div class="lightTip">{{orderMsg.name}}</div>
|
||||||
<svg-icon icon-class="return" />
|
</el-col>
|
||||||
返回
|
<el-col :span='3'>
|
||||||
</el-button>
|
<div class="blodTip">产品信息</div>
|
||||||
<div style="padding-left: 14px; margin-top: 20px">
|
<div class="lightTip">{{orderMsg.productName}}</div>
|
||||||
<el-row>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span='3'>
|
||||||
<div class="blodTip">订单名</div>
|
<div class="blodTip">产品规格</div>
|
||||||
<div class="lightTip">{{ orderMsg.name }}</div>
|
<div class="lightTip">{{orderMsg.specifications}}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span='3'>
|
||||||
<div class="blodTip">产品信息</div>
|
<div class="blodTip">客户</div>
|
||||||
<div class="lightTip">{{ orderMsg.productName }}</div>
|
<div class="lightTip">{{orderMsg.customerName}}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span='3'>
|
||||||
<div class="blodTip">产品规格</div>
|
<div class="blodTip">包装规格</div>
|
||||||
<div class="lightTip">{{ orderMsg.specifications }}</div>
|
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<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="blodTip">物料计算方式</div>
|
||||||
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}
|
<div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
|
||||||
</div>
|
</el-col>
|
||||||
</el-col> -->
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">创建时间</div>
|
||||||
<div class="blodTip">创建时间</div>
|
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
|
||||||
<div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">计划开始时间</div>
|
||||||
<div class="blodTip">计划开始时间</div>
|
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
|
||||||
<div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
</el-row>
|
<el-row>
|
||||||
<el-row>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">计划完成时间</div>
|
||||||
<div class="blodTip">计划完成时间</div>
|
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
|
||||||
<div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">计划加工数量</div>
|
||||||
<div class="blodTip">计划加工数量</div>
|
<div class="lightTip">{{orderMsg.planQuantity}}</div>
|
||||||
<div class="lightTip">{{ orderMsg.planQuantity }}</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">加工平方数(平方米)</div>
|
||||||
<div class="blodTip">加工平方数(平方米)</div>
|
<div class="lightTip">{{orderMsg.planArea}}</div>
|
||||||
<div class="lightTip">{{ orderMsg.planArea }}</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">预计用时(时)</div>
|
||||||
<div class="blodTip">预计用时(时)</div>
|
<div class="lightTip">{{ orderMsg.expectTime }}</div>
|
||||||
<div class="lightTip">{{ orderMsg.expectTime }}</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">状态</div>
|
||||||
<div class="blodTip">状态</div>
|
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
|
||||||
<div class="lightTip">
|
</el-col>
|
||||||
{{ getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status) }}
|
<el-col :span='3'>
|
||||||
</div>
|
<div class="blodTip">实际开始时间</div>
|
||||||
</el-col>
|
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
|
||||||
<el-col :span="3">
|
</el-col>
|
||||||
<div class="blodTip">实际开始时间</div>
|
<el-col :span='3'>
|
||||||
<div class="lightTip">
|
<div class="blodTip">实际完成时间</div>
|
||||||
{{ parseTime(orderMsg.startProduceTime) }}
|
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
|
||||||
</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">实际生产数量</div>
|
||||||
<div class="blodTip">实际完成时间</div>
|
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
|
||||||
<div class="lightTip">
|
</el-col>
|
||||||
{{ parseTime(orderMsg.finishProduceTime) }}
|
</el-row>
|
||||||
</div>
|
<el-row>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
<el-col :span="3">
|
<div class="blodTip">完成比%</div>
|
||||||
<div class="blodTip">实际生产数量</div>
|
<div class="lightTip">{{orderMsg.completeProp}}</div>
|
||||||
<div class="lightTip">{{ orderMsg.actualQuantity }}</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span='3'>
|
||||||
</el-row>
|
<div class="blodTip">废片数量</div>
|
||||||
<el-row>
|
<div class="lightTip">{{orderMsg.nokQuantity}}</div>
|
||||||
<el-col :span="3">
|
</el-col>
|
||||||
<div class="blodTip">完成比%</div>
|
<el-col :span='3'>
|
||||||
<div class="lightTip">{{ orderMsg.completeProp }}</div>
|
<div class="blodTip">负责人</div>
|
||||||
</el-col>
|
<div class="lightTip">{{orderMsg.workers}}</div>
|
||||||
<el-col :span="3">
|
</el-col>
|
||||||
<div class="blodTip">废片数量</div>
|
<el-col :span='3'>
|
||||||
<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="blodTip">关联工艺</div>
|
||||||
<div class="lightTip">{{processFlowName}}</div>
|
<div class="lightTip">{{processFlowName}}</div>
|
||||||
</el-col> -->
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box2">
|
<div class="box2">
|
||||||
<!-- <div class="boxTitle">
|
<div class="boxTitle">
|
||||||
<span class="blueTitle"></span>
|
<span class="blueTitle"></span>
|
||||||
<span>工单信息</span>
|
<span>工单信息</span>
|
||||||
</div> -->
|
</div>
|
||||||
<div class="toggleTabBox">
|
<!-- 列表 -->
|
||||||
<div
|
<base-table
|
||||||
:class="{ active: activeModule === 'orderInfo' }"
|
:page="queryParams.pageNo"
|
||||||
@click="toggleTab('orderInfo')">
|
:limit="queryParams.pageSize"
|
||||||
子订单信息
|
:table-props="tableProps1"
|
||||||
</div>
|
:table-data="list1"
|
||||||
<div
|
:max-height="tableH"
|
||||||
:class="{ active: activeModule === 'useInfo' }"
|
/>
|
||||||
@click="toggleTab('useInfo')">
|
</div>
|
||||||
用料信息
|
<div class="box3">
|
||||||
</div>
|
<div class="boxTitle">
|
||||||
</div>
|
<span class="blueTitle"></span>
|
||||||
<!-- 列表 -->
|
<span>预计用料信息</span>
|
||||||
<el-row v-show="activeModule === 'orderInfo'">
|
</div>
|
||||||
<el-col :span="6">
|
<!-- 列表 -->
|
||||||
<el-tree
|
<base-table
|
||||||
:data="treeData"
|
:page="queryParams.pageNo"
|
||||||
:props="defaultProps"
|
:limit="queryParams.pageSize"
|
||||||
@node-click="handleNodeClick"></el-tree>
|
:table-props="tableProps2"
|
||||||
</el-col>
|
:table-data="list2"
|
||||||
<el-col :span="18">
|
:max-height="tableH"
|
||||||
<base-table
|
/>
|
||||||
:page="queryParams.pageNo"
|
</div>
|
||||||
:limit="queryParams.pageSize"
|
</div>
|
||||||
:table-props="tableProps1"
|
|
||||||
:table-data="list1"
|
|
||||||
:max-height="tableH" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<base-table
|
|
||||||
v-show="activeModule === 'useInfo'"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps2"
|
|
||||||
:table-data="list2"
|
|
||||||
:max-height="tableH" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { parseTime } from '@/utils/ruoyi';
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict'
|
||||||
import {
|
import { getProcessFlowList } from '@/api/base/orderManage'
|
||||||
getProcessFlowList,
|
|
||||||
getOrderRemainNum,
|
|
||||||
getMaterialCostOrder,
|
|
||||||
} from '@/api/base/orderManage';
|
|
||||||
import {
|
|
||||||
orderDetail,
|
|
||||||
bomUseNum,
|
|
||||||
getDetailTree,
|
|
||||||
getDetailTreeInfo,
|
|
||||||
} from '@/api/base/orderManage';
|
|
||||||
const tableProps1 = [
|
const tableProps1 = [
|
||||||
{
|
{
|
||||||
prop: 'issueTime',
|
prop: 'issueTime',
|
||||||
label: '下发时间',
|
label: '下发时间',
|
||||||
filter: parseTime,
|
filter: parseTime,
|
||||||
minWidth: 160,
|
minWidth: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '工单名',
|
label: '工单名',
|
||||||
minWidth: 100,
|
minWidth: 100,
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '工单编码',
|
label: '工单编码',
|
||||||
minWidth: 150,
|
minWidth: 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'planAssignmentQuantity',
|
prop: 'planAssignmentQuantity',
|
||||||
label: '计划加工量',
|
label: '计划加工量',
|
||||||
width: 100,
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'actualQuantity',
|
prop: 'actualQuantity',
|
||||||
label: '实际加工量',
|
label: '实际加工量',
|
||||||
width: 100,
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'actualArea',
|
prop: 'actualArea',
|
||||||
label: '加工平方数',
|
label: '加工平方数',
|
||||||
width: 100,
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'status',
|
prop: 'status',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
filter: publicFormatter('order_status'),
|
filter: publicFormatter('order_status')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'startProduceTime',
|
prop: 'startProduceTime',
|
||||||
label: '开始时间',
|
label: '开始时间',
|
||||||
filter: parseTime,
|
filter: parseTime,
|
||||||
minWidth: 160,
|
minWidth: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'finishProduceTime',
|
prop: 'finishProduceTime',
|
||||||
label: '结束时间',
|
label: '结束时间',
|
||||||
filter: parseTime,
|
filter: parseTime,
|
||||||
minWidth: 160,
|
minWidth: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productLineNames',
|
prop: 'productLineNames',
|
||||||
label: '关联产线',
|
label: '关联产线',
|
||||||
filter: (val) => (val ? val.join(',') : ''),
|
filter: (val) => val ? val.join(',') : '',
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'workers',
|
prop: 'workers',
|
||||||
label: '负责人',
|
label: '负责人'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注',
|
label: '备注'
|
||||||
},
|
}
|
||||||
];
|
]
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
{
|
{
|
||||||
prop: 'materialName',
|
prop: 'materialName',
|
||||||
label: '物料名称',
|
label: '物料名称'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'unit',
|
prop: 'unit',
|
||||||
label: '单位',
|
label: '单位',
|
||||||
filter: publicFormatter('unit_dict'),
|
filter: publicFormatter('unit_dict')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'num',
|
prop: 'num',
|
||||||
label: '剩余生产预计消耗',
|
label: '剩余生产预计消耗'
|
||||||
},
|
}
|
||||||
];
|
]
|
||||||
|
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
|
||||||
export default {
|
export default {
|
||||||
name: 'OrderDetailData',
|
name: 'OrderDetailData',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderId: '',
|
orderId: '',
|
||||||
tableProps1,
|
tableProps1,
|
||||||
treeData: undefined,
|
tableProps2,
|
||||||
activeModule: 'orderInfo',
|
list1: [],
|
||||||
tableProps2,
|
list2: [],
|
||||||
list1: [],
|
tableH: this.tableHeight(510) / 2,
|
||||||
list2: [],
|
// 查询参数
|
||||||
tableH: this.tableHeight(510) / 2,
|
queryParams: {
|
||||||
// 查询参数
|
pageNo: 1,
|
||||||
queryParams: {
|
pageSize: 500
|
||||||
pageNo: 1,
|
},
|
||||||
pageSize: 500,
|
orderMsg: {},
|
||||||
},
|
processFlowName: ''
|
||||||
defaultProps: {
|
}
|
||||||
children: 'children',
|
},
|
||||||
label: 'name',
|
mounted() {
|
||||||
},
|
window.addEventListener('resize', () => {
|
||||||
orderMsg: {},
|
this.tableH = this.tableHeight(510) / 2
|
||||||
processFlowName: '',
|
})
|
||||||
};
|
this.orderId = location.href.split('?')[1].split('=')[1]
|
||||||
},
|
this.getMsg()
|
||||||
mounted() {
|
},
|
||||||
window.addEventListener('resize', () => {
|
watch: {
|
||||||
this.tableH = this.tableHeight(510) / 2;
|
$route: 'initData'
|
||||||
});
|
},
|
||||||
this.orderId = location.href.split('?')[1].split('=')[1];
|
methods: {
|
||||||
this.getMsg();
|
initData(to) {
|
||||||
},
|
if (to.name === 'OrderDetailData') {
|
||||||
watch: {
|
this.orderId = location.href.split('?')[1].split('=')[1]
|
||||||
$route: 'initData',
|
this.getMsg()
|
||||||
},
|
}
|
||||||
methods: {
|
},
|
||||||
toggleTab(val) {
|
getMsg() {
|
||||||
this.activeModule = val;
|
orderDetail({
|
||||||
},
|
id: this.orderId
|
||||||
handleNodeClick(val) {
|
}).then(res => {
|
||||||
console.log(val);
|
this.orderMsg = res.data
|
||||||
getDetailTreeInfo({
|
this.list1 = res.data.coreWorkOrderRespVOS
|
||||||
id: val.id,
|
bomUseNum({
|
||||||
}).then((res) => {
|
productId: this.orderMsg.planProductId
|
||||||
this.list1 = res.data.order;
|
}).then(res2 => {
|
||||||
console.log(res);
|
if (res2.data && res2.data.length > 0) {
|
||||||
});
|
let arr = res2.data
|
||||||
},
|
arr.map(item => {
|
||||||
initData(to) {
|
if (item) {
|
||||||
if (to.name === 'OrderDetailData') {
|
let a = item.num * this.orderMsg.remainingQuantity
|
||||||
this.orderId = location.href.split('?')[1].split('=')[1];
|
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
|
||||||
this.getMsg();
|
}
|
||||||
}
|
})
|
||||||
},
|
this.list2 = arr
|
||||||
getMsg() {
|
}else {
|
||||||
orderDetail({
|
this.list2 = []
|
||||||
id: this.orderId,
|
}
|
||||||
}).then((res) => {
|
})
|
||||||
this.orderMsg = res.data;
|
// 工艺
|
||||||
this.list1 = res.data.coreWorkOrderRespVOS;
|
getProcessFlowList().then(res => {
|
||||||
|
let arr = res.data || []
|
||||||
getOrderRemainNum(this.orderId).then((resNum) => {
|
if (arr.length > 0) {
|
||||||
bomUseNum({
|
arr.map(item => {
|
||||||
productId: this.orderMsg.planProductId,
|
if (item.id === this.orderMsg.processFlowId) {
|
||||||
}).then((res2) => {
|
this.processFlowName = item.name
|
||||||
if (res2.data && res2.data.length > 0) {
|
}
|
||||||
let arr = res2.data;
|
})
|
||||||
arr.map((item) => {
|
}
|
||||||
if (item) {
|
})
|
||||||
let a = item.num * resNum.data;
|
})
|
||||||
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : '';
|
},
|
||||||
}
|
// 返回
|
||||||
});
|
returnOrderManage() {
|
||||||
this.list2 = arr;
|
this.$router.push({path: '/order/base/order-manage'})
|
||||||
this.getMaterialCostOrder(this.orderId);
|
}
|
||||||
} else {
|
}
|
||||||
this.list2 = [];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
getDetailTree({
|
|
||||||
id: this.orderId,
|
|
||||||
}).then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
this.treeData = res.data;
|
|
||||||
});
|
|
||||||
// 工艺
|
|
||||||
getProcessFlowList().then((res) => {
|
|
||||||
let arr = res.data || [];
|
|
||||||
if (arr.length > 0) {
|
|
||||||
arr.map((item) => {
|
|
||||||
if (item.id === this.orderMsg.processFlowId) {
|
|
||||||
this.processFlowName = item.name;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getMaterialCostOrder(id) {
|
|
||||||
getMaterialCostOrder({ id }).then((res) => {
|
|
||||||
this.list2.push(...res.data);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 返回
|
|
||||||
returnOrderManage() {
|
|
||||||
this.$router.go(-1);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.orderDetailData {
|
|
||||||
background-color: rgb(242, 244, 249);
|
|
||||||
.box1,
|
|
||||||
.box2,
|
|
||||||
.box3 {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
}
|
|
||||||
.box2 {
|
|
||||||
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;
|
|
||||||
padding: 16px 16px 0 16px;
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</script>
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
.orderDetailData {
|
||||||
|
background-color: rgb(242, 244, 249);
|
||||||
|
.box1, .box2, .box3 {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 9px;
|
||||||
|
}
|
||||||
|
.box2 {
|
||||||
|
height: calc((100vh - 360px) / 2);
|
||||||
|
padding: 12px 16px 0;
|
||||||
|
margin: 8px 0;
|
||||||
|
}
|
||||||
|
.box1 {
|
||||||
|
height: 215px;
|
||||||
|
padding: 16px 16px 0 16px;
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.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>
|
@ -174,40 +174,40 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
// this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
|
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
|
||||||
// ? {
|
? {
|
||||||
// type: 'qualityDetail',
|
type: 'qualityDetail',
|
||||||
// btnName: '质量',
|
btnName: '质量',
|
||||||
// showTip: '质量详情',
|
showTip: '质量详情',
|
||||||
// showParam: {
|
showParam: {
|
||||||
// type: '&',
|
type: '&',
|
||||||
// data: [
|
data: [
|
||||||
// {
|
{
|
||||||
// type: 'more',
|
type: 'more',
|
||||||
// name: 'workOrderNum',
|
name: 'workOrderNum',
|
||||||
// value: 1
|
value: 1
|
||||||
// }
|
}
|
||||||
// ]
|
]
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// : undefined,
|
: undefined,
|
||||||
// this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
|
this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
|
||||||
// ? {
|
? {
|
||||||
// type: 'sendOutDetail',
|
type: 'sendOutDetail',
|
||||||
// btnName: '发货',
|
btnName: '发货',
|
||||||
// showTip: '发货详情',
|
showTip: '发货详情',
|
||||||
// showParam: {
|
showParam: {
|
||||||
// type: '&',
|
type: '&',
|
||||||
// data: [
|
data: [
|
||||||
// {
|
{
|
||||||
// type: 'more',
|
type: 'more',
|
||||||
// name: 'workOrderNum',
|
name: 'workOrderNum',
|
||||||
// value: 1
|
value: 1
|
||||||
// }
|
}
|
||||||
// ]
|
]
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// : undefined
|
: undefined
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
chartList: []
|
chartList: []
|
||||||
}
|
}
|
||||||
@ -297,7 +297,7 @@ export default {
|
|||||||
switch (val.type) {
|
switch (val.type) {
|
||||||
case 'orderDetail':
|
case 'orderDetail':
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/produce/core-work-order-detail?woIdString='+val.data.woIdString
|
path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'qualityDetail':
|
case 'qualityDetail':
|
||||||
@ -368,4 +368,4 @@ export default {
|
|||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,484 +1,324 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form
|
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm" label-position="top">
|
||||||
ref="dataForm"
|
<el-row :gutter="20">
|
||||||
:rules="rules"
|
<el-col :span='8'>
|
||||||
label-width="130px"
|
<el-form-item label="工单名称" prop="name">
|
||||||
:model="dataForm"
|
<el-input v-model="dataForm.name" placeholder="请输入工单名称"></el-input>
|
||||||
label-position="top">
|
</el-form-item>
|
||||||
<el-row :gutter="20">
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span='8'>
|
||||||
<el-form-item label="工单名称" prop="name">
|
<el-form-item label="工单编码" prop="code">
|
||||||
<el-input
|
<el-input v-model="dataForm.code" disabled placeholder="请输入工单编码"></el-input>
|
||||||
v-model="dataForm.name"
|
</el-form-item>
|
||||||
placeholder="请输入工单名称"></el-input>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span='8'>
|
||||||
</el-col>
|
<el-form-item label="产品名称" prop="planProductId">
|
||||||
<el-col :span="8">
|
<el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" filterable @change="selectProduct">
|
||||||
<el-form-item label="工单编码" prop="code">
|
<el-option
|
||||||
<el-input
|
v-for="item in productList"
|
||||||
v-model="dataForm.code"
|
:key="item.id"
|
||||||
disabled
|
:label="item.name"
|
||||||
placeholder="请输入工单编码"></el-input>
|
:value="item.id">
|
||||||
</el-form-item>
|
</el-option>
|
||||||
</el-col>
|
</el-select>
|
||||||
<el-col :span="8">
|
</el-form-item>
|
||||||
<el-form-item label="产品名称" prop="planProductId">
|
</el-col>
|
||||||
<el-select
|
</el-row>
|
||||||
v-model="dataForm.planProductId"
|
<el-row :gutter="20">
|
||||||
placeholder="请选择产品"
|
<el-col :span='8'>
|
||||||
style="width: 100%"
|
<el-form-item label="产品规格" prop="specifications">
|
||||||
filterable
|
<el-input v-model="dataForm.specifications" placeholder="请输入产品规格" />
|
||||||
@change="selectProduct">
|
</el-form-item>
|
||||||
<el-option
|
</el-col>
|
||||||
v-for="item in productList"
|
<el-col :span='8'>
|
||||||
:key="item.id"
|
<el-form-item label="计划开始时间">
|
||||||
:label="item.name"
|
<el-date-picker
|
||||||
:value="item.id"></el-option>
|
v-model="dataForm.planStartTime"
|
||||||
</el-select>
|
type="datetime"
|
||||||
</el-form-item>
|
value-format="timestamp"
|
||||||
</el-col>
|
style="width: 100%;"
|
||||||
</el-row>
|
placeholder="请选择计划开始时间">
|
||||||
<el-row :gutter="20">
|
</el-date-picker>
|
||||||
<el-col :span="8">
|
</el-form-item>
|
||||||
<el-form-item label="产品规格" prop="specifications">
|
</el-col>
|
||||||
<el-input
|
<el-col :span='8'>
|
||||||
v-model="dataForm.specifications"
|
<el-form-item label="计划完成时间">
|
||||||
placeholder="请输入产品规格" />
|
<el-date-picker
|
||||||
</el-form-item>
|
v-model="dataForm.planFinishTime"
|
||||||
</el-col>
|
type="datetime"
|
||||||
<el-col :span="8">
|
value-format="timestamp"
|
||||||
<el-form-item label="计划开始时间">
|
style="width: 100%;"
|
||||||
<el-date-picker
|
placeholder="请选择计划完成时间">
|
||||||
v-model="dataForm.planStartTime"
|
</el-date-picker>
|
||||||
type="datetime"
|
</el-form-item>
|
||||||
value-format="timestamp"
|
</el-col>
|
||||||
style="width: 100%"
|
</el-row>
|
||||||
placeholder="请选择计划开始时间"></el-date-picker>
|
<el-row :gutter="20">
|
||||||
</el-form-item>
|
<el-col :span='8'>
|
||||||
</el-col>
|
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
||||||
<el-col :span="8">
|
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划投入数量"></el-input-number>
|
||||||
<el-form-item label="计划完成时间">
|
</el-form-item>
|
||||||
<el-date-picker
|
</el-col>
|
||||||
v-model="dataForm.planFinishTime"
|
<el-col :span='8'>
|
||||||
type="datetime"
|
<el-form-item label="计划生产数量" prop="planQuantity">
|
||||||
value-format="timestamp"
|
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划生产数量"></el-input-number>
|
||||||
style="width: 100%"
|
</el-form-item>
|
||||||
placeholder="请选择计划完成时间"></el-date-picker>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span='8'>
|
||||||
</el-col>
|
<el-form-item label="关联工艺" prop="processFlowId">
|
||||||
</el-row>
|
<el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange">
|
||||||
<el-row :gutter="20">
|
<el-option
|
||||||
<el-col :span="8">
|
v-for="item in processFlowList"
|
||||||
<el-form-item label="计划投入数量" prop="planAssignQuantity">
|
:key="item.id"
|
||||||
<el-input-number
|
:label="item.name"
|
||||||
v-model="dataForm.planAssignQuantity"
|
:value="item.id">
|
||||||
:min="0"
|
</el-option>
|
||||||
:max="9999999999999"
|
</el-select>
|
||||||
style="width: 100%"
|
</el-form-item>
|
||||||
placeholder="请输入计划投入数量"></el-input-number>
|
</el-col>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
</el-col>
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span='8'>
|
||||||
<el-form-item label="计划生产数量" prop="planQuantity">
|
<el-form-item label="物料计算方式" prop="materialMethod">
|
||||||
<el-input-number
|
<!-- <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange">
|
||||||
v-model="dataForm.planQuantity"
|
<el-radio :label="1">产品基础BOM</el-radio>
|
||||||
:min="0"
|
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||||
:max="9999999999999"
|
</el-radio-group> -->
|
||||||
style="width: 100%"
|
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange">
|
||||||
placeholder="请输入计划生产数量"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="优先级" prop="priority">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.priority"
|
|
||||||
placeholder="请选择优先级"
|
|
||||||
style="width: 100%">
|
|
||||||
<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-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="工单类型" prop="type">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.type"
|
|
||||||
placeholder="请选择工单类型"
|
|
||||||
style="width: 100%">
|
|
||||||
<el-option
|
|
||||||
v-for="item in workOrderTypeList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="负责部门" prop="deptId">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.deptId"
|
|
||||||
placeholder="请选择关联产线"
|
|
||||||
style="width: 100%">
|
|
||||||
<el-option
|
|
||||||
v-for="item in deptList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="负责人" prop="workers">
|
|
||||||
<el-input
|
|
||||||
v-model="dataForm.workers"
|
|
||||||
placeholder="请输入负责人"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<span style="margin: 0 20px 15px 0; display: inline-block">
|
|
||||||
物料计算方式
|
|
||||||
</span>
|
|
||||||
<el-radio-group
|
|
||||||
v-model="dataForm.materialMethod"
|
|
||||||
@change="materialMethodChange">
|
|
||||||
<el-radio :label="1">产品基础BOM</el-radio>
|
|
||||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
<!-- <el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;"
|
|
||||||
@change="materialMethodChange">
|
|
||||||
<el-option key="1" label="产品基础BOM" :value="1" />
|
<el-option key="1" label="产品基础BOM" :value="1" />
|
||||||
<el-option key="2" label="工艺扩展BOM" :value="2" />
|
<el-option key="2" label="工艺扩展BOM" :value="2" />
|
||||||
</el-select> -->
|
</el-select>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
<div v-if="dataForm.materialMethod === 1">
|
<el-col :span='8'>
|
||||||
<el-row :gutter="20">
|
<el-form-item label="优先级" prop="priority">
|
||||||
<el-col :span="24">
|
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
|
||||||
<span style="margin: 8px 0; display: inline-block">关联产线</span>
|
<el-option
|
||||||
<el-button style="margin-left: 20px" type="text" @click="addBind">
|
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
|
||||||
新增
|
:key="item.value"
|
||||||
</el-button>
|
:label="item.label"
|
||||||
</el-col>
|
:value="item.value">
|
||||||
</el-row>
|
</el-option>
|
||||||
<el-row
|
</el-select>
|
||||||
:gutter="20"
|
</el-form-item>
|
||||||
v-for="(item, index) in dataForm.productLineIds"
|
</el-col>
|
||||||
:key="index + 'line'"
|
<el-col :span='8'>
|
||||||
style="margin-bottom: 8px">
|
<el-form-item label="工单类型" prop="type">
|
||||||
<el-col :span="8">
|
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
|
||||||
<el-select
|
<el-option
|
||||||
v-model="item.lineId"
|
v-for="item in workOrderTypeList"
|
||||||
placeholder="请选择产线"
|
:key="item.id"
|
||||||
style="width: 100%">
|
:label="item.name"
|
||||||
<el-option
|
:value="item.id">
|
||||||
v-for="item in productLineList"
|
</el-option>
|
||||||
:key="item.id"
|
</el-select>
|
||||||
:label="item.name"
|
</el-form-item>
|
||||||
:value="item.id"></el-option>
|
</el-col>
|
||||||
</el-select>
|
</el-row>
|
||||||
</el-col>
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span='8'>
|
||||||
<el-input-number
|
<el-form-item label="关联产线" prop="productLineIds">
|
||||||
style="width: 100%"
|
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||||
v-model="item.num"
|
<el-option
|
||||||
placeholder="请输入数量"
|
v-for="item in productLineList"
|
||||||
:step="1"
|
:key="item.id"
|
||||||
:min="0"
|
:label="item.name"
|
||||||
step-strictly />
|
:value="item.id">
|
||||||
</el-col>
|
</el-option>
|
||||||
</el-row>
|
</el-select>
|
||||||
</div>
|
</el-form-item>
|
||||||
<div v-else>
|
</el-col>
|
||||||
<el-row :gutter="20">
|
<el-col :span='8'>
|
||||||
<el-col :span="24">
|
<el-form-item label="负责人" prop="workers">
|
||||||
<span style="margin: 8px 0; display: inline-block">
|
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
|
||||||
关联产线及工艺
|
</el-form-item>
|
||||||
</span>
|
</el-col>
|
||||||
<el-button style="margin-left: 20px" type="text" @click="addBind">
|
</el-row>
|
||||||
新增
|
<!-- <el-row>
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row
|
|
||||||
:gutter="20"
|
|
||||||
v-for="(item, index) in dataForm.productLineIds"
|
|
||||||
:key="index + 'process'"
|
|
||||||
style="margin-bottom: 8px">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-select
|
|
||||||
v-model="item.lineId"
|
|
||||||
placeholder="请选择产线"
|
|
||||||
style="width: 100%"
|
|
||||||
@change="processLineIdChange">
|
|
||||||
<el-option
|
|
||||||
v-for="item in productLineList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-select
|
|
||||||
v-model="item.processId"
|
|
||||||
placeholder="请选择工艺"
|
|
||||||
filterable
|
|
||||||
style="width: 100%">
|
|
||||||
<el-option
|
|
||||||
v-for="item in processFlowList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-input-number
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="item.num"
|
|
||||||
:step="1"
|
|
||||||
:min="0"
|
|
||||||
step-strictly />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
<!-- <el-row>
|
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
|
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
|
||||||
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row> -->
|
</el-row> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getProductAll } from '@/api/base/product';
|
import { getProductAll } from '@/api/base/product'
|
||||||
import { getProcessFlowPage, workOrderList } from '@/api/base/orderManage';
|
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
|
||||||
import {
|
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
|
||||||
createCoreWO,
|
import { getLineAll } from '@/api/base/productionLine'
|
||||||
updateCoreWO,
|
|
||||||
getCode,
|
|
||||||
getCoreWO,
|
|
||||||
} from '@/api/base/coreWorkOrder';
|
|
||||||
import { getLineAll } from '@/api/base/productionLine';
|
|
||||||
import basicAdd from '../../core/mixins/basic-add';
|
import basicAdd from '../../core/mixins/basic-add';
|
||||||
import { listDept } from '@/api/system/dept';
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddWorkOrder',
|
name: 'AddWorkOrder',
|
||||||
mixins: [basicAdd],
|
mixins: [basicAdd],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
isGetCode: true,
|
isGetCode: true,
|
||||||
codeURL: getCode,
|
codeURL: getCode,
|
||||||
createURL: createCoreWO,
|
createURL: createCoreWO,
|
||||||
updateURL: updateCoreWO,
|
updateURL: updateCoreWO,
|
||||||
infoURL: getCoreWO,
|
infoURL: getCoreWO
|
||||||
},
|
},
|
||||||
dataForm: {
|
dataForm: {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
workOrderId: '',
|
workOrderId: '',
|
||||||
name: '',
|
name: '',
|
||||||
code: '',
|
code: '',
|
||||||
deptId: undefined,
|
planProductId: '',
|
||||||
planProductId: '',
|
specifications: '',
|
||||||
specifications: '',
|
planStartTime: '',
|
||||||
planStartTime: '',
|
planFinishTime: '',
|
||||||
planFinishTime: '',
|
planAssignQuantity: 0,
|
||||||
planAssignQuantity: 0,
|
planQuantity: 0,
|
||||||
planQuantity: 0,
|
processFlowId: '',
|
||||||
materialMethod: 1,
|
materialMethod: 1,
|
||||||
triggerOrigin: 1,
|
triggerOrigin: 1,
|
||||||
priority: '',
|
priority: '',
|
||||||
productLineIds: [{ lineId: null, processId: null, num: null }],
|
productLineIds: [],
|
||||||
type: '',
|
type: '',
|
||||||
workers: '',
|
workers: '',
|
||||||
status: 1,
|
status: 1
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
||||||
{ required: true, message: '工单名称不能为空', trigger: 'blur' },
|
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
|
||||||
],
|
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
|
||||||
planProductId: [
|
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
|
||||||
{ required: true, message: '产品名称不能为空', trigger: 'change' },
|
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }]
|
||||||
],
|
},
|
||||||
planAssignQuantity: [
|
productList: [],
|
||||||
{ required: true, message: '计划投入数量不能为空', trigger: 'blur' },
|
processFlowList: [],
|
||||||
],
|
productLineList: [],
|
||||||
planQuantity: [
|
workOrderTypeList: [
|
||||||
{ required: true, message: '计划生产数量不能为空', trigger: 'blur' },
|
{id: 1,name:'普通'},
|
||||||
],
|
{id: 2, name:'特殊'}
|
||||||
},
|
],
|
||||||
productList: [],
|
planStartTime: '',
|
||||||
processFlowList: [],
|
planFinishTime: '',
|
||||||
productLineList: [],
|
isBind: false,
|
||||||
deptList: [],
|
workOrderList: []
|
||||||
workOrderTypeList: [
|
}
|
||||||
{ id: 1, name: '普通' },
|
},
|
||||||
{ id: 2, name: '特殊' },
|
mounted() {
|
||||||
],
|
this.getDict()
|
||||||
planStartTime: '',
|
},
|
||||||
planFinishTime: '',
|
methods: {
|
||||||
isBind: false,
|
// 工艺变更
|
||||||
workOrderList: [],
|
materialMethodChange(val) {
|
||||||
};
|
if (val === 2 && !this.dataForm.processFlowId) {
|
||||||
},
|
this.dataForm.materialMethod = 1
|
||||||
mounted() {
|
this.$modal.msgError("请先选择关联工艺");
|
||||||
this.getDict();
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
// 工艺变更
|
||||||
// 工艺变更
|
processFlowIdChange(val) {
|
||||||
materialMethodChange(val) {
|
console.log(val)
|
||||||
console.log(val);
|
if (!val) {
|
||||||
this.processFlowList = [];
|
this.dataForm.materialMethod = 1
|
||||||
this.dataForm.productLineIds = [];
|
}
|
||||||
const obj = { lineId: null, processId: null, num: null };
|
},
|
||||||
this.dataForm.productLineIds.push(obj);
|
init(id) {
|
||||||
// if (val === 2 && !this.dataForm.processFlowId) {
|
this.dataForm.id = id || "";
|
||||||
// this.dataForm.materialMethod = 1;
|
this.visible = true;
|
||||||
// this.$modal.msgError('请先选择关联工艺');
|
if (this.urlOptions.getOption) {
|
||||||
// }
|
this.getArr()
|
||||||
},
|
}
|
||||||
// 产线工艺关联
|
this.$nextTick(() => {
|
||||||
processLineIdChange(val) {
|
this.$refs["dataForm"].resetFields();
|
||||||
const params = {
|
this.planStartTime = ''
|
||||||
pageNo: 1,
|
this.planFinishTime = ''
|
||||||
pageSize: 100,
|
if (this.dataForm.id) {
|
||||||
lineId: val,
|
getCoreWO(id).then(response => {
|
||||||
};
|
this.dataForm = response.data;
|
||||||
// 工艺
|
if (this.dataForm.priority !== undefined) {
|
||||||
getProcessFlowPage(params).then((res) => {
|
this.dataForm.priority = String(this.dataForm.priority)
|
||||||
this.processFlowList = res.data.list || [];
|
}
|
||||||
});
|
this.dataForm.priority
|
||||||
},
|
});
|
||||||
init(id) {
|
} else {
|
||||||
this.dataForm.id = id || '';
|
if (this.urlOptions.isGetCode) {
|
||||||
this.visible = true;
|
this.getCode()
|
||||||
if (this.urlOptions.getOption) {
|
}
|
||||||
this.getArr();
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].resetFields();
|
|
||||||
this.planStartTime = '';
|
|
||||||
this.planFinishTime = '';
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
getCoreWO(id).then((response) => {
|
|
||||||
this.dataForm = response.data;
|
|
||||||
if (this.dataForm.priority !== undefined) {
|
|
||||||
this.dataForm.priority = String(this.dataForm.priority);
|
|
||||||
}
|
|
||||||
this.dataForm.priority;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (this.urlOptions.isGetCode) {
|
|
||||||
this.getCode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs["dataForm"].validate((valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let isContinue = true;
|
// 修改的提交
|
||||||
if (this.dataForm.materialMethod === 1) {
|
if (this.dataForm.id) {
|
||||||
this.dataForm.productLineIds.forEach((item) => {
|
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||||
if (!item.lineId) {
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.$message('关联产线不能为空');
|
this.visible = false;
|
||||||
isContinue = false;
|
this.$emit("refreshDataList");
|
||||||
}
|
});
|
||||||
});
|
return;
|
||||||
} else {
|
}
|
||||||
this.dataForm.productLineIds.forEach((item) => {
|
// 添加的提交
|
||||||
if (!item.lineId || !item.processId) {
|
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||||
this.$message('关联产线及工艺不能为空');
|
this.$modal.msgSuccess("新增成功");
|
||||||
isContinue = false;
|
this.visible = false;
|
||||||
}
|
this.$confirm('是否添加预使用主原料信息?', '提示', {
|
||||||
});
|
confirmButtonText: '确定',
|
||||||
}
|
cancelButtonText: '取消',
|
||||||
// 修改的提交
|
type: 'warning'
|
||||||
if (this.dataForm.id && isContinue) {
|
}).then(() => {
|
||||||
this.urlOptions.updateURL(this.dataForm).then((response) => {
|
console.log('121', this.dataForm.name)
|
||||||
this.$modal.msgSuccess('修改成功');
|
this.$emit("refreshDataList", {
|
||||||
this.visible = false;
|
id: response.data,
|
||||||
this.$emit('refreshDataList');
|
name: this.dataForm.name
|
||||||
});
|
});
|
||||||
return;
|
}).catch(() => {
|
||||||
}
|
this.$emit("refreshDataList");
|
||||||
// 添加的提交
|
});
|
||||||
if (isContinue) {
|
});
|
||||||
this.urlOptions.createURL(this.dataForm).then((response) => {
|
});
|
||||||
this.$modal.msgSuccess('新增成功');
|
},
|
||||||
this.visible = false;
|
getCode() {
|
||||||
this.$confirm('是否添加预使用主原料信息?', '提示', {
|
this.urlOptions.codeURL()
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
console.log('121', this.dataForm.name);
|
|
||||||
this.$emit('refreshDataList', {
|
|
||||||
id: response.data,
|
|
||||||
name: this.dataForm.name,
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getCode() {
|
|
||||||
this.urlOptions
|
|
||||||
.codeURL()
|
|
||||||
.then(({ data: res }) => {
|
.then(({ data: res }) => {
|
||||||
this.dataForm.code = res;
|
this.dataForm.code = res;
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
getDict() {
|
getDict() {
|
||||||
// 产品
|
// 产品
|
||||||
getProductAll().then((res) => {
|
getProductAll().then(res => {
|
||||||
this.productList = res.data || [];
|
this.productList = res.data || []
|
||||||
});
|
})
|
||||||
// 产线
|
// 产线
|
||||||
getLineAll().then((res) => {
|
getLineAll().then(res => {
|
||||||
this.productLineList = res.data || [];
|
this.productLineList = res.data || []
|
||||||
});
|
})
|
||||||
listDept().then((res) => {
|
// 工艺
|
||||||
this.deptList = res.data || [];
|
getProcessFlowList().then(res => {
|
||||||
});
|
this.processFlowList = res.data || []
|
||||||
// 工单list
|
})
|
||||||
workOrderList({
|
// 工单list
|
||||||
status: 1,
|
workOrderList({
|
||||||
}).then((res) => {
|
status: 1
|
||||||
this.workOrderList = res.data || [];
|
}).then(res => {
|
||||||
});
|
this.workOrderList = res.data || []
|
||||||
},
|
})
|
||||||
// 选产品带出规格
|
},
|
||||||
selectProduct(val) {
|
// 选产品带出规格
|
||||||
if (val) {
|
selectProduct(val) {
|
||||||
this.productList.map((item) => {
|
if (val) {
|
||||||
if (val === item.id) {
|
this.productList.map(item => {
|
||||||
this.dataForm.specifications = item.specifications;
|
if (val === item.id) {
|
||||||
}
|
this.dataForm.specifications = item.specifications
|
||||||
});
|
}
|
||||||
} else {
|
})
|
||||||
this.dataForm.specifications = '';
|
} else {
|
||||||
}
|
this.dataForm.specifications = ''
|
||||||
},
|
}
|
||||||
addBind() {
|
}
|
||||||
const obj = { lineId: null, processId: null, num: null };
|
}
|
||||||
this.dataForm.productLineIds.push(obj);
|
}
|
||||||
},
|
</script>
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -1,100 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-09-11 10:07:42
|
|
||||||
* @LastEditTime: 2024-09-11 10:07:43
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div
|
|
||||||
id="orderEnergyChart"
|
|
||||||
style="width: 100%"
|
|
||||||
:style="{ height: chartHeight + 'px' }"
|
|
||||||
></div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import resize from '@/utils/chartMixins/resize'
|
|
||||||
export default {
|
|
||||||
name: "BarChart",
|
|
||||||
mixins: [resize],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
chartDom: '',
|
|
||||||
chart: '',
|
|
||||||
chartHeight: this.tableHeight(430)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
chartData: {
|
|
||||||
type: Array,
|
|
||||||
required: true,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
chartData: function () {
|
|
||||||
this.getChart()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.chartHeight = this.tableHeight(430)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getChart() {
|
|
||||||
if (
|
|
||||||
this.chart !== null &&
|
|
||||||
this.chart !== '' &&
|
|
||||||
this.chart !== undefined
|
|
||||||
) {
|
|
||||||
this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
|
||||||
}
|
|
||||||
this.chartDom = document.getElementById('orderEnergyChart')
|
|
||||||
this.chart = echarts.init(this.chartDom)
|
|
||||||
console.log(this.chartData)
|
|
||||||
let xData = []
|
|
||||||
let yData = []
|
|
||||||
this.chartData && this.chartData.map(item =>{
|
|
||||||
xData.push(item.objName)
|
|
||||||
yData.push(item.useNum)
|
|
||||||
})
|
|
||||||
var option = {
|
|
||||||
color:['#288AFF'],
|
|
||||||
grid: {
|
|
||||||
left: '2%',
|
|
||||||
right: '1%',
|
|
||||||
bottom: '1%',
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: xData,
|
|
||||||
axisLabel: {
|
|
||||||
rotate: "45"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value'
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
data: yData,
|
|
||||||
type: 'bar',
|
|
||||||
barMaxWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
option && this.chart.setOption(option);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,175 +1,155 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: DY
|
||||||
* @LastEditTime: 2024-10-15 16:16:22
|
* @LastEditTime: 2023-11-23 18:45:15
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<!-- <el-drawer
|
<!-- <el-drawer
|
||||||
:visible.sync="visible"
|
:visible.sync="visible"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
:wrapper-closable="false"
|
:wrapper-closable="false"
|
||||||
class="drawer"
|
class="drawer"
|
||||||
size="50%"> -->
|
size="50%"> -->
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- <small-title slot="title" :no-padding="true">
|
||||||
|
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</small-title> -->
|
||||||
|
<el-button style="float: right" type="primary" @click="goback()">返回</el-button>
|
||||||
|
<div v-show="workOrderButton.length">
|
||||||
|
<el-button v-for="(work, index) in workOrderButton" :key="index" type="primary" @click="init(work.id, true)">{{ work.name }}</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<div>
|
||||||
|
<h1>工单编码:{{ dataForm.code }}</h1>
|
||||||
|
</div>
|
||||||
|
<small-title
|
||||||
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
|
:no-padding="true">
|
||||||
|
基本信息
|
||||||
|
</small-title>
|
||||||
|
<div class="formContent">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">工单名称:{{ dataForm.name }}</el-col>
|
||||||
|
<el-col :span="8">工单来源:{{ dataForm.triggerOrigin === 1 ? 'MES' : dataForm.triggerOrigin === 2 ? 'ERP' : ''}}</el-col>
|
||||||
|
<el-col :span="8">所属订单:
|
||||||
|
<span v-for="(item, index) in orderList" :key="index" style="margin-right: 10px">{{ item.orderName }}</span>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">产品名称:{{ dataForm.productName }}</el-col>
|
||||||
|
<el-col :span="8">规 格:{{ dataForm.specifications }}</el-col>
|
||||||
|
<el-col :span="8">计划生产数量:{{ dataForm.planQuantity }}</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">预计用时(小时):{{ dataForm.remainingTime }}</el-col>
|
||||||
|
<el-col :span="8">计划投入数量:{{ dataForm.planAssignQuantity }}</el-col>
|
||||||
|
<el-col :span="8">优先级:{{ fitlerP(dataForm.priority) }}</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">负责人:{{ dataForm.workers }}</el-col>
|
||||||
|
<el-col :span="8">关联产线:
|
||||||
|
<span v-for="(item, index) in dataForm.productLineNames" :key="index" style="margin-right: 10px">{{ item }}</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">关联工艺:{{ dataForm.processFlowName }}</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
|
<small-title
|
||||||
<el-row v-show="workOrderButton.length !== 0" class="" style="
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
margin-bottom: 4px;
|
:no-padding="true">
|
||||||
border-radius: 8px;
|
生产信息
|
||||||
">
|
</small-title>
|
||||||
<workOrderNav :id-list="workOrderButton" @getWorkOrderId="getId">
|
<div class="formContent">
|
||||||
</workOrderNav>
|
<el-row :gutter="20">
|
||||||
</el-row>
|
<el-col :span="8">工单创建时间:{{ parseTime(dataForm.createTime) }}</el-col>
|
||||||
<el-row class="" style="
|
<el-col :span="8">计划开始时间:{{ parseTime(dataForm.planStartTime) }}</el-col>
|
||||||
height: 1px;
|
<el-col :span="8">计划完成时间:{{ parseTime(dataForm.planFinishTime) }}</el-col>
|
||||||
flex: .3;
|
</el-row>
|
||||||
margin-bottom: 12px;
|
<el-row :gutter="20">
|
||||||
background: #fff;
|
<el-col :span="8">预计结束时间:{{ parseTime(dataForm.computeFinishTime) }}</el-col>
|
||||||
padding: 16px 16px px;
|
<el-col :span="8">实际开始时间:{{ parseTime(dataForm.startProduceTime) }}</el-col>
|
||||||
border-radius: 8px;
|
<el-col :span="8">实际完成时间:{{ parseTime(dataForm.finishProduceTime) }}</el-col>
|
||||||
display: flex;
|
</el-row>
|
||||||
flex-direction: column;
|
<el-row :gutter="20">
|
||||||
">
|
<el-col :span="8">工单状态:{{ fitlerS(dataForm.status) }}</el-col>
|
||||||
<div class="content">
|
<el-col :span="8">实际投入数量:{{ dataForm.assignQuantity }}</el-col>
|
||||||
<div>
|
<el-col :span="8">实际生产数量:{{ dataForm.actualQuantity }}</el-col>
|
||||||
<h1>工单编码:{{ dataForm.code }}</h1>
|
</el-row>
|
||||||
</div>
|
<el-row :gutter="20">
|
||||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
<el-col :span="8">废片数量:{{ dataForm.nokQuantity }}</el-col>
|
||||||
基本信息
|
<el-col :span="8">检测瑕疵数:{{ }}</el-col>
|
||||||
</small-title>
|
</el-row>
|
||||||
<div class="formContent">
|
</div>
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">工单名称:{{ dataForm.name }}</el-col>
|
|
||||||
<el-col :span="8">工单来源:{{ dataForm.triggerOrigin === 1 ? 'MES' : dataForm.triggerOrigin === 2 ? 'ERP' : ''}}
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">所属订单:
|
|
||||||
<span v-for="(item, index) in orderList" :key="index" style="margin-right: 10px">{{ item.orderName
|
|
||||||
}}</span>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">产品名称:{{ dataForm.productName }}</el-col>
|
|
||||||
<el-col :span="8">规 格:{{ dataForm.specifications }}</el-col>
|
|
||||||
<el-col :span="8">计划生产数量:{{ dataForm.planQuantity }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">预计用时(小时):{{ dataForm.remainingTime }}</el-col>
|
|
||||||
<el-col :span="8">计划投入数量:{{ dataForm.planAssignQuantity }}</el-col>
|
|
||||||
<el-col :span="8">优先级:{{ fitlerP(dataForm.priority) }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">负责人:{{ dataForm.workers }}</el-col>
|
|
||||||
<el-col :span="8">关联产线:
|
|
||||||
<span v-for="(item, index) in dataForm.productLineNames" :key="index" style="margin-right: 10px">{{ item
|
|
||||||
}}</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展'
|
|
||||||
:
|
|
||||||
'' }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">关联工艺:{{ dataForm.processFlowName }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
<el-row class="" style="
|
|
||||||
height: 1px;
|
|
||||||
flex: 1;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
background: #fff;
|
|
||||||
padding: 16px 16px 32px;
|
|
||||||
border-radius: 8px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
">
|
|
||||||
<el-tabs v-model="activeName" @tab-click="switchTab">
|
|
||||||
<el-tab-pane label="生产信息" name="produce">
|
|
||||||
<div class="formContent">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">工单创建时间:{{ parseTime(dataForm.createTime) }}</el-col>
|
|
||||||
<el-col :span="8">计划开始时间:{{ parseTime(dataForm.planStartTime) }}</el-col>
|
|
||||||
<el-col :span="8">计划完成时间:{{ parseTime(dataForm.planFinishTime) }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">预计结束时间:{{ parseTime(dataForm.computeFinishTime) }}</el-col>
|
|
||||||
<el-col :span="8">实际开始时间:{{ parseTime(dataForm.startProduceTime) }}</el-col>
|
|
||||||
<el-col :span="8">实际完成时间:{{ parseTime(dataForm.finishProduceTime) }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">工单状态:{{ fitlerS(dataForm.status) }}</el-col>
|
|
||||||
<el-col :span="8">实际投入数量:{{ dataForm.assignQuantity }}</el-col>
|
|
||||||
<el-col :span="8">实际生产数量:{{ dataForm.actualQuantity }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">废片数量:{{ dataForm.nokQuantity }}</el-col>
|
|
||||||
<el-col :span="8">检测瑕疵数:{{ }}</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="订单信息" name="order">
|
|
||||||
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo"
|
|
||||||
:limit="listQuery.pageSize" :table-data="orderList">
|
|
||||||
<method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="预计用料信息" name="material">
|
|
||||||
<base-table :max-height="tableH" :table-props="tableProps1" :page="listQuery1.pageNo"
|
|
||||||
:limit="listQuery1.pageSize" :table-data="materialList" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="质量信息" name="quality">
|
|
||||||
<base-table :max-height="tableH" :table-props="tablePropsQuality" :table-data="qualityList" :page="1"
|
|
||||||
:limit="10" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="能源信息" name="energy">
|
|
||||||
<div class="toggleTabBox">
|
|
||||||
<div :class="{ active: activeModule === 'dataList' }" @click="toggleTab('dataList')">数据列表</div>
|
|
||||||
<div :class="{ active: activeModule === 'barChart' }" @click="toggleTab('barChart')">柱状图</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div v-show="activeModule === 'dataList'">
|
|
||||||
<!-- 表格 -->
|
|
||||||
<base-table :max-height="tableH" :table-props="tablePropsEnergy" :page="listQueryEnergy.pageNo"
|
|
||||||
:limit="listQueryEnergy.pageSize" :table-data="energyList" />
|
|
||||||
</div>
|
|
||||||
<!-- 图形 -->
|
|
||||||
<div v-show="activeModule === 'barChart'">
|
|
||||||
<bar-chart ref="orderEnergyChart" :chartData="chartData" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
|
|
||||||
</el-row>
|
<div class="attr-list">
|
||||||
|
<small-title
|
||||||
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
|
:no-padding="true">
|
||||||
|
订单相关信息
|
||||||
|
</small-title>
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="orderList">
|
||||||
|
<method-btn
|
||||||
|
v-if="!isdetail"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<!-- <pagination
|
||||||
|
v-show="listQuery.total > 0"
|
||||||
|
:total="listQuery.total"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page-sizes="[5, 10, 15]"
|
||||||
|
@pagination="getList" /> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<div class="attr-list">
|
||||||
<!-- <base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false"
|
<small-title
|
||||||
@confirm="submitForm">
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
<el-select v-if="open" style="width: 100%" filterable clearable v-model="queryParams.equipmentId"
|
:no-padding="true">
|
||||||
placeholder="请选择一个设备">
|
预计用料信息
|
||||||
<el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option>
|
</small-title>
|
||||||
</el-select>
|
<base-table
|
||||||
</base-dialog> -->
|
:table-props="tableProps1"
|
||||||
</div>
|
:page="listQuery1.pageNo"
|
||||||
|
:limit="listQuery1.pageSize"
|
||||||
|
:table-data="materialList" />
|
||||||
|
<!-- <pagination
|
||||||
|
v-show="listQuery1.total > 0"
|
||||||
|
:total="listQuery1.total"
|
||||||
|
:page.sync="listQuery1.pageNo"
|
||||||
|
:limit.sync="listQuery1.pageSize"
|
||||||
|
:page-sizes="[5, 10, 15]"
|
||||||
|
@pagination="getList" /> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="drawer-body__footer">
|
||||||
|
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import basicAdd from '../../core/mixins/basic-add';
|
// import basicAdd from '../../core/mixins/basic-add';
|
||||||
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById,getMaterialCostWorkOrder } from "@/api/base/coreWorkOrder";
|
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
|
||||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
|
||||||
import { getOrderEnergyData } from "@/api/monitoring/orderEnergy";
|
|
||||||
// import { orderList } from "@/api/base/orderManage";
|
// import { orderList } from "@/api/base/orderManage";
|
||||||
import {
|
|
||||||
getStatisticalDataPage,
|
|
||||||
} from '@/api/monitoring/statisticalData';
|
|
||||||
import { getProcessFlowList } from '@/api/base/orderManage'
|
import { getProcessFlowList } from '@/api/base/orderManage'
|
||||||
import SmallTitle from './SmallTitle';
|
import SmallTitle from './SmallTitle';
|
||||||
import { publicFormatter } from "@/utils/dict";
|
import { publicFormatter } from "@/utils/dict";
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
import workOrderNav from './workOrderNav.vue'
|
|
||||||
import BarChart from "./barChart"
|
|
||||||
const tableBtn = [
|
const tableBtn = [
|
||||||
{
|
{
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
@ -215,105 +195,18 @@ const tableProps1 = [
|
|||||||
filter: publicFormatter('unit_dict')
|
filter: publicFormatter('unit_dict')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remainingNum',
|
prop: 'num',
|
||||||
label: '剩余生产预计消耗'
|
label: '剩余生产预计消耗'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tablePropsEnergy = [
|
|
||||||
{
|
|
||||||
prop: 'objName',
|
|
||||||
label: '对象名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'objCode',
|
|
||||||
label: '对象编码',
|
|
||||||
// filter: publicFormatter('unit_dict')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'energyType',
|
|
||||||
label: '能源类型',
|
|
||||||
// filter: publicFormatter('unit_dict')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'startNum',
|
|
||||||
label: '工单开始值',
|
|
||||||
// filter: publicFormatter('unit_dict')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'endNum',
|
|
||||||
label: '工单结束值/当前值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'useNum',
|
|
||||||
label: '使用量'
|
|
||||||
},
|
|
||||||
];
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [tableHeightMixin],
|
components: { SmallTitle },
|
||||||
components: { SmallTitle, workOrderNav, BarChart },
|
|
||||||
computed: {
|
|
||||||
tablePropsQuality() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'workOrderName',
|
|
||||||
label: '工单名称',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'productionName',
|
|
||||||
label: '产品',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// width: 160,
|
|
||||||
prop: 'inspectionContent',
|
|
||||||
label: '检测内容',
|
|
||||||
},
|
|
||||||
...this.dynamicProps,
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'sumScrap',
|
|
||||||
label: '未检测总数',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// width: 128,
|
|
||||||
prop: 'scrapRatio',
|
|
||||||
label: '比例(%)',
|
|
||||||
// subcomponent: {
|
|
||||||
// name: 'TextOnly',
|
|
||||||
// props: {
|
|
||||||
// injectData: {
|
|
||||||
// type: Object,
|
|
||||||
// default: () => ({}),
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// data() {
|
|
||||||
// return {
|
|
||||||
// text: '比例',
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// methods: {
|
|
||||||
// handleEmit(payload) {
|
|
||||||
// console.log('handleEmit', payload);
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// render(h) {
|
|
||||||
// return h('el-button', { props: { type: 'text' } }, this.text);
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableBtn,
|
tableBtn,
|
||||||
tableProps,
|
tableProps,
|
||||||
heightNum: 236,
|
tableProps1,
|
||||||
tablePropsEnergy,
|
|
||||||
tableProps1,
|
|
||||||
activeModule:'dataList',
|
|
||||||
workOrderId:undefined,
|
|
||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
infoURL: getCoreWO
|
infoURL: getCoreWO
|
||||||
@ -322,13 +215,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
listQueryEnergy: {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
activeName:'produce',
|
|
||||||
listQuery1: {
|
listQuery1: {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -336,120 +223,40 @@ export default {
|
|||||||
},
|
},
|
||||||
dataForm: {},
|
dataForm: {},
|
||||||
orderList: [],
|
orderList: [],
|
||||||
materialList: [],
|
materialList: [],
|
||||||
energyList: [],
|
|
||||||
qualityList: [],
|
|
||||||
chartData:[],
|
|
||||||
dynamicProps:[],
|
|
||||||
// orderArray: [],
|
// orderArray: [],
|
||||||
visible: false,
|
visible: false,
|
||||||
isdetail: false,
|
isdetail: false,
|
||||||
workOrderButton: [],
|
workOrderButton: [],
|
||||||
processFlowList: []
|
processFlowList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
workOrderId(newValue, oldValue) {
|
|
||||||
this.activeName = 'produce'
|
|
||||||
this.init(newValue)
|
|
||||||
this.dataForm.id = newValue
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
created() {
|
||||||
this.getDict()
|
this.getDict()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.$route.query.woIdString && this.$route.query.woIdString !== 'undefined') {
|
if (this.$route.query.woIdString && this.$route.query.woIdString !== 'undefined') {
|
||||||
const idList = this.$route.query.woIdString.split(',')
|
const idList = this.$route.query.woIdString.split(',')
|
||||||
console.log(idList);
|
|
||||||
|
|
||||||
getCoreWOListById(idList).then(res => {
|
getCoreWOListById(idList).then(res => {
|
||||||
this.workOrderButton = res.data.map(work => {
|
this.workOrderButton = res.data.map(work => {
|
||||||
return {
|
return {
|
||||||
id: work.id,
|
id: work.id,
|
||||||
name: work.name
|
name: work.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// console.log(this.workOrderButton);
|
|
||||||
this.init(this.workOrderButton[0].id, true)
|
this.init(this.workOrderButton[0].id, true)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.init(this.$route.query.id, true)
|
this.init(this.$route.query.id, true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getId(val) {
|
|
||||||
this.workOrderId = val
|
|
||||||
},
|
|
||||||
async switchTab(val) {
|
|
||||||
if (this.activeName === 'order') {
|
|
||||||
getConOrderList({
|
|
||||||
workOrderId: this.dataForm.id,
|
|
||||||
}).then((response) => {
|
|
||||||
this.orderList = response.data;
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
});
|
|
||||||
}else if (this.activeName === 'material') {
|
|
||||||
getMaterialCostWorkOrder({
|
|
||||||
id: this.dataForm.id,
|
|
||||||
}).then((response) => {
|
|
||||||
this.materialList = response.data;
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
});
|
|
||||||
} else if (this.activeName === 'energy') {
|
|
||||||
getOrderEnergyData({
|
|
||||||
workOrderId: this.dataForm.id,
|
|
||||||
}).then((response) => {
|
|
||||||
this.energyList = response.data
|
|
||||||
this.chartData = response.data
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
});
|
|
||||||
} else if (this.activeName === 'quality') {
|
|
||||||
const {
|
|
||||||
data: { data, otherList, otherMap, nameData },
|
|
||||||
} = await getStatisticalDataPage({
|
|
||||||
workOrderIdList:[this.dataForm,id]
|
|
||||||
})
|
|
||||||
// console.log(this.queryParams);
|
|
||||||
this.dynamicProps = this.filterNameData(nameData)
|
|
||||||
this.qualityList = this.filterData(data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getDict() {
|
getDict() {
|
||||||
// 工艺
|
// 工艺
|
||||||
getProcessFlowList().then(res => {
|
getProcessFlowList().then(res => {
|
||||||
this.processFlowList = res.data || []
|
this.processFlowList = res.data || []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
filterNameData(nameData) {
|
|
||||||
const ndSet = new Set();
|
|
||||||
nameData.forEach((nd) => {
|
|
||||||
ndSet.add(nd.name);
|
|
||||||
});
|
|
||||||
return Array.from(ndSet.values())
|
|
||||||
.sort()
|
|
||||||
.map((name) => ({
|
|
||||||
prop: name,
|
|
||||||
label: name,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
filterData(data) {
|
|
||||||
return data.map((item) => {
|
|
||||||
const { data: innerData } = item;
|
|
||||||
const keyValuePairs = {};
|
|
||||||
innerData.map((d) => {
|
|
||||||
keyValuePairs[d.dynamicName] = d.dynamicValue;
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
inspectionContent: item.inspectionContent,
|
|
||||||
...keyValuePairs,
|
|
||||||
sumInput: item.sumInput,
|
|
||||||
productionName: item.productionName,
|
|
||||||
workOrderId: item.workOrderId,
|
|
||||||
scrapRatio: item.scrapRatio,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fitlerP(val) {
|
fitlerP(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
if (val === 1) {
|
if (val === 1) {
|
||||||
@ -511,26 +318,24 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.addNew(raw.data.id);
|
this.addNew(raw.data.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleTab(val) {
|
|
||||||
this.activeModule = val
|
|
||||||
if (this.activeModule === 'barChart') {
|
|
||||||
this.$nextTick((res) => {
|
|
||||||
this.$refs.orderEnergyChart.getChart()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getList() {
|
getList() {
|
||||||
// 获取订单列表
|
// 获取订单列表
|
||||||
|
getConOrderList({
|
||||||
|
workOrderId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.orderList = response.data;
|
||||||
|
// this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
// 获取预使用原料列表
|
// 获取预使用原料列表
|
||||||
// if (this.dataForm.planProductId) {
|
if (this.dataForm.planProductId) {
|
||||||
// getMaterialBomPage({
|
getMaterialBomPage({
|
||||||
// productId: this.dataForm.planProductId,
|
productId: this.dataForm.planProductId,
|
||||||
// }).then((response) => {
|
}).then((response) => {
|
||||||
// this.materialList = response.data;
|
this.materialList = response.data;
|
||||||
// // this.listQuery.total = response.data.length;
|
// this.listQuery.total = response.data.length;
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// 获取订单相关信息
|
// 获取订单相关信息
|
||||||
// orderList({
|
// orderList({
|
||||||
// workOrderId: this.dataForm.id
|
// workOrderId: this.dataForm.id
|
||||||
@ -559,7 +364,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取订单列表和用料列表
|
// 获取订单列表和用料列表
|
||||||
// this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (this.urlOptions.isGetCode) {
|
if (this.urlOptions.isGetCode) {
|
||||||
@ -568,6 +373,10 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
goback() {
|
||||||
|
this.$router.go(-1);
|
||||||
|
// this.initData();
|
||||||
|
},
|
||||||
goEdit() {
|
goEdit() {
|
||||||
this.isdetail = false;
|
this.isdetail = false;
|
||||||
},
|
},
|
||||||
@ -581,7 +390,7 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style scoped>
|
||||||
.drawer >>> .el-drawer {
|
.drawer >>> .el-drawer {
|
||||||
border-radius: 8px 0 0 8px;
|
border-radius: 8px 0 0 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -644,26 +453,4 @@ export default {
|
|||||||
.add {
|
.add {
|
||||||
color: #0b58ff;
|
color: #0b58ff;
|
||||||
}
|
}
|
||||||
.container{
|
|
||||||
/* background-color: #fff; */
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 16px 16px 0 16px;
|
|
||||||
margin: 8px 0 8px 0px;
|
|
||||||
}
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -60,9 +60,68 @@ import {
|
|||||||
getConOrderList,
|
getConOrderList,
|
||||||
getCoreWOList
|
getCoreWOList
|
||||||
} from '@/api/base/coreWorkOrder';
|
} from '@/api/base/coreWorkOrder';
|
||||||
import { listDept } from '@/api/system/dept';
|
|
||||||
|
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '创建时间',
|
||||||
|
filter: parseTime,
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '工单名称',
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '工单编码',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'workers',
|
||||||
|
label: '负责人',
|
||||||
|
minWidth: 100,
|
||||||
|
showOverflowtooltip: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'priority',
|
||||||
|
label: '优先级',
|
||||||
|
filter: (val) => ['', '低', '正常', '高'][val]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'triggerOrigin',
|
||||||
|
label: '来源',
|
||||||
|
filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'status',
|
||||||
|
label: '工单状态',
|
||||||
|
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'planFinishTime',
|
||||||
|
label: '计划完成时间',
|
||||||
|
filter: parseTime,
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'planQuantity',
|
||||||
|
label: '计划生产数量',
|
||||||
|
minWidth: 120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'actualQuantity',
|
||||||
|
label: '实际生产数量',
|
||||||
|
minWidth: 120,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [basicPage],
|
mixins: [basicPage],
|
||||||
components: {
|
components: {
|
||||||
@ -75,38 +134,37 @@ export default {
|
|||||||
urlOptions: {
|
urlOptions: {
|
||||||
getDataListURL: getCoreWOPage,
|
getDataListURL: getCoreWOPage,
|
||||||
deleteURL: deleteCoreWO
|
deleteURL: deleteCoreWO
|
||||||
},
|
},
|
||||||
departments:[],
|
detailVisible: false,
|
||||||
detailVisible: false,
|
|
||||||
departmentsLoaded: false,
|
|
||||||
materialVisible: false,
|
materialVisible: false,
|
||||||
allocationVisible: false,
|
allocationVisible: false,
|
||||||
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
// this.$auth.hasPermi(`base:core-work-order:material`)
|
this.$auth.hasPermi(`base:core-work-order:material`)
|
||||||
// ? {
|
? {
|
||||||
// type: 'material',
|
type: 'material',
|
||||||
// btnName: '原料信息',
|
btnName: '原料信息',
|
||||||
// }
|
}
|
||||||
// : undefined,
|
: undefined,
|
||||||
// {
|
{
|
||||||
// type: 'active',
|
type: 'active',
|
||||||
// btnName: '激活',
|
btnName: '激活',
|
||||||
// showParam: {
|
showParam: {
|
||||||
// type: '|',
|
type: '|',
|
||||||
// data: [
|
data: [
|
||||||
// {
|
{
|
||||||
// name: 'status',
|
name: 'status',
|
||||||
// type: 'equal',
|
type: 'equal',
|
||||||
// value: 1
|
value: 1
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// name: 'status',
|
name: 'status',
|
||||||
// type: 'equal',
|
type: 'equal',
|
||||||
// value: 3
|
value: 3
|
||||||
// }
|
}
|
||||||
// ]
|
]
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
type: 'pause',
|
type: 'pause',
|
||||||
btnName: '暂停',
|
btnName: '暂停',
|
||||||
@ -265,88 +323,13 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
mounted() {
|
||||||
tableProps() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '创建时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 150,
|
|
||||||
showOverflowtooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '工单名称',
|
|
||||||
minWidth: 120,
|
|
||||||
showOverflowtooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'code',
|
|
||||||
label: '工单编码',
|
|
||||||
minWidth: 150,
|
|
||||||
showOverflowtooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'deptId',
|
|
||||||
label: '负责部门',
|
|
||||||
minWidth: 100,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
filter: (val) => {
|
|
||||||
if (this.departmentsLoaded) {
|
|
||||||
const department = this.departments.find((dept) => dept.id === val);
|
|
||||||
return department ? department.name : '';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'priority',
|
|
||||||
label: '优先级',
|
|
||||||
filter: (val) => ['', '低', '正常', '高'][val]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'triggerOrigin',
|
|
||||||
label: '来源',
|
|
||||||
filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'status',
|
|
||||||
label: '工单状态',
|
|
||||||
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'planFinishTime',
|
|
||||||
label: '计划完成时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 150,
|
|
||||||
showOverflowtooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'planQuantity',
|
|
||||||
label: '计划生产数量',
|
|
||||||
minWidth: 120,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'actualQuantity',
|
|
||||||
label: '实际生产数量',
|
|
||||||
minWidth: 120,
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
console.log(this.$route.query.workOrderName)
|
console.log(this.$route.query.workOrderName)
|
||||||
if (this.$route.query.workOrderName) {
|
if (this.$route.query.workOrderName) {
|
||||||
this.listQuery.name = this.$route.query.workOrderName;
|
this.listQuery.name = this.$route.query.workOrderName;
|
||||||
this.formConfig[0].defaultSelect = this.$route.query.workOrderName;
|
this.formConfig[0].defaultSelect = this.$route.query.workOrderName;
|
||||||
}
|
}
|
||||||
listDept().then(res => {
|
|
||||||
this.departments = res.data || []
|
|
||||||
this.departmentsLoaded = true;
|
|
||||||
})
|
|
||||||
// this.getWorkOrder()
|
// this.getWorkOrder()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
|
@ -1,151 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-09-09 15:39:08
|
|
||||||
* @LastEditTime: 2024-09-11 10:25:54
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div class="button-nav">
|
|
||||||
<!-- <div class="text-carousel"> -->
|
|
||||||
<el-button style="flex: .1" type="text" @click="prevText" icon="el-icon-caret-left"></el-button>
|
|
||||||
<button @click="handleChange(item.id)" v-for="(item,index) in idList" :key="item.id"
|
|
||||||
:class="[item.id === currentMenu ? 'active' : '']">{{ item.name }}
|
|
||||||
</button>
|
|
||||||
<el-button style="flex: .1" type="text" @click="nextText" icon="el-icon-caret-right"></el-button>
|
|
||||||
<button style="flex: .2;display: inline-block;" @click="goback()">
|
|
||||||
<svg-icon style="width: 20px; height: 20px" :icon-class=" 'back' " />
|
|
||||||
<span>返回</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<!-- </div> -->
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
idList: {
|
|
||||||
type: Array,
|
|
||||||
default:[]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
currentMenu: undefined
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
currentMenu(newValue,oldValue) {
|
|
||||||
this.$emit('getWorkOrderId', newValue)
|
|
||||||
},
|
|
||||||
idList(newValue, oldValue) {
|
|
||||||
console.log(newValue);
|
|
||||||
this.currentMenu = newValue[0].id
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// created() {
|
|
||||||
// if (this.currentMenu === undefined) {
|
|
||||||
// console.log(this.idList);
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.currentMenu = this.idList[0]?.id
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// mounted() {
|
|
||||||
|
|
||||||
// },
|
|
||||||
methods: {
|
|
||||||
goback() {
|
|
||||||
this.$router.go(-1);
|
|
||||||
// this.initData();
|
|
||||||
},
|
|
||||||
handleChange(val) {
|
|
||||||
this.currentMenu = val
|
|
||||||
// this.$emit('getWorkOrderId',val)
|
|
||||||
},
|
|
||||||
prevText() {
|
|
||||||
const currentIndex = this.idList.findIndex((item) => item.id === this.currentMenu);
|
|
||||||
const newIndex = (currentIndex - 1 + this.idList.length) % this.idList.length;
|
|
||||||
this.currentMenu = this.idList[newIndex].id;
|
|
||||||
// this.$emit('getWorkOrderId', val)
|
|
||||||
},
|
|
||||||
nextText() {
|
|
||||||
const currentIndex = this.idList.findIndex((item) => item.id === this.currentMenu);
|
|
||||||
const newIndex = (currentIndex + 1) % this.idList.length;
|
|
||||||
this.currentMenu = this.idList[newIndex].id;
|
|
||||||
// this.$emit('getWorkOrderId', val)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.button-nav {
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px 0;
|
|
||||||
display: flex;
|
|
||||||
// justify-content: space-around;
|
|
||||||
gap: 12px;
|
|
||||||
|
|
||||||
* {
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
cursor: pointer;
|
|
||||||
appearance: none;
|
|
||||||
outline: none;
|
|
||||||
border: none;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 8px;
|
|
||||||
border-bottom-left-radius: 5px;
|
|
||||||
border-bottom-right-radius: 5px;
|
|
||||||
padding: 20px;
|
|
||||||
color: #888;
|
|
||||||
letter-spacing: 2px;
|
|
||||||
flex: 1;
|
|
||||||
box-sizing: padding-box;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: attr(data-text);
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
left: 50%;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
transform: translate(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
color: #111;
|
|
||||||
border-bottom: 4px solid #0b58ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style scoped>
|
|
||||||
.custom-tabs >>> .el-tabs__header {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
display: inline-block;
|
|
||||||
/* transform: translateY(-12px); */
|
|
||||||
}
|
|
||||||
.custom-tabs >>> .el-tabs__item {
|
|
||||||
padding-left: 0px !important;
|
|
||||||
padding-right: 0px !important;
|
|
||||||
line-height: 36px !important;
|
|
||||||
height: 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-tabs >>> .el-tabs__content {
|
|
||||||
height: calc(100% - 42px);
|
|
||||||
}
|
|
||||||
.custom-tabs >>> .el-tab-pane {
|
|
||||||
box-sizing: border-box;
|
|
||||||
height: 100%;
|
|
||||||
padding: 20px;
|
|
||||||
border: 10px solid #f002;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,10 +1,3 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-08-13 08:36:54
|
|
||||||
* @LastEditTime: 2024-09-11 09:35:12
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
<template>
|
||||||
<base-table
|
<base-table
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
|
@ -102,14 +102,14 @@ export default {
|
|||||||
bottom: '3%',
|
bottom: '3%',
|
||||||
bottom: '55%',
|
bottom: '55%',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// containLabel: true,
|
containLabel: true,
|
||||||
// top: 40,
|
top: 40,
|
||||||
// left: '4%',
|
left: '4%',
|
||||||
// right: '2%',
|
right: '2%',
|
||||||
// bottom: '3%',
|
bottom: '3%',
|
||||||
// top: '55%',
|
top: '55%',
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
@ -128,22 +128,22 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// type: 'category',
|
type: 'category',
|
||||||
// data: nameArr,
|
data: nameArr,
|
||||||
// gridIndex: 1,
|
gridIndex: 1,
|
||||||
// axisTick: {
|
axisTick: {
|
||||||
// alignWithLabel: true,
|
alignWithLabel: true,
|
||||||
// },
|
},
|
||||||
// axisLabel: {
|
axisLabel: {
|
||||||
// color: '#979797',
|
color: '#979797',
|
||||||
// },
|
},
|
||||||
// axisLine: {
|
axisLine: {
|
||||||
// lineStyle: {
|
lineStyle: {
|
||||||
// color: '#979797',
|
color: '#979797',
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
@ -159,19 +159,19 @@ export default {
|
|||||||
color: '#979797',
|
color: '#979797',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// gridIndex: 1,
|
gridIndex: 1,
|
||||||
// name: '剩余使用天数',
|
name: '剩余使用天数',
|
||||||
// axisTick: {
|
axisTick: {
|
||||||
// show: false,
|
show: false,
|
||||||
// },
|
},
|
||||||
// splitArea: {
|
splitArea: {
|
||||||
// show: false,
|
show: false,
|
||||||
// },
|
},
|
||||||
// axisLabel: {
|
axisLabel: {
|
||||||
// color: '#979797',
|
color: '#979797',
|
||||||
// },
|
},
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
@ -181,15 +181,15 @@ export default {
|
|||||||
data: valueArr,
|
data: valueArr,
|
||||||
animationDuration,
|
animationDuration,
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// name: '天数',
|
name: '天数',
|
||||||
// type: 'bar',
|
type: 'bar',
|
||||||
// barWidth: '20',
|
barWidth: '20',
|
||||||
// data: dayArr,
|
data: dayArr,
|
||||||
// animationDuration,
|
animationDuration,
|
||||||
// xAxisIndex: 1,
|
xAxisIndex: 1,
|
||||||
// yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
// },
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user