This commit is contained in:
caoqianming 2024-05-31 17:09:35 +08:00
commit 0958c62f06
32 changed files with 3990 additions and 2621 deletions

View File

@ -1,47 +1,62 @@
<template> <template>
<el-config-provider :locale="locale" :size="config.size" :zIndex="config.zIndex" :button="config.button"> <el-config-provider
:locale="locale"
:size="config.size"
:zIndex="config.zIndex"
:button="config.button"
>
<router-view></router-view> <router-view></router-view>
</el-config-provider> </el-config-provider>
</template> </template>
<script> <script>
import colorTool from '@/utils/color'; import colorTool from "@/utils/color";
export default { export default {
name: 'App', name: "App",
data() { data() {
return { return {
config: { config: {
size: "default", size: "default",
zIndex: 2000, zIndex: 2000,
button: { button: {
autoInsertSpace: false autoInsertSpace: false,
} },
} },
} };
}, },
computed: { computed: {
locale() { locale() {
return this.$i18n.messages[this.$i18n.locale].el return this.$i18n.messages[this.$i18n.locale].el;
}, },
}, },
created() { created() {
// //
const app_color = this.$CONFIG.COLOR || this.$TOOL.data.get('APP_COLOR') const app_color =
this.$CONFIG.COLOR || this.$TOOL.data.get("APP_COLOR");
if (app_color) { if (app_color) {
document.documentElement.style.setProperty('--el-color-primary', app_color); document.documentElement.style.setProperty(
"--el-color-primary",
app_color
);
for (let i = 1; i <= 9; i++) { for (let i = 1; i <= 9; i++) {
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, colorTool.lighten(app_color, i / 10)); document.documentElement.style.setProperty(
`--el-color-primary-light-${i}`,
colorTool.lighten(app_color, i / 10)
);
} }
for (let i = 1; i <= 9; i++) { for (let i = 1; i <= 9; i++) {
document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, colorTool.darken(app_color, i / 10)); document.documentElement.style.setProperty(
`--el-color-primary-dark-${i}`,
colorTool.darken(app_color, i / 10)
);
} }
} }
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/style/style.scss'; @import "@/style/style.scss";
.card-header { .card-header {
display: flex; display: flex;
@ -134,7 +149,7 @@ export default {
border-radius: 15px; border-radius: 15px;
} }
.el-calendar>.el-calendar__body { .el-calendar > .el-calendar__body {
padding: 0 20px 20px; padding: 0 20px 20px;
} }
@ -160,19 +175,19 @@ export default {
background: linear-gradient(to right, #053949, #107b90); background: linear-gradient(to right, #053949, #107b90);
} }
.enpMenu>.el-dropdown-menu__item { .enpMenu > .el-dropdown-menu__item {
margin-bottom: 0.5vh; margin-bottom: 0.5vh;
//background: linear-gradient(to right, #29d, #1dabfd); //background: linear-gradient(to right, #29d, #1dabfd);
background: linear-gradient(to right, #1b8fa4, #107b90); background: linear-gradient(to right, #1b8fa4, #107b90);
} }
.enpMenu>.el-dropdown-menu__item:not(.is-disabled):focus { .enpMenu > .el-dropdown-menu__item:not(.is-disabled):focus {
//background: linear-gradient(to right, #10608e, #1dabfd); //background: linear-gradient(to right, #10608e, #1dabfd);
background: linear-gradient(to right, #053949, #107b90); background: linear-gradient(to right, #053949, #107b90);
color: #ffffff; color: #ffffff;
} }
.enpMenu>.el-dropdown-menu__item { .enpMenu > .el-dropdown-menu__item {
color: #ffffff; color: #ffffff;
} }
@ -205,8 +220,12 @@ export default {
color: #ffffff !important; color: #ffffff !important;
} }
#enpTable .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell { #enpTable
background-color: rgba(0, 50, 45, .5) !important; .el-table--enable-row-hover
.el-table__body
tr:hover
> td.el-table__cell {
background-color: rgba(0, 50, 45, 0.5) !important;
} }
#enpTable .el-table th.el-table__cell, #enpTable .el-table th.el-table__cell,
@ -231,18 +250,22 @@ export default {
background: none !important; background: none !important;
} }
#enpTable .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell { #enpTable
background-color: rgba(0, 50, 45, .5) !important; .el-table--striped
.el-table__body
tr.el-table__row--striped
td.el-table__cell {
background-color: rgba(0, 50, 45, 0.5) !important;
} }
.enpelCard.el-card { .enpelCard.el-card {
background: none !important; background: none !important;
} }
.bigScreenTable table th{ .bigScreenTable table th {
font-size: 0.8vw!important; font-size: 0.8vw !important;
} }
.bigScreenTable table td{ .bigScreenTable table td {
font-size: 0.7vw!important; font-size: 0.7vw !important;
} }
// .searchSelect>.select-trigger>.el-input>.el-input__wrapper { // .searchSelect>.select-trigger>.el-input>.el-input__wrapper {
@ -263,9 +286,16 @@ export default {
// background-image: url('/public/img/enp_blue/selectBg.png'); // background-image: url('/public/img/enp_blue/selectBg.png');
// } // }
.enpCheckbox>.el-checkbox>.el-checkbox__label { .enpCheckbox > .el-checkbox > .el-checkbox__label {
color: #ffffff;
}
#hourBaseTable.el-table--border th.el-table__cell {
background: #008080;
color: #ffffff;
}
#hourBaseTable.el-table.is-scrolling-left th.el-table-fixed-column--left {
background: #008080;
color: #ffffff; color: #ffffff;
} }
// //
</style> </style>

View File

