更新 #400

Merged
zwq merged 1 commits from projects/mes-zwq into projects/mes-test 2024-10-16 09:58:03 +08:00
21 changed files with 1621 additions and 829 deletions
Showing only changes of commit 9699e90ab3 - Show all commits

View File

@ -1,3 +1,10 @@
/*
* @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'
// 获取走势分析数据 // 获取走势分析数据
@ -17,6 +24,15 @@ 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({
@ -35,6 +51,24 @@ 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({

View File

@ -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,6 +16,14 @@ 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({

View File

@ -50,6 +50,22 @@ 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() {
@ -59,6 +75,16 @@ 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({

View File

@ -150,6 +150,10 @@
<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'>
@ -326,8 +330,16 @@ export default {
}) })
} }
}, },
//
search() {
if (this.validateData()) {
this.queryParams.startTime = this.queryParams.startTime + '';
this.queryParams.endTime = this.queryParams.endTime + '';
this.$emit('submit', this.queryParams);
}
},
// //
search() { validateData() {
if (!this.queryParams.energyTypeId) { if (!this.queryParams.energyTypeId) {
this.$modal.msgError('请选择能源类型') this.$modal.msgError('请选择能源类型')
return false return false
@ -397,10 +409,7 @@ export default {
this.$modal.msgError('请选择对象') this.$modal.msgError('请选择对象')
return false return false
} }
this.queryParams.startTime = this.queryParams.startTime + '' return true;
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
@ -436,7 +445,14 @@ 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>
@ -494,4 +510,4 @@ export default {
vertical-align: middle; vertical-align: middle;
margin: 0 10px; margin: 0 10px;
} }
</style> </style>

View File

@ -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"/> <search-area :isFold="isFold" @submit="getList" @exportD="exportData"/>
<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 } from "@/api/analysis/energyAnalysis" import { getCompare ,exportCompare} 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,32 +85,17 @@ export default {
} }
this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX); this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX);
}, },
// /** 导出按钮操作 */
exportExl() { exportData(val) {
if (this.list.length > 0) { //
var wb = XLSX.utils.table_to_book( this.$modal.confirm('是否确认导出对比分析数据?').then(() => {
document.querySelector('.contrast-out-table') this.exportLoading = true;
); return exportCompare(val);
let fileName = '对比分析.xlsx'; }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '对比分析数据.xlsx');
bookType: 'xlsx', this.exportLoading = false;
bookSST: true, }).catch(() => {});
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>

View File

@ -158,14 +158,33 @@ export default {
this.$emit('submit', this.queryParams) this.$emit('submit', this.queryParams)
}, },
exportData() { exportData() {
let name if (this.objArr.length === 0) {
if (this.queryParams.objId) { this.$modal.msgError('请选择对象')
name = this.getObjName(this.objList, this.queryParams.objId) return false
} else { } else {
this.$modal.msgWarning("对象不能为空") this.queryParams.objId = this.objArr[this.objArr.length-1]
}
if (!this.queryParams.type) {
this.$modal.msgError('请选择时间维度')
return false return false
} }
this.$emit('exportD', {name: name}) if (!this.queryParams.searchTime) {
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) {
@ -229,4 +248,4 @@ export default {
margin-top: 10px; margin-top: 10px;
} }
} }
</style> </style>

View File

@ -19,7 +19,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getQoq } from "@/api/analysis/energyAnalysis" import { getQoq,exportChain } 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,26 +89,14 @@ export default {
this.chartData = this.list this.chartData = this.list
}, },
exportData(val) { exportData(val) {
if (this.list.length > 0) { //
var wb = XLSX.utils.table_to_book(document.querySelector(".qoq-out-table")) this.$modal.confirm('是否确认导出环比分析数据?').then(() => {
let fileName = val.name + "环比分析.xlsx" this.exportLoading = true;
var wbout = XLSX.write(wb, { return exportChain(val);
bookType: "xlsx", }).then(response => {
bookSST: true, this.$download.excel(response, '环比分析数据.xlsx');
type: "array" this.exportLoading = false;
}) }).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("暂无数据导出")
}
} }
} }
} }
@ -129,4 +117,4 @@ export default {
margin-right: 8px; margin-right: 8px;
vertical-align: bottom; vertical-align: bottom;
} }
</style> </style>

