Compare commits
8 Commits
1d38a560ec
...
f9741b07c0
Author | SHA1 | Date | |
---|---|---|---|
|
f9741b07c0 | ||
|
fcb1885bf7 | ||
123d45afa9 | |||
97e6a665de | |||
298789bf24 | |||
876f7d8f3c | |||
5695c3db90 | |||
9537c55f0e |
5
.env.dev
5
.env.dev
@ -1,7 +1,7 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2023-11-06 09:08:54
|
||||
# @LastEditTime: 2023-11-07 09:23:07
|
||||
# @LastEditors: DY
|
||||
# @Description:
|
||||
###
|
||||
@ -14,10 +14,11 @@ VUE_APP_TITLE = MES系统
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
|
||||
VUE_APP_BASE_API = 'http://192.168.1.56:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.159:48080'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-11-06 10:50:57
|
||||
* @LastEditTime: 2023-11-06 17:49:42
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -108,4 +108,31 @@ export function getCoreWOMaPage(query) {
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得预计用料信息分页
|
||||
export function getMaterialBomPage(query) {
|
||||
return request({
|
||||
url: '/base/material-product-bom/bomUseNum',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单分页
|
||||
export function getConOrderList(query) {
|
||||
return request({
|
||||
url: '/base/order/listConOrder',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 改变工单状态 激活暂停完成作废
|
||||
export function statusChange(data) {
|
||||
return request({
|
||||
url: '/base/core-work-order/statusChange',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-12 14:07:04
|
||||
* @LastEditTime: 2023-09-13 09:53:45
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-07 14:17:38
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getYieldAnalysisPageData(data) {
|
||||
export function getYieldAnalysisPageData(query) {
|
||||
return request({
|
||||
url: '/analysis/production-analysis/getOutput',
|
||||
method: 'post',
|
||||
data: data
|
||||
url: '/base/core-production-line-rec-day/monthList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-09-12 09:44:53
|
||||
* @LastEditTime: 2023-09-15 14:12:26
|
||||
* @LastEditTime: 2023-11-06 18:57:05
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得近24小时产线生产数据
|
||||
export function getPdlDataOneDay(data) {
|
||||
export function getPdlDataOneDay(query) {
|
||||
return request({
|
||||
url: '/monitoring/production-monitor/getPdlDataOneDay',
|
||||
method: 'post',
|
||||
data: data
|
||||
url: '/base/core-production-line-rec-hour/list24h',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -1,416 +0,0 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-04 11:39:25
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
size="50%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料类型" prop="materialType">
|
||||
<el-select
|
||||
v-model="dataForm.materialType"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择物料类型">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas('material_type')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品类型" prop="productType">
|
||||
<el-select
|
||||
v-model="dataForm.productType"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择产品类型">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-select
|
||||
v-model="dataForm.unit"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择单位">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.UNIT_DICT)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位平方数" prop="area">
|
||||
<el-input-number v-model="dataForm.area" :precision="2" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规格" prop="specifications">
|
||||
<el-input v-model="dataForm.specifications" :disabled="isdetail" clearable placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线生产单位用时(S)" prop="processTime">
|
||||
<el-input v-model.number="dataForm.processTime" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
产品属性
|
||||
</small-title>
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block;" @click="addNew()">
|
||||
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
||||
<span class="add">添加</span>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="productAttrList">
|
||||
<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="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:product-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { createCoreProduct, updateCoreProduct, getCoreProduct, getCode, getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import attrAdd from './attr-add';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '属性名',
|
||||
},
|
||||
{
|
||||
prop: 'value',
|
||||
label: '属性值',
|
||||
},
|
||||
];
|
||||
|
||||
const topBtnConfig = [
|
||||
{
|
||||
type: 'add',
|
||||
btnName: 'btn.add'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { SmallTitle, attrAdd },
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
topBtnConfig,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createCoreProduct,
|
||||
updateURL: updateCoreProduct,
|
||||
infoURL: getCoreProduct,
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: '',
|
||||
materialType: undefined,
|
||||
productType: undefined,
|
||||
area: undefined,
|
||||
specifications: undefined,
|
||||
processTime: 0,
|
||||
remark: undefined,
|
||||
unit: undefined
|
||||
},
|
||||
productAttrList: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
idAttrShow: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
|
||||
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
initData() {
|
||||
this.productAttrList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.attrName
|
||||
? '[名称=' + raw.data.attrName + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取产品属性列表
|
||||
getCoreProductAttrPage({
|
||||
...this.listQuery,
|
||||
productId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.productAttrList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
if (id) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.idAttrShow = false
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
this.dataForm.unit = String(this.dataForm.unit)
|
||||
this.dataForm.materialType = String(this.dataForm.materialType)
|
||||
this.dataForm.productType = String(this.dataForm.productType)
|
||||
});
|
||||
// 获取产品属性列表
|
||||
this.getList();
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
// this.initData();
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 30px 24px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-06 10:01:37
|
||||
* @LastEditTime: 2023-11-06 14:38:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -16,8 +16,8 @@
|
||||
{{ '预使用主原料信息' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div style="height: 15vh">
|
||||
<div style="font-size: 18px;">工单名:{{ workOrderName }}</div>
|
||||
<div style="height: 10vh">
|
||||
<div style="font-size: 18px;">工单名:{{ dataForm.name }}</div>
|
||||
</div>
|
||||
|
||||
<div class="attr-list">
|
||||
@ -64,7 +64,7 @@
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:product-id="dataForm.id"
|
||||
:work-order-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
@ -136,7 +136,6 @@ export default {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
topBtnConfig,
|
||||
workOrderName: '111',
|
||||
addOrUpdateVisible: false,
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
@ -144,7 +143,8 @@ export default {
|
||||
total: 0,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined
|
||||
id: undefined,
|
||||
name: ''
|
||||
},
|
||||
materialList: [],
|
||||
visible: false,
|
||||
@ -199,10 +199,11 @@ export default {
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
init(row, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.dataForm.id = row.id || undefined;
|
||||
this.dataForm.name = row.name || '';
|
||||
this.visible = true;
|
||||
this.getList()
|
||||
|
||||
@ -237,6 +238,7 @@ export default {
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
console.log('22', id)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
|
@ -178,7 +178,8 @@ export default {
|
||||
priority: '',
|
||||
productLineIds: [],
|
||||
type: '',
|
||||
workers: ''
|
||||
workers: '',
|
||||
status: 1
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
||||
|
@ -75,6 +75,7 @@
|
||||
<el-select
|
||||
v-model="dataForm.unit"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
placeholder="请选择单位">
|
||||
<el-option
|
||||
v-for="dict in getDictDatas('unit_dict')"
|
||||
@ -103,7 +104,7 @@ import { getDictDatas} from "@/utils/dict";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
productId: {
|
||||
workOrderId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
@ -121,8 +122,8 @@ export default {
|
||||
unit: undefined
|
||||
},
|
||||
originList: [
|
||||
{ label: 1, value: '内部'},
|
||||
{ label: 2, value: '采购'}
|
||||
{ label: '内部', value: 1},
|
||||
{ label: '采购', value: 2}
|
||||
],
|
||||
supplierList: [],
|
||||
dataRule: {
|
||||
@ -142,13 +143,12 @@ export default {
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
console.log('1', this.dataForm.id)
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCoreWOMa({
|
||||
id: this.dataForm.id
|
||||
}).then((res) => {
|
||||
getCoreWOMa(this.dataForm.id).then((res) => {
|
||||
this.dataForm = res.data
|
||||
});
|
||||
}
|
||||
@ -162,7 +162,7 @@ export default {
|
||||
if (this.dataForm.id) {
|
||||
updateCoreWOMa({
|
||||
...this.dataForm,
|
||||
workOrderId: this.productId,
|
||||
workOrderId: this.workOrderId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
@ -173,7 +173,7 @@ export default {
|
||||
// 添加的提交
|
||||
createCoreWOMa({
|
||||
...this.dataForm,
|
||||
workOrderId: this.productId,
|
||||
workOrderId: this.workOrderId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
|
413
src/views/base/coreWorkOrder/detail.vue
Normal file
413
src/views/base/coreWorkOrder/detail.vue
Normal file
@ -0,0 +1,413 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-06 17:08:22
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
size="50%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div>
|
||||
<h2>工单编码:{{ dataForm.code }}</h2>
|
||||
</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 orderArray" :key="index" style="margin-right: 10px">{{ item.name }}</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.expectedTime }}</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">关联产线:{{ dataForm.productLineNames }}</el-col>
|
||||
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
|
||||
</el-row>
|
||||
</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">订单创建时间:
|
||||
<span v-for="(item, index) in orderArray" :key="index" style="margin-right: 10px">{{ item.createTime }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">计划开始时间:{{ dataForm.planStartTime }}</el-col>
|
||||
<el-col :span="8">计划完成时间:{{ dataForm.planFinishTime }}</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">预计结束时间:{{ dataForm.computeFinishTime }}</el-col>
|
||||
<el-col :span="8">实际开始时间:{{ dataForm.startProduceTime }}</el-col>
|
||||
<el-col :span="8">实际完成时间:{{ 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">检测瑕疵数:{{ 0 }}</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
预计用料信息
|
||||
</small-title>
|
||||
<base-table
|
||||
:table-props="tableProps1"
|
||||
: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>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import basicAdd from '../../core/mixins/basic-add';
|
||||
import { getCoreWO, getMaterialBomPage, getConOrderList } from "@/api/base/coreWorkOrder";
|
||||
import { orderList } from "@/api/base/orderManage";
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { publicFormatter } from "@/utils/dict";
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'orderName',
|
||||
label: '订单名称',
|
||||
},
|
||||
{
|
||||
prop: 'orderCode',
|
||||
label: '订单编码',
|
||||
},
|
||||
{
|
||||
prop: 'priority',
|
||||
label: '优先级',
|
||||
filter: (val) => ['', '低', '正常', '高'][val]
|
||||
},
|
||||
{
|
||||
prop: 'planAssignmentQuantity',
|
||||
label: '计划分配数量',
|
||||
},
|
||||
{
|
||||
prop: 'actualAssignmentQuantity',
|
||||
label: '实际分配数量',
|
||||
}
|
||||
];
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '原料名称'
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '剩余生产预计消耗'
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
components: { SmallTitle },
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
tableProps1,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
infoURL: getCoreWO
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
listQuery1: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
dataForm: {},
|
||||
orderList: [],
|
||||
materialList: [],
|
||||
orderArray: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
fitlerP(val) {
|
||||
if (val) {
|
||||
if (val === 1) {
|
||||
return '低'
|
||||
} else if (val === 2) {
|
||||
return '正常'
|
||||
} else {
|
||||
return '高'
|
||||
}
|
||||
}
|
||||
},
|
||||
fitlerS(val) {
|
||||
if (val) {
|
||||
if (val === 1) {
|
||||
return '等待'
|
||||
} else if (val === 2) {
|
||||
return '激活'
|
||||
} else if (val === 3) {
|
||||
return '暂停'
|
||||
} else if (val === 4) {
|
||||
return '完成'
|
||||
} else {
|
||||
return '作废'
|
||||
}
|
||||
}
|
||||
},
|
||||
initData() {
|
||||
this.orderList.splice(0);
|
||||
this.materialList.splice(0);
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.attrName
|
||||
? '[名称=' + raw.data.attrName + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取订单列表
|
||||
getConOrderList({
|
||||
workOrderId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.orderList = response.data;
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
// 获取预使用原料列表
|
||||
if (this.dataForm.planProductId) {
|
||||
getMaterialBomPage({
|
||||
productId: this.dataForm.planProductId,
|
||||
}).then((response) => {
|
||||
this.materialList = response.data;
|
||||
// this.listQuery.total = response.data.length;
|
||||
});
|
||||
}
|
||||
// 获取订单相关信息
|
||||
orderList({
|
||||
workOrderId: this.dataForm.id
|
||||
}).then((response) => {
|
||||
this.orderArray = response.data;
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取工单详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
// 获取订单列表和用料列表
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
// this.initData();
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 10px 24px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.formContent {
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
@ -34,23 +34,32 @@
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="refreshWorkOrder"></add-work-order>
|
||||
</base-dialog>
|
||||
<!-- 预使用原料信息 -->
|
||||
<add-or-update
|
||||
v-if="materialVisible"
|
||||
ref="material"
|
||||
@refreshDataList="closeDetail"></add-or-update>
|
||||
<!-- 查看详情 -->
|
||||
<detail
|
||||
v-if="detailVisible"
|
||||
ref="detail"
|
||||
@refreshDataList="closeDetail"></add-or-update>
|
||||
@refreshDataList="closeDetail"></detail>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import AddWorkOrder from './addWorkOrder'
|
||||
import Detail from './detail.vue';
|
||||
import basicPage from '../../core/mixins/basic-page';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import {
|
||||
getCoreWOPage,
|
||||
deleteCoreWO
|
||||
deleteCoreWO,
|
||||
statusChange
|
||||
} from '@/api/base/coreWorkOrder';
|
||||
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
@ -103,7 +112,8 @@ export default {
|
||||
mixins: [basicPage],
|
||||
components: {
|
||||
AddWorkOrder,
|
||||
AddOrUpdate
|
||||
AddOrUpdate,
|
||||
Detail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -112,12 +122,23 @@ export default {
|
||||
deleteURL: deleteCoreWO
|
||||
},
|
||||
detailVisible: false,
|
||||
materialVisible: false,
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-work-order:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:material`)
|
||||
@ -136,22 +157,94 @@ export default {
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
// {
|
||||
// type: 'equal',
|
||||
// btnName: '开始',
|
||||
// showParam: {
|
||||
// type: '&',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'status',
|
||||
// type: 'equal',
|
||||
// value: 1
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
{
|
||||
type: 'active',
|
||||
btnName: '激活',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'pause',
|
||||
btnName: '暂停',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'nullify',
|
||||
btnName: '作废',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 4
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'finish',
|
||||
btnName: '完成',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
].filter((v)=>v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
@ -217,16 +310,59 @@ export default {
|
||||
},
|
||||
closeDetail() {
|
||||
this.detailVisible = false
|
||||
this.materialVisible = false
|
||||
this.getDataList()
|
||||
},
|
||||
// 其他方法
|
||||
otherMethods(val) {
|
||||
if (val.type === 'material') {
|
||||
this.detailVisible = true;
|
||||
this.materialVisible = true;
|
||||
this.addOrEditTitle = "预使用主原料信息";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.material.init(val.data, true);
|
||||
});
|
||||
} else if (val.type === 'detail') {
|
||||
this.detailVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.detail.init(val.data.id, true);
|
||||
});
|
||||
} else {
|
||||
const param = {
|
||||
id: val.data.id,
|
||||
status: undefined
|
||||
}
|
||||
if (val.type === 'active') {
|
||||
param.status = 2
|
||||
}
|
||||
if (val.type === 'pause') {
|
||||
param.status = 3
|
||||
}
|
||||
if (val.type === 'nullify') {
|
||||
param.status = 9
|
||||
}
|
||||
if (val.type === 'finish') {
|
||||
param.status = 4
|
||||
}
|
||||
console.log('22',val)
|
||||
this.$confirm(`确定对${'[工单名称=' + val.data.name + ']'}进行${val.type}操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
statusChange(param).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '暂停成功!',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-10-27 15:11:02
|
||||
* @LastEditTime: 2023-11-06 19:44:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -56,6 +56,7 @@
|
||||
v-model="dataForm.type"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择物料类型">
|
||||
<el-option
|
||||
v-for="dict in materialList"
|
||||
@ -83,6 +84,7 @@
|
||||
filterable
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择供应商">
|
||||
<el-option
|
||||
v-for="dict in supplierList"
|
||||
@ -100,9 +102,10 @@
|
||||
v-model="dataForm.unit"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择物料单位">
|
||||
<el-option
|
||||
v-for="dict in unitList"
|
||||
v-for="dict in getDictDatas('unit_dict')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
@ -172,6 +175,7 @@ import { listData } from "@/api/system/dict/data";
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import attrAdd from './attr-add';
|
||||
import { getDictDatas } from "@/utils/dict";
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
@ -265,17 +269,17 @@ export default {
|
||||
const supplierRes = await getSupplierList();
|
||||
this.supplierList = supplierRes.data;
|
||||
// 物料单位列表
|
||||
const unitRes = await listData({
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
dictType: 'goods_unit',
|
||||
});
|
||||
this.unitList = unitRes.data.list.map(item => {
|
||||
return {
|
||||
label: item.label,
|
||||
value: Number(item.value)
|
||||
}
|
||||
});
|
||||
// const unitRes = await listData({
|
||||
// pageNo: 1,
|
||||
// pageSize: 99,
|
||||
// dictType: 'goods_unit',
|
||||
// });
|
||||
// this.unitList = unitRes.data.list.map(item => {
|
||||
// return {
|
||||
// label: item.label,
|
||||
// value: Number(item.value)
|
||||
// }
|
||||
// });
|
||||
},
|
||||
initData() {
|
||||
this.materialAttrList.splice(0);
|
||||
@ -341,6 +345,9 @@ export default {
|
||||
// 获取物料详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
if (this.dataForm.unit) {
|
||||
this.dataForm.unit = String(this.dataForm.unit)
|
||||
}
|
||||
});
|
||||
// 获取物料的属性列表
|
||||
this.getList();
|
||||
|
@ -58,10 +58,6 @@ const tableProps = [
|
||||
prop: 'engName',
|
||||
label: '英文名称'
|
||||
},
|
||||
{
|
||||
prop: 'abbr',
|
||||
label: '缩写'
|
||||
},
|
||||
{
|
||||
prop: 'materialType',
|
||||
label: '物料类型'
|
||||
@ -117,13 +113,13 @@ export default {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
label: '物料名称',
|
||||
placeholder: '物料名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
label: '物料编码',
|
||||
placeholder: '物料编码',
|
||||
param: 'code',
|
||||
},
|
||||
@ -228,6 +224,27 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否删除物料名称为"${name}"的数据项?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-10-24 18:34:07
|
||||
* @LastEditTime: 2023-11-06 19:55:59
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -64,7 +64,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
isGetCode: false,
|
||||
codeURL: getCode,
|
||||
createURL: createMaterialDate,
|
||||
updateURL: updateMaterialDate,
|
||||
@ -81,8 +81,8 @@ export default {
|
||||
materialList: [],
|
||||
dataRule: {
|
||||
materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "工厂编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "工厂名称不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "批次号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "批次名称不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -164,6 +164,27 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否删除物料批次名称为"${name}"的数据项?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-10-27 16:06:44
|
||||
* @LastEditTime: 2023-11-06 20:04:03
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -30,7 +30,9 @@
|
||||
<el-select
|
||||
v-model="dataForm.productId"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择产品">
|
||||
<el-option
|
||||
v-for="dict in productList"
|
||||
@ -88,6 +90,7 @@
|
||||
<el-select
|
||||
v-model="scope.row.materialId"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!scope.row.isEdit"
|
||||
placeholder="请选择物料"
|
||||
@change="setCode(scope.row)">
|
||||
@ -125,7 +128,7 @@
|
||||
<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-button v-else type="primary" size="small" @click="saveData(scope.row)">保存</el-button>
|
||||
<el-button v-else type="text" size="small" @click="saveData(scope.row)">保存</el-button>
|
||||
<el-tooltip placement="top" content="删除">
|
||||
<el-button
|
||||
type="text"
|
||||
@ -256,7 +259,7 @@ export default {
|
||||
const unitRes = await listData({
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
dictType: 'goods_unit',
|
||||
dictType: 'unit_dict',
|
||||
});
|
||||
this.unitList = unitRes.data.list.map(item => {
|
||||
return {
|
||||
@ -295,17 +298,17 @@ export default {
|
||||
.catch(() => {});
|
||||
},
|
||||
setCode(row) {
|
||||
this.materialList.filter(item => {
|
||||
const tempM = this.materialList.filter(item => {
|
||||
if (row.materialId === item.id) {
|
||||
row.materialCode = item.code
|
||||
}
|
||||
this.unitList.filter(u => {
|
||||
if (item.unit === u.value) {
|
||||
row.unit = u.value
|
||||
row.mUnit = u.label
|
||||
}
|
||||
})
|
||||
// return row.materialId === item.id
|
||||
return row.materialId === item.id
|
||||
})
|
||||
this.unitList.filter(u => {
|
||||
if (tempM[0].unit === u.value) {
|
||||
row.unit = u.value
|
||||
row.mUnit = u.label
|
||||
}
|
||||
})
|
||||
// row.materialCode = tempList[0].code
|
||||
// row.unit = tempList[0].unit
|
||||
@ -343,8 +346,7 @@ export default {
|
||||
// 获取产品Bom详细列表
|
||||
getProBomList({
|
||||
...this.listQuery,
|
||||
bomId: this.dataForm.id,
|
||||
createTime: ['2023-10-26 00:00:00', '2023-10-27 12:00:00']
|
||||
bomId: this.dataForm.id
|
||||
}).then((response) => {
|
||||
this.tableData = response.data.records.map(item => {
|
||||
this.unitList.filter(u => {
|
||||
@ -450,7 +452,7 @@ export default {
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
max-height: 30vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
|
@ -97,16 +97,10 @@ export default {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
placeholder: '物料名称',
|
||||
label: '产品名称',
|
||||
placeholder: '产品名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
placeholder: '物料编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
@ -158,7 +152,6 @@ export default {
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name ? val.name : undefined;
|
||||
this.listQuery.code = val.code ? val.code : undefined;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-10-26 09:43:51
|
||||
* @LastEditTime: 2023-11-06 19:27:57
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -164,7 +164,7 @@ export default {
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '自动'
|
||||
name: 'PDA'
|
||||
}
|
||||
],
|
||||
materialList: [],
|
||||
@ -187,7 +187,6 @@ export default {
|
||||
async getDictData() {
|
||||
const materRes = await getMaterialList()
|
||||
this.materialList = materRes.data
|
||||
console.log('你好', this.materialList)
|
||||
const dateRes = await getMaterDateList()
|
||||
this.materialDateList = dateRes.data
|
||||
const eqRes = await getEqListAll()
|
||||
@ -252,6 +251,9 @@ export default {
|
||||
return item.id === this.dataForm.materialId
|
||||
})
|
||||
this.dataForm.materialCode = tempMaterial[0].code
|
||||
getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{
|
||||
this.materialDateList = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -56,7 +56,7 @@ const tableProps = [
|
||||
label: '物料编码'
|
||||
},
|
||||
{
|
||||
prop: 'materialDateId',
|
||||
prop: 'materialDateName',
|
||||
label: '物料批次'
|
||||
},
|
||||
{
|
||||
@ -183,7 +183,6 @@ export default {
|
||||
} else {
|
||||
this.listQuery.useTime = []
|
||||
}
|
||||
console.log('222', this.listQuery, val.time)
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
@ -207,6 +206,22 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === "edit") {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "编辑";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === "delete") {
|
||||
this.deleteHandle(val.data.id, val.data.materialName, val.data._pageIndex)
|
||||
} else if (val.type === "change") {
|
||||
this.changeStatus(val.data.id)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -19,7 +19,7 @@
|
||||
// import basicPage from '../../mixins/basic-page';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
|
||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
// import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
import lineChart from '../LineChart'
|
||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
|
||||
|
||||
@ -58,21 +58,20 @@ export default {
|
||||
dataListLoading:false,
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
lineIds: [],
|
||||
time: ''
|
||||
// lineIds: [],
|
||||
recordTime: []
|
||||
},
|
||||
dateLabelList: [],
|
||||
optionArrUrl: [getProductionLinePage ],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineIds',
|
||||
defaultSelect: '',
|
||||
multiple:true,
|
||||
filterable: true,
|
||||
},
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '产线',
|
||||
// selectOptions: [],
|
||||
// param: 'lineIds',
|
||||
// defaultSelect: '',
|
||||
// multiple:true,
|
||||
// filterable: true,
|
||||
// },
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
@ -94,22 +93,22 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getArr();
|
||||
// this.getArr();
|
||||
},
|
||||
methods: {
|
||||
getArr() {
|
||||
const params = {
|
||||
page: 1,
|
||||
limit: 500,
|
||||
};
|
||||
this.optionArrUrl.forEach((item, index) => {
|
||||
item(params).then((response) => {
|
||||
this.formConfig[index].selectOptions = response.data.list
|
||||
// this.formConfig[0].defaultSelect = response.data.list[0].id
|
||||
this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
|
||||
});
|
||||
});
|
||||
},
|
||||
// getArr() {
|
||||
// const params = {
|
||||
// page: 1,
|
||||
// limit: 500,
|
||||
// };
|
||||
// this.optionArrUrl.forEach((item, index) => {
|
||||
// item(params).then((response) => {
|
||||
// this.formConfig[index].selectOptions = response.data.list
|
||||
// // this.formConfig[0].defaultSelect = response.data.list[0].id
|
||||
// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
|
||||
// });
|
||||
// });
|
||||
// },
|
||||
getData() {
|
||||
// this.listQuery.lineIds = ['1672847052717821953']
|
||||
// this.listQuery.productId = val.productId;
|
||||
@ -230,12 +229,26 @@ export default {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined
|
||||
// this.listQuery.productId = val.productId;
|
||||
this.listQuery.time = val.time ? new Date(val.time).getTime() : undefined
|
||||
// this.listQuery.pageNo = 1;
|
||||
// this.listQuery.pageSize = 10;
|
||||
// this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
|
||||
if (val.time) {
|
||||
const tempTtime = new Date(val.time)
|
||||
let day = 0
|
||||
switch (tempTtime.getMonth() + 1) {
|
||||
case 1, 3, 5, 7, 8, 10, 12:
|
||||
day = 31;
|
||||
break;
|
||||
case 2:
|
||||
day = 28;
|
||||
break;
|
||||
case 4, 6, 9, 11:
|
||||
day = 30;
|
||||
break;
|
||||
}
|
||||
console.log(parseTime(new Date(tempTtime.getFullYear(), 11, 31, 23, 59, 59)))
|
||||
this.listQuery.recordTime = [
|
||||
val.time,
|
||||
parseTime(new Date(tempTtime.getFullYear(), tempTtime.getMonth(), day, 23, 59, 59))
|
||||
]
|
||||
this.getData()
|
||||
} else {
|
||||
this.$message({
|
||||
|
@ -2,7 +2,7 @@
|
||||
filename: index.vue
|
||||
author: liubin
|
||||
date: 2023-08-04 14:44:58
|
||||
description: 设备24小时生产记录
|
||||
description: 近24小时产线生产数据
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
<script>
|
||||
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
|
||||
export default {
|
||||
name: 'productionLineData24',
|
||||
@ -54,28 +55,32 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
/** 构建tableProps - 依据第一个元素所提供的信息 */
|
||||
buildProps(plData) {
|
||||
plData.forEach(item => {
|
||||
this.timeList.push(item.name)
|
||||
})
|
||||
const timeArray = Array.from(new Set(this.timeList))
|
||||
console.log('nihc', timeArray)
|
||||
for (const times of timeArray) {
|
||||
if (times !== '投入数量' && times !== '产出数量' && times !== '报废数量' && times !== '产出面积') {
|
||||
const subprop = {
|
||||
label: times.slice(0, 10) + ' ' + times.slice(11),
|
||||
align: 'center',
|
||||
children: [
|
||||
{ prop: times + '_in', label: '投入数量' },
|
||||
{ prop: times + '_out', label: '产出数量' },
|
||||
{ prop: times + '_junk', label: '报废数量' },
|
||||
{ prop: times + '_area', label: '产出面积' }
|
||||
]
|
||||
}
|
||||
this.arr.push(subprop)
|
||||
buildProps() {
|
||||
// 获取当前时间
|
||||
var currentTime = new Date();
|
||||
let timeArr = []
|
||||
|
||||
// 添加24小时内的整点时间--时间戳格式
|
||||
for (let i = 0; i < 24; i ++) {
|
||||
timeArr.unshift(new Date(currentTime.getFullYear(), currentTime.getMonth(), currentTime.getDate(), currentTime.getHours() - i, 0, 0).getTime())
|
||||
}
|
||||
console.log("24小时内的开始时间:" + timeArr, timeArr.length);
|
||||
for(const times of timeArr) {
|
||||
const subprop = {
|
||||
label: parseTime(times),
|
||||
align: 'center',
|
||||
children: [
|
||||
{ prop: times + '_up', label: '上片数据' },
|
||||
{ prop: times + '_down', label: '下片数据' },
|
||||
{ prop: times + '_good', label: '良品面积' },
|
||||
{ prop: times + '_bad', label: '报废数据' },
|
||||
{ prop: times + '_percent', label: '报废比例(%)' }
|
||||
]
|
||||
}
|
||||
this.arr.push(subprop)
|
||||
}
|
||||
this.tableProps = this.arr
|
||||
console.log('111', this.tableProps)
|
||||
},
|
||||
setRowSpan(arr) {
|
||||
let count = 0
|
||||
@ -101,20 +106,11 @@ export default {
|
||||
console.log('打印看下数据list', list)
|
||||
list.forEach((ele, index) => {
|
||||
let tempData = []
|
||||
ele.data.forEach(item => {
|
||||
item.children.forEach(params => {
|
||||
if (params.dynamicName === '投入数量') {
|
||||
tempData[item.dynamicName + '_in'] = params.dynamicValue
|
||||
} else if (params.dynamicName === '产出数量') {
|
||||
tempData[item.dynamicName + '_out'] = params.dynamicValue
|
||||
} else if (params.dynamicName === '报废数量') {
|
||||
tempData[item.dynamicName + '_junk'] = params.dynamicValue
|
||||
} else {
|
||||
tempData[item.dynamicName + '_area'] = params.dynamicValue
|
||||
}
|
||||
})
|
||||
})
|
||||
tempData['proLineName'] = ele.proLineName
|
||||
tempData[ele.recordTime + '_up'] = ele.inputNum
|
||||
tempData[ele.recordTime + '_down'] = ele.outputNum
|
||||
tempData[ele.recordTime + '_up'] = ele.inputNum
|
||||
tempData['proLineName'] = ele.lineName
|
||||
tempData['workOrderName'] = ele.workOrderName
|
||||
tempData['spec'] = ele.spec
|
||||
this.tableData.push(tempData)
|
||||
console.log('看看数据', this.tableData, tempData)
|
||||
@ -151,17 +147,23 @@ export default {
|
||||
prop: 'proLineName',
|
||||
label: '生产线',
|
||||
fixed: 'left',
|
||||
showOverflowTooltip: true
|
||||
'show-overflow-tooltip': true
|
||||
},
|
||||
{
|
||||
prop: 'workOrderName',
|
||||
label: '当前工单',
|
||||
fixed: 'left',
|
||||
'show-overflow-tooltip': true
|
||||
},
|
||||
{
|
||||
prop: 'spec',
|
||||
label: '产品规格',
|
||||
fixed: 'left',
|
||||
showOverflowTooltip: true
|
||||
'show-overflow-tooltip': true
|
||||
}
|
||||
]
|
||||
this.buildProps(res.data.nameData);
|
||||
this.buildData(res.data.data);
|
||||
this.buildProps();
|
||||
this.buildData(res.data);
|
||||
})
|
||||
|
||||
// // const data = this.res.data;
|
||||
|
@ -35,34 +35,39 @@
|
||||
<el-tabs v-model="activeName" @tab-click="toggleTab">
|
||||
<el-tab-pane label="数据列表" name="dataList">
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="150"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="viewDetDetail"
|
||||
<div v-if="activeName === 'dataList'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="150"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="viewDetDetail"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="环形图" name="barChart">
|
||||
<div
|
||||
id="logDetPieBar"
|
||||
style="width: 182px; height: 180px;"
|
||||
></div>
|
||||
<div v-if="activeName === 'barChart'">
|
||||
<div
|
||||
id="logDetPieBar"
|
||||
style="width: 100%"
|
||||
:style="{ height: chartHeight + 'px' }"
|
||||
></div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@ -110,6 +115,8 @@
|
||||
<script>
|
||||
import { deliveryLogPage, deliveryLogDetPage } from '@/api/base/delivery'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import * as echarts from 'echarts'
|
||||
import resize from '@/utils/chartMixins/resize'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'deliveryTime',
|
||||
@ -182,6 +189,7 @@ const tableProps2 = [
|
||||
]
|
||||
export default {
|
||||
name: 'DeliveryLogDetDetail',
|
||||
mixins: [resize],
|
||||
data() {
|
||||
return {
|
||||
centervisible: false,
|
||||
@ -195,6 +203,7 @@ export default {
|
||||
orderMsg: {},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
total: 0,
|
||||
tableH: this.tableHeight(350),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team:update')
|
||||
@ -215,9 +224,18 @@ export default {
|
||||
tableData2: [],
|
||||
tableH2: this.tableHeight(275),
|
||||
total2: 0,
|
||||
logCode: ''
|
||||
logCode: '',
|
||||
// 图
|
||||
chartDom: '',
|
||||
chart: '',
|
||||
chartHeight: this.tableHeight(300)
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// chartData: function () {
|
||||
// this.getChart()
|
||||
// }
|
||||
// },
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(350)
|
||||
@ -225,6 +243,9 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH2 = this.tableHeight(275)
|
||||
})
|
||||
window.addEventListener('resize', () => {
|
||||
this.chartHeight = this.tableHeight(300)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
init(params) {
|
||||
@ -236,13 +257,87 @@ export default {
|
||||
getList() {
|
||||
deliveryLogPage({...this.queryParams}).then(res => {
|
||||
this.tableData = res.data.list || []
|
||||
this.taotal = res.data.total || 0
|
||||
})
|
||||
},
|
||||
toggleTab() {
|
||||
|
||||
if (this.activeName === 'barChart') {
|
||||
this.$nextTick(() => {
|
||||
this.getBar()
|
||||
})
|
||||
}
|
||||
},
|
||||
getBar() {
|
||||
|
||||
if (
|
||||
this.chart !== null &&
|
||||
this.chart !== '' &&
|
||||
this.chart !== undefined
|
||||
) {
|
||||
this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
||||
}
|
||||
this.chartDom = document.getElementById('logDetPieBar')
|
||||
this.chart = echarts.init(this.chartDom)
|
||||
let seriesData = []
|
||||
let sumData = 0
|
||||
this.tableData && this.tableData.map(item =>{
|
||||
let obj = {}
|
||||
obj.value = item.rate
|
||||
obj.name = item.name
|
||||
seriesData.push(obj)
|
||||
sumData+=item.rate
|
||||
})
|
||||
if (sumData < 100) {
|
||||
let obj = {}
|
||||
obj.value = 100 - sumData
|
||||
obj.name = "未发货"
|
||||
seriesData.push(obj)
|
||||
}
|
||||
var option = {
|
||||
color: ['#B0EB42', '#FF9747', '#FF6860', '#7164FF', '#288AFF', '#63BDFF', '#73DE93', '#FFCE6A'],
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function(params) {
|
||||
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${params.color};"></span>`
|
||||
return `<span>
|
||||
<span style="color:rgba(0,0,0,0.85);">${str}${params.name}</span>
|
||||
<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${params.percent}</span>
|
||||
</span>`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
bottom: '5%',
|
||||
left: 'center',
|
||||
icon: 'rect',
|
||||
itemHeight: 8,
|
||||
itemWidth: 8
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['60%', '80%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 40,
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
scale: true ,
|
||||
scaleSize: 20 ,
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
data: seriesData
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && this.chart.setOption(option);
|
||||
},
|
||||
viewDetDetail(val) {
|
||||
this.logCode = val.data.code
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer title="参数绑定" :visible.sync="visible" size="70%" @close='closeD'>
|
||||
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'>
|
||||
<div class="box">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="关联表名">
|
||||
@ -94,6 +94,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
drawerTitle: '',
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableBtn: [],
|
||||
@ -131,9 +132,11 @@ export default {
|
||||
this.objName = data.objName
|
||||
this.getList()
|
||||
if (title === 'detail') {
|
||||
this.drawerTitle = '查看参数'
|
||||
this.showBtn = false
|
||||
this.tableBtn = []
|
||||
} else {
|
||||
this.drawerTitle = '参数绑定'
|
||||
this.showBtn = true
|
||||
this.tableBtn = [
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer title="参数绑定" :visible.sync="visible" size="70%" @close='closeD'>
|
||||
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'>
|
||||
<div class="box">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="方案名称">
|
||||
@ -85,6 +85,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
drawerTitle: '',
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableBtn: [],
|
||||
@ -125,9 +126,11 @@ export default {
|
||||
this.energyTypeId = data.energyTypeId
|
||||
this.getList()
|
||||
if (title === 'detail') {
|
||||
this.drawerTitle = '查看参数'
|
||||
this.showBtn = false
|
||||
this.tableBtn = []
|
||||
} else {
|
||||
this.drawerTitle = '参数绑定'
|
||||
this.showBtn = true
|
||||
this.tableBtn = [
|
||||
{
|
||||
|
@ -288,9 +288,13 @@ export default {
|
||||
this.open = true;
|
||||
this.title = '添加保养计划';
|
||||
},
|
||||
handleDetail(id){
|
||||
alert('跳转到 保养记录')
|
||||
},
|
||||
handleDetail(id){
|
||||
// alert('跳转到 保养记录')
|
||||
this.$router.push({
|
||||
name: 'Record',
|
||||
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
|
@ -60,31 +60,31 @@ export default {
|
||||
this.chart = echarts.init(this.$el, 'macarons');
|
||||
|
||||
this.chart.setOption({
|
||||
title: {
|
||||
text: this.title
|
||||
? '{space|}{tip|}{space|}{value|' + this.title + '}'
|
||||
: '',
|
||||
left: '0%',
|
||||
top: '0%',
|
||||
textStyle: {
|
||||
rich: {
|
||||
tip: {
|
||||
width: 4,
|
||||
height: 18,
|
||||
backgroundColor: '#0B58FF',
|
||||
marginRight: 6,
|
||||
},
|
||||
space: {
|
||||
width: 8,
|
||||
},
|
||||
value: {
|
||||
fontSize: 16,
|
||||
fontWeight: 'bold',
|
||||
color: 'black',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// title: {
|
||||
// text: this.title
|
||||
// ? '{space|}{tip|}{space|}{value|' + this.title + '}'
|
||||
// : '',
|
||||
// left: '0%',
|
||||
// top: '0%',
|
||||
// textStyle: {
|
||||
// rich: {
|
||||
// tip: {
|
||||
// width: 4,
|
||||
// height: 18,
|
||||
// backgroundColor: '#0B58FF',
|
||||
// marginRight: 6,
|
||||
// },
|
||||
// space: {
|
||||
// width: 8,
|
||||
// },
|
||||
// value: {
|
||||
// fontSize: 16,
|
||||
// fontWeight: 'bold',
|
||||
// color: 'black',
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
color: ['#288AFF', '#8EF0AB', '#FFDC94'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@ -148,6 +148,7 @@ export default {
|
||||
yAxis: [
|
||||
{
|
||||
gridIndex: 0,
|
||||
name: '库存数量',
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
@ -160,6 +161,7 @@ export default {
|
||||
},
|
||||
{
|
||||
gridIndex: 1,
|
||||
name: '剩余使用天数',
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
|
@ -59,7 +59,7 @@ export default {
|
||||
zlevel: 2, // 控制圆环图中间的字的层级
|
||||
text: '总数',
|
||||
subtext: totalNumber,
|
||||
top: '42%', // 控制位置
|
||||
top: '35%', // 控制位置
|
||||
left: '50%', // 控制位置
|
||||
textAlign: 'center', // 让文字居中
|
||||
textStyle: {
|
||||
@ -72,7 +72,7 @@ export default {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
show: true, // 控制鼠标悬浮是否显示数据
|
||||
formatter: '产品: {b}<br/>数量: {c}<br/>占比: {d}%',
|
||||
formatter: '{b}<br/>数量: {c}<br/>占比: {d}%',
|
||||
},
|
||||
legend: {
|
||||
orient: 'vartical',
|
||||
|
@ -2,16 +2,20 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-22 15:01:54
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 16:32:13
|
||||
* @LastEditTime: 2023-11-07 14:12:00
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-row :gutter="10" class="chart-container">
|
||||
<el-col :span="14">
|
||||
<el-col :span="wareType === 1 ? 14 : 24">
|
||||
<div class="chart-card">
|
||||
<div class="title">库存总览</div>
|
||||
<div class="sub-title">产品总数量
|
||||
<div style="color: black;">{{ totalNum }}</div>
|
||||
</div>
|
||||
<barChart
|
||||
ref="barChart"
|
||||
height="500px"
|
||||
height="600px"
|
||||
title="库存总览"
|
||||
v-if="overviewList.length"
|
||||
:histogram="overviewList" />
|
||||
@ -19,16 +23,18 @@
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="wareType === 1 ? 10 : 0">
|
||||
<div class="chart-card">
|
||||
<div class="title">库位占用率</div>
|
||||
<pieChart
|
||||
ref="pieChart"
|
||||
height="600px"
|
||||
title="库位占用率"
|
||||
v-if="rateList.length"
|
||||
:pie-data="rateList" />
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -36,46 +42,62 @@
|
||||
<script>
|
||||
import barChart from '../../chart/BarChart.vue';
|
||||
import pieChart from '../../chart/PieChart.vue';
|
||||
import {
|
||||
getOverview,
|
||||
getRate,
|
||||
} from '@/api/warehouse/warehouseLocation';
|
||||
import { getOverview, getRate } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
allURL: getOverview,
|
||||
rateURL: getRate
|
||||
rateURL: getRate,
|
||||
},
|
||||
listQuery: {
|
||||
storageType: 2,
|
||||
},
|
||||
wareType: 1,
|
||||
totalNum: 0,
|
||||
overviewList: [],
|
||||
rateList: []
|
||||
rateList: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
barChart,
|
||||
pieChart
|
||||
pieChart,
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList();
|
||||
},
|
||||
created() {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
this.wareType = item.type;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
const data = {
|
||||
storageType : 2
|
||||
}
|
||||
this.urlOptions.allURL(data).then((response) => {
|
||||
this.overviewList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
this.urlOptions.allURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.overviewList = response.data;
|
||||
this.overviewList.forEach(item=>{
|
||||
this.totalNum += item.num
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
this.urlOptions.rateURL(data).then((response) => {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
this.urlOptions.rateURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
@ -93,4 +115,33 @@ export default {
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
line-height: 16px;
|
||||
margin-bottom: 10px;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
border-radius: 1px;
|
||||
margin-right: 5px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
.sub-title{
|
||||
font-size: 16px;
|
||||
line-height: 18px;
|
||||
color: #888686;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
margin-right: 30px;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
@ -58,7 +58,7 @@ import {
|
||||
getWarehouseLocationHisPage,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
@ -179,8 +179,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(this.listQuery.storageType).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-21 14:26:23
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 14:46:59
|
||||
* @LastEditTime: 2023-11-06 11:25:34
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -93,7 +93,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -129,7 +130,10 @@ export default {
|
||||
there: [],
|
||||
four: [],
|
||||
}),
|
||||
listAll(1).then((response) => {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === 2) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
response.data.forEach((a, b) => {
|
||||
if (b % 4 === 0) {
|
||||
this.wareData.one.push(a);
|
||||
@ -142,7 +146,10 @@ export default {
|
||||
}
|
||||
});
|
||||
this.total = Math.ceil(response.data.length / 40);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
|
@ -64,7 +64,7 @@ import {
|
||||
outWarehouseRealtimeLocation,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -203,8 +203,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(this.listQuery.storageType).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,16 +2,20 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-22 15:01:54
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 16:11:36
|
||||
* @LastEditTime: 2023-11-07 14:11:50
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-row :gutter="10" class="chart-container">
|
||||
<el-col :span="14">
|
||||
<el-col :span="wareType === 1 ? 14 : 24">
|
||||
<div class="chart-card">
|
||||
<div class="title">库存总览</div>
|
||||
<div class="sub-title">产品总数量
|
||||
<div style="color: black;">{{ totalNum }}</div>
|
||||
</div>
|
||||
<barChart
|
||||
ref="barChart"
|
||||
height="500px"
|
||||
height="600px"
|
||||
title="库存总览"
|
||||
v-if="overviewList.length"
|
||||
:histogram="overviewList" />
|
||||
@ -19,16 +23,18 @@
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="wareType === 1 ? 10 : 0">
|
||||
<div class="chart-card">
|
||||
<div class="title">库位占用率</div>
|
||||
<pieChart
|
||||
ref="pieChart"
|
||||
height="600px"
|
||||
title="库位占用率"
|
||||
v-if="rateList.length"
|
||||
:pie-data="rateList" />
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -36,46 +42,62 @@
|
||||
<script>
|
||||
import barChart from '../../chart/BarChart.vue';
|
||||
import pieChart from '../../chart/PieChart.vue';
|
||||
import {
|
||||
getOverview,
|
||||
getRate,
|
||||
} from '@/api/warehouse/warehouseLocation';
|
||||
import { getOverview, getRate } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
allURL: getOverview,
|
||||
rateURL: getRate
|
||||
rateURL: getRate,
|
||||
},
|
||||
listQuery: {
|
||||
storageType: 5,
|
||||
},
|
||||
wareType: 1,
|
||||
totalNum: 0,
|
||||
overviewList: [],
|
||||
rateList: []
|
||||
rateList: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
barChart,
|
||||
pieChart
|
||||
pieChart,
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList();
|
||||
},
|
||||
created() {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
this.wareType = item.type;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
const data = {
|
||||
storageType : 5
|
||||
}
|
||||
this.urlOptions.allURL(data).then((response) => {
|
||||
this.overviewList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
this.urlOptions.allURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.overviewList = response.data;
|
||||
this.overviewList.forEach(item=>{
|
||||
this.totalNum += item.num
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
this.urlOptions.rateURL(data).then((response) => {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
this.urlOptions.rateURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
@ -93,4 +115,33 @@ export default {
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
line-height: 16px;
|
||||
margin-bottom: 10px;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
border-radius: 1px;
|
||||
margin-right: 5px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
.sub-title{
|
||||
font-size: 16px;
|
||||
line-height: 18px;
|
||||
color: #888686;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
margin-right: 30px;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
@ -58,7 +58,7 @@ import {
|
||||
getWarehouseLocationHisPage,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
@ -179,8 +179,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(this.listQuery.storageType).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-21 14:26:23
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 14:46:59
|
||||
* @LastEditTime: 2023-11-06 11:32:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -93,7 +93,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -129,7 +130,10 @@ export default {
|
||||
there: [],
|
||||
four: [],
|
||||
}),
|
||||
listAll(1).then((response) => {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === 5) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
response.data.forEach((a, b) => {
|
||||
if (b % 4 === 0) {
|
||||
this.wareData.one.push(a);
|
||||
@ -142,7 +146,10 @@ export default {
|
||||
}
|
||||
});
|
||||
this.total = Math.ceil(response.data.length / 40);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
|
@ -64,7 +64,7 @@ import {
|
||||
outWarehouseRealtimeLocation,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -203,8 +203,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(this.listQuery.storageType).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,16 +2,20 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-22 15:01:54
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 16:06:10
|
||||
* @LastEditTime: 2023-11-07 14:11:37
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-row :gutter="10" class="chart-container">
|
||||
<el-col :span="14">
|
||||
<el-col :span="wareType === 1 ? 14 : 24">
|
||||
<div class="chart-card">
|
||||
<div class="title">库存总览</div>
|
||||
<div class="sub-title">产品总数量
|
||||
<div style="color: black;">{{ totalNum }}</div>
|
||||
</div>
|
||||
<barChart
|
||||
ref="barChart"
|
||||
height="500px"
|
||||
height="600px"
|
||||
title="库存总览"
|
||||
v-if="overviewList.length"
|
||||
:histogram="overviewList" />
|
||||
@ -19,16 +23,18 @@
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="wareType === 1 ? 10 : 0">
|
||||
<div class="chart-card">
|
||||
<div class="title">库位占用率</div>
|
||||
<pieChart
|
||||
ref="pieChart"
|
||||
height="600px"
|
||||
title="库位占用率"
|
||||
v-if="rateList.length"
|
||||
:pie-data="rateList" />
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -36,46 +42,62 @@
|
||||
<script>
|
||||
import barChart from '../../chart/BarChart.vue';
|
||||
import pieChart from '../../chart/PieChart.vue';
|
||||
import {
|
||||
getOverview,
|
||||
getRate,
|
||||
} from '@/api/warehouse/warehouseLocation';
|
||||
import { getOverview, getRate } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
allURL: getOverview,
|
||||
rateURL: getRate
|
||||
rateURL: getRate,
|
||||
},
|
||||
listQuery: {
|
||||
storageType: 3,
|
||||
},
|
||||
wareType: 1,
|
||||
totalNum: 0,
|
||||
overviewList: [],
|
||||
rateList: []
|
||||
rateList: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
barChart,
|
||||
pieChart
|
||||
pieChart,
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList();
|
||||
},
|
||||
created() {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
this.wareType = item.type;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
const data = {
|
||||
storageType : 3
|
||||
}
|
||||
this.urlOptions.allURL(data).then((response) => {
|
||||
this.overviewList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
this.urlOptions.allURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.overviewList = response.data;
|
||||
this.overviewList.forEach(item=>{
|
||||
this.totalNum += item.num
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
this.urlOptions.rateURL(data).then((response) => {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
this.urlOptions.rateURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
@ -93,4 +115,33 @@ export default {
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
line-height: 16px;
|
||||
margin-bottom: 10px;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
border-radius: 1px;
|
||||
margin-right: 5px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
.sub-title{
|
||||
font-size: 16px;
|
||||
line-height: 18px;
|
||||
color: #888686;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
margin-right: 30px;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
@ -58,7 +58,7 @@ import {
|
||||
getWarehouseLocationHisPage,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
@ -179,8 +179,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(3).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-21 14:26:23
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 14:46:59
|
||||
* @LastEditTime: 2023-11-06 11:31:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -93,7 +93,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -129,7 +130,10 @@ export default {
|
||||
there: [],
|
||||
four: [],
|
||||
}),
|
||||
listAll(1).then((response) => {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === 3) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
response.data.forEach((a, b) => {
|
||||
if (b % 4 === 0) {
|
||||
this.wareData.one.push(a);
|
||||
@ -142,7 +146,10 @@ export default {
|
||||
}
|
||||
});
|
||||
this.total = Math.ceil(response.data.length / 40);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
|
@ -64,7 +64,7 @@ import {
|
||||
outWarehouseRealtimeLocation,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -203,8 +203,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(3).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,16 +2,20 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-22 15:01:54
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 16:24:11
|
||||
* @LastEditTime: 2023-11-07 14:11:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-row :gutter="10" class="chart-container">
|
||||
<el-col :span="14">
|
||||
<el-col :span="wareType === 1 ? 14 : 24">
|
||||
<div class="chart-card">
|
||||
<div class="title">库存总览</div>
|
||||
<div class="sub-title">产品总数量
|
||||
<div style="color: black;">{{ totalNum }}</div>
|
||||
</div>
|
||||
<barChart
|
||||
ref="barChart"
|
||||
height="500px"
|
||||
height="600px"
|
||||
title="库存总览"
|
||||
v-if="overviewList.length"
|
||||
:histogram="overviewList" />
|
||||
@ -19,16 +23,18 @@
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="wareType === 1 ? 10 : 0">
|
||||
<div class="chart-card">
|
||||
<div class="title">库位占用率</div>
|
||||
<pieChart
|
||||
ref="pieChart"
|
||||
height="600px"
|
||||
title="库位占用率"
|
||||
v-if="rateList.length"
|
||||
:pie-data="rateList" />
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -36,46 +42,62 @@
|
||||
<script>
|
||||
import barChart from '../../chart/BarChart.vue';
|
||||
import pieChart from '../../chart/PieChart.vue';
|
||||
import {
|
||||
getOverview,
|
||||
getRate,
|
||||
} from '@/api/warehouse/warehouseLocation';
|
||||
import { getOverview, getRate } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
allURL: getOverview,
|
||||
rateURL: getRate
|
||||
rateURL: getRate,
|
||||
},
|
||||
listQuery: {
|
||||
storageType: 4,
|
||||
},
|
||||
wareType: 1,
|
||||
totalNum: 0,
|
||||
overviewList: [],
|
||||
rateList: []
|
||||
rateList: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
barChart,
|
||||
pieChart
|
||||
pieChart,
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList();
|
||||
},
|
||||
created() {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
this.wareType = item.type;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
const data = {
|
||||
storageType : 4
|
||||
}
|
||||
this.urlOptions.allURL(data).then((response) => {
|
||||
this.overviewList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
this.urlOptions.allURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.overviewList = response.data;
|
||||
this.overviewList.forEach(item=>{
|
||||
this.totalNum += item.num
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
this.urlOptions.rateURL(data).then((response) => {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
this.urlOptions.rateURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
@ -93,4 +115,33 @@ export default {
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
line-height: 16px;
|
||||
margin-bottom: 10px;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
border-radius: 1px;
|
||||
margin-right: 5px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
.sub-title{
|
||||
font-size: 16px;
|
||||
line-height: 18px;
|
||||
color: #888686;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
margin-right: 30px;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
@ -58,7 +58,7 @@ import {
|
||||
getWarehouseLocationHisPage,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
@ -179,8 +179,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(this.listQuery.storageType).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-21 14:26:23
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 14:46:59
|
||||
* @LastEditTime: 2023-11-06 11:31:14
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -93,7 +93,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -129,7 +130,10 @@ export default {
|
||||
there: [],
|
||||
four: [],
|
||||
}),
|
||||
listAll(1).then((response) => {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === 4) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
response.data.forEach((a, b) => {
|
||||
if (b % 4 === 0) {
|
||||
this.wareData.one.push(a);
|
||||
@ -142,7 +146,10 @@ export default {
|
||||
}
|
||||
});
|
||||
this.total = Math.ceil(response.data.length / 40);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
|
@ -64,7 +64,7 @@ import {
|
||||
outWarehouseRealtimeLocation,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -203,8 +203,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(this.listQuery.storageType).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,16 +2,20 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-22 15:01:54
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 15:18:38
|
||||
* @LastEditTime: 2023-11-07 14:11:10
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-row :gutter="10" class="chart-container">
|
||||
<el-col :span="14">
|
||||
<el-col :span="wareType === 1 ? 14 : 24">
|
||||
<div class="chart-card">
|
||||
<div class="title">库存总览</div>
|
||||
<div class="sub-title">产品总数量
|
||||
<div style="color: black;">{{ totalNum }}</div>
|
||||
</div>
|
||||
<barChart
|
||||
ref="barChart"
|
||||
height="500px"
|
||||
height="600px"
|
||||
title="库存总览"
|
||||
v-if="overviewList.length"
|
||||
:histogram="overviewList" />
|
||||
@ -19,16 +23,18 @@
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="wareType === 1 ? 10 : 0">
|
||||
<div class="chart-card">
|
||||
<div class="title">库位占用率</div>
|
||||
<pieChart
|
||||
ref="pieChart"
|
||||
height="600px"
|
||||
title="库位占用率"
|
||||
v-if="rateList.length"
|
||||
:pie-data="rateList" />
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-else></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -36,46 +42,62 @@
|
||||
<script>
|
||||
import barChart from '../../chart/BarChart.vue';
|
||||
import pieChart from '../../chart/PieChart.vue';
|
||||
import {
|
||||
getOverview,
|
||||
getRate,
|
||||
} from '@/api/warehouse/warehouseLocation';
|
||||
import { getOverview, getRate } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
allURL: getOverview,
|
||||
rateURL: getRate
|
||||
rateURL: getRate,
|
||||
},
|
||||
listQuery: {
|
||||
storageType: 1,
|
||||
},
|
||||
wareType: 1,
|
||||
totalNum: 0,
|
||||
overviewList: [],
|
||||
rateList: []
|
||||
rateList: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
barChart,
|
||||
pieChart
|
||||
pieChart,
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList();
|
||||
},
|
||||
created() {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
this.wareType = item.type;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
const data = {
|
||||
storageType : 1
|
||||
}
|
||||
this.urlOptions.allURL(data).then((response) => {
|
||||
this.overviewList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
this.urlOptions.allURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.overviewList = response.data;
|
||||
this.overviewList.forEach(item=>{
|
||||
this.totalNum += item.num
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs.barChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
this.urlOptions.rateURL(data).then((response) => {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
this.urlOptions.rateURL(this.listQuery).then((response) => {
|
||||
if (response.data && response.data.length) {
|
||||
this.rateList = response.data;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.pieChart.initChart();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
@ -93,4 +115,33 @@ export default {
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
line-height: 16px;
|
||||
margin-bottom: 10px;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
border-radius: 1px;
|
||||
margin-right: 5px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
.sub-title{
|
||||
font-size: 16px;
|
||||
line-height: 18px;
|
||||
color: #888686;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
margin-right: 30px;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
@ -58,7 +58,7 @@ import {
|
||||
getWarehouseLocationHisPage,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
@ -179,8 +179,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(1).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-21 14:26:23
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-11-04 14:46:59
|
||||
* @LastEditTime: 2023-11-06 11:30:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -93,7 +93,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -129,7 +130,10 @@ export default {
|
||||
there: [],
|
||||
four: [],
|
||||
}),
|
||||
listAll(1).then((response) => {
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === 1) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
response.data.forEach((a, b) => {
|
||||
if (b % 4 === 0) {
|
||||
this.wareData.one.push(a);
|
||||
@ -142,7 +146,10 @@ export default {
|
||||
}
|
||||
});
|
||||
this.total = Math.ceil(response.data.length / 40);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
|
@ -64,7 +64,7 @@ import {
|
||||
outWarehouseRealtimeLocation,
|
||||
} from '@/api/warehouse/warehouseRealtimeLocation';
|
||||
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
|
||||
|
||||
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -175,7 +175,7 @@ export default {
|
||||
label: '入库时间',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "timestamp",
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
@ -203,8 +203,14 @@ export default {
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
listByWarehouse(1).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
getWarehouseList().then((response) => {
|
||||
response.data.forEach((item) => {
|
||||
if (item.storageType === this.listQuery.storageType) {
|
||||
listByWarehouse(item.id).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
@ -216,7 +222,7 @@ export default {
|
||||
this.listQuery.locationId = val.name;
|
||||
this.listQuery.palletCode = val.code;
|
||||
this.listQuery.status = val.status;
|
||||
this.listQuery.inTime = val.searchTime?val.searchTime:null;
|
||||
this.listQuery.inTime = val.searchTime ? val.searchTime : null;
|
||||
this.getDataList();
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user