@ -151,6 +151,15 @@ export default {
); );
} }
}, },
analyze: {
name: "一段时间范围的工段分析数据",
req: async function(data){
return await http.post(
`${config.API_URL}/enm/enstat/analyze/`,
data
);
}
},
mplogx: { mplogx: {
name: "测点采集数据", name: "测点采集数据",
req: async function(data){ req: async function(data){

View File

@ -805,7 +805,7 @@ const routes = [
"title": "环保模块", "title": "环保模块",
"icon": "el-icon-grid", "icon": "el-icon-grid",
"type": "menu", "type": "menu",
// "perms": ["enm_hb"] "perms": ["enm_hb"]
}, },
"children": [ "children": [
{ {
@ -814,7 +814,7 @@ const routes = [
"meta": { "meta": {
"title": "排放口", "title": "排放口",
"icon": "el-icon-cellphone", "icon": "el-icon-cellphone",
// "perms": ["enm_hb"] "perms": ["enm_hb"]
}, },
"component": "enp/pfk" "component": "enp/pfk"
} }
@ -2382,6 +2382,17 @@ const routes = [
} }
] ]
}, },
{
"path": "/enm_base/search",
"name": "search",
"meta": {
"title": "综合查询",
"icon": "el-icon-postcard",
"type": "menu",
"perms": ["enm_base"]
},
"component": "enm_base/search"
},
//基础配置 //基础配置
{ {
"name": "enm_base", "name": "enm_base",
@ -2440,6 +2451,7 @@ const routes = [
"meta": { "meta": {
"title": "日志详情", "title": "日志详情",
"icon": "el-icon-document-copy", "icon": "el-icon-document-copy",
"perms": ["enm_base"],
"hidden": true "hidden": true
}, },
"component": "enm_rm/logDetail" "component": "enm_rm/logDetail"
@ -2450,7 +2462,7 @@ const routes = [
"meta": { "meta": {
"title": "计算系数", "title": "计算系数",
"icon": "el-icon-grid", "icon": "el-icon-grid",
"perms": ["enm_base"] "perms": ["enm_formula"]
}, },
"component": "enm_base/formulaSetting" "component": "enm_base/formulaSetting"
}, },

View File

@ -0,0 +1,357 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
时间1
<el-date-picker
v-model="query.searchData"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
@change="getList1"
/>
<el-button
type="primary"
@click="exportExcel()"
:loading="exportLoading"
>导出xlsx
</el-button>
时间2
<el-date-picker
v-model="query.searchData2"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
@change="getList2"
/>
<el-button type="primary" @click="comparas">对比 </el-button>
</div>
</el-header>
<el-card style="margin-top: 5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
<table
border="1"
width="1200"
cellspacing="0"
:key="timeStamp"
id="myTable"
class="myTable"
>
<thead class="myTableHead">
<tr>
<th>工段</th>
<th>总产量</th>
<th>台时产量</th>
<th>运转时间</th>
<th>运转率</th>
<th>单位产品电耗</th>
<th>单位产品综合电耗</th>
<th>单位产品标煤耗</th>
<th>单位产品综合能耗</th>
<th>吨熟料发电量</th>
</tr>
</thead>
<tr v-for="(item, index) in tableDatas1" :key="index">
<td>{{ item.mgroup_name }}</td>
<td>{{ item.total_production }}</td>
<td>{{ item.production_hour }}</td>
<td>{{ item.run_hour }}</td>
<td>{{ item.run_rate }}</td>
<td>{{ item.elec_consume_unit }}</td>
<td>{{ item.celec_consume_unit }}</td>
<td>{{ item.coal_consume_unit }}</td>
<td>{{ item.cen_consume_unit }}</td>
<td>{{ item.production_elec_unit }}</td>
<!-- <td
v-for="(item0, index0) in item"
:key="index0"
class="numCell"
>
{{ item0 }}
</td> -->
</tr>
</table>
<table
border="1"
width="1200"
cellspacing="0"
:key="timeStamp"
id="myTable"
class="myTable"
>
<thead class="myTableHead">
<tr>
<th>工段</th>
<th>总产量</th>
<th>台时产量</th>
<th>运转时间</th>
<th>运转率</th>
<th>单位产品电耗</th>
<th>单位产品综合电耗</th>
<th>单位产品标煤耗</th>
<th>单位产品综合能耗</th>
<th>吨熟料发电量</th>
</tr>
</thead>
<tr v-for="(item, index) in tableDatas2" :key="index">
<td>{{ item.mgroup_name }}</td>
<td>{{ item.total_production }}</td>
<td>{{ item.production_hour }}</td>
<td>{{ item.run_hour }}</td>
<td>{{ item.run_rate }}</td>
<td>{{ item.elec_consume_unit }}</td>
<td>{{ item.celec_consume_unit }}</td>
<td>{{ item.coal_consume_unit }}</td>
<td>{{ item.cen_consume_unit }}</td>
<td>{{ item.production_elec_unit }}</td>
<!-- <td
v-for="(item0, index0) in item"
:key="index0"
class="numCell"
>
{{ item0 }}
</td> -->
</tr>
</table>
</div>
</div>
</el-card>
<el-dialog title="对比" v-model="dialogVisible" width="1224">
<el-select
v-model="mgroupName"
placeholder="工段"
@change="mgroupChange"
>
<el-option
v-for="item in mgroups"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
<div id="myChart" style="width: 1200px; height: 400px"></div>
</el-dialog>
</div>
</template>
<script>
import * as echarts from "echarts";
const colors = ["#647bfe", "#91CC75"];
export default {
data() {
return {
mgroupName: "",
timeStamp: 0,
query: {
searchData: "",
page: 0,
type: "month_st",
mgroup: "",
},
tableDatas1: [
{ mgroup_name: "石灰石破碎" },
{ mgroup_name: "原料磨" },
{ mgroup_name: "煤磨" },
{ mgroup_name: "回转窑" },
{ mgroup_name: "余热发电" },
],
tableDatas2: [
{ mgroup_name: "石灰石破碎" },
{ mgroup_name: "原料磨" },
{ mgroup_name: "煤磨" },
{ mgroup_name: "回转窑" },
{ mgroup_name: "余热发电" },
],
chartData1: {},
chartData2: {},
mgroups: [],
searchData: [],
searchData2: [],
exportLoading: false,
dialogVisible: false,
options: {
color: ["#647bfe", "#91CC75"],
tooltip: {
show: true,
// trigger: "axis",
// axisPointer: {
// type: "cross",
// },
// confine: false,
showContent: true,
triggerOn: "mousemove",
},
grid: {
right: "7%",
left: "7%",
top: "15%",
},
legend: {
top: "2%",
data: ["时段一", "时段二"],
},
xAxis: {
axisTick: {
show: false,
length: 5,
inside: true,
},
data: [
"总产量",
"台时产量",
"运转时间",
"运转率",
"单位产品电耗",
"单位产品综合电耗",
"单位产品标煤耗",
"单位产品综合能耗",
"吨熟料发电量",
],
},
yAxis: [
{
type: "value",
name: "电量 (KW·h)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
],
series: [
{
name: "时段一",
type: "bar",
yAxisIndex: 0,
data: [0, 0, 0, 0, 0, 0, 0, 0, 0],
},
{
name: "时段二",
type: "bar",
yAxisIndex: 0,
data: [0, 0, 0, 0, 0, 0, 0, 0, 0],
},
],
},
myChart: null,
};
},
mounted() {
this.getMgroup();
},
methods: {
getList1(val) {
let that = this;
let start_date = val[0];
let end_date = val[1];
this.$API.enm.analyze
.req({
start_date: start_date,
end_date: end_date,
})
.then((res) => {
that.tableDatas1 = res;
res.forEach((item) => {
that.chartData1[item.mgroup_name] = [];
let arr = [];
arr[0] = item.total_production;
arr[1] = item.production_hour;
arr[2] = item.run_hour;
arr[3] = item.run_rate;
arr[4] = item.elec_consume_unit;
arr[5] = item.celec_consume_unit;
arr[6] = item.coal_consume_unit;
arr[7] = item.cen_consume_unit;
arr[8] = item.production_elec_unit;
that.chartData1[item.mgroup_name] = arr;
});
});
},
getList2(val) {
let that = this;
let start_date = val[0];
let end_date = val[1];
this.$API.enm.analyze
.req({
start_date: start_date,
end_date: end_date,
})
.then((res) => {
that.tableDatas2 = res;
res.forEach((item) => {
that.chartData2[item.mgroup_name] = [];
let arr = [];
arr[0] = item.total_production;
arr[1] = item.production_hour;
arr[2] = item.run_hour;
arr[3] = item.run_rate;
arr[4] = item.elec_consume_unit;
arr[5] = item.celec_consume_unit;
arr[6] = item.coal_consume_unit;
arr[7] = item.cen_consume_unit;
arr[8] = item.production_elec_unit;
that.chartData2[item.mgroup_name] = arr;
});
});
},
getMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => {
this.mgroups = res;
});
},
//
comparas() {
let that = this;
that.dialogVisible = true;
setTimeout(() => {
let chartDom = document.getElementById("myChart");
that.myChart = echarts.init(chartDom);
that.myChart.setOption(that.options);
}, 100);
() => {};
},
mgroupChange(val) {
let that = this;
that.options.series[0].data = this.chartData1[val];
that.options.series[1].data = this.chartData2[val];
that.myChart.clear();
that.myChart.setOption(that.options);
},
handleQuery() {
this.tableDatas1 = [];
this.getData();
},
itemClick(type, item) {
this.type = type;
this.asynDialog = true;
},
handlePrint() {
this.$PRINT("#myReport");
},
exportExcel() {
this.exportLoading = true;
this.$XLSX("#myTable", this.tableName);
this.exportLoading = false;
},
},
};
</script>
<style scoped>
.printWrap {
width: 100%;
overflow-x: scroll;
}
</style>

View File

@ -97,19 +97,20 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
width="140" width="120"
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
size="small" size="small"
@click="sflog_edit(scope.row)" @click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
type="primary" type="primary"
>编辑</el-button >编辑</el-button
> >
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider> -->
<el-button <el-button
link link
size="small" size="small"

View File

@ -186,7 +186,7 @@ let toolbox = {
}; };
let legend = { let legend = {
top: "2%", top: "2%",
data: ["煤磨排风机主电机", "煤磨主电机"], data: [],
}; };
let yAxis = { let yAxis = {
type: "value", type: "value",
@ -227,7 +227,7 @@ export default {
mgroup: "", mgroup: "",
}, },
searchDate: "", searchDate: "",
tableName: "主要设备100KW以上单位产品电耗数据表", tableName: "主要设备单位产品电耗数据表",
tableDatas: [ tableDatas: [
["煤磨排风机主电机", "", "KW·h/t", "", "", ""], ["煤磨排风机主电机", "", "KW·h/t", "", "", ""],
["煤磨主电机", "", "KW·h/t", "", "", ""], ["煤磨主电机", "", "KW·h/t", "", "", ""],
@ -259,18 +259,7 @@ export default {
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "煤磨排风机主电机",
type: "bar",
data: [],
},
{
name: "煤磨主电机",
type: "bar",
data: [],
},
],
}, },
option2: { option2: {
color: colors, color: colors,
@ -287,18 +276,7 @@ export default {
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "煤磨排风机主电机",
type: "bar",
data: [],
},
{
name: "煤磨主电机",
type: "bar",
data: [],
},
],
}, },
option3: { option3: {
color: colors, color: colors,
@ -312,35 +290,12 @@ export default {
length: 5, length: 5,
inside: true, inside: true,
}, },
data: [ data: [],
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "煤磨排风机主电机",
type: "bar",
data: [],
},
{
name: "煤磨主电机",
type: "bar",
data: [],
},
],
}, },
mpoints: [],
}; };
}, },
mounted() { mounted() {
@ -350,12 +305,32 @@ export default {
that.month = myDate.getMonth() + 1; that.month = myDate.getMonth() + 1;
that.days = myDate.getDate(); that.days = myDate.getDate();
that.hours = myDate.getHours(); that.hours = myDate.getHours();
that.getMpoints();
that.getTableHourData(); that.getTableHourData();
that.getHourData(that.year, that.month, that.days); that.getHourData(that.year, that.month, that.days);
that.getDayData(that.year, that.month); that.getDayData(that.year, that.month);
that.getMonthData(that.year); that.getMonthData(that.year);
}, },
methods: { methods: {
getMpoints() {
let that = this;
let obj = {};
obj.mgroup__name = "煤磨";
obj.page = 0;
obj.enabled = 1;
obj.need_display = 1;
obj.ordering = "report_sortstr";
obj.material__code__in = "elec,elec_0";
this.$API.enm.mpoint.list.req(obj).then((res) => {
console.log("mpoints", res);
let arr = [];
res.forEach((item) => {
arr.push(item.nickname);
});
console.log("arr", arr);
that.mpoints = arr;
});
},
typeRadioChange() { typeRadioChange() {
this.searchDate = ""; this.searchDate = "";
}, },
@ -402,7 +377,6 @@ export default {
obj.hour = hours_h; obj.hour = hours_h;
obj.mgroup__name = "煤磨"; obj.mgroup__name = "煤磨";
obj.mpoint__material__code__in = "elec,elec_0"; obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat this.$API.enm.mpoint.stat
@ -411,14 +385,15 @@ export default {
that.tableData = res; that.tableData = res;
console.log("getTableHourData", res); console.log("getTableHourData", res);
res.forEach((item) => { res.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname);
let obj = []; let obj = [];
obj[0] = item.ep_monitored_name; obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t"; obj[1] = "KW·h/t";
obj[2] = item.elec_consume_unit; obj[2] = item.elec_consume_unit;
obj[3] = 0; obj[3] = 0;
obj[4] = 0; obj[4] = 0;
obj[5] = item.mpoint; obj[5] = item.mpoint;
that.tableDatas.push(obj); that.tableDatas[index] = obj;
}); });
let yetTime = timeDate - 3600000 * 24; let yetTime = timeDate - 3600000 * 24;
let ystDate = new Date(yetTime); let ystDate = new Date(yetTime);
@ -434,13 +409,25 @@ export default {
obj_d.day_s = days_h; obj_d.day_s = days_h;
obj_d.mgroup__name = "煤磨"; obj_d.mgroup__name = "煤磨";
obj_d.mpoint__material__code__in = "elec,elec_0"; obj_d.mpoint__material__code__in = "elec,elec_0";
obj_d.mpoint__ep_monitored__isnull = 0;
obj_d.mpoint__need_display = 1; obj_d.mpoint__need_display = 1;
obj_d.page = 0; obj_d.page = 0;
this.$API.enm.mpoint.stat.req(obj_d).then((res) => { this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
console.log("getTableHourData", res); console.log("getTableHourData", res);
res.forEach((item, index) => { res.forEach((item, index) => {
that.tableDatas[index][3] = item.elec_consume_unit; let index_d = that.mpoints.indexOf(
item.mpoint_nickname
);
if (that.tableDatas[index_d]) {
that.tableDatas[index_d][3] =
item.elec_consume_unit;
} else {
let obj = [];
obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t";
obj[3] = item.elec_consume_unit;
obj[5] = item.mpoint;
that.tableDatas[index_d] = obj;
}
}); });
let obj_m = {}; let obj_m = {};
obj_m.type = "month_s"; obj_m.type = "month_s";
@ -448,14 +435,25 @@ export default {
obj_m.month_s = that.month; obj_m.month_s = that.month;
obj_m.mgroup__name = "煤磨"; obj_m.mgroup__name = "煤磨";
obj_m.mpoint__material__code__in = "elec,elec_0"; obj_m.mpoint__material__code__in = "elec,elec_0";
obj_m.mpoint__ep_monitored__isnull = 0;
obj_m.mpoint__need_display = 1; obj_m.mpoint__need_display = 1;
obj_m.page = 0; obj_m.page = 0;
this.$API.enm.mpoint.stat.req(obj_m).then((res) => { this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
console.log("getTableHourData", res); console.log("getTableHourData", res);
res.forEach((item, index) => { res.forEach((item, index) => {
that.tableDatas[index][4] = let index_m = that.mpoints.indexOf(
item.mpoint_nickname
);
if (that.tableDatas[index_m]) {
that.tableDatas[index_m][4] =
item.elec_consume_unit; item.elec_consume_unit;
} else {
let obj = [];
obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t";
obj[4] = item.elec_consume_unit;
obj[5] = item.mpoint;
that.tableDatas[index_m] = obj;
}
}); });
}); });
}); });
@ -465,28 +463,36 @@ export default {
// //
getHourData(year, month, days) { getHourData(year, month, days) {
let that = this; let that = this;
let query = {}; let obj = {};
query.page = 0; obj.type = "hour_s";
query.year_s = year; obj.year_s = year;
query.month_s = month; obj.month_s = month;
query.day_s = days; obj.day_s = days;
query.type = "hour_s"; obj.mgroup__name = "煤磨";
query.mgroup = that.query.mgroup; obj.mpoint__material__code__in = "elec,elec_0";
this.$API.enm.mpoint.stat.req(query).then((response) => { obj.mpoint__ep_monitored__isnull = 0;
let seriesData0 = [], obj.mpoint__need_display = 1;
seriesData1 = []; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData = [];
for (let i = 0; i < that.mpoints.length; i++) {
seriesData.push([]);
}
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let ind = item.hour; let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
if (item.ep_monitored_name == "煤磨排风机主电机") { let ind = item.hour; //xAxis
seriesData0[ind] = item.elec_consume_unit; seriesData[index][ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "煤磨主电机") {
seriesData1[ind] = item.elec_consume_unit;
}
}); });
let options = { ...that.option1 }; let options = { ...that.option1 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let hourXAxis = []; let hourXAxis = [];
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
let item = i + "时"; let item = i + "时";
@ -499,27 +505,35 @@ export default {
// //
getDayData(year, month) { getDayData(year, month) {
let that = this; let that = this;
let query1 = {}; let obj = {};
query1.page = 0; obj.type = "day_s";
query1.year_s = year; obj.year_s = year;
query1.month_s = month; obj.month_s = month;
query1.type = "day_s"; obj.mgroup__name = "煤磨";
query1.mgroup = this.query.mgroup; obj.mpoint__material__code__in = "elec,elec_0";
this.$API.enm.mpoint.stat.req(query1).then((response) => { obj.mpoint__ep_monitored__isnull = 0;
let seriesData0 = [], obj.mpoint__need_display = 1;
seriesData1 = []; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData = [];
for (let i = 0; i < that.mpoints.length; i++) {
seriesData.push([]);
}
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
let ind = item.day_s - 1; let ind = item.day_s - 1;
if (item.ep_monitored_name == "煤磨排风机主电机") { seriesData[index][ind] = item.elec_consume_unit;
seriesData0[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "煤磨主电机") {
seriesData1[ind] = item.elec_consume_unit;
}
}); });
let options = { ...that.option2 }; let options = { ...that.option2 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let dayXAxis = []; let dayXAxis = [];
let dayss = new Date(year, month, 0).getDate(); let dayss = new Date(year, month, 0).getDate();
for (let i = 1; i <= dayss; i++) { for (let i = 1; i <= dayss; i++) {
@ -533,26 +547,34 @@ export default {
// //
getMonthData(year) { getMonthData(year) {
let that = this; let that = this;
let query2 = {}; let obj = {};
query2.page = 0; obj.type = "month_s";
query2.year_s = year; obj.year_s = year;
query2.type = "month_s"; obj.mgroup__name = "煤磨";
query2.mgroup = that.query.mgroup; obj.mpoint__material__code__in = "elec,elec_0";
this.$API.enm.mpoint.stat.req(query2).then((response) => { obj.mpoint__ep_monitored__isnull = 0;
let seriesData0 = [], obj.mpoint__need_display = 1;
seriesData1 = []; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData = [];
for (let i = 0; i < that.mpoints.length; i++) {
seriesData.push([]);
}
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let ind = item.month_s - 1; let ind = item.month_s - 1;
if (item.ep_monitored_name == "煤磨排风机主电机") { let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
seriesData0[ind] = item.elec_consume_unit; seriesData[index][ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "煤磨主电机") {
seriesData1[ind] = item.elec_consume_unit;
}
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let monthXAxis = []; let monthXAxis = [];
for (let i = 1; i < 13; i++) { for (let i = 1; i < 13; i++) {
let item = i + "月"; let item = i + "月";

View File

@ -104,12 +104,13 @@
link link
size="small" size="small"
@click="sflog_edit(scope.row)" @click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
type="primary" type="primary"
>操作</el-button >操作</el-button
> >
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider> -->
<el-button <el-button
link link
size="small" size="small"

View File

@ -97,19 +97,20 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
width="140" width="120"
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
size="small" size="small"
@click="sflog_edit(scope.row)" @click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
type="primary" type="primary"
>操作</el-button >操作</el-button
> >
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider> -->
<el-button <el-button
link link
size="small" size="small"

View File

@ -187,8 +187,7 @@ let toolbox = {
let legend = { let legend = {
top: "2%", top: "2%",
left: "center", left: "center",
// orient:'vertical', data: [],
data: ["尾排风机", "高温风机", "头排风机", "低压变压器柜"],
}; };
let yAxis = { let yAxis = {
type: "value", type: "value",
@ -232,7 +231,7 @@ export default {
}, },
mpoint: "", mpoint: "",
searchDate: "", searchDate: "",
tableName: "主要设备100KW以上单位产品电耗数据表", tableName: "主要设备单位产品电耗数据表",
tableDatas: [ tableDatas: [
["尾排风机", "KW·h/t", "", "", ""], ["尾排风机", "KW·h/t", "", "", ""],
["高温风机", "KW·h/t", "", "", ""], ["高温风机", "KW·h/t", "", "", ""],
@ -264,28 +263,7 @@ export default {
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "尾排风机",
type: "bar",
data: [],
},
{
name: "高温风机",
type: "bar",
data: [],
},
{
name: "头排风机",
type: "bar",
data: [],
},
{
name: "低压变压器柜",
type: "bar",
data: [],
},
],
}, },
option2: { option2: {
color: colors, color: colors,
@ -302,28 +280,7 @@ export default {
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "尾排风机",
type: "bar",
data: [],
},
{
name: "高温风机",
type: "bar",
data: [],
},
{
name: "头排风机",
type: "bar",
data: [],
},
{
name: "低压变压器柜",
type: "bar",
data: [],
},
],
}, },
option3: { option3: {
color: colors, color: colors,
@ -337,45 +294,12 @@ export default {
length: 5, length: 5,
inside: true, inside: true,
}, },
data: [ data: [],
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "尾排风机",
type: "bar",
data: [],
},
{
name: "高温风机",
type: "bar",
data: [],
},
{
name: "头排风机",
type: "bar",
data: [],
},
{
name: "低压变压器柜",
type: "bar",
data: [],
},
],
}, },
mpoints: [],
}; };
}, },
mounted() { mounted() {
@ -385,12 +309,32 @@ export default {
that.month = myDate.getMonth() + 1; that.month = myDate.getMonth() + 1;
that.days = myDate.getDate(); that.days = myDate.getDate();
that.hours = myDate.getHours(); that.hours = myDate.getHours();
that.getMpoints();
that.getTableHourData(); that.getTableHourData();
that.getHourData(that.year, that.month, that.days); that.getHourData(that.year, that.month, that.days);
that.getDayData(that.year, that.month); that.getDayData(that.year, that.month);
that.getMonthData(that.year); that.getMonthData(that.year);
}, },
methods: { methods: {
getMpoints() {
let that = this;
let obj = {};
obj.mgroup__name = "回转窑";
obj.page = 0;
obj.enabled = 1;
obj.need_display = 1;
obj.ordering = "report_sortstr";
obj.material__code__in = "elec,elec_0";
this.$API.enm.mpoint.list.req(obj).then((res) => {
console.log("mpoints", res);
let arr = [];
res.forEach((item) => {
arr.push(item.nickname);
});
console.log("arr", arr);
that.mpoints = arr;
});
},
typeRadioChange() { typeRadioChange() {
this.searchDate = ""; this.searchDate = "";
}, },
@ -437,19 +381,20 @@ export default {
obj.hour = hours_h; obj.hour = hours_h;
obj.mgroup__name = "回转窑"; obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0"; obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0; // obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => { this.$API.enm.mpoint.stat.req(obj).then((res) => {
res.forEach((item) => { res.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname);
let obj = []; let obj = [];
obj[0] = item.ep_monitored_name; obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t"; obj[1] = "KW·h/t";
obj[2] = item.elec_consume_unit; obj[2] = item.elec_consume_unit;
obj[3] = 0; obj[3] = 0;
obj[4] = 0; obj[4] = 0;
obj[5] = item.mpoint; obj[5] = item.mpoint;
that.tableDatas.push(obj); that.tableDatas[index] = obj;
}); });
let yetTime = timeDate - 3600000 * 24; let yetTime = timeDate - 3600000 * 24;
let ystDate = new Date(yetTime); let ystDate = new Date(yetTime);
@ -465,22 +410,23 @@ export default {
obj_d.day_s = days_d; obj_d.day_s = days_d;
obj_d.mgroup__name = "回转窑"; obj_d.mgroup__name = "回转窑";
obj_d.mpoint__material__code__in = "elec,elec_0"; obj_d.mpoint__material__code__in = "elec,elec_0";
obj_d.mpoint__ep_monitored__isnull = 0;
obj_d.mpoint__need_display = 1; obj_d.mpoint__need_display = 1;
obj_d.page = 0; obj_d.page = 0;
this.$API.enm.mpoint.stat.req(obj_d).then((res) => { this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
res.forEach((item, index_d) => { res.forEach((item) => {
// that.tableDatas[index][3] = item.elec_consume_unit; let index_d = that.mpoints.indexOf(
item.mpoint_nickname
);
if (that.tableDatas[index_d]) { if (that.tableDatas[index_d]) {
that.tableDatas[index_d][3] = that.tableDatas[index_d][3] =
item.elec_consume_unit; item.elec_consume_unit;
} else { } else {
let obj = []; let obj = [];
obj[0] = item.ep_monitored_name; obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t"; obj[1] = "KW·h/t";
obj[3] = item.elec_consume_unit; obj[3] = item.elec_consume_unit;
obj[5] = item.mpoint; obj[5] = item.mpoint;
that.tableDatas.push(obj); that.tableDatas[index_d] = obj;
} }
}); });
let obj_m = {}; let obj_m = {};
@ -489,24 +435,23 @@ export default {
obj_m.month_s = that.month; obj_m.month_s = that.month;
obj_m.mgroup__name = "回转窑"; obj_m.mgroup__name = "回转窑";
obj_m.mpoint__material__code__in = "elec,elec_0"; obj_m.mpoint__material__code__in = "elec,elec_0";
obj_m.mpoint__ep_monitored__isnull = 0;
obj_m.mpoint__need_display = 1; obj_m.mpoint__need_display = 1;
obj_m.page = 0; obj_m.page = 0;
this.$API.enm.mpoint.stat.req(obj_m).then((res) => { this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
console.log("getTableHourData", res); res.forEach((item) => {
res.forEach((item, index_m) => { let index_m = that.mpoints.indexOf(
// that.tableDatas[index_m][4] = item.mpoint_nickname
// item.elec_consume_unit; );
if (that.tableDatas[index_m]) { if (that.tableDatas[index_m]) {
that.tableDatas[index_m][4] = that.tableDatas[index_m][4] =
item.elec_consume_unit; item.elec_consume_unit;
} else { } else {
let obj = []; let obj = [];
obj[0] = item.ep_monitored_name; obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t"; obj[1] = "KW·h/t";
obj[4] = item.elec_consume_unit; obj[4] = item.elec_consume_unit;
obj[5] = item.mpoint; obj[5] = item.mpoint;
that.tableDatas.push(obj); that.tableDatas[index_m] = obj;
} }
}); });
}); });
@ -527,24 +472,24 @@ export default {
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => { this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData0 = [], let seriesData = [];
seriesData1 = [], for (let i = 0; i < that.mpoints.length; i++) {
seriesData2 = []; seriesData.push([]);
response.forEach((item) => {
console.log(item.ep_monitored_name);
let ind = item.hour;
if (item.ep_monitored_name == "尾排风机") {
seriesData0[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "高温风机") {
seriesData1[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "头排风机") {
seriesData2[ind] = item.elec_consume_unit;
} }
response.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
let ind = item.hour; //xAxis
seriesData[index][ind] = item.elec_consume_unit;
}); });
let options = { ...that.option1 }; let options = { ...that.option1 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
options.series[2].data = seriesData2; chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let hourXAxis = []; let hourXAxis = [];
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
let item = i + "时"; let item = i + "时";
@ -567,24 +512,25 @@ export default {
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => { this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData0 = [], let seriesData = [];
seriesData1 = [], for (let i = 0; i < that.mpoints.length; i++) {
seriesData2 = []; seriesData.push([]);
}
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
let ind = item.day_s - 1; let ind = item.day_s - 1;
if (item.ep_monitored_name == "尾排风机") { seriesData[index][ind] = item.elec_consume_unit;
seriesData0[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "高温风机") {
seriesData1[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "头排风机") {
seriesData2[ind] = item.elec_consume_unit;
}
}); });
let options = { ...that.option2 }; let options = { ...that.option2 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
options.series[2].data = seriesData2; chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let dayXAxis = []; let dayXAxis = [];
let dayss = new Date(year, month, 0).getDate(); let dayss = new Date(year, month, 0).getDate();
for (let i = 1; i <= dayss; i++) { for (let i = 1; i <= dayss; i++) {
@ -607,24 +553,25 @@ export default {
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => { this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData0 = [], let seriesData = [];
seriesData1 = [], for (let i = 0; i < that.mpoints.length; i++) {
seriesData2 = []; seriesData.push([]);
}
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let ind = item.month_s - 1; let ind = item.month_s - 1;
if (item.ep_monitored_name == "尾排风机") { let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
seriesData0[ind] = item.elec_consume_unit; seriesData[index][ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "高温风机") {
seriesData1[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "头排风机") {
seriesData2[ind] = item.elec_consume_unit;
}
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
options.series[2].data = seriesData2; chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let monthXAxis = []; let monthXAxis = [];
for (let i = 1; i < 13; i++) { for (let i = 1; i < 13; i++) {
let item = i + "月"; let item = i + "月";

View File

@ -96,17 +96,18 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
width="140" width="120"
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
size="small" size="small"
@click="sflog_edit(scope.row)" @click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
type="primary" type="primary"
>编辑</el-button >编辑</el-button
> >
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider> -->
<el-button <el-button
link link
size="small" size="small"

View File

@ -62,16 +62,19 @@
label="#" label="#"
type="index" type="index"
width="50" width="50"
fixed="left"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="工段" label="工段"
prop="mgroup_name" prop="mgroup_name"
width="80" width="90"
fixed="left"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="目标(项目)" label="目标(项目)"
prop="goal_cate_name" prop="goal_cate_name"
min-width="120" width="190"
fixed="left"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="1月" label="1月"
@ -140,7 +143,7 @@
type="primary" type="primary"
>编辑</el-button >编辑</el-button
> >
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider> -->
<el-popconfirm <el-popconfirm
title="确定删除吗?" title="确定删除吗?"
@confirm="handleDel(scope.row)" @confirm="handleDel(scope.row)"

View File

@ -96,19 +96,20 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
width="140" width="120"
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
size="small" size="small"
@click="sflog_edit(scope.row)" @click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
type="primary" type="primary"
>编辑</el-button >编辑</el-button
> >
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider> -->
<el-button <el-button
link link
size="small" size="small"

View File

@ -179,7 +179,7 @@ let toolbox = {
}; };
let legend = { let legend = {
top: "2%", top: "2%",
data: ["辊压机", "循环风机"], data: [],
}; };
let yAxis = { let yAxis = {
type: "value", type: "value",
@ -223,7 +223,7 @@ export default {
}, },
mpoint: "", mpoint: "",
searchDate: "", searchDate: "",
tableName: "主要设备100KW以上单位产品电耗数据表", tableName: "主要设备单位产品电耗数据表",
tableDatas: [ tableDatas: [
// ["", "KW·h/t", "", "", ""], // ["", "KW·h/t", "", "", ""],
// ["", "KW·h/t", "", "", ""], // ["", "KW·h/t", "", "", ""],
@ -254,18 +254,7 @@ export default {
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "辊压机",
type: "bar",
data: [],
},
{
name: "循环风机",
type: "bar",
data: [],
},
],
}, },
option2: { option2: {
color: colors, color: colors,
@ -282,18 +271,7 @@ export default {
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "辊压机",
type: "bar",
data: [],
},
{
name: "循环风机",
type: "bar",
data: [],
},
],
}, },
option3: { option3: {
color: colors, color: colors,
@ -307,36 +285,12 @@ export default {
length: 5, length: 5,
inside: true, inside: true,
}, },
data: [ data: [],
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
}, },
yAxis: yAxis, yAxis: yAxis,
series: [ series: [],
{
name: "辊压机",
type: "bar",
data: [],
}, },
{ mpoints: [],
name: "循环风机",
type: "bar",
data: [],
},
],
},
mpointList: [],
}; };
}, },
mounted() { mounted() {
@ -346,12 +300,32 @@ export default {
that.month = myDate.getMonth() + 1; that.month = myDate.getMonth() + 1;
that.days = myDate.getDate(); that.days = myDate.getDate();
that.hours = myDate.getHours(); that.hours = myDate.getHours();
that.getMpoints();
that.getTableHourData(); that.getTableHourData();
that.getHourData(that.year, that.month, that.days); that.getHourData(that.year, that.month, that.days);
that.getDayData(that.year, that.month); that.getDayData(that.year, that.month);
that.getMonthData(that.year); that.getMonthData(that.year);
}, },
methods: { methods: {
getMpoints() {
let that = this;
let obj = {};
obj.mgroup__name = "原料磨";
obj.page = 0;
obj.enabled = 1;
obj.need_display = 1;
obj.ordering = "report_sortstr";
obj.material__code__in = "elec,elec_0";
this.$API.enm.mpoint.list.req(obj).then((res) => {
console.log("mpoints", res);
let arr = [];
res.forEach((item) => {
arr.push(item.nickname);
});
console.log("arr", arr);
that.mpoints = arr;
});
},
typeRadioChange() { typeRadioChange() {
this.searchDate = ""; this.searchDate = "";
}, },
@ -397,19 +371,19 @@ export default {
obj.hour = hours_h; obj.hour = hours_h;
obj.mgroup__name = "原料磨"; obj.mgroup__name = "原料磨";
obj.mpoint__material__code__in = "elec,elec_0"; obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => { this.$API.enm.mpoint.stat.req(obj).then((res) => {
res.forEach((item) => { res.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname);
let obj = []; let obj = [];
obj[0] = item.ep_monitored_name; obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t"; obj[1] = "KW·h/t";
obj[2] = item.elec_consume_unit; obj[2] = item.elec_consume_unit;
obj[3] = 0; obj[3] = 0;
obj[4] = 0; obj[4] = 0;
obj[5] = item.mpoint; obj[5] = item.mpoint;
that.tableDatas.push(obj); that.tableDatas[index] = obj;
}); });
let yetTime = timeDate - 3600000 * 24; let yetTime = timeDate - 3600000 * 24;
let ystDate = new Date(yetTime); let ystDate = new Date(yetTime);
@ -425,22 +399,23 @@ export default {
obj_d.day_s = days_d; obj_d.day_s = days_d;
obj_d.mgroup__name = "原料磨"; obj_d.mgroup__name = "原料磨";
obj_d.mpoint__material__code__in = "elec,elec_0"; obj_d.mpoint__material__code__in = "elec,elec_0";
obj_d.mpoint__ep_monitored__isnull = 0;
obj_d.mpoint__need_display = 1; obj_d.mpoint__need_display = 1;
obj_d.page = 0; obj_d.page = 0;
this.$API.enm.mpoint.stat.req(obj_d).then((res) => { this.$API.enm.mpoint.stat.req(obj_d).then((res) => {
console.log("getTableDayData", res); res.forEach((item) => {
res.forEach((item, index_d) => { let index_d = that.mpoints.indexOf(
item.mpoint_nickname
);
if (that.tableDatas[index_d]) { if (that.tableDatas[index_d]) {
that.tableDatas[index_d][3] = that.tableDatas[index_d][3] =
item.elec_consume_unit; item.elec_consume_unit;
} else { } else {
let obj = []; let obj = [];
obj[0] = item.ep_monitored_name; obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t"; obj[1] = "KW·h/t";
obj[3] = item.elec_consume_unit; obj[3] = item.elec_consume_unit;
obj[5] = item.mpoint; obj[5] = item.mpoint;
that.tableDatas.push(obj); that.tableDatas[index_d] = obj;
} }
}); });
}); });
@ -450,22 +425,23 @@ export default {
obj_m.month_s = that.month; obj_m.month_s = that.month;
obj_m.mgroup__name = "原料磨"; obj_m.mgroup__name = "原料磨";
obj_m.mpoint__material__code__in = "elec,elec_0"; obj_m.mpoint__material__code__in = "elec,elec_0";
obj_m.mpoint__ep_monitored__isnull = 0;
obj_m.mpoint__need_display = 1; obj_m.mpoint__need_display = 1;
obj_m.page = 0; obj_m.page = 0;
this.$API.enm.mpoint.stat.req(obj_m).then((res) => { this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
console.log("getTableMonthrData", res); res.forEach((item) => {
res.forEach((item, index_m) => { let index_m = that.mpoints.indexOf(
item.mpoint_nickname
);
if (that.tableDatas[index_m]) { if (that.tableDatas[index_m]) {
that.tableDatas[index_m][4] = that.tableDatas[index_m][4] =
item.elec_consume_unit; item.elec_consume_unit;
} else { } else {
let obj = []; let obj = [];
obj[0] = item.ep_monitored_name; obj[0] = item.mpoint_nickname;
obj[1] = "KW·h/t"; obj[1] = "KW·h/t";
obj[4] = item.elec_consume_unit; obj[4] = item.elec_consume_unit;
obj[5] = item.mpoint; obj[5] = item.mpoint;
that.tableDatas.push(obj); that.tableDatas[index_m] = obj;
} }
}); });
}); });
@ -485,26 +461,31 @@ export default {
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => { this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData0 = [], let seriesData = [];
seriesData1 = []; for (let i = 0; i < that.mpoints.length; i++) {
response.forEach((item) => { seriesData.push([]);
console.log(item.ep_monitored_name);
let ind = item.hour;
if (item.ep_monitored_name == "辊压机") {
seriesData0[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "循环风机") {
seriesData1[ind] = item.elec_consume_unit;
} }
response.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
let ind = item.hour; //xAxis
seriesData[index][ind] = item.elec_consume_unit;
}); });
let options = { ...that.option1 }; let options = { ...that.option1 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let hourXAxis = []; let hourXAxis = [];
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
let item = i + "时"; let item = i + "时";
hourXAxis.push(item); hourXAxis.push(item);
} }
options.xAxis.data = hourXAxis; options.xAxis.data = hourXAxis;
console.log("options", options);
that.optionHour = options; that.optionHour = options;
}); });
}, },
@ -521,20 +502,25 @@ export default {
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => { this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData0 = [], let seriesData = [];
seriesData1 = []; for (let i = 0; i < that.mpoints.length; i++) {
seriesData.push([]);
}
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
let ind = item.day_s - 1; let ind = item.day_s - 1;
if (item.ep_monitored_name == "辊压机") { seriesData[index][ind] = item.elec_consume_unit;
seriesData0[ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "循环风机") {
seriesData1[ind] = item.elec_consume_unit;
}
}); });
let options = { ...that.option2 }; let options = { ...that.option2 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let dayXAxis = []; let dayXAxis = [];
let dayss = new Date(year, month, 0).getDate(); let dayss = new Date(year, month, 0).getDate();
for (let i = 1; i <= dayss; i++) { for (let i = 1; i <= dayss; i++) {
@ -557,20 +543,25 @@ export default {
obj.mpoint__need_display = 1; obj.mpoint__need_display = 1;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => { this.$API.enm.mpoint.stat.req(obj).then((response) => {
let seriesData0 = [], let seriesData = [];
seriesData1 = []; for (let i = 0; i < that.mpoints.length; i++) {
seriesData.push([]);
}
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let ind = item.month_s - 1; let ind = item.month_s - 1;
if (item.ep_monitored_name == "辊压机") { let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
seriesData0[ind] = item.elec_consume_unit; seriesData[index][ind] = item.elec_consume_unit;
} else if (item.ep_monitored_name == "循环风机") {
seriesData1[ind] = item.elec_consume_unit;
}
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; for (let j = 0; j < that.mpoints.length; j++) {
options.series[1].data = seriesData1; let chartItem = {};
chartItem.name = that.mpoints[j];
chartItem.type = "bar";
chartItem.data = seriesData[j];
options.series.push(chartItem);
}
options.legend.data = that.mpoints;
let monthXAxis = []; let monthXAxis = [];
for (let i = 1; i < 13; i++) { for (let i = 1; i < 13; i++) {
let item = i + "月"; let item = i + "月";

View File

@ -2,26 +2,75 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" @click="add('do_in')" v-auth="'mio.do'">生产入库</el-button> <el-button
<el-button type="primary" @click="add('sale_out')" v-auth="'mio.sale'">销售发货</el-button> type="primary"
<el-select v-model="query.type" clearable style="width: 120px; margin-left: 2px" placeholder="出入库类型" @click="add('do_in')"
@change="handleQuery"> v-auth="'mio.do'"
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> >生产入库</el-button
>
<el-button
type="primary"
@click="add('sale_out')"
v-auth="'mio.sale'"
>销售发货</el-button
>
<el-select
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
placeholder="出入库类型"
@change="handleQuery"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
<el-select v-model="query.state" clearable style="width: 120px; margin-left: 2px" placeholder="状态" <el-select
@change="handleQuery"> v-model="query.state"
<el-option v-for="item in stateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> clearable
style="width: 120px; margin-left: 2px"
placeholder="状态"
@change="handleQuery"
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input v-model="query.search" placeholder="编号" clearable style="margin-right: 5px;"></el-input> <el-input
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> v-model="query.search"
placeholder="编号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" :params="params" :query="query" row-key="id" stripe> <scTable
ref="table"
:apiObj="apiObj"
:params="params"
:query="query"
row-key="id"
stripe
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="记录编号" prop="number"></el-table-column> <el-table-column
label="记录编号"
prop="number"
></el-table-column>
<el-table-column label="出/入库类型"> <el-table-column label="出/入库类型">
<template #default="scope"> <template #default="scope">
{{ typeDict[scope.row.type] }} {{ typeDict[scope.row.type] }}
@ -40,17 +89,36 @@
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time"> <el-table-column label="创建时间" prop="create_time">
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150px"> <el-table-column
label="操作"
fixed="right"
align="center"
width="150px"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)"> <el-button
link
type="primary"
@click="table_detail(scope.row)"
>
查看 查看
</el-button> </el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'mio.submit'" <el-button
v-if="scope.row.state == 10"> link
type="primary"
@click="table_submit(scope.row)"
v-auth="'mio.submit'"
v-if="scope.row.state == 10"
>
提交 提交
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mio.delete'" <el-button
v-if="scope.row.state == 10"> link
type="danger"
@click="table_del(scope.row)"
v-auth="'mio.delete'"
v-if="scope.row.state == 10"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -58,50 +126,66 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" <save-dialog
@closed="dialog.save = false"></save-dialog> v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type"
:cate="cate"
:mioId="mioId"
@closed="visibleDrawer = false"
>
</record-dialog>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default { export default {
name: "mio", name: "mio",
components: { components: {
saveDialog saveDialog,
recordDialog,
}, },
data() { data() {
return { return {
stateDict: { stateDict: {
10: '创建中', 10: "创建中",
20: '已提交' 20: "已提交",
}, },
stateOptions: [ stateOptions: [
{ id: 10, name: '创建中' }, { id: 10, name: "创建中" },
{ id: 20, name: '已提交' }, { id: 20, name: "已提交" },
], ],
typeDict: { typeDict: {
'sale_out': '销售发货', sale_out: "销售发货",
'do_in': '生产入库', do_in: "生产入库",
}, },
cateOptions: [ cateOptions: [
{ id: 'sale_out', name: '销售发货' }, { id: "sale_out", name: "销售发货" },
{ id: 'do_in', name: '生产入库' }, { id: "do_in", name: "生产入库" },
], ],
dialog: { dialog: {
save: false, save: false,
record: false,
}, },
query: { query: {},
},
params: { params: {
type__in: 'sale_out,do_in', type__in: "sale_out,do_in",
materials__type: 10 materials__type: 10,
},
form: {
}, },
form: {},
apiObj: this.$API.inm.mio.list, apiObj: this.$API.inm.mio.list,
selection: [], selection: [],
type: "",
cate: "good",
mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -121,40 +205,47 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.$router.push({ this.type = row.type;
name: "mioitem", this.mioId = row.id;
query: { mio: row.id, type: row.type, cate: 'good' } this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
}); });
}, },
// //
table_del(row) { table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.inm.mio.delete.req(row.id).then((res) => { .then(() => {
this.$API.inm.mio.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
table_submit(row) { table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then(res => { this.$API.inm.mio.submit.req(row.id).then((res) => {
this.$message.success("提交成功"); this.$message.success("提交成功");
this.$refs.table.refresh() this.$refs.table.refresh();
}) });
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },
handleSaveSuccess() { handleSaveSuccess() {
this.$refs.table.refresh() this.$refs.table.refresh();
} },
}, },
}; };
</script> </script>

View File

@ -149,13 +149,23 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type"
:cate="cate"
:mioId="mioId"
@closed="visibleDrawer = false"
>
</record-dialog>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default { export default {
name: "mio", name: "mio",
components: { components: {
recordDialog,
saveDialog, saveDialog,
}, },
data() { data() {
@ -178,6 +188,7 @@ export default {
], ],
dialog: { dialog: {
save: false, save: false,
record: false,
}, },
query: {}, query: {},
params: { params: {
@ -187,6 +198,10 @@ export default {
form: {}, form: {},
apiObj: this.$API.inm.mio.list, apiObj: this.$API.inm.mio.list,
selection: [], selection: [],
type: "",
cate: "halfgood",
mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -206,9 +221,11 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.$router.push({ this.type = row.type;
name: "mioitem", this.mioId = row.id;
query: { mio: row.id, type: row.type, cate: "halfgood" }, this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
}); });
}, },
// //

View File

@ -132,14 +132,25 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type"
:cate="cate"
:mioId="mioId"
@closed="visibleDrawer = false"
>
</record-dialog>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default { export default {
name: "mio", name: "mio",
components: { components: {
saveDialog, saveDialog,
recordDialog,
}, },
data() { data() {
return { return {
@ -155,6 +166,7 @@ export default {
cateOptions: [{ id: "pur_in", name: "采购入库" }], cateOptions: [{ id: "pur_in", name: "采购入库" }],
dialog: { dialog: {
save: false, save: false,
record: false,
}, },
query: {}, query: {},
params: { params: {
@ -164,6 +176,10 @@ export default {
form: {}, form: {},
apiObj: this.$API.inm.mio.list, apiObj: this.$API.inm.mio.list,
selection: [], selection: [],
type: "",
cate: "helpso",
mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -183,9 +199,11 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.$router.push({ this.type = row.type;
name: "mioitem", this.mioId = row.id;
query: { mio: row.id, type: row.type, cate: "helpso" }, this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
}); });
}, },
// //

View File

@ -149,14 +149,25 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type"
:cate="cate"
:mioId="mioId"
@closed="visibleDrawer = false"
>
</record-dialog>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default { export default {
name: "mio", name: "mio",
components: { components: {
saveDialog, saveDialog,
recordDialog,
}, },
data() { data() {
return { return {
@ -178,6 +189,7 @@ export default {
], ],
dialog: { dialog: {
save: false, save: false,
record: false,
}, },
query: {}, query: {},
params: { params: {
@ -187,6 +199,10 @@ export default {
form: {}, form: {},
apiObj: this.$API.inm.mio.list, apiObj: this.$API.inm.mio.list,
selection: [], selection: [],
type: "",
cate: "mainso",
mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -206,9 +222,11 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.$router.push({ this.type = row.type;
name: "mioitem", this.mioId = row.id;
query: { mio: row.id, type: row.type, cate: "mainso" }, this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
}); });
}, },
// //

View File

@ -8,26 +8,68 @@
<el-button type="primary" @click="add('pur_in')">采购入库</el-button> <el-button type="primary" @click="add('pur_in')">采购入库</el-button>
<el-button type="primary" @click="add('sale_out')">销售发货</el-button> <el-button type="primary" @click="add('sale_out')">销售发货</el-button>
<el-divider direction="vertical"></el-divider> --> <el-divider direction="vertical"></el-divider> -->
<el-button type="primary" @click="add('other_in')" v-auth="'mio.other'">其他入库</el-button> <el-button
<el-button type="primary" @click="add('other_out')" v-auth="'mio.other'">其他出库</el-button> type="primary"
<el-select v-model="query.type" clearable style="width: 120px; margin-left: 2px" placeholder="出入库类型" @click="add('other_in')"
@change="handleQuery"> v-auth="'mio.other'"
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> >其他入库</el-button
>
<el-button
type="primary"
@click="add('other_out')"
v-auth="'mio.other'"
>其他出库</el-button
>
<el-select
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
placeholder="出入库类型"
@change="handleQuery"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
<el-select v-model="query.state" clearable style="width: 120px; margin-left: 2px" placeholder="状态" <el-select
@change="handleQuery"> v-model="query.state"
<el-option v-for="item in stateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> clearable
style="width: 120px; margin-left: 2px"
placeholder="状态"
@change="handleQuery"
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-select>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input v-model="query.search" placeholder="编号" clearable style="margin-right: 5px;"></el-input> <el-input
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> v-model="query.search"
placeholder="编号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe> <scTable ref="table" :apiObj="apiObj" row-key="id" stripe>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="记录编号" prop="number"></el-table-column> <el-table-column
label="记录编号"
prop="number"
></el-table-column>
<el-table-column label="出/入库类型"> <el-table-column label="出/入库类型">
<template #default="scope"> <template #default="scope">
{{ typeDict[scope.row.type] }} {{ typeDict[scope.row.type] }}
@ -45,17 +87,44 @@
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time"> <el-table-column label="创建时间" prop="create_time">
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150px"> <el-table-column
label="操作"
fixed="right"
align="center"
width="150px"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)"> <el-button
link
type="primary"
@click="table_detail(scope.row)"
>
查看 查看
</el-button> </el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'mio.submit'" <el-button
v-if="scope.row.state == 10&&(scope.row.type=='other_in'||scope.row.type=='other_out')"> link
type="primary"
@click="table_submit(scope.row)"
v-auth="'mio.submit'"
v-if="
scope.row.state == 10 &&
(scope.row.type == 'other_in' ||
scope.row.type == 'other_out')
"
>
提交 提交
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mio.delete'" <el-button
v-if="scope.row.state == 10&&(scope.row.type=='other_in'||scope.row.type=='other_out')"> link
type="danger"
@click="table_del(scope.row)"
v-auth="'mio.delete'"
v-if="
scope.row.state == 10 &&
(scope.row.type == 'other_in' ||
scope.row.type == 'other_out')
"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -63,54 +132,71 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" <save-dialog
@closed="dialog.save = false"></save-dialog> v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type"
:cate="cate"
:mioId="mioId"
@closed="visibleDrawer = false"
>
</record-dialog>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default { export default {
name: "mio", name: "mio",
components: { components: {
saveDialog saveDialog,
recordDialog,
}, },
data() { data() {
return { return {
stateDict: { stateDict: {
10: '创建中', 10: "创建中",
20: '已提交' 20: "已提交",
}, },
stateOptions: [ stateOptions: [
{ id: 10, name: '创建中' }, { id: 10, name: "创建中" },
{ id: 20, name: '已提交' }, { id: 20, name: "已提交" },
], ],
typeDict: { typeDict: {
'do_out': '生产领料', do_out: "生产领料",
'sale_out': '销售发货', sale_out: "销售发货",
'pur_in': '采购入库', pur_in: "采购入库",
'do_in': '生产入库', do_in: "生产入库",
'other_in': '其他入库', other_in: "其他入库",
'other_out': '其他出库', other_out: "其他出库",
}, },
cateOptions: [ cateOptions: [
{ id: 'do_out', name: '生产领料' }, { id: "do_out", name: "生产领料" },
{ id: 'sale_out', name: '销售发货' }, { id: "sale_out", name: "销售发货" },
{ id: 'pur_in', name: '采购入库' }, { id: "pur_in", name: "采购入库" },
{ id: 'do_in', name: '生产入库' }, { id: "do_in", name: "生产入库" },
{ id: 'other_in', name: '其他入库' }, { id: "other_in", name: "其他入库" },
{ id: 'other_out', name: '其他出库' }, { id: "other_out", name: "其他出库" },
], ],
dialog: { dialog: {
save: false, save: false,
record: false,
}, },
visibleDrawer: false,
query: { query: {
search: '' search: "",
},
form: {
}, },
form: {},
apiObj: this.$API.inm.mio.list, apiObj: this.$API.inm.mio.list,
selection: [], selection: [],
type: "",
mioId: "",
}; };
}, },
methods: { methods: {
@ -130,41 +216,47 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.$router.push({ this.type = row.type;
name: "mioitem", this.mioId = row.id;
query: { mio: row.id ,type:row.type} this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
}); });
}, },
// //
table_del(row) { table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.inm.mio.delete.req(row.id).then((res) => { .then(() => {
this.$API.inm.mio.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
table_submit(row) { table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then(res => { this.$API.inm.mio.submit.req(row.id).then((res) => {
this.$message.success("提交成功"); this.$message.success("提交成功");
this.$refs.table.refresh() this.$refs.table.refresh();
}) });
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },
handleSaveSuccess() { handleSaveSuccess() {
this.$refs.table.refresh() this.$refs.table.refresh();
} },
}, },
}; };
</script> </script>

View File

@ -1,4 +1,11 @@
<template> <template>
<el-drawer
v-model="visible"
title="出入库记录"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px"> <div style="padding: 8px">
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="hover"> <el-card style="width: 100%" header="基本信息" shadow="hover">
@ -98,11 +105,17 @@
<div> <div>
{{ item.material_name }} {{ item.material_name }}
<span <span
style="color: gray; font-size: 12px" style="
color: gray;
font-size: 12px;
"
>:</span >:</span
>{{ item.batch }} >{{ item.batch }}
<span <span
style="color: gray; font-size: 12px" style="
color: gray;
font-size: 12px;
"
>:</span >:</span
>{{ item.rate }} >{{ item.rate }}
</div> </div>
@ -170,6 +183,7 @@
</el-card> </el-card>
</div> </div>
</div> </div>
</el-drawer>
<save-dialog <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
@ -203,6 +217,20 @@ export default {
saveDialog, saveDialog,
checkDialog, checkDialog,
}, },
props: {
type: {
type: String,
default: "",
},
cate: {
type: String,
default: "",
},
mioId: {
type: String,
default: "",
},
},
data() { data() {
return { return {
dialog: { dialog: {
@ -211,7 +239,7 @@ export default {
}, },
apiObj: null, apiObj: null,
params: {}, params: {},
mioId: "", // mioId: "",
mioObj: {}, mioObj: {},
selection: [], selection: [],
stateDict: { stateDict: {
@ -226,21 +254,26 @@ export default {
other_in: "其他入库", other_in: "其他入库",
other_out: "其他出库", other_out: "其他出库",
}, },
visible: false,
mioitemId: "", mioitemId: "",
type: "", // type: "",
cate: "", // cate: "",
objitem: {}, objitem: {},
}; };
}, },
mounted() { mounted() {
this.type = this.$route.query.type; // this.type = this.$route.query.type;
this.cate = this.$route.query.cate; // this.cate = this.$route.query.cate;
this.mioId = this.$route.query.mio; // this.mioId = this.$route.query.mio;
this.params.mio = this.$route.query.mio; // this.params.mio = this.$route.query.mio;
this.params.mio = this.mioId;
this.apiObj = this.$API.inm.mioitem.list; this.apiObj = this.$API.inm.mioitem.list;
this.getMio(); this.getMio();
}, },
methods: { methods: {
open() {
this.visible = true;
},
getMio() { getMio() {
this.$API.inm.mio.item.req(this.mioId).then((res) => { this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.mioObj = res; this.mioObj = res;

View File

@ -2,24 +2,56 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_order.create'">新增</el-button> <el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_order.create'"
>新增</el-button
>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input v-model="query.search" placeholder="订单编号" clearable style="margin-right: 5px;"></el-input> <el-input
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> v-model="query.search"
placeholder="订单编号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query"> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="订单编号" prop="number"> <el-table-column label="订单编号" prop="number">
</el-table-column> </el-table-column>
<el-table-column label="供应商" prop="supplier_name" show-overflow-tooltip> <el-table-column
label="供应商"
prop="supplier_name"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="物料信息" prop="materials_"> <el-table-column label="物料信息" prop="materials_">
<template #default="scope"> <template #default="scope">
<div v-for="item in scope.row.materials_" v-bind:key="item.id"> <div
<span>{{ item.name }}[{{ item.specification }}][{{ item.model }}]</span> v-for="item in scope.row.materials_"
v-bind:key="item.id"
>
<span
>{{ item.name }}[{{ item.specification }}][{{
item.model
}}]</span
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -27,29 +59,59 @@
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="state"> <el-table-column label="状态" prop="state">
<template #default="scope"> <template #default="scope">
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label <span
}}</el-tag></span> ><el-tag
:type="stateOption[scope.row.state].color"
>{{
stateOption[scope.row.state].label
}}</el-tag
></span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="提交时间" prop="submit_time"> <el-table-column label="提交时间" prop="submit_time">
</el-table-column> </el-table-column>
<el-table-column label="创建人" prop="create_by_name"> <el-table-column label="创建人" prop="create_by_name">
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200"> <el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)"> <el-button
link
type="primary"
@click="table_detail(scope.row)"
>
详情 详情
</el-button> </el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_order.update'" <el-button
v-if="scope.row.state == 10"> link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_order.update'"
v-if="scope.row.state == 10"
>
编辑 编辑
</el-button> </el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_order.submit'" <el-button
v-if="scope.row.state == 10"> link
type="primary"
@click="table_submit(scope.row)"
v-auth="'pu_order.submit'"
v-if="scope.row.state == 10"
>
提交 提交
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_order.delete'" <el-button
v-if="scope.row.state == 10"> link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_order.delete'"
v-if="scope.row.state == 10"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -57,15 +119,28 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" <save-dialog
@closed="dialog.save = false"></save-dialog> v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<detail-dialog
ref="detailDialogs"
v-if="dialog.detail"
:orderId="orderId"
@closed="dialog.detail = false"
>
</detail-dialog>
</template> </template>
<script> <script>
import saveDialog from "./order_form.vue"; import saveDialog from "./order_form.vue";
import detailDialog from "./orderitem.vue";
export default { export default {
name: "rparty", name: "rparty",
components: { components: {
saveDialog, saveDialog,
detailDialog,
}, },
data() { data() {
return { return {
@ -75,16 +150,16 @@ export default {
apiObj: this.$API.pum.order.list, apiObj: this.$API.pum.order.list,
query: { query: {
page: 1, page: 1,
page_size: 20 page_size: 20,
}, },
selection: [], selection: [],
stateOption: { stateOption: {
10: { "label": "创建中", "color": "" }, 10: { label: "创建中", color: "" },
20: { "label": "已提交", "color": "" }, 20: { label: "已提交", color: "" },
30: { "label": "到货中", "color": "" }, 30: { label: "到货中", color: "" },
40: { "label": "已完成", "color": "success" }, 40: { label: "已完成", color: "success" },
}, },
orderId: "",
}; };
}, },
methods: { methods: {
@ -104,34 +179,35 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.orderId = row.id;
this.dialog.detail = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$router.push({ this.$refs.detailDialogs.open();
name: "orderitem",
query: {
pu_order: row.id
}
});
}); });
}, },
table_submit(row) { table_submit(row) {
console.log(row)
this.$API.pum.order.submit.req(row.id).then((res) => { this.$API.pum.order.submit.req(row.id).then((res) => {
this.$refs.table.refresh(); this.$refs.table.refresh();
}) });
}, },
// //
async table_del(row) { async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.pum.order.delete.req(row.id).then((res) => { .then(() => {
this.$API.pum.order.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
@ -143,7 +219,7 @@ export default {
} }
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};

View File

@ -1,49 +1,120 @@
<template> <template>
<el-drawer
v-model="visible"
title="订单详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px"> <div style="padding: 8px">
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="hover"> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions> <el-descriptions>
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item> <el-descriptions-item label="订单编号">{{
<el-descriptions-item label="订单状态">{{ stateOption[orderObj.state] }}</el-descriptions-item> orderObj.number
<el-descriptions-item label="供应商">{{ orderObj.supplier_name }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{ orderObj.belong_dept_name }}</el-descriptions-item> <el-descriptions-item label="订单状态">{{
<el-descriptions-item label="创建人">{{ orderObj.create_by_name }}</el-descriptions-item> stateOption[orderObj.state]
<el-descriptions-item label="创建时间">{{ orderObj.create_time }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="供应商">{{
orderObj.supplier_name
}}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{
orderObj.belong_dept_name
}}</el-descriptions-item>
<el-descriptions-item label="创建人">{{
orderObj.create_by_name
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
orderObj.create_time
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
</div> </div>
<div style="height:8px"></div> <div style="height: 8px"></div>
<div> <div>
<el-card style="width: 100%" header="订单明细" shadow="hover"> <el-card style="width: 100%" header="订单明细" shadow="hover">
<div> <div>
<el-button type="primary" @click="addLinkPlanItem" v-auth="'pu_orderitem.create'" <el-button
v-if="orderObj.state == 10">计划明细变更采购明细</el-button> type="primary"
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'" @click="addLinkPlanItem"
v-if="orderObj.state == 10">手动新增</el-button> v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>计划明细变更采购明细</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>手动新增</el-button
>
</div> </div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination hideDo> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
:query="query"
hidePagination
hideDo
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="物料" prop="material" show-overflow-tooltip> <el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span> <span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所需数量" prop="count"> <el-table-column label="所需数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="已到货数量" prop="delivered_count"> <el-table-column
label="已到货数量"
prop="delivered_count"
>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip> <el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="更新时间" prop="update_time" show-overflow-tooltip> <el-table-column
label="更新时间"
prop="update_time"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="100px"> <el-table-column
label="操作"
fixed="right"
align="left"
width="100px"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_orderitem.update'" <el-button
v-if="orderObj.state == 10"> link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_orderitem.update'"
v-if="orderObj.state == 10"
>
编辑 编辑
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_orderitem.delete'" <el-button
v-if="orderObj.state == 10"> link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_orderitem.delete'"
v-if="orderObj.state == 10"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -52,10 +123,21 @@
</el-card> </el-card>
</div> </div>
</div> </div>
<save-dialog v-if="dialog.save" ref="saveDialog" :puOrder="puOrder" @success="handleSaveSuccess" </el-drawer>
@closed="dialog.save = false"></save-dialog> <save-dialog
<plan-dialog v-if="dialog.plan" ref="planDialog" :puOrder="puOrder" @success="handlePlanSuccess" v-if="dialog.save"
@closed="dialog.plan = false"></plan-dialog> ref="saveDialog"
:puOrder="puOrder"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<plan-dialog
v-if="dialog.plan"
ref="planDialog"
:puOrder="puOrder"
@success="handlePlanSuccess"
@closed="dialog.plan = false"
></plan-dialog>
</template> </template>
<script> <script>
import saveDialog from "./orderitem_form.vue"; import saveDialog from "./orderitem_form.vue";
@ -63,7 +145,14 @@ import planDialog from "./orderitemplan.vue";
export default { export default {
name: "rparty", name: "rparty",
components: { components: {
saveDialog, planDialog saveDialog,
planDialog,
},
props: {
orderId: {
type: String,
default: "",
},
}, },
data() { data() {
return { return {
@ -72,9 +161,11 @@ export default {
splan: false, splan: false,
}, },
apiObj: null, apiObj: null,
params: {}, params: {
pu_order: "",
},
query: {}, query: {},
puOrder: '', puOrder: "",
orderObj: {}, orderObj: {},
selection: [], selection: [],
stateOption: { stateOption: {
@ -83,19 +174,23 @@ export default {
30: "到货中", 30: "到货中",
40: "已完成", 40: "已完成",
}, },
visible: false,
}; };
}, },
mounted() { mounted() {
this.puOrder = this.$route.query.pu_order; this.puOrder = this.orderId;
this.params.pu_order = this.$route.query.pu_order; this.params.pu_order = this.orderId;
this.apiObj = this.$API.pum.orderitem.list; this.apiObj = this.$API.pum.orderitem.list;
this.getOrder(); this.getOrder();
}, },
methods: { methods: {
open() {
this.visible = true;
},
getOrder() { getOrder() {
this.$API.pum.order.item.req(this.puOrder).then((res) => { this.$API.pum.order.item.req(this.puOrder).then((res) => {
this.orderObj = res; this.orderObj = res;
}) });
}, },
// //
add() { add() {
@ -135,15 +230,20 @@ export default {
table_del(row) { table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.pum.orderitem.delete.req(row.id).then((res) => { .then(() => {
this.$API.pum.orderitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
@ -158,7 +258,7 @@ export default {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};

View File

@ -2,75 +2,149 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_plan.create'">新增</el-button> <el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_plan.create'"
>新增</el-button
>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input v-model="query.search" placeholder="计划编号" clearable style="margin-right: 5px;"></el-input> <el-input
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> v-model="query.search"
placeholder="计划编号"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query"> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="计划名称" prop="name" show-overflow-tooltip> <el-table-column
label="计划名称"
prop="name"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="计划编号" prop="number"> <el-table-column label="计划编号" prop="number">
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="state"> <el-table-column label="状态" prop="state">
<template #default="scope"> <template #default="scope">
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label <span
}}</el-tag></span> ><el-tag
:type="stateOption[scope.row.state].color"
>{{
stateOption[scope.row.state].label
}}</el-tag
></span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="提交时间" prop="submit_time" show-overflow-tooltip> <el-table-column
label="提交时间"
prop="submit_time"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200"> <el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">详情 <el-button
link
type="primary"
@click="table_detail(scope.row)"
>详情
</el-button> </el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_plan.update'" <el-button
v-if="scope.row.state == 10">编辑 link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_plan.update'"
v-if="scope.row.state == 10"
>编辑
</el-button> </el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_plan.submit'" <el-button
v-if="scope.row.state == 10">提交 link
type="primary"
@click="table_submit(scope.row)"
v-auth="'pu_plan.submit'"
v-if="scope.row.state == 10"
>提交
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_plan.delete'" <el-button
v-if="scope.row.state == 10">删除 link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_plan.delete'"
v-if="scope.row.state == 10"
>删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" <save-dialog
@closed="dialog.save = false"></save-dialog> v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<detail-dialog
ref="detailDialogs"
v-if="dialog.detail"
:planId="planId"
@closed="dialog.detail = false"
>
</detail-dialog>
</template> </template>
<script> <script>
import saveDialog from "./plan_form.vue"; import saveDialog from "./plan_form.vue";
import detailDialog from "./planitem.vue";
export default { export default {
name: "rparty", name: "rparty",
components: { components: {
saveDialog, saveDialog,
detailDialog,
}, },
data() { data() {
return { return {
dialog: { dialog: {
save: false, save: false,
detail: false,
}, },
apiObj: this.$API.pum.plan.list, apiObj: this.$API.pum.plan.list,
query: { query: {
page: 1, page: 1,
page_size: 20, page_size: 20,
type: 10 type: 10,
}, },
selection: [], selection: [],
stateOption: { stateOption: {
10: { "label": "创建中", "color": "" }, 10: { label: "创建中", color: "" },
20: { "label": "已提交", "color": "" }, 20: { label: "已提交", color: "" },
30: { "label": "下单中", "color": "" }, 30: { label: "下单中", color: "" },
40: { "label": "下单完成", "color": "" }, 40: { label: "下单完成", color: "" },
40: { "label": "已完成", "color": "success" }, 40: { label: "已完成", color: "success" },
}, },
planId: "",
}; };
}, },
methods: { methods: {
@ -83,12 +157,10 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.planId = row.id;
this.dialog.detail = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$router.push({ this.$refs.detailDialogs.open();
name: "planitem",
query: { pu_plan: row.id }
});
}); });
}, },
// //
@ -100,10 +172,8 @@ export default {
}, },
// //
table_submit(row) { table_submit(row) {
console.log(row.id)
this.$API.pum.plan.submit.req(row.id).then((res) => { this.$API.pum.plan.submit.req(row.id).then((res) => {
this.$refs.table.refresh(); this.$refs.table.refresh();
debugger;
this.$message.success("提交成功"); this.$message.success("提交成功");
}); });
}, },
@ -111,15 +181,20 @@ export default {
table_del(row) { table_del(row) {
this.$confirm(`确定删除该计划吗?`, "提示", { this.$confirm(`确定删除该计划吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.pum.plan.delete.req(row.id).then((res) => { .then(() => {
this.$API.pum.plan.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
@ -130,7 +205,7 @@ export default {
} }
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};

View File

@ -1,31 +1,69 @@
<template> <template>
<el-drawer
v-model="visible"
title="计划详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px"> <div style="padding: 8px">
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="hover"> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions> <el-descriptions>
<el-descriptions-item label="计划名称">{{ orderObj.name }}</el-descriptions-item> <el-descriptions-item label="计划名称">{{
<el-descriptions-item label="计划编号">{{ orderObj.number }}</el-descriptions-item> orderObj.name
<el-descriptions-item label="计划状态">{{ stateOption[orderObj.state] }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="计划编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{
stateOption[orderObj.state]
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
</div> </div>
<div style="height:8px"></div> <div style="height: 8px"></div>
<div> <div>
<el-card style="width: 100%" header="计划明细" shadow="hover"> <el-card style="width: 100%" header="计划明细" shadow="hover">
<div> <div>
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add" <el-button
v-if="orderObj.state == 10">新增</el-button> type="primary"
icon="el-icon-plus"
v-auth="'pu_planitem.create'"
@click="add"
v-if="orderObj.state == 10"
>新增</el-button
>
</div> </div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination hideDo> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:query="query"
hidePagination
hideDo
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="所属物料" prop="material" show-overflow-tooltip> <el-table-column
label="所属物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span> <span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属数量" prop="need_count"> <el-table-column label="所属数量" prop="need_count">
</el-table-column> </el-table-column>
<el-table-column label="需求日期" prop="need_date" show-overflow-tooltip> <el-table-column
label="需求日期"
prop="need_date"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="部门" prop="belong_dept_name"> <el-table-column label="部门" prop="belong_dept_name">
</el-table-column> </el-table-column>
@ -37,16 +75,35 @@
</el-table-column> </el-table-column>
<el-table-column label="创建人" prop="create_by_name"> <el-table-column label="创建人" prop="create_by_name">
</el-table-column> </el-table-column>
<el-table-column label="备注" prop="note" show-overflow-tooltip> <el-table-column
label="备注"
prop="note"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100px"> <el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_planitem.update'" <el-button
v-if="orderObj == 10"> link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_planitem.update'"
v-if="orderObj == 10"
>
编辑 编辑
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_planitem.delete'" <el-button
v-if="orderObj == 10"> link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_planitem.delete'"
v-if="orderObj == 10"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -55,8 +112,14 @@
</el-card> </el-card>
</div> </div>
</div> </div>
<save-dialog v-if="dialog.save" ref="saveDialog" :puPlan="puPlan" @success="handleSaveSuccess" </el-drawer>
@closed="dialog.save = false"></save-dialog> <save-dialog
v-if="dialog.save"
ref="saveDialog"
:puPlan="puPlan"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template> </template>
<script> <script>
import saveDialog from "./planitem_form.vue"; import saveDialog from "./planitem_form.vue";
@ -65,17 +128,24 @@ export default {
components: { components: {
saveDialog, saveDialog,
}, },
props: {
planId: {
type: String,
default: "",
},
},
data() { data() {
return { return {
dialog: { dialog: {
save: false, save: false,
}, },
puPlan: '', puPlan: "",
orderObj: {}, orderObj: {},
apiObj: null, apiObj: null,
query: { query: {
page: 1, page: 1,
page_size: 20 page_size: 20,
pu_plan: "",
}, },
stateOption: { stateOption: {
10: "创建中", 10: "创建中",
@ -84,22 +154,24 @@ export default {
40: "下单完成", 40: "下单完成",
40: "已完成", 40: "已完成",
}, },
visible: false,
}; };
}, },
mounted() { mounted() {
this.puPlan = this.$route.query.pu_plan; this.puPlan = this.planId;
this.query.pu_plan = this.$route.query.pu_plan; this.query.pu_plan = this.planId;
this.apiObj = this.$API.pum.planitem.list; this.apiObj = this.$API.pum.planitem.list;
this.$refs.table.refresh(); // this.$refs.table.refresh();
this.getOrder(); this.getOrder();
}, },
methods: { methods: {
open() {
this.visible = true;
},
getOrder() { getOrder() {
this.$API.pum.plan.item.req(this.puPlan).then((res) => { this.$API.pum.plan.item.req(this.puPlan).then((res) => {
debugger;
console.log(res);
this.orderObj = res; this.orderObj = res;
}) });
}, },
// //
add() { add() {
@ -127,14 +199,19 @@ export default {
table_del(row) { table_del(row) {
this.$confirm(`确定删除该计划详情吗?`, "提示", { this.$confirm(`确定删除该计划详情吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.pum.planitem.delete.req(row.id).then((res) => { .then(() => {
this.$API.pum.planitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
@ -146,7 +223,7 @@ export default {
} }
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};

View File

@ -2,7 +2,11 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button> <el-button
type="primary"
icon="el-icon-plus"
@click="add"
></el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-date-picker <el-date-picker
@ -14,7 +18,8 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery" @click="handleQuery"
>查询</el-button> >查询</el-button
>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -25,45 +30,69 @@
stripe stripe
:params="query" :params="query"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50" />
<el-table-column label="日期" prop="test_date" show-overflow-tooltip> <el-table-column
</el-table-column> label="日期"
<el-table-column label="批次号" prop="batch"> prop="test_date"
</el-table-column> show-overflow-tooltip
<el-table-column label="总数" prop="count"> >
</el-table-column> </el-table-column>
<el-table-column label="批次号" prop="batch"> </el-table-column>
<el-table-column label="总数" prop="count"> </el-table-column>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template #default="scope"> <template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)">编辑</el-link> <el-link type="primary" @click="table_edit(scope.row)"
>编辑</el-link
>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_check(scope.row)">检验</el-link> <el-link type="primary" @click="table_check(scope.row)"
>检验</el-link
>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)">删除</el-link> <el-link type="danger" @click="table_del(scope.row)"
>删除</el-link
>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleCheckSuccess" @closed="dialog.check = false"> <save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog> </save-dialog>
<check-dialog
ref="checkDialogs"
v-if="dialog.check"
:type="product_type"
:ftestWork="ftestWork"
@closed="dialog.check = false"
>
</check-dialog>
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "./product_form.vue"; import saveDialog from "./product_form.vue";
export default { import checkDialog from "./productCheck.vue";
export default {
name: "rparty", name: "rparty",
components:{ components: {
saveDialog saveDialog,
checkDialog,
}, },
data() { data() {
return { return {
apiObj: this.$API.qm.ftestwork.list, apiObj: this.$API.qm.ftestwork.list,
dialog:{ dialog: {
check:false, save: false,
check: false,
}, },
query: { query: {
page:1, page: 1,
page_size:20, page_size: 20,
type:10 type: 10,
}, },
selection: [], selection: [],
}; };
@ -81,52 +110,61 @@ import saveDialog from "./product_form.vue";
this.$refs.saveDialog.open("edit").setData(row); this.$refs.saveDialog.open("edit").setData(row);
}); });
}, },
table_del(row){ table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.qm.ftestwork.delete.req(row.id).then((res) => { .then(() => {
this.$API.qm.ftestwork.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh(); this.$refs.table.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
table_show(row) { table_show(row) {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("show",10).setData(row); this.$refs.saveDialog.open("show", 10).setData(row);
}); });
}, },
table_check(row){ table_check(row) {
// console.log('ftestWork',row) debugger;
let type = ''; console.log(row);
if(row.material_name.indexOf('棒')>-1){ let that = this;
type = 'bang'; let type = "";
}else{ if (row.material_name.indexOf("棒") > -1) {
type='guan'; type = "bang";
} else {
type = "guan";
} }
this.$router.push({ that.product_type = type;
name: "productDetail", that.ftestWork = row.id;
query: { that.dialog.check = true;
type:type, this.$nextTick(() => {
ftestWork:row.id this.$refs.checkDialogs.open();
},
}); });
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },
handleCheckSuccess(){ handleSaveSuccess() {
this.dialog.save = false; this.dialog.save = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
handleCheckSuccess() {
this.dialog.check = false;
}, },
}; },
};
</script> </script>

View File

@ -1,4 +1,11 @@
<template> <template>
<el-drawer
v-model="visible"
title="成品检验"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px"> <div style="padding: 8px">
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="hover"> <el-card style="width: 100%" header="基本信息" shadow="hover">
@ -278,6 +285,7 @@
</el-card> </el-card>
</div> </div>
</div> </div>
</el-drawer>
<save-dialog <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
@ -295,6 +303,17 @@
import saveDialog from "./product_check.vue"; import saveDialog from "./product_check.vue";
export default { export default {
name: "mioitem", name: "mioitem",
emits: ["success", "closed"],
props: {
ftestWork: {
type: String,
default: "",
},
type: {
type: String,
default: "",
},
},
components: { components: {
saveDialog, saveDialog,
}, },
@ -318,10 +337,11 @@ export default {
apiObj: null, apiObj: null,
params: {}, params: {},
formTableData: [], formTableData: [],
ftestWork: "", // ftestWork: "",
type: "", // type: "",
userList: [], userList: [],
workObj: {}, workObj: {},
visible: false,
}; };
}, },
watch: { watch: {
@ -332,8 +352,8 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
that.type = that.$route.query.type; // that.type = that.$route.query.type;
that.ftestWork = that.$route.query.ftestWork; // that.ftestWork = that.$route.query.ftestWork;
that.addTemplate.ftest_work = that.ftestWork; that.addTemplate.ftest_work = that.ftestWork;
that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => { that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => {
that.workObj = res; that.workObj = res;
@ -345,6 +365,9 @@ export default {
that.getUserList(that.ftestWork); that.getUserList(that.ftestWork);
}, },
methods: { methods: {
open() {
this.visible = true;
},
// //
getTestItem(tag, ftestWork) { getTestItem(tag, ftestWork) {
let that = this; let that = this;
@ -366,7 +389,9 @@ export default {
// //
getUserList() { getUserList() {
let that = this; let that = this;
this.$API.system.user.list.req({ page: 0 }).then((res) => { this.$API.system.user.list
.req({ page: 0, belong_dept__name: "检验管理部" })
.then((res) => {
that.userList = res; that.userList = res;
}); });
}, },

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog <el-dialog
title="首件检验任务" title="成品检验任务"
v-model="visible" v-model="visible"
:size="1000" :size="1000"
destroy-on-close destroy-on-close
@ -20,21 +20,26 @@
<el-select <el-select
v-model="form.batch" v-model="form.batch"
placeholder="物料批次" placeholder="物料批次"
clearable style="width:100%" clearable
style="width: 100%"
@change="handleChange" @change="handleChange"
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.id" :key="item.id"
:label="item.batch" :label="item.batch"
:value="item.id"> :value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="总数"> <el-form-item label="总数">
<el-input v-model="form.count" disabled></el-input> <el-input
v-model="form.count"
disabled
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
@ -43,7 +48,7 @@
v-model="form.test_date" v-model="form.test_date"
type="date" type="date"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
style="width:100%" style="width: 100%"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -51,7 +56,9 @@
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button> <el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
</el-container> </el-container>
@ -63,11 +70,22 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
form: { form: {},
},
rules: { rules: {
test_date: [{required: true, message: "请选择检验日期", trigger: "blur"}], test_date: [
batch: [{required: true, message: "请选择物料批次", trigger: "blur"}] {
required: true,
message: "请选择检验日期",
trigger: "blur",
},
],
batch: [
{
required: true,
message: "请选择物料批次",
trigger: "blur",
},
],
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,
@ -87,17 +105,19 @@ export default {
return this; return this;
}, },
// //
getMaterialBatch(){ getMaterialBatch() {
let that = this; let that = this;
this.$API.inm.warehouse.batch.req({page:0,material__type:10,count__gte:0}).then(res=>{ this.$API.inm.warehouse.batch
.req({ page: 0, material__type: 10, count__gte: 0 })
.then((res) => {
that.options = res; that.options = res;
}); });
}, },
handleChange(val){ handleChange(val) {
let that = this; let that = this;
console.log(val) console.log(val);
that.options.forEach(item => { that.options.forEach((item) => {
if(item.id==val){ if (item.id == val) {
that.form.count = item.count; that.form.count = item.count;
that.form.batch = item.batch; that.form.batch = item.batch;
that.form.material = item.material; that.form.material = item.material;
@ -111,21 +131,24 @@ export default {
this.isSaveing = true; this.isSaveing = true;
try { try {
if (this.mode == "add") { if (this.mode == "add") {
this.$API.qm.ftestwork.create.req(this.form).then(res => { this.$API.qm.ftestwork.create
.req(this.form)
.then((res) => {
this.isSaveing = false; this.isSaveing = false;
this.visible = false; this.visible = false;
this.$emit("success"); this.$emit("success");
this.$message.success("操作成功"); this.$message.success("操作成功");
}); });
} else if (this.mode == "edit") { } else if (this.mode == "edit") {
this.$API.qm.ftestwork.update.req(this.form.id,this.form).then(res => { this.$API.qm.ftestwork.update
.req(this.form.id, this.form)
.then((res) => {
this.isSaveing = false; this.isSaveing = false;
this.visible = false; this.visible = false;
this.$emit("success"); this.$emit("success");
this.$message.success("操作成功"); this.$message.success("操作成功");
}); });
} }
} catch (err) { } catch (err) {
// //
this.isSaveing = false; this.isSaveing = false;
@ -137,7 +160,7 @@ export default {
// //
setData(data) { setData(data) {
Object.assign(this.form, data); Object.assign(this.form, data);
this.form.test_group = this.form.split(',') this.form.test_group = this.form.split(",");
}, },
// //
setFilters(filters) { setFilters(filters) {
@ -148,5 +171,4 @@ export default {
}; };
</script> </script>
<style> <style></style>
</style>

View File

@ -2,15 +2,37 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.create'">新增</el-button> <el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'order.create'"
>新增</el-button
>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input> <el-input
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> v-model="query.search"
placeholder="名称"
clearable
style="margin-right: 5px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query"> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:query="query"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="订单编号" prop="number"> <el-table-column label="订单编号" prop="number">
</el-table-column> </el-table-column>
@ -19,34 +41,72 @@
{{ stateOption[scope.row.state] }} {{ stateOption[scope.row.state] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户" prop="customer_name" show-overflow-tooltip> <el-table-column
label="客户"
prop="customer_name"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="所属合同" prop="contract_number" show-overflow-tooltip> <el-table-column
label="所属合同"
prop="contract_number"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date"> <el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column> </el-table-column>
<el-table-column label="提交时间" prop="submit_time" width="160"> <el-table-column
label="提交时间"
prop="submit_time"
width="160"
>
</el-table-column> </el-table-column>
<el-table-column label="创建人" prop="create_by_name"> <el-table-column label="创建人" prop="create_by_name">
</el-table-column> </el-table-column>
<el-table-column label="备注"> <el-table-column label="备注">
<template #default="scope">{{ scope.row.description }}</template> <template #default="scope">{{
scope.row.description
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200"> <el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)"> <el-button
link
type="primary"
@click="table_detail(scope.row)"
>
详情 详情
</el-button> </el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'order.update'" <el-button
v-if="scope.row.state == 10"> link
type="primary"
@click="table_submit(scope.row)"
v-auth="'order.update'"
v-if="scope.row.state == 10"
>
提交 提交
</el-button> </el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'order.submit'" <el-button
v-if="scope.row.state == 10"> link
type="primary"
@click="table_edit(scope.row)"
v-auth="'order.submit'"
v-if="scope.row.state == 10"
>
编辑 编辑
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'" <el-button
v-if="scope.row.state == 10"> link
type="danger"
@click="table_del(scope.row)"
v-auth="'order.delete'"
v-if="scope.row.state == 10"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -54,33 +114,48 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" <save-dialog
@closed="dialog.save = false"></save-dialog> v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<detail-dialog
v-model="dialog.detail"
:orderId="orderId"
ref="detailDialogs"
@closed="dialog.detail = false"
>
</detail-dialog>
</template> </template>
<script> <script>
import saveDialog from "./order_form.vue"; import saveDialog from "./order_form.vue";
import detailDialog from "./orderitem.vue";
export default { export default {
name: "rparty", name: "rparty",
components: { components: {
saveDialog, saveDialog,
detailDialog,
}, },
data() { data() {
return { return {
dialog: { dialog: {
save: false, save: false,
detail: false,
}, },
apiObj: this.$API.sam.order.list, apiObj: this.$API.sam.order.list,
query: { query: {
page: 1, page: 1,
page_size: 20 page_size: 20,
}, },
selection: [], selection: [],
stateOption: { stateOption: {
10: '创建中', 10: "创建中",
20: '已提交', 20: "已提交",
30: '进行中', 30: "进行中",
40: '已交付', 40: "已交付",
}, },
orderId: "",
}; };
}, },
methods: { methods: {
@ -99,36 +174,43 @@ export default {
}); });
}, },
table_submit(row) { table_submit(row) {
this.$API.sam.order.submit.req(row.id).then((res) => { this.$API.sam.order.submit
.req(row.id)
.then((res) => {
this.$message.success("提交成功"); this.$message.success("提交成功");
this.handleQuery(); this.handleQuery();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}, },
// //
table_detail(row) { table_detail(row) {
this.$router.push({ this.orderId = row.id;
name: "samOrderitem", this.dialog.detail = true;
query: { order: row.id } this.$nextTick(() => {
this.$refs.detailDialogs.open();
}); });
}, },
// //
async table_del(row) { async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.sam.order.delete.req(row.id).then((res) => { .then(() => {
this.$API.sam.order.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
if (mode == "add") { if (mode == "add") {
@ -138,7 +220,7 @@ export default {
} }
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};

View File

@ -1,26 +1,59 @@
<template> <template>
<el-drawer
v-model="visible"
title="订单详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px"> <div style="padding: 8px">
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="hover"> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions> <el-descriptions>
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item> <el-descriptions-item label="订单编号">{{
<el-descriptions-item label="客户">{{ orderObj.customer_name }}</el-descriptions-item> orderObj.number
<el-descriptions-item label="订单状态">{{ orderObj.state }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{ orderObj.delivery_date }}</el-descriptions-item> <el-descriptions-item label="客户">{{
orderObj.customer_name
}}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{
orderObj.state
}}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{
orderObj.delivery_date
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
</div> </div>
<div style="height:8px"></div> <div style="height: 8px"></div>
<div> <div>
<el-card style="width: 100%" header="订单明细" shadow="hover"> <el-card style="width: 100%" header="订单明细" shadow="hover">
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'order.update'"></el-button> <el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'order.update'"
></el-button>
</div> </div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination> <scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="所需产品" prop="material" show-overflow-tooltip> <el-table-column
label="所需产品"
prop="material"
show-overflow-tooltip
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span> <span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="关联订单" prop="order" show-overflow-tooltip> <!-- <el-table-column label="关联订单" prop="order" show-overflow-tooltip>
@ -30,17 +63,37 @@
</el-table-column> --> </el-table-column> -->
<el-table-column label="所需数量" prop="count"> <el-table-column label="所需数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="已交货数量" prop="delivered_count"> <el-table-column
label="已交货数量"
prop="delivered_count"
>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip> <el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100px"> <el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope"> <template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'order.update'"> <el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'order.update'"
>
编辑 编辑
</el-link> </el-link>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'"> <el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'order.delete'"
>
删除 删除
</el-link> </el-link>
</template> </template>
@ -49,8 +102,14 @@
</el-card> </el-card>
</div> </div>
</div> </div>
<save-dialog v-if="dialog.save" ref="saveDialog" :orderId="orderId" @success="handleSaveSuccess" </el-drawer>
@closed="dialog.save = false"></save-dialog> <save-dialog
v-if="dialog.save"
ref="saveDialog"
:orderId="orderId"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template> </template>
<script> <script>
import saveDialog from "./orderitem_form.vue"; import saveDialog from "./orderitem_form.vue";
@ -59,6 +118,12 @@ export default {
components: { components: {
saveDialog, saveDialog,
}, },
props: {
orderId: {
type: String,
default: "",
},
},
data() { data() {
return { return {
dialog: { dialog: {
@ -66,28 +131,29 @@ export default {
}, },
apiObj: null, apiObj: null,
params: {}, params: {},
orderId: '',
orderObj: {}, orderObj: {},
selection: [], selection: [],
state_: { state_: {
10: '完好', 10: "完好",
20: '限用', 20: "限用",
30: '在修', 30: "在修",
40: '禁用', 40: "禁用",
}, },
visible: false,
}; };
}, },
mounted() { mounted() {},
this.orderId = this.$route.query.order; methods: {
this.params.order = this.$route.query.order; open() {
this.visible = true;
this.params.order = this.orderId;
this.apiObj = this.$API.sam.orderitem.list; this.apiObj = this.$API.sam.orderitem.list;
this.getOrder(); this.getOrder();
}, },
methods: {
getOrder() { getOrder() {
this.$API.sam.order.item.req(this.orderId).then((res) => { this.$API.sam.order.item.req(this.orderId).then((res) => {
this.orderObj = res; this.orderObj = res;
}) });
}, },
// //
table_add() { table_add() {
@ -114,14 +180,19 @@ export default {
table_del(row) { table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.sam.orderitem.delete.req(row.id).then((res) => { .then(() => {
this.$API.sam.orderitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
@ -132,7 +203,7 @@ export default {
} }
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query);
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};

View File

@ -70,17 +70,13 @@
label="物料名" label="物料名"
prop="name" prop="name"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column label="型号" prop="model">
label="型号" </el-table-column>
prop="model" <el-table-column label="规格" prop="specification">
></el-table-column> </el-table-column>
<el-table-column
label="规格"
prop="specification"
></el-table-column>
<el-table-column <el-table-column
label="库存总数" label="库存总数"
prop="count" prop="count_mb"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="周预估值" label="周预估值"
@ -107,7 +103,7 @@
> >
{{ {{
Math.floor( Math.floor(
scope.row.count / scope.row.count_mb /
scope.row.week_esitimate_consume scope.row.week_esitimate_consume
) * 7 ) * 7
}} }}
@ -337,7 +333,9 @@ export default {
}, },
// //
weekcountChange(row) { weekcountChange(row) {
let obj = { week_esitimate_consume: row.week_esitimate_consume }; let obj = {
week_esitimate_consume: row.week_esitimate_consume,
};
this.$API.mtm.material.setWeekConsume this.$API.mtm.material.setWeekConsume
.req(row.id, obj) .req(row.id, obj)
.then((res) => { .then((res) => {

View File

@ -257,11 +257,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('棒') > -1"
>
<el-form-item label="断裂"> <el-form-item label="断裂">
<el-input-number <el-input-number
v-model="form.count_n_dl" v-model="form.count_n_dl"
@ -276,11 +272,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('棒') > -1"
>
<el-form-item label="气泡"> <el-form-item label="气泡">
<el-input-number <el-input-number
v-model="form.count_n_qp" v-model="form.count_n_qp"
@ -295,11 +287,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('棒') > -1"
>
<el-form-item label="不亮"> <el-form-item label="不亮">
<el-input-number <el-input-number
v-model="form.count_n_bl" v-model="form.count_n_bl"
@ -314,11 +302,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('棒') > -1"
>
<el-form-item label="横纹"> <el-form-item label="横纹">
<el-input-number <el-input-number
v-model="form.count_n_hw" v-model="form.count_n_hw"
@ -333,11 +317,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('棒') > -1"
>
<el-form-item label="有皮"> <el-form-item label="有皮">
<el-input-number <el-input-number
v-model="form.count_n_yp" v-model="form.count_n_yp"
@ -352,11 +332,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('棒') > -1"
>
<el-form-item label="爆皮"> <el-form-item label="爆皮">
<el-input-number <el-input-number
v-model="form.count_n_bp" v-model="form.count_n_bp"
@ -371,11 +347,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('棒') > -1"
>
<el-form-item label="色差"> <el-form-item label="色差">
<el-input-number <el-input-number
v-model="form.count_n_sc" v-model="form.count_n_sc"
@ -390,11 +362,37 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12" <el-form-item label="直径大">
:sm="24" <el-input-number
v-if="material_name.indexOf('管') > -1" v-model="form.count_n_zjd"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="直径大"
@change="countNotOkSun"
> >
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="直径小">
<el-input-number
v-model="form.count_n_zjx"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="直径小"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气线"> <el-form-item label="气线">
<el-input-number <el-input-number
v-model="form.count_n_qx" v-model="form.count_n_qx"
@ -409,11 +407,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('管') > -1"
>
<el-form-item label="结石"> <el-form-item label="结石">
<el-input-number <el-input-number
v-model="form.count_n_js" v-model="form.count_n_js"
@ -428,11 +422,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('管') > -1"
>
<el-form-item label="椭圆度大"> <el-form-item label="椭圆度大">
<el-input-number <el-input-number
v-model="form.count_n_tydd" v-model="form.count_n_tydd"
@ -447,11 +437,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('管') > -1"
>
<el-form-item label="水雾"> <el-form-item label="水雾">
<el-input-number <el-input-number
v-model="form.count_n_sw" v-model="form.count_n_sw"
@ -466,11 +452,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('管') > -1"
>
<el-form-item label="壁厚偏差大"> <el-form-item label="壁厚偏差大">
<el-input-number <el-input-number
v-model="form.count_n_bhpcd" v-model="form.count_n_bhpcd"
@ -485,11 +467,7 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :md="12" :sm="24">
:md="12"
:sm="24"
v-if="material_name.indexOf('管') > -1"
>
<el-form-item label="弯"> <el-form-item label="弯">
<el-input-number <el-input-number
v-model="form.count_n_wq" v-model="form.count_n_wq"
@ -526,12 +504,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row v-if="material_name=='光纤预制棒'"> -->
<!-- <el-row v-if="material_name.indexOf('棒')>-1">
</el-row> -->
<!-- <el-row v-if="material_name=='光纤预制管'"> -->
<!-- <el-row v-if="material_name.indexOf('管')>-1">
</el-row> -->
</el-form> </el-form>
<el-footer> <el-footer>
<el-button type="primary" v-loading="isSaveing" @click="submit" <el-button type="primary" v-loading="isSaveing" @click="submit"
@ -575,6 +547,7 @@ export default {
count_n_zdd: 0, // count_n_zdd: 0, //
count_n_d: 0, // count_n_d: 0, //
count_n_zw: 0, // count_n_zw: 0, //
count_n_tydd: 0, // 8
// //
count_n_dl: 0, // count_n_dl: 0, //
count_n_qp: 0, // count_n_qp: 0, //
@ -583,13 +556,14 @@ export default {
count_n_yp: 0, // count_n_yp: 0, //
count_n_bp: 0, // count_n_bp: 0, //
count_n_sc: 0, // count_n_sc: 0, //
count_n_zjx: 0, //
count_n_zjd: 0, // 9
// //
count_n_qx: 0, //线 count_n_qx: 0, //线
count_n_js: 0, // count_n_js: 0, //
count_n_tydd: 0, //
count_n_sw: 0, // count_n_sw: 0, //
count_n_bhpcd: 0, // count_n_bhpcd: 0, //
count_n_wq: 0, // count_n_wq: 0, // 5
handle_user: "", handle_user: "",
}, },
@ -615,11 +589,6 @@ export default {
this.getEquipment(); this.getEquipment();
this.getWMaterial(); this.getWMaterial();
this.getShiftOptions(); this.getShiftOptions();
// let date = new Date();
// let year = date.getFullYear();
// let month = date.getMonth() + 1;
// let day = date.getDate();
// this.form.handle_date = year + "-" + month + "-" + day;
this.form.material_out = this.material_out; this.form.material_out = this.material_out;
this.form.handle_date = this.handle_date; this.form.handle_date = this.handle_date;
this.form.mgroup = this.mgroup; this.form.mgroup = this.mgroup;
@ -656,7 +625,6 @@ export default {
if (res.length > 0) { if (res.length > 0) {
let arr = []; let arr = [];
res.forEach((item) => { res.forEach((item) => {
// if(item.count>0){}
arr.push(item.batch); arr.push(item.batch);
}); });
this.wmaterialOptions = arr; this.wmaterialOptions = arr;
@ -710,6 +678,8 @@ export default {
Number(this.form.count_n_yp) + Number(this.form.count_n_yp) +
Number(this.form.count_n_bp) + Number(this.form.count_n_bp) +
Number(this.form.count_n_sc) + Number(this.form.count_n_sc) +
Number(this.form.count_n_zjd) +
Number(this.form.count_n_zjx) +
Number(this.form.count_n_qx) + Number(this.form.count_n_qx) +
Number(this.form.count_n_js) + Number(this.form.count_n_js) +
Number(this.form.count_n_tydd) + Number(this.form.count_n_tydd) +

View File

@ -296,14 +296,25 @@
</el-container> </el-container>
</el-main> </el-main>
</el-container> </el-container>
<showDrawer
ref="showDrawer"
v-if="visibleDrawer"
:mtaskId="mtaskId"
@closed="visibleDrawer = false"
>
</showDrawer>
</template> </template>
<script> <script>
import showDrawer from "./mlog_dept6_detail.vue";
export default { export default {
components: {
showDrawer,
},
data() { data() {
return { return {
dialog: { dialog: {
save: false, detail: false,
}, },
apiObj: null, apiObj: null,
query: {}, query: {},
@ -337,6 +348,8 @@ export default {
queryMtask: { queryMtask: {
state__in: "", state__in: "",
}, },
mtaskId: "",
visibleDrawer: false,
}; };
}, },
mounted() { mounted() {
@ -364,16 +377,10 @@ export default {
}, },
// //
itemClick(row) { itemClick(row) {
// this.currentMtask = row; this.mtaskId = row.id;
// this.mgroup = row.mgroup; this.visibleDrawer = true;
// this.mtask = row.id; this.$nextTick(() => {
// this.material_out = row.material_out_.id; this.$refs.showDrawer.open();
// this.handledate = row.start_date;
// this.paramsMlog.mtask = this.mtask;
// this.apiObjMlog = this.$API.wpm.mlog.list;
this.$router.push({
name: "mlogDept6Detail",
query: { mtaskId: row.id },
}); });
}, },
handleQueryMtask() { handleQueryMtask() {

View File

@ -1,5 +1,12 @@
<template> <template>
<el-container> <el-container>
<el-drawer
v-model="visible"
title="进度详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<!-- 任务信息 --> <!-- 任务信息 -->
<el-header style="height: 20%; padding: 0"> <el-header style="height: 20%; padding: 0">
<el-card style="width: 100%; height: 100%"> <el-card style="width: 100%; height: 100%">
@ -9,83 +16,218 @@
</div> </div>
</template> </template>
<el-descriptions> <el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item> <el-descriptions-item label="任务编号">{{
currentMtask.number
}}</el-descriptions-item>
<el-descriptions-item label="产品全称"> <el-descriptions-item label="产品全称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_name }}</span> <span v-if="currentMtask.material_out_">{{
currentMtask.material_out_name
}}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="计划数量">{{ currentMtask.count }}</el-descriptions-item> <el-descriptions-item label="计划数量">{{
<el-descriptions-item label="计划日期">{{ currentMtask.start_date }}</el-descriptions-item> currentMtask.count
<el-descriptions-item label="合格数">{{ currentMtask.count_ok }}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="计划日期">{{
currentMtask.start_date
}}</el-descriptions-item>
<el-descriptions-item label="合格数">{{
currentMtask.count_ok
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
</el-header> </el-header>
<!-- 日志 --> <!-- 日志 -->
<el-main style="padding: 0;"> <el-main style="padding: 0">
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog" <el-button
v-if="currentMtask && currentMtask.state == 20" v-auth="'mlog.create'">新增</el-button> type="primary"
icon="el-icon-plus"
@click="addMlog"
v-if="currentMtask && currentMtask.state == 20"
v-auth="'mlog.create'"
>新增</el-button
>
</div> </div>
</el-header> </el-header>
<el-main style="padding: 0;"> <el-main style="padding: 0">
<scTable ref="mtaskMlogs" :apiObj="apiObj" row-key="id" :params="params" stripe hidePagination hideDo> <scTable
<el-table-column label="工序" prop="mgroup_name"></el-table-column> ref="mtaskMlogs"
<el-table-column label="产品名称" prop="material_out_" min-width="120"> :apiObj="apiObj"
row-key="id"
:params="params"
stripe
hidePagination
hideDo
>
<el-table-column
label="工序"
prop="mgroup_name"
></el-table-column>
<el-table-column
label="产品名称"
prop="material_out_"
min-width="120"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.material_out_">{{scope.row.material_out_.name}}</span> <span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次号" prop="batch"></el-table-column> <el-table-column
<el-table-column label="加工设备" prop="equipment_name"></el-table-column> label="批次号"
<el-table-column label="领用数量" prop="count_use"> </el-table-column> prop="batch"
<el-table-column label="加工数量" prop="count_real"> </el-table-column> ></el-table-column>
<el-table-column label="合格数量" prop="count_ok"></el-table-column> <el-table-column
label="加工设备"
prop="equipment_name"
></el-table-column>
<el-table-column label="领用数量" prop="count_use">
</el-table-column>
<el-table-column label="加工数量" prop="count_real">
</el-table-column>
<el-table-column
label="合格数量"
prop="count_ok"
></el-table-column>
<el-table-column label="不合格数量" align="center"> <el-table-column label="不合格数量" align="center">
<el-table-column prop="count_n_hs" label="划伤" /> <el-table-column
<el-table-column prop="count_n_zs" label="挫伤" /> prop="count_n_hs"
<el-table-column prop="count_n_zz" label="杂质" /> label="划伤"
<el-table-column prop="count_n_tw" label="条纹" /> />
<el-table-column prop="count_n_zdd" label="锥度大" /> <el-table-column
prop="count_n_zs"
label="挫伤"
/>
<el-table-column
prop="count_n_zz"
label="杂质"
/>
<el-table-column
prop="count_n_tw"
label="条纹"
/>
<el-table-column
prop="count_n_zdd"
label="锥度大"
/>
<el-table-column prop="count_n_d" label="短" /> <el-table-column prop="count_n_d" label="短" />
<!-- --> <!-- -->
<!-- <template v-if="currentMtask.material_out_.name=='光纤预制棒'"> --> <!-- <template v-if="currentMtask.material_out_.name=='光纤预制棒'"> -->
<template v-if="material_name.indexOf('棒')>-1"> <template
<el-table-column prop="count_n_dl" label="断裂" /> v-if="material_name.indexOf('棒') > -1"
<el-table-column prop="count_n_qp" label="气泡"/> >
<el-table-column prop="count_n_bl" label="不亮" /> <el-table-column
<el-table-column prop="count_n_hw" label="横纹" /> prop="count_n_dl"
<el-table-column prop="count_n_yp" label="有皮" /> label="断裂"
<el-table-column prop="count_n_bp" label="爆皮" /> />
<el-table-column prop="count_n_sc" label="色差" /> <el-table-column
prop="count_n_qp"
label="气泡"
/>
<el-table-column
prop="count_n_bl"
label="不亮"
/>
<el-table-column
prop="count_n_hw"
label="横纹"
/>
<el-table-column
prop="count_n_yp"
label="有皮"
/>
<el-table-column
prop="count_n_bp"
label="爆皮"
/>
<el-table-column
prop="count_n_sc"
label="色差"
/>
</template> </template>
<!-- --> <!-- -->
<!-- <template v-if="currentMtask.material_out_.name=='光纤预制管'"> --> <!-- <template v-if="currentMtask.material_out_.name=='光纤预制管'"> -->
<template v-if="material_name.indexOf('管')>-1"> <template
<el-table-column prop="count_n_qx" label="气线"/> v-if="material_name.indexOf('管') > -1"
<el-table-column prop="count_n_js" label="结石" /> >
<el-table-column prop="count_n_tydd" label="椭圆度大" /> <el-table-column
<el-table-column prop="count_n_sw" label="水雾" /> prop="count_n_qx"
<el-table-column prop="count_n_bhpcd" label="壁厚偏差大" /> label="气线"
<el-table-column prop="count_n_wq" label="弯" /> />
<el-table-column
prop="count_n_js"
label="结石"
/>
<el-table-column
prop="count_n_tydd"
label="椭圆度大"
/>
<el-table-column
prop="count_n_sw"
label="水雾"
/>
<el-table-column
prop="count_n_bhpcd"
label="壁厚偏差大"
/>
<el-table-column
prop="count_n_wq"
label="弯"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作人" prop="update_by_name"></el-table-column> <el-table-column
<el-table-column label="操作" fixed="right" width="130"> label="操作人"
prop="update_by_name"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
width="130"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'mlog.update'" <el-button
v-if="scope.row.submit_time == null">编辑 link
type="primary"
@click="table_edit(scope.row)"
v-auth="'mlog.update'"
v-if="scope.row.submit_time == null"
>编辑
</el-button> </el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'" <el-button
v-if="scope.row.submit_time == null">删除 link
type="danger"
@click="table_del(scope.row)"
v-auth="'mlog.delete'"
v-if="scope.row.submit_time == null"
>删除
</el-button> </el-button>
<el-button link type="primary" @click="mlog_submit(scope.row)" v-auth="'mlog.submit'" <el-button
v-if="scope.row.submit_time == null" :loading="mlogHandleLoading">提交 link
type="primary"
@click="mlog_submit(scope.row)"
v-auth="'mlog.submit'"
v-if="scope.row.submit_time == null"
:loading="mlogHandleLoading"
>提交
</el-button> </el-button>
<el-button link type="danger" @click="mlog_revert(scope.row)" v-auth="'mlog.submit'" <el-button
v-if="scope.row.submit_time != null" :loading="mlogHandleLoading">撤回 link
type="danger"
@click="mlog_revert(scope.row)"
v-auth="'mlog.submit'"
v-if="scope.row.submit_time != null"
:loading="mlogHandleLoading"
>撤回
</el-button> </el-button>
<el-button link type="success" @click="table_show(scope.row)"> <el-button
link
type="success"
@click="table_show(scope.row)"
>
日志记录 日志记录
</el-button> </el-button>
</template> </template>
@ -94,9 +236,24 @@
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
<save-dialog v-if="dialogSave" ref="saveDialog" :mtask="mtask" :mgroup="mgroup" :handledate="handledate" </el-drawer>
:material_out="material_out" :material_name="material_name" @success="handleSaveSuccess" @closed="dialogSave = false"></save-dialog> <save-dialog
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false"> v-if="dialogSave"
ref="saveDialog"
:mtask="mtask"
:mgroup="mgroup"
:handledate="handledate"
:material_out="material_out"
:material_name="material_name"
@success="handleSaveSuccess"
@closed="dialogSave = false"
></save-dialog>
<showDrawer
ref="showDrawer"
v-if="visibleDrawer"
:mlogId="mlogId"
@closed="visibleDrawer = false"
>
</showDrawer> </showDrawer>
</el-container> </el-container>
</template> </template>
@ -105,7 +262,14 @@ import saveDialog from "./mlog6_form.vue";
import showDrawer from "./mlog_drawer.vue"; import showDrawer from "./mlog_drawer.vue";
export default { export default {
components: { components: {
saveDialog, showDrawer saveDialog,
showDrawer,
},
props: {
mtaskId: {
type: String,
default: "",
},
}, },
data() { data() {
return { return {
@ -114,33 +278,37 @@ export default {
save: false, save: false,
}, },
state_: { state_: {
10: '创建中', 10: "创建中",
20: '已下达', 20: "已下达",
30: '生产中', 30: "生产中",
40: '已提交', 40: "已提交",
}, },
hideDo: true, hideDo: true,
currentMtask: {}, currentMtask: {},
apiObj: null, apiObj: null,
params: { params: {
mtask: '' mtask: "",
}, },
mlogId: '', mlogId: "",
handledate: '', handledate: "",
visible: false,
dialogSave: false, dialogSave: false,
visibleDrawer: false, visibleDrawer: false,
} };
}, },
mounted() { mounted() {
this.mtaskId = this.$route.query.mtaskId; console.log(this.mtaskId);
console.log(this.$route.query) this.getMtask();
debugger;
this.getMtask(this.mtaskId);
}, },
methods: { methods: {
getMtask(id) { open() {
this.visible = true;
this.params.mtask = this.mtaskId;
return this;
},
getMtask() {
let that = this; let that = this;
this.$API.pm.mtask.item.req(id).then(res => { this.$API.pm.mtask.item.req(that.mtaskId).then((res) => {
that.currentMtask = res; that.currentMtask = res;
this.mgroup = res.mgroup; this.mgroup = res.mgroup;
this.mtask = res.id; this.mtask = res.id;
@ -150,7 +318,7 @@ export default {
this.params.mtask = this.mtaskId; this.params.mtask = this.mtaskId;
this.apiObj = this.$API.wpm.mlog.list; this.apiObj = this.$API.wpm.mlog.list;
}) });
}, },
table_show(row) { table_show(row) {
this.visibleDrawer = true; this.visibleDrawer = true;
@ -184,15 +352,20 @@ export default {
table_del(row) { table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { })
this.$API.wpm.mlog.delete.req(row.id).then((res) => { .then(() => {
this.$API.wpm.mlog.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.mtaskMlogs.refresh(); this.$refs.mtaskMlogs.refresh();
return res; return res;
}).catch((err) => { })
.catch((err) => {
return err; return err;
}); });
}).catch(() => { }); })
.catch(() => {});
}, },
// //
@ -203,23 +376,33 @@ export default {
this.query = {}; this.query = {};
}, },
mlog_submit(row) { mlog_submit(row) {
this.$API.wpm.mlog.submit.req(row.id).then(res => { let that = this;
this.$message.success('操作成功') this.$API.wpm.mlog.submit
this.getMtask(row.mtask) .req(row.id)
}).catch(err => { }) .then((res) => {
that.$message.success("操作成功");
that.getMtask(that.mtask);
that.$refs.mtaskMlogs.refresh();
})
.catch((err) => {});
}, },
mlog_revert(row) { mlog_revert(row) {
this.mlogHandleLoading = true; let that = this;
this.$API.wpm.mlog.revert.req(row.id).then(res => { that.mlogHandleLoading = true;
this.$message.success("撤回成功"); that.$API.wpm.mlog.revert
this.getMtask(row.mtask) .req(row.id)
this.mlogHandleLoading = false; .then((res) => {
}).catch(e => { that.$message.success("撤回成功");
this.mlogHandleLoading = false; that.$refs.mtaskMlogs.refresh();
that.getMtask(that.mtask);
that.mlogHandleLoading = false;
}) })
.catch((e) => {
that.mlogHandleLoading = false;
});
}, },
} },
} };
</script> </script>
<style scoped> <style scoped>
.tabsHeader { .tabsHeader {
@ -227,15 +410,15 @@ export default {
position: absolute; position: absolute;
right: 20px; right: 20px;
margin-top: 4px; margin-top: 4px;
z-index: 100 z-index: 100;
} }
.right-panel>*+* { .right-panel > * + * {
margin-left: 10px; margin-left: 10px;
} }
.el-main.nopadding { .el-main.nopadding {
padding: 0 20px 0 20px padding: 0 20px 0 20px;
} }
.tableTitle { .tableTitle {