View File

@ -125,14 +125,26 @@ export default {
this.$emit('submit', this.queryParams) this.$emit('submit', this.queryParams)
}, },
exportData() { exportData() {
let name if (this.objArr.length === 0) {
if (this.queryParams.objId) { this.$modal.msgError('请选择对象')
name = this.getObjName(this.objList, this.queryParams.objId) return false
} else { } else {
this.$modal.msgWarning("对象不能为空") this.queryParams.objId = this.objArr[this.objArr.length-1]
}
if (!this.queryParams.type) {
this.$modal.msgError('请选择时间维度')
return false return false
} }
this.$emit('exportD', {name: name}) if (!this.queryParams.searchTime) {
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) {
@ -202,4 +214,4 @@ export default {
background: #E8E8E8; background: #E8E8E8;
vertical-align: middle; vertical-align: middle;
} }
</style> </style>

View File

@ -20,7 +20,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getYoy } from "@/api/analysis/energyAnalysis" import { getYoy,exportYoy } 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,26 +101,14 @@ export default {
this.chartData = this.list this.chartData = this.list
}, },
exportData(val) { exportData(val) {
if (this.list.length > 0) { //
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table")) this.$modal.confirm('是否确认导出同比分析数据?').then(() => {
let fileName = val.name + "同比分析.xlsx" this.exportLoading = true;
var wbout = XLSX.write(wb, { return exportYoy(val);
bookType: "xlsx", }).then(response => {
bookSST: true, this.$download.excel(response, '同比分析数据.xlsx');
type: "array" this.exportLoading = false;
}) }).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("暂无数据导出")
}
} }
} }
} }
@ -140,4 +128,4 @@ export default {
margin-right: 8px; margin-right: 8px;
vertical-align: bottom; vertical-align: bottom;
} }
</style> </style>

View File

