Merge remote-tracking branch 'origin/master'

yangwl
Yangwl 4 months ago
commit ce1d8b87de

@ -33,6 +33,15 @@ export function getProRoutes(prodCode) {
})
}
// 通过物料code获取工艺信息
export function getCanProductLine(data) {
return request({
url: '/plan/order/getCanProductLine',
method: 'post',
data: data
})
}
// 获取当天的递增工单执行顺序
export function getProSortNo(productDate) {
const data = {
@ -62,6 +71,14 @@ export function getWorkOrderList(id) {
})
}
//排产预览
export function getWorkOrderListCG(id) {
return request({
url: '/plan/order/getWorkOrderListCG/' + id,
method: 'get'
})
}
// 通过母订单id查询最新订单列表
export function getOrderList(id) {
return request({
@ -165,4 +182,31 @@ export function deleteOrder(orderIds) {
url: '/plan/order/deleteOrder/' + orderIds,
method: 'post'
});
}
}
//辅助排产
export function autoSplitOrder(data) {
return request({
url: '/plan/order/autoSplitOrder',
method: 'post',
data: data
});
}
//关闭窗口
export function autoSplitOrderCancel(data) {
return request({
url: '/plan/order/autoSplitOrderCancel',
method: 'post',
data: data
});
}
//确认排产
export function autoSplitOrderOk(data) {
return request({
url: '/plan/order/autoSplitOrderOk',
method: 'post',
data: data
});
}

@ -174,3 +174,10 @@ export function removeWorkOrderBatch(batchCode,workorderCode) {
});
}
export function getProdLineList() {
return request({
url: '/plan/pro/workorder/getProdLineList',
method: 'get',
params: {}
});
}