@ -0,0 +1,430 @@
<!--
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', // headersurl
};
},
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) {
// dependswatcher
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;
// dataFormcodebug
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>

View File

@ -37,12 +37,14 @@
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<DialogForm <DialogFormZ
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>
@ -51,14 +53,16 @@
<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: {}, components: { DialogFormZ },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
@ -129,33 +133,44 @@ export default {
rows: [ rows: [
[ [
{ {
input: true, select: true,
label: '备件名称', label: '备件名称',
prop: 'name', prop: 'productMaterialId',
options: [],
bind: {
filterable: true,
clearable: false,
},
rules: [ rules: [
{ required: true, message: '备件名称不能为空', trigger: 'blur' }, {
required: true,
message: '备件名称不能为空',
trigger: 'change',
},
], ],
}, },
{
input: true,
label: '备件编码',
prop: 'code',
url: '/base/equipment-spare-part/getCode',
rules: [
{ required: true, message: '备件编码不能为空', trigger: 'blur' },
],
},
],
[
{ {
input: true, input: true,
label: '备件型号', label: '备件型号',
prop: 'model', prop: 'model',
}, },
],
[
{
input: true,
label: '备件编码',
prop: 'code',
bind: {
disabled: true,
},
},
{ {
input: true, input: true,
label: '规格', label: '规格',
prop: 'specifications', prop: 'specifications',
bind: {
disabled: true,
},
}, },
], ],
[ [
@ -165,27 +180,32 @@ export default {
prop: 'supplierId', prop: 'supplierId',
url: '/base/core-supplier/listAll', // TODO: url: '/base/core-supplier/listAll', // TODO:
bind: { bind: {
filterable: true, disabled: true,
clearable: true,
}, },
rules: [
{ required: true, message: '供应商不能为空', trigger: 'blur' },
],
}, },
{ {
select: true, select: true,
label: '物料类型', label: '单位',
prop: 'type', prop: 'unit', //
options: this.getDictDatas('material_type'),
// url: '/base/core-equipment/listAll', // TODO:
bind: { bind: {
filterable: true, disabled: true,
clearable: true,
}, },
rules: [ options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
{ 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' },
// ],
// },
], ],
[ [
{ {
@ -201,14 +221,6 @@ export default {
}, },
], ],
}, },
{
select: true,
label: '单位',
prop: 'unit', //
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
},
],
[
{ {
input: true, input: true,
label: '备注', label: '备注',
@ -225,11 +237,23 @@ 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();
@ -267,8 +291,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,
@ -294,6 +318,7 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '添加备品备件'; this.title = '添加备品备件';
this.getDict();
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -302,13 +327,14 @@ 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();
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -355,6 +381,7 @@ export default {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = '修改备品备件'; this.title = '修改备品备件';
this.getDict();
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -375,6 +402,30 @@ 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>

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zwq
* @LastEditTime: 2023-11-28 10:34:24 * @LastEditTime: 2024-10-15 15:59:48
* @Description: * @Description:
--> -->
<template> <template>
@ -26,9 +26,11 @@ 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 = [
{ {
@ -62,6 +64,14 @@ const tableProps = [
prop: 'actualQuantity', prop: 'actualQuantity',
label: '生产数量' label: '生产数量'
}, },
{
prop: 'lineName',
label: '产线名称'
},
{
prop: 'lineNum',
label: '产线预计产量'
},
{ {
prop: 'planProductUnit', prop: 'planProductUnit',
label: '单位', label: '单位',
@ -187,7 +197,7 @@ export default {
if (val.type === "processDetail") { if (val.type === "processDetail") {
console.log(val); console.log(val);
let specificationsData ='' let specificationsData =''
getCoreProduct(val.data.planProductId).then((res) => { getProductMaterial(val.data.planProductId).then((res) => {
console.log(res) console.log(res)
this.$router.push({ this.$router.push({
@ -199,6 +209,7 @@ 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,
}, },

View File

@ -185,6 +185,7 @@ 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,
@ -232,6 +233,7 @@ 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,
@ -263,6 +265,7 @@ 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);

View File

@ -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-08-14 15:26:32 * @LastEditTime: 2024-10-14 09:26:29
* @Description: * @Description:
--> -->
<template> <template>
@ -252,10 +252,8 @@ export default {
}); });
}, },
async getDict() { async getDict() {
const materRes = await getMaterialTree(); const materRes = await getMaterialTree();//
let typeId = materRes.data[0].product let typeId = materRes.data.find(item=>item.product === 1).id
? materRes.data[0].id
: materRes.data[1].id;
const listQuery = { const listQuery = {
typeId: typeId, typeId: typeId,
}; };

View File

@ -117,8 +117,8 @@ export default {
methods: { methods: {
async getDict() { async getDict() {
// //
const materRes = await getMaterialTree(); const materRes = await getMaterialTree(); //
let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id let typeId = materRes.data.find(item=>item.product === 1).id
const listQuery= { const listQuery= {
typeId:typeId typeId:typeId
} }

View File

@ -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-08-14 15:27:50 * @LastEditTime: 2024-10-14 09:26:53
* @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[0].product?materRes.data[1].id:materRes.data[0].id let typeId = materRes.data.find(item=>item.product === 0).id
const listQuery= { const listQuery= {
typeId:typeId typeId:typeId
} }

View File

@ -283,7 +283,7 @@ export default {
}, },
// //
returnOrderManage() { returnOrderManage() {
this.$router.push({path: '/order/base/order-manage'}) this.$router.go(-1);
} }
} }
} }
@ -340,4 +340,4 @@ export default {
vertical-align: bottom; vertical-align: bottom;
} }
} }
</style> </style>

View File

@ -1,357 +1,411 @@
<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 type="primary" plain size="small" style="float: right;" @click="returnOrderManage"> <el-button
<svg-icon icon-class="return" /> 返回 type="primary"
</el-button> plain
<div style="padding-left: 14px;"> size="small"
<el-row> style="float: right; margin-top: -10px"
<el-col :span='3'> @click="returnOrderManage">
<div class="blodTip">订单名</div> <svg-icon icon-class="return" />
<div class="lightTip">{{orderMsg.name}}</div> 返回
</el-col> </el-button>
<el-col :span='3'> <div style="padding-left: 14px; margin-top: 20px">
<div class="blodTip">产品信息</div> <el-row>
<div class="lightTip">{{orderMsg.productName}}</div> <el-col :span="3">
</el-col> <div class="blodTip">订单名</div>
<el-col :span='3'> <div class="lightTip">{{ orderMsg.name }}</div>
<div class="blodTip">产品规格</div> </el-col>
<div class="lightTip">{{orderMsg.specifications}}</div> <el-col :span="3">
</el-col> <div class="blodTip">产品信息</div>
<el-col :span='3'> <div class="lightTip">{{ orderMsg.productName }}</div>
<div class="blodTip">客户</div> </el-col>
<div class="lightTip">{{orderMsg.customerName}}</div> <el-col :span="3">
</el-col> <div class="blodTip">产品规格</div>
<el-col :span='3'> <div class="lightTip">{{ orderMsg.specifications }}</div>
<div class="blodTip">包装规格</div> </el-col>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div> <el-col :span="3">
</el-col> <div class="blodTip">客户</div>
<!-- <el-col :span='3'> <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 class="toggleTabBox">
<div :class="{ active: activeModule === 'orderInfo' }" @click="toggleTab('orderInfo')">子订单信息</div> <div
<!-- <div :class="{ active: activeModule === 'useInfo' }" @click="toggleTab('useInfo')">用料信息</div> --> :class="{ active: activeModule === 'orderInfo' }"
</div> @click="toggleTab('orderInfo')">
<!-- 列表 --> 子订单信息
<el-row v-show="activeModule === 'orderInfo'"> </div>
<el-col :span="6"> <div
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree> :class="{ active: activeModule === 'useInfo' }"
</el-col> @click="toggleTab('useInfo')">
<el-col :span="18"> 用料信息
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps1" </div>
:table-data="list1" :max-height="tableH" /> </div>
</el-col> <!-- 列表 -->
</el-row> <el-row v-show="activeModule === 'orderInfo'">
<!-- <base-table v-show="activeModule === 'useInfo'" :page="queryParams.pageNo" :limit="queryParams.pageSize" <el-col :span="6">
:table-props="tableProps2" :table-data="list2" :max-height="tableH" /> --> <el-tree
</div> :data="treeData"
</div> :props="defaultProps"
@node-click="handleNodeClick"></el-tree>
</el-col>
<el-col :span="18">
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
: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 { getProcessFlowList } from '@/api/base/orderManage' import {
import { orderDetail, bomUseNum, getDetailTree, getDetailTreeInfo } 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: '剩余生产预计消耗',
} },
] ];
export default { export default {
name: 'OrderDetailData', name: 'OrderDetailData',
data() { data() {
return { return {
orderId: '', orderId: '',
tableProps1, tableProps1,
treeData:undefined, treeData: undefined,
activeModule:'orderInfo', activeModule: 'orderInfo',
tableProps2, tableProps2,
list1: [], list1: [],
list2: [], list2: [],
tableH: this.tableHeight(510) / 2, tableH: this.tableHeight(510) / 2,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 500 pageSize: 500,
}, },
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name',
}, },
orderMsg: {}, orderMsg: {},
processFlowName: '' processFlowName: '',
} };
}, },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2 this.tableH = this.tableHeight(510) / 2;
}) });
this.orderId = location.href.split('?')[1].split('=')[1] this.orderId = location.href.split('?')[1].split('=')[1];
this.getMsg() this.getMsg();
}, },
watch: { watch: {
$route: 'initData' $route: 'initData',
}, },
methods: { methods: {
toggleTab(val) { toggleTab(val) {
this.activeModule = val this.activeModule = val;
}, },
handleNodeClick(val) { handleNodeClick(val) {
console.log(val) console.log(val);
getDetailTreeInfo({ getDetailTreeInfo({
id: val.id id: val.id,
}).then(res => { }).then((res) => {
this.list1 = res.data.order this.list1 = res.data.order;
console.log(res) console.log(res);
}) });
}, },
initData(to) { initData(to) {
if (to.name === 'OrderDetailData') { if (to.name === 'OrderDetailData') {
this.orderId = location.href.split('?')[1].split('=')[1] this.orderId = location.href.split('?')[1].split('=')[1];
this.getMsg() this.getMsg();
} }
}, },
getMsg() { getMsg() {
orderDetail({ orderDetail({
id: this.orderId id: this.orderId,
}).then(res => { }).then((res) => {
this.orderMsg = res.data this.orderMsg = res.data;
this.list1 = res.data.coreWorkOrderRespVOS this.list1 = res.data.coreWorkOrderRespVOS;
bomUseNum({
productId: this.orderMsg.planProductId getOrderRemainNum(this.orderId).then((resNum) => {
}).then(res2 => { bomUseNum({
if (res2.data && res2.data.length > 0) { productId: this.orderMsg.planProductId,
let arr = res2.data }).then((res2) => {
arr.map(item => { if (res2.data && res2.data.length > 0) {
if (item) { let arr = res2.data;
let a = item.num * this.orderMsg.remainingQuantity arr.map((item) => {
item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : '' if (item) {
} let a = item.num * resNum.data;
}) item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : '';
this.list2 = arr }
}else { });
this.list2 = [] this.list2 = arr;
} this.getMaterialCostOrder(this.orderId);
}) } else {
getDetailTree({ this.list2 = [];
id: this.orderId }
}).then(res => { });
console.log(res) });
this.treeData =res.data getDetailTree({
}) id: this.orderId,
// }).then((res) => {
getProcessFlowList().then(res => { console.log(res);
let arr = res.data || [] this.treeData = res.data;
if (arr.length > 0) { });
arr.map(item => { //
if (item.id === this.orderMsg.processFlowId) { getProcessFlowList().then((res) => {
this.processFlowName = item.name let arr = res.data || [];
} if (arr.length > 0) {
}) arr.map((item) => {
} if (item.id === this.orderMsg.processFlowId) {
}) this.processFlowName = item.name;
}) }
}, });
// }
returnOrderManage() { });
this.$router.go(-1); });
} },
} getMaterialCostOrder(id) {
} getMaterialCostOrder({ id }).then((res) => {
this.list2.push(...res.data);
});
},
//
returnOrderManage() {
this.$router.go(-1);
},
},
};
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.orderDetailData { .orderDetailData {
background-color: rgb(242, 244, 249); background-color: rgb(242, 244, 249);
.box1, .box2, .box3 { .box1,
background-color: #fff; .box2,
border-radius: 9px; .box3 {
} background-color: #fff;
.box2 { border-radius: 9px;
height: calc((100vh - 360px)); }
padding: 12px 16px 0; .box2 {
margin: 8px 0; height: calc((100vh - 360px));
.toggleTabBox { padding: 12px 16px 0;
display: inline-block; margin: 8px 0;
div { .toggleTabBox {
display: inline-block; display: inline-block;
padding: 0 8px 4px; div {
color: rgba(102, 102, 102, 0.5); display: inline-block;
border-bottom: 2px solid rgba(242, 244, 249, 1); padding: 0 8px 4px;
cursor: pointer; color: rgba(102, 102, 102, 0.5);
} border-bottom: 2px solid rgba(242, 244, 249, 1);
.active { cursor: pointer;
color: rgba(0, 0, 0, 0.85); }
border-bottom-color: #0B58FF; .active {
} color: rgba(0, 0, 0, 0.85);
} border-bottom-color: #0b58ff;
} }
.box1 { }
height: 215px; }
padding: 16px 16px 0 16px; .box1 {
.blodTip { height: 215px;
height: 16px; padding: 16px 16px 0 16px;
font-size: 14px; .blodTip {
font-weight: 600; height: 16px;
color: rgba(0,0,0,0.85); font-size: 14px;
margin-bottom: 8px; font-weight: 600;
} color: rgba(0, 0, 0, 0.85);
.lightTip { margin-bottom: 8px;
height: 16px; }
font-size: 14px; .lightTip {
font-weight: 400; height: 16px;
color: rgba(102,102,102,0.75); font-size: 14px;
margin-bottom: 12px; font-weight: 400;
} color: rgba(102, 102, 102, 0.75);
} margin-bottom: 12px;
}
}
} }
</style> </style>

View File

@ -1,315 +1,484 @@
<template> <template>
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm" label-position="top"> <el-form
<el-row :gutter="20"> ref="dataForm"
<el-col :span='8'> :rules="rules"
<el-form-item label="工单名称" prop="name"> label-width="130px"
<el-input v-model="dataForm.name" placeholder="请输入工单名称"></el-input> :model="dataForm"
</el-form-item> label-position="top">
</el-col> <el-row :gutter="20">
<el-col :span='8'> <el-col :span="8">
<el-form-item label="工单编码" prop="code"> <el-form-item label="工单名称" prop="name">
<el-input v-model="dataForm.code" disabled placeholder="请输入工单编码"></el-input> <el-input
</el-form-item> v-model="dataForm.name"
</el-col> placeholder="请输入工单名称"></el-input>
<el-col :span='8'> </el-form-item>
<el-form-item label="产品名称" prop="planProductId"> </el-col>
<el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" filterable <el-col :span="8">
@change="selectProduct"> <el-form-item label="工单编码" prop="code">
<el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id"> <el-input
</el-option> v-model="dataForm.code"
</el-select> disabled
</el-form-item> placeholder="请输入工单编码"></el-input>
</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="planProductId">
<el-form-item label="产品规格" prop="specifications"> <el-select
<el-input v-model="dataForm.specifications" placeholder="请输入产品规格" /> v-model="dataForm.planProductId"
</el-form-item> placeholder="请选择产品"
</el-col> style="width: 100%"
<el-col :span='8'> filterable
<el-form-item label="计划开始时间"> @change="selectProduct">
<el-date-picker v-model="dataForm.planStartTime" type="datetime" value-format="timestamp" style="width: 100%;" <el-option
placeholder="请选择计划开始时间"> v-for="item in productList"
</el-date-picker> :key="item.id"
</el-form-item> :label="item.name"
</el-col> :value="item.id"></el-option>
<el-col :span='8'> </el-select>
<el-form-item label="计划完成时间"> </el-form-item>
<el-date-picker v-model="dataForm.planFinishTime" type="datetime" value-format="timestamp" </el-col>
style="width: 100%;" placeholder="请选择计划完成时间"> </el-row>
</el-date-picker> <el-row :gutter="20">
</el-form-item> <el-col :span="8">
</el-col> <el-form-item label="产品规格" prop="specifications">
</el-row> <el-input
<el-row :gutter="20"> v-model="dataForm.specifications"
<el-col :span='8'> placeholder="请输入产品规格" />
<el-form-item label="计划投入数量" prop="planAssignQuantity"> </el-form-item>
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;" </el-col>
placeholder="请输入计划投入数量"></el-input-number> <el-col :span="8">
</el-form-item> <el-form-item label="计划开始时间">
</el-col> <el-date-picker
<el-col :span='8'> v-model="dataForm.planStartTime"
<el-form-item label="计划生产数量" prop="planQuantity"> type="datetime"
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;" value-format="timestamp"
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-col :span="8">
<el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;" <el-form-item label="计划完成时间">
@change="processFlowIdChange"> <el-date-picker
<el-option v-for="item in processFlowList" :key="item.id" :label="item.name" :value="item.id"> v-model="dataForm.planFinishTime"
</el-option> type="datetime"
</el-select> value-format="timestamp"
</el-form-item> style="width: 100%"
</el-col> placeholder="请选择计划完成时间"></el-date-picker>
</el-row> </el-form-item>
<el-row :gutter="20"> </el-col>
<el-col :span='8'> </el-row>
<el-form-item label="物料计算方式" prop="materialMethod"> <el-row :gutter="20">
<!-- <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange"> <el-col :span="8">
<el-radio :label="1">产品基础BOM</el-radio> <el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-radio :label="2">工艺扩展BOM</el-radio> <el-input-number
</el-radio-group> --> v-model="dataForm.planAssignQuantity"
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" :min="0"
:max="9999999999999"
style="width: 100%"
placeholder="请输入计划投入数量"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number
v-model="dataForm.planQuantity"
:min="0"
:max="9999999999999"
style="width: 100%"
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"> @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-form-item> </el-col>
</el-col> </el-row>
<el-col :span='8'> <div v-if="dataForm.materialMethod === 1">
<el-form-item label="优先级" prop="priority"> <el-row :gutter="20">
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;"> <el-col :span="24">
<el-option v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" :key="item.value" :label="item.label" <span style="margin: 8px 0; display: inline-block">关联产线</span>
:value="item.value"> <el-button style="margin-left: 20px" type="text" @click="addBind">
</el-option> 新增
</el-select> </el-button>
</el-form-item> </el-col>
</el-col> </el-row>
<el-col :span='8'> <el-row
<el-form-item label="工单类型" prop="type"> :gutter="20"
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;"> v-for="(item, index) in dataForm.productLineIds"
<el-option v-for="item in workOrderTypeList" :key="item.id" :label="item.name" :value="item.id"> :key="index + 'line'"
</el-option> style="margin-bottom: 8px">
</el-select> <el-col :span="8">
</el-form-item> <el-select
</el-col> v-model="item.lineId"
</el-row> placeholder="请选择产线"
<el-row :gutter="20"> style="width: 100%">
<el-col :span='8'> <el-option
<el-form-item label="关联产线" prop="productLineIds"> v-for="item in productLineList"
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;"> :key="item.id"
<el-option v-for="item in productLineList" :key="item.id" :label="item.name" :value="item.id"> :label="item.name"
</el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-col>
</el-col> <el-col :span="8">
<el-col :span='8'> <el-input-number
<el-form-item label="负责部门" prop="deptId"> style="width: 100%"
<el-select v-model="dataForm.deptId" placeholder="请选择关联产线" style="width: 100%;"> v-model="item.num"
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id"> placeholder="请输入数量"
</el-option> :step="1"
</el-select> :min="0"
</el-form-item> step-strictly />
</el-col> </el-col>
<el-col :span='8'> </el-row>
<el-form-item label="负责人" prop="workers"> </div>
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input> <div v-else>
</el-form-item> <el-row :gutter="20">
</el-col> <el-col :span="24">
</el-row> <span style="margin: 8px 0; display: inline-block">
<!-- <el-row> 关联产线及工艺
</span>
<el-button style="margin-left: 20px" type="text" @click="addBind">
新增
</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 { getProcessFlowList, workOrderList } from '@/api/base/orderManage' import { getProcessFlowPage, workOrderList } from '@/api/base/orderManage';
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder' import {
import { getLineAll } from '@/api/base/productionLine' createCoreWO,
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'; 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, 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: [
deptList:[], { required: true, message: '计划生产数量不能为空', trigger: 'blur' },
workOrderTypeList: [ ],
{id: 1,name:'普通'}, },
{id: 2, name:'特殊'} productList: [],
], processFlowList: [],
planStartTime: '', productLineList: [],
planFinishTime: '', deptList: [],
isBind: false, workOrderTypeList: [
workOrderList: [] { id: 1, name: '普通' },
} { id: 2, name: '特殊' },
}, ],
mounted() { planStartTime: '',
this.getDict() planFinishTime: '',
}, isBind: false,
methods: { workOrderList: [],
// };
materialMethodChange(val) { },
if (val === 2 && !this.dataForm.processFlowId) { mounted() {
this.dataForm.materialMethod = 1 this.getDict();
this.$modal.msgError("请先选择关联工艺"); },
} methods: {
}, //
// materialMethodChange(val) {
processFlowIdChange(val) { console.log(val);
console.log(val) this.processFlowList = [];
if (!val) { this.dataForm.productLineIds = [];
this.dataForm.materialMethod = 1 const obj = { lineId: null, processId: null, num: null };
} this.dataForm.productLineIds.push(obj);
}, // if (val === 2 && !this.dataForm.processFlowId) {
init(id) { // this.dataForm.materialMethod = 1;
this.dataForm.id = id || ""; // this.$modal.msgError('');
this.visible = true; // }
if (this.urlOptions.getOption) { },
this.getArr() // 线
} processLineIdChange(val) {
this.$nextTick(() => { const params = {
this.$refs["dataForm"].resetFields(); pageNo: 1,
this.planStartTime = '' pageSize: 100,
this.planFinishTime = '' lineId: val,
if (this.dataForm.id) { };
getCoreWO(id).then(response => { //
this.dataForm = response.data; getProcessFlowPage(params).then((res) => {
if (this.dataForm.priority !== undefined) { this.processFlowList = res.data.list || [];
this.dataForm.priority = String(this.dataForm.priority) });
} },
this.dataForm.priority init(id) {
}); this.dataForm.id = id || '';
} else { this.visible = true;
if (this.urlOptions.isGetCode) { if (this.urlOptions.getOption) {
this.getCode() 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.id) { if (this.dataForm.materialMethod === 1) {
this.urlOptions.updateURL(this.dataForm).then(response => { this.dataForm.productLineIds.forEach((item) => {
this.$modal.msgSuccess("修改成功"); if (!item.lineId) {
this.visible = false; this.$message('关联产线不能为空');
this.$emit("refreshDataList"); isContinue = false;
}); }
return; });
} } else {
// this.dataForm.productLineIds.forEach((item) => {
this.urlOptions.createURL(this.dataForm).then(response => { if (!item.lineId || !item.processId) {
this.$modal.msgSuccess("新增成功"); this.$message('关联产线及工艺不能为空');
this.visible = false; isContinue = false;
this.$confirm('是否添加预使用主原料信息?', '提示', { }
confirmButtonText: '确定', });
cancelButtonText: '取消', }
type: 'warning' //
}).then(() => { if (this.dataForm.id && isContinue) {
console.log('121', this.dataForm.name) this.urlOptions.updateURL(this.dataForm).then((response) => {
this.$emit("refreshDataList", { this.$modal.msgSuccess('修改成功');
id: response.data, this.visible = false;
name: this.dataForm.name this.$emit('refreshDataList');
}); });
}).catch(() => { return;
this.$emit("refreshDataList"); }
}); //
}); if (isContinue) {
}); this.urlOptions.createURL(this.dataForm).then((response) => {
}, this.$modal.msgSuccess('新增成功');
getCode() { this.visible = false;
this.urlOptions.codeURL() this.$confirm('是否添加预使用主原料信息?', '提示', {
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 => { listDept().then((res) => {
this.deptList = res.data || [] this.deptList = res.data || [];
}) });
// // list
getProcessFlowList().then(res => { workOrderList({
this.processFlowList = res.data || [] status: 1,
}) }).then((res) => {
// list this.workOrderList = res.data || [];
workOrderList({ });
status: 1 },
}).then(res => { //
this.workOrderList = res.data || [] selectProduct(val) {
}) if (val) {
}, this.productList.map((item) => {
// if (val === item.id) {
selectProduct(val) { this.dataForm.specifications = item.specifications;
if (val) { }
this.productList.map(item => { });
if (val === item.id) { } else {
this.dataForm.specifications = item.specifications this.dataForm.specifications = '';
} }
}) },
} else { addBind() {
this.dataForm.specifications = '' const obj = { lineId: null, processId: null, num: null };
} this.dataForm.productLineIds.push(obj);
} },
} },
} };
</script> </script>

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zhp * @LastEditors: zwq
* @LastEditTime: 2024-09-11 10:27:13 * @LastEditTime: 2024-10-15 16:16:22
* @Description: * @Description:
--> -->
<template> <template>
@ -157,7 +157,7 @@
<script> <script>
// import basicAdd from '../../core/mixins/basic-add'; // import basicAdd from '../../core/mixins/basic-add';
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder"; import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById,getMaterialCostWorkOrder } from "@/api/base/coreWorkOrder";
import tableHeightMixin from '@/mixins/tableHeightMixin'; import tableHeightMixin from '@/mixins/tableHeightMixin';
import { getOrderEnergyData } from "@/api/monitoring/orderEnergy"; import { getOrderEnergyData } from "@/api/monitoring/orderEnergy";
// import { orderList } from "@/api/base/orderManage"; // import { orderList } from "@/api/base/orderManage";
@ -215,7 +215,7 @@ const tableProps1 = [
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict')
}, },
{ {
prop: 'num', prop: 'remainingNum',
label: '剩余生产预计消耗' label: '剩余生产预计消耗'
}, },
]; ];
@ -390,8 +390,8 @@ export default {
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); });
}else if (this.activeName === 'material') { }else if (this.activeName === 'material') {
getConOrderList({ getMaterialCostWorkOrder({
workOrderId: this.dataForm.id, id: this.dataForm.id,
}).then((response) => { }).then((response) => {
this.materialList = response.data; this.materialList = response.data;
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;

View File

@ -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,
}, // },
], ],
}); });
}, },