@ -86,15 +86,8 @@
<el-table-column prop="efficiency" label="产线标准效率(PC/H)" width="100"/>
<el-table-column prop="manStandard" label="标准用人" width="80"/>
<el-table-column prop="useMan" label="实际用人" width="80"/>
<el-table-column
prop="workTimeStandard"
label="标准工时"
width="80">
</el-table-column>
<el-table-column
prop="workTime"
label="实际工时"
width="80">
<el-table-column prop="workTimeStandard" label="标准工时" width="80"></el-table-column>
<el-table-column prop="workTime" label="实际工时" width="80">
</el-table-column>
<el-table-column
prop="productivity"
@ -136,7 +129,7 @@
import { getDailyReportNew,getWorkcenterList} from "@/api/mes/reportWork";
import moment from 'moment';
export default {
name: "Prepare",
name: "DailyReportNew",
data() {
return {
//
@ -159,11 +152,10 @@ export default {
open: false,
//
queryParams: {
timeArray: [moment(new Date().toLocaleDateString().replace(/\//g, "-")).format('YYYY-MM-DD'),
moment(new Date().toLocaleDateString().replace(/\//g, "-")).format('YYYY-MM-DD')],
timeArray: [],
productDateStart: null,
productDateEnd: null,
sapName: null,
productDateEnd: null,
sapName: null,
pageNum: 1,
pageSize: 10,
workCenter: null,
@ -177,17 +169,33 @@ export default {
};
},
created() {
this.getList();
this.getDate();
this.getWorkcenterList();
},
methods: {
indexMethod(index){
return index+1 ;
},
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate(0);
let end = this.Fungetdate(1);
this.queryParams.timeArray.push(start, end);
this.getList();
},
Fungetdate(num) {
var dd = new Date();
dd.setDate(dd.getDate() + num);
var y = dd.getFullYear();
var m = dd.getMonth() + 1; //
var d = dd.getDate();
return y + "-" + m + "-" + d;
},
/** 查询备料单列表 */
getList() {
this.loading = true;
if(this.queryParams.timeArray.length>0){
if(this.queryParams.timeArray.length>0){
this.queryParams.productDateStart = moment(this.queryParams.timeArray[0]).format('YYYY-MM-DD');
this.queryParams.productDateEnd = moment(this.queryParams.timeArray[1]).format('YYYY-MM-DD');
}
@ -199,7 +207,7 @@ export default {
});
},
getWorkcenterList(){
getWorkcenterList().then(data => {
getWorkcenterList().then(data => {
this.options = data;
});
this.queryParams.workCenter = this.options[0].factoryCode;
@ -212,11 +220,10 @@ export default {
//
reset() {
this.form = {
};
this.resetForm("form");
},
productCodeFormate(row, column, cellValue){
productCodeFormate(row, column, cellValue){
if(cellValue != null){
return cellValue.slice(7,18); //
}

@ -115,12 +115,15 @@
>导出
</el-button>
</el-col>
<!--
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-edit" size="mini" @click="handleAutoSplit" v-hasPermi="['mes:pro:order:edit']">
<el-button type="primary" plain icon="el-icon-guide" size="mini"
@click="handleAutoSplit"
:disabled="single"
v-hasPermi="['mes:pro:order:edit']">辅助排产
</el-button>
</el-col>
-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -499,32 +502,67 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 自动排产规划 -->
<!-- 辅助排产规划 -->
<el-dialog :title="titleAutoSplit" :visible.sync="openAutoSplit" width="1000px">
<el-table v-loading="autoSplitLoading" :data="autoSplitList" ref="autoSplitTable">
<el-table-column label="订单号" width="150" align="left" prop="orderCode" />
<el-table-column label="产品编码" width="150" align="left" prop="prodCode" :formatter="productCodeFormate"/>
<el-table-column label="产品名称" width="150" align="left" prop="prodDesc" :show-overflow-tooltip="true" />
<el-table-column width="90" label="订单数量" align="center" prop="quantity"/>
<el-table-column width="70" label="单位" align="center" prop="unit"/>
<el-table-column label="任务清单" align="center" prop="workerOrder" width="100"/>
<el-table-column width="120" label="计划生产日期" align="center" prop="planProDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planProDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="排产顺序" align="center" prop="useMan">
<template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.useMan" @change="handleEdit(scope.$index,scope.row)"></el-input>
</template>
</el-table-column>
</el-table>
<el-button type="primary autoSplitBtn">自动拆分</el-button>
<el-divider content-position="center" >拆分结果</el-divider>
<el-table
<el-steps :active="activeSplit" simple>
<el-step title="工单基本信息" icon="el-icon-edit"></el-step>
<el-step title="生产线体选择" icon="el-icon-s-tools"></el-step>
<el-step title="排产结果查看" icon="el-icon-s-order"></el-step>
</el-steps>
<!--第一步-->
<el-form ref="autoSplitform1" :model="autoSplitform1" label-width="80px" v-if="activeSplit == 0">
<div style="margin-top:20px">
<el-row>
<el-col :span="12">
<el-form-item label="计划生产时间" label-width="100px">
<el-date-picker type="date" placeholder="选择日期" v-model="autoSplitform1.productDate" style="width: 100%;">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="生产工艺" label-width="100px">
<el-select v-model="autoSplitform1.routeCode" placeholder="请选择工艺" style="width: 100%;">
<el-option v-for="item in routes" :key="item.routeCode" :label="item.routeName"
:value="item.routeCode"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工单排序" label-width="100px">
<el-input v-model="autoSplitform1.sortNo" type="Number" style="width: 100%;"></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
<!--第二步-->
<el-form ref="autoSplitform2" :model="autoSplitform2" label-width="80px" v-if="activeSplit == 1">
<div style="margin-top:20px">
<el-form-item label="选择设备" >
<el-checkbox-group v-model="autoSplitform2.lineCodes">
<el-checkbox
v-for="(item, index) in lineCodes"
:key="item.lineCode"
:label="item.lineCode"
:name="item.lineName"
>
{{ item.lineName }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</div>
</el-form>
<!--第三步-->
<el-table v-if="activeSplit == 2"
border
:data="splitData"
v-if="refreshWorkerTable"
v-loading="workerLoading"
row-key="workorderCode"
style="width: 100%"
@ -532,27 +570,21 @@
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column width="50" align="center" type="selection"/>
<el-table-column width="160" align="center" prop="workorderCode" label="母工单号"></el-table-column>
<el-table-column width="70" align="center" prop="quantitySplit" label="母单物料编码"></el-table-column>
<el-table-column width="70" align="center" prop="quantitySplit" label="母单物料名称"></el-table-column>
<el-table-column width="70" align="center" prop="quantitySplit" label="母单数量"></el-table-column>
<el-table-column width="60" label="单位" align="center" prop="unit"/>
<el-table-column width="160" align="center" prop="workorderCode" label="子工单号"></el-table-column>
<el-table-column width="70" align="center" prop="quantitySplit" label="子单物料编码"></el-table-column>
<el-table-column width="70" align="center" prop="quantitySplit" label="子单物料名称"></el-table-column>
<el-table-column width="70" align="center" prop="quantitySplit" label="子单数量"></el-table-column>
<el-table-column width="60" label="单位" align="center" prop="unit"/>
<el-table-column width="160" align="center" prop="workorderCode" label="工单号"></el-table-column>
<el-table-column width="100" align="center" prop="productDate" label="工单日期"></el-table-column>
<el-table-column width="150" align="center" prop="prodLineCode" label="生产线体设备"></el-table-column>
<el-table-column width="70" align="center" prop="quantitySplit" label="数量"></el-table-column>
<el-table-column width="60" label="单位" align="center" prop="unit"/>
<el-table-column width="90" label="工艺编码" align="center" prop="routeCode"/>
<el-table-column width="70" label="班次" align="center" prop="shiftDesc"/>
<el-table-column width="160" align="center" prop="batchCodeList" label="批次号"></el-table-column>
<el-table-column width="100" align="center" prop="batchNumList" label="批次数量"></el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary"> </el-button>
<el-button style="margin-top: 12px;" @click="next" v-if="this.activeSplit < 2"></el-button>
<el-button style="margin-top: 12px;" @click="prev" v-if="this.activeSplit > 0"></el-button>
<el-button type="primary" @click="autoSplitCommit" v-if="this.activeSplit==2"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -565,13 +597,14 @@ import {
getProEquipment,
getProRoutes,getProSortNo,
getProShifts,
getWorkOrderList,
getWorkOrderList,getWorkOrderListCG,
subSplitOrder,checkRepeatBatchCodes,
listOrder,
addOrder,
updateOrder,
syncSAP, selectMaterielList,getAutoSplitList,
deleteOrder
deleteOrder,getCanProductLine,
autoSplitOrder,autoSplitOrderCancel,autoSplitOrderOk
} from '@/api/plan/order'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -689,11 +722,18 @@ export default {
/**********************************/
eRouteProps: {multiple: true},
eRouteOptions: [],
titleAutoSplit:"订单排产",
titleAutoSplit:"订单辅助排产",
openAutoSplit:false,
orderCodes:[],
autoSplitList:[],
autoSplitLoading: true
openAutoSplit: false,
activeSplit: 0,
autoSplitform1:{
productDate:null,
sortNo:null
},
autoSplitform2: {lineCodes:[]},
lineCodes:[]
}
},
created() {
@ -1335,6 +1375,9 @@ export default {
this.dialogVisible = false;
this.splitOpen = false;
this.reset();
this.openAutoSplit = false;
this.activeSplit = 0;
autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => {});
},
//
checkNull(entity) {
@ -1444,7 +1487,7 @@ export default {
}
)
},
/**自动排产**/
/**辅助排产**/
//
handleAutoSplitSelection(selection) {
this.single = selection.length !== 1
@ -1453,11 +1496,33 @@ export default {
},
//
handleAutoSplit(row) {
debugger
this.autoSplitLoading = true;
this.openAutoSplit = true;
this.autoSplitList = this.orderCodes;
if(this.autoSplitList[0] == 'o2'){
this.$modal.msgError("已经拆分结束!");
}
this.autoSplitform1.productDate = this.autoSplitList[0].planProDate;
// ()
getProRoutes(this.autoSplitList[0].prodCode).then(response => {
this.routes = response.data;
this.autoSplitform1.routeCode = response.data[0].routeCode;
})
//var ymd = moment(this.autoSplitform1.productDate).format('YYYY-MM-DD')
//
getProSortNo(this.autoSplitform1.productDate).then(response => {
this.autoSplitform1.sortNo = response
})
// 线
getCanProductLine(this.autoSplitList[0]).then(response => {
this.lineCodes = response.lineList;
this.autoSplitform2.lineCodes = response.recommendLineList;//['XL01','XL02'];
})
this.openAutoSplit = true;
this.autoSplitLoading = false;
},
//
selectable(row, index) {
@ -1494,7 +1559,44 @@ export default {
}
});
}
},
next() {
if (this.activeSplit++ > 2) this.activeSplit = 0;
//线
if(this.activeSplit == 2){
autoSplitOrder(Object.assign({},this.autoSplitList[0],this.autoSplitform1,this.autoSplitform2)).then(response => {
this.workerLoading = true // true
//
getWorkOrderListCG(this.autoSplitList[0].id).then(response => {
var data = response.data
this.splitData = data
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
})
});
}
},
prev(){
if (this.activeSplit-- > 2) this.activeSplit = 2;
//
if(this.activeSplit == 1){
autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => {
});
}
},
autoSplitCommit(){
autoSplitOrderOk(Object.assign({},this.autoSplitList[0])).then(response => {
this.$modal.msgSuccess('提交成功')
this.getList();
this.openAutoSplit = false;
this.activeSplit = 0;
});
}
}
}

@ -49,12 +49,14 @@
/>
</el-form-item>
<el-form-item label="产线编码" prop="prodLineCode">
<el-input
v-model="queryParams.prodLineCode"
placeholder="请输入产线编码"
clearable
@keyup.enter.native="handleQuery"
/>
<el-select clearable v-model="queryParams.prodLineCode">
<el-option
v-for="item in prodLineList"
:key="item.lineCode"
:label="item.lineName"
:value="item.lineCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产日期" prop="productDateArray">
<el-date-picker
@ -732,7 +734,8 @@ import {
getWorkOrderBatchInfo,
insertWorkOrderBatch,
updateWorkOrderBatch,
removeWorkOrderBatch
removeWorkOrderBatch,
getProdLineList
} from '@/api/plan/workorder'
import moment from 'moment';
import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order'
@ -910,6 +913,7 @@ export default {
{required: true, message: "当前批次数量不能为空", trigger: "blur"}
]
},
prodLineList:[],
/**********************************/
eRouteProps: {multiple: true},
eRouteOptions: [],
@ -936,6 +940,9 @@ export default {
getProShifts().then(response => {
this.workShift = response.data
})
getProdLineList().then(response => {
this.prodLineList = response
})
},
methods: {
//

@ -242,8 +242,7 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id =
row.id || this.ids
const id = row.id || this.ids
getCode(id).then(response => {
this.form = response.data;
this.open = true;

@ -106,7 +106,7 @@ import {
} from "@/api/quality/materialGroupDetail";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import ItemSelectMaterial from "../qcIncome/selectMaterial.vue";
import ItemSelectMaterial from "./selectMaterial.vue";
export default {
name: "MaterialGroupAdd",
@ -201,7 +201,7 @@ export default {
//this.loading = false;
});
},
/** 查询部门下拉树结构 */
/** 查询下拉树结构 */
getMaterialTree() {
materialTreeSelect().then((response) => {
this.materialOptions = response.data;
@ -304,6 +304,7 @@ export default {
this.reset();
this.form.groupId = data.id;
this.$refs.itemSelectMaterial.showFlag = true;
//this.$refs.itemSelectMaterial.headerToken =
},
/**删除树节点 */
remove(node, data) {
@ -337,21 +338,27 @@ export default {
},
//
onSelectMaterial(obj) {
this.form.materialCode = obj.code;
this.form.materialName = obj.name;
console.log(this.form.groupId);
if(this.form.materialCode != null) {
addMaterialGroupDetail(this.form).then((response) => {
let message = response.code
if(message == 200) {
this.$modal.msgSuccess("新增成功");
}else {
this.$modal.msgError("新增失败");
}
this.open = false;
this.getMaterialTree();
});
}
debugger
if(obj.length == 0){
this.getMaterialTree();
}else{
this.form.materialCode = obj.code;
this.form.materialName = obj.name;
console.log(this.form.groupId);
if(this.form.materialCode != null) {
addMaterialGroupDetail(this.form).then((response) => {
let message = response.code
if(message == 200) {
this.$modal.msgSuccess("新增成功");
}else {
this.$modal.msgError("新增失败");
}
this.open = false;
this.getMaterialTree();
});
}
}
}
},
};

@ -0,0 +1,224 @@
<template>
<el-dialog title="BOM物料选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-tabs type="border-card" v-model="activeName">
<el-tab-pane label="物料选择" name="first">
<el-row :gutter="20">
<!--BOM数据-->
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
<el-form-item label="物料编码" prop="itemCode">
<el-input
v-model="queryParams.component"
placeholder="请输入物料编码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="itemName">
<el-input
v-model="queryParams.componentName"
placeholder="请输入物料名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="BOM物料组件编码" align="left" key="component" prop="component" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="BOM物料组件名称" align="left" key="componentName" prop="componentName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="导入物料" name="second">
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板
</el-link>
</div>
</el-upload>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm" v-if="this.activeName == 'first'"> </el-button>
<el-button type="primary" @click="submitFileForm" v-if="this.activeName == 'second'"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {getQcListBom } from "@/api/quality/income";
import { getToken } from '@/utils/auth'
export default {
name: "itemSelectMaterial",
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: false,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
component: '',
componentName : ''
},
//
columns: [
{ key: 0, label: `BOM物料编码`, visible: true },
{ key: 1, label: `产品名称`, visible: true },
{ key: 2, label: `BOM物料组件编码`, visible: true },
{ key: 3, label: `BOM物料组件名称`, visible: true }
],
//
activeName: 'first',
upload: {
//
isUploading: false,
//
updateSupport: 0,
//
headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/quality/checkTypeProject/importData"
}
};
},
created() {
this.getList();
},
methods: {
handleEquipmentSelectionChange (val) {
this.itemList = val
},
/** 查询BOM列表*/
getList() {
this.loading = true;
this.queryParams.bomCode = this.queryParams.itemCode;
this.queryParams.productDescZh = this.queryParams.itemName;
getQcListBom(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleBomSelectionChange(selection) {
if(selection.length>1){
this.$modal.msgSuccess("只能选一个");
}
this.ids = selection[0].component;
this.idsName = selection[0].componentName;
},
submitBomForm() {
this.selectedRows.code = this.ids;
this.selectedRows.name = this.idsName;
this.$emit('onSelected', this.selectedRows);
this.showFlag = false;
},
// -
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// -
handleFileSuccess(response, file, fileList) {
this.showFlag = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$emit('onSelected', []);
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
this.getList();
},
// -
submitFileForm() {
this.$refs.upload.submit().then();
this.showFlag = false;
},
// -
importTemplate() {
this.download('/quality/checkTypeProject/importMaterailTemplate', {}, `qua_import_template_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -137,10 +137,31 @@
plain
icon="el-icon-s-data"
size="mini"
@click="handleAnalysis"
>图标分析</el-button
@click="handleAnalysis1"
>柱状图表分析</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-s-data"
size="mini"
@click="handleAnalysis2"
>折线图表分析</el-button
>
</el-col>
<!--
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-s-data"
size="mini"
@click="handleAnalysis3"
>综合图表分析</el-button
>
</el-col>-->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
@ -201,13 +222,13 @@
<el-dialog
:title="title"
:visible.sync="open"
width="1880px"
width="1300px"
append-to-body
>
<div
class="echartbox"
id="echart1"
style="margin: auto; margin-top: 20px; width: 1820px; height: 545px"
style="margin: auto; margin-top: 20px; width: 1220px; height: 545px"
></div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
@ -398,7 +419,7 @@ export default {
this.loading = false;
});
},
getanalyzeList() {
getanalyzeList1() {
if (this.queryParams.incomeTimeArray.length > 0) {
this.queryParams.ymArrayStart = moment(
this.queryParams.incomeTimeArray[0]
@ -598,21 +619,14 @@ export default {
);
},
//
handleAnalysis() {
this.title = "图表分析";
//
handleAnalysis1() {
this.title = "柱状图表分析";
if (
this.queryParams.projectNoArray.length > 0 &&
this.queryParams.projectNoArray.length < 2
) {
// this.projectNoOptions.forEach((item) => {
// if (item.recordId == this.queryParams.projectNoArray) {
// console.log(item);
// }
// });
this.open = true;
this.getanalyzeList();
this.getanalyzeList1();
} else if (this.queryParams.projectNoArray.length < 0) {
this.$modal.msgError("请选择定量检测项");
} else {
@ -621,6 +635,12 @@ export default {
},
//
cancel() {
var chartDom = document.getElementById("echart1");
// ECharts
if (echarts.getInstanceByDom(chartDom)) {
//
echarts.dispose(chartDom);
}
this.open = false;
},
//
@ -674,10 +694,379 @@ export default {
type: "value",
},
],
series: this.seriesdata,
series: this.seriesdata
};
myChart1.setOption(option1);
},
//
handleAnalysis2() {
this.title = "折线图表分析";
if (
this.queryParams.projectNoArray.length > 0 &&
this.queryParams.projectNoArray.length < 2
) {
this.open = true;
this.getanalyzeList2();
} else if (this.queryParams.projectNoArray.length < 0) {
this.$modal.msgError("请选择定量检测项");
} else {
this.$modal.msgError("请选择一项定量检测项");
}
},
getanalyzeList2() {
if (this.queryParams.incomeTimeArray.length > 0) {
this.queryParams.ymArrayStart = moment(
this.queryParams.incomeTimeArray[0]
).format("YYYY-MM-DD");
this.queryParams.ymArrayEnd = moment(
this.queryParams.incomeTimeArray[1]
).format("YYYY-MM-DD");
}
getDLTableAvgInfo(this.queryParams).then((response) => {
this.detailechartslist = [];
this.seriesdata = [];
this.legenddata = [];
this.xAxisdata = [];
let col1 = response.titleCol1;
let col2 = response.titleCol2;
// mcode0Pcode0
for (let i = 0; i < col1.length; i++) {
for (let j = 0; j < col2.length; j++) {
var detailTitle = {};
detailTitle.col1Id = "mcode" + i + "Pcode" + j;
detailTitle.col1Name = col1[i];
detailTitle.col1xName = col2[j];
this.detailechartslist.push(detailTitle);
}
}
if (this.detailechartslist.length > 0) {
this.analyzeList = response;
const datalist = this.detailechartslist.map((item) => {
const xdata = this.analyzeList.dxData.map((d) => {
return (d.ymdms = moment(d.ymdms, "YYYY-MM-DD AVG").format(
"YYYY-MM-DD"
));
});
const datalist = this.analyzeList.dxData.map((d) => d[item.col1Id]);
return {
...item,
xdata,
datalist,
};
});
this.xAxisdata = datalist[0].xdata;
this.titledata = datalist[0].col1xName;
datalist.forEach((e, index) => {
this.legenddata.push(e.col1Name);
if (e.houer) {
state.xAxisdata = e.col1Name;
}
var item = {
name: e.col1Name,
type: 'line',
data: e.datalist,
markLine: {
symbolSize: 0,//
data: [
{
lineStyle: {
color: '#ffc000',
width: 3
},
yAxis: response.upperDiff,//
label: { show: true, position: 'end', formatter: '上限' }
},
{
lineStyle: {
color: '#4f81bd',
width: 3
},
yAxis: response.downDiff,
label: { show: true, position: 'end', formatter: '下限' }
},
{type: 'average', name: '平均值'}
]
}
};
this.seriesdata.push(item);
});
this.initChart2();
} else {
this.$modal.msgError("数据为空");
this.detailechartslist = [];
this.seriesdata = [];
this.legenddata = [];
this.xAxisdata = [];
(this.titledata = ""), this.initChart2();
}
});
},
//
initChart2() {
const _this = this;
var chartDom = document.getElementById("echart1");
// ECharts
if (echarts.getInstanceByDom(chartDom)) {
//
echarts.dispose(chartDom);
}
var myChart1 = echarts.init(document.querySelector("#echart1"));
var option1 = {
title: {
text: '折线图表分析'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: this.legenddata//['Email', 'Union Ads']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.xAxisdata//['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: this.seriesdata
/**[
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210],
markLine: {
symbolSize: 0,//
data: [
{
lineStyle: {
color: '#ffc000',
width: 3
},
yAxis: 200,//
label: { show: true, position: 'end', formatter: '上限' }
},
{
lineStyle: {
color: '#4f81bd',
width: 3
},
yAxis: 100,
label: { show: true, position: 'end', formatter: '下限' }
}
]
}
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
}
]**/
};
myChart1.setOption(option1);
},
//
handleAnalysis3() {
this.title = "综合图表分析";
if (
this.queryParams.projectNoArray.length > 0 &&
this.queryParams.projectNoArray.length < 2
) {
this.open = true;
this.getanalyzeList3();
} else if (this.queryParams.projectNoArray.length < 0) {
this.$modal.msgError("请选择定量检测项");
} else {
this.$modal.msgError("请选择一项定量检测项");
}
},
getanalyzeList3() {
if (this.queryParams.incomeTimeArray.length > 0) {
this.queryParams.ymArrayStart = moment(
this.queryParams.incomeTimeArray[0]
).format("YYYY-MM-DD");
this.queryParams.ymArrayEnd = moment(
this.queryParams.incomeTimeArray[1]
).format("YYYY-MM-DD");
}
getDLTableAvgInfo(this.queryParams).then((response) => {
this.detailechartslist = [];
this.seriesdata = [];
this.legenddata = [];
this.xAxisdata = [];
let col1 = response.titleCol1;
let col2 = response.titleCol2;
// mcode0Pcode0
for (let i = 0; i < col1.length; i++) {
for (let j = 0; j < col2.length; j++) {
var detailTitle = {};
detailTitle.col1Id = "mcode" + i + "Pcode" + j;
detailTitle.col1Name = col1[i];
detailTitle.col1xName = col2[j];
this.detailechartslist.push(detailTitle);
}
}
if (this.detailechartslist.length > 0) {
this.analyzeList = response;
const datalist = this.detailechartslist.map((item) => {
const xdata = this.analyzeList.dxData.map((d) => {
return (d.ymdms = moment(d.ymdms, "YYYY-MM-DD AVG").format(
"YYYY-MM-DD"
));
});
const datalist = this.analyzeList.dxData.map((d) => d[item.col1Id]);
return {
...item,
xdata,
datalist,
};
});
this.xAxisdata = datalist[0].xdata;
this.titledata = datalist[0].col1xName;
datalist.forEach((e, index) => {
this.legenddata.push(e.col1Name);
if (e.houer) {
state.xAxisdata = e.col1Name;
}
var item = {
name: e.col1Name,
type: 'line',
data: e.datalist,
markLine: {
symbolSize: 0,//
data: [
{
lineStyle: {
color: '#ffc000',
width: 3
},
yAxis: response.upperDiff,//
label: { show: true, position: 'end', formatter: '上限' }
},
{
lineStyle: {
color: '#4f81bd',
width: 3
},
yAxis: response.downDiff,
label: { show: true, position: 'end', formatter: '下限' }
}
]
}
};
this.seriesdata.push(item);
});
this.initChart3();
} else {
this.$modal.msgError("数据为空");
this.detailechartslist = [];
this.seriesdata = [];
this.legenddata = [];
this.xAxisdata = [];
(this.titledata = ""), this.initChart3();
}
});
},
//
initChart3() {
const _this = this;
var chartDom = document.getElementById("echart1");
// ECharts
if (echarts.getInstanceByDom(chartDom)) {
//
echarts.dispose(chartDom);
}
var myChart1 = echarts.init(document.querySelector("#echart1"));
var option3 = {
title: {
text: '综合图表分析'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: this.legenddata//['Email', 'Union Ads']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.xAxisdata//['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: this.seriesdata
/**[
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210],
markLine: {
symbolSize: 0,//
data: [
{
lineStyle: {
color: '#ffc000',
width: 3
},
yAxis: 200,//
label: { show: true, position: 'end', formatter: '上限' }
},
{
lineStyle: {
color: '#4f81bd',
width: 3
},
yAxis: 100,
label: { show: true, position: 'end', formatter: '下限' }
}
]
}
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
}
]**/
};
myChart1.setOption(option3);
},
},
};
</script>

@ -375,6 +375,14 @@
v-model="form.reportRate"
style="width: 320px"
/>
</el-form-item>
<el-form-item label="每批次最大数量" prop="mvgr5Nm">
<el-input-number
:min="0"
:step="1"
v-model="form.mvgr5Nm"
style="width: 320px"
/>
</el-form-item>
<el-form-item label="是否启用" prop="activeFlag">
<el-select

Loading…
Cancel
Save