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.elec_consume_unit; item.mpoint_nickname
);
if (that.tableDatas[index_m]) {
that.tableDatas[index_m][4] =
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) => { response.forEach((item) => {
console.log(item.ep_monitored_name); let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
let ind = item.hour; let ind = item.hour; //xAxis
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.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: [],
},
{
name: "循环风机",
type: "bar",
data: [],
},
],
}, },
mpointList: [], mpoints: [],
}; };
}, },
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++) {
seriesData.push([]);
}
response.forEach((item) => { response.forEach((item) => {
console.log(item.ep_monitored_name); let index = that.mpoints.indexOf(item.mpoint_nickname); //mpoint
let ind = item.hour; let ind = item.hour; //xAxis
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.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

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

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

View File

@ -1,175 +1,189 @@
<template> <template>
<div style="padding: 8px"> <el-drawer
<div> v-model="visible"
<el-card style="width: 100%" header="基本信息" shadow="hover"> title="出入库记录"
<el-descriptions> :size="'90%'"
<el-descriptions-item label="编号">{{ destroy-on-close
mioObj.number @closed="$emit('closed')"
}}</el-descriptions-item> >
<el-descriptions-item label="出入库类型">{{ <div style="padding: 8px">
typeDict[mioObj.type] <div>
}}</el-descriptions-item> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions-item label="状态">{{ <el-descriptions>
stateDict[mioObj.state] <el-descriptions-item label="编号">{{
}}</el-descriptions-item> mioObj.number
<el-descriptions-item label="部门/车间">{{ }}</el-descriptions-item>
mioObj.belong_dept_name <el-descriptions-item label="出入库类型">{{
}}</el-descriptions-item> typeDict[mioObj.type]
<el-descriptions-item label="执行人">{{ }}</el-descriptions-item>
mioObj.do_user_name <el-descriptions-item label="状态">{{
}}</el-descriptions-item> stateDict[mioObj.state]
<el-descriptions-item label="创建时间">{{ }}</el-descriptions-item>
mioObj.create_time <el-descriptions-item label="部门/车间">{{
}}</el-descriptions-item> mioObj.belong_dept_name
<el-descriptions-item }}</el-descriptions-item>
label="采购订单" <el-descriptions-item label="执行人">{{
v-if="mioObj.type == 'pur_in'" mioObj.do_user_name
>{{ mioObj.order_number }}</el-descriptions-item }}</el-descriptions-item>
> <el-descriptions-item label="创建时间">{{
<el-descriptions-item mioObj.create_time
label="供应商" }}</el-descriptions-item>
v-if="mioObj.type == 'pur_in'" <el-descriptions-item
>{{ mioObj.supplier_name }}</el-descriptions-item label="采购订单"
> v-if="mioObj.type == 'pur_in'"
<el-descriptions-item >{{ mioObj.order_number }}</el-descriptions-item
label="销售订单" >
v-if="mioObj.type == 'sale_out'" <el-descriptions-item
>{{ mioObj.pu_order_number }}</el-descriptions-item label="供应商"
> v-if="mioObj.type == 'pur_in'"
<el-descriptions-item >{{ mioObj.supplier_name }}</el-descriptions-item
label="客户" >
v-if="mioObj.type == 'sale_out'" <el-descriptions-item
>{{ mioObj.customer_name }}</el-descriptions-item label="销售订单"
> v-if="mioObj.type == 'sale_out'"
</el-descriptions> >{{ mioObj.pu_order_number }}</el-descriptions-item
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10"> >
<el-descriptions-item
label="客户"
v-if="mioObj.type == 'sale_out'"
>{{ mioObj.customer_name }}</el-descriptions-item
>
</el-descriptions>
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10">
提交 提交
</el-button> --> </el-button> -->
</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 <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="table_add" @click="table_add"
v-if="mioObj.state == 10" v-if="mioObj.state == 10"
>新增</el-button >新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
hideDo
> >
</div> <el-table-column type="index" width="50" />
<scTable <el-table-column
ref="table" label="物料"
:apiObj="apiObj" prop="material"
row-key="id" show-overflow-tooltip
stripe >
:params="params" <template #default="scope"
hidePagination >{{ scope.row.material_name }}
hideDo </template>
> </el-table-column>
<el-table-column type="index" width="50" /> <el-table-column label="批次号" prop="batch">
<el-table-column </el-table-column>
label="物料" <el-table-column label="仓库" prop="warehouse_name">
prop="material" </el-table-column>
show-overflow-tooltip <el-table-column label="数量" prop="count">
> </el-table-column>
<template #default="scope" <el-table-column
>{{ scope.row.material_name }} label="组合件信息"
</template> v-if="cate == 'good'"
</el-table-column> width="300"
<el-table-column label="批次号" prop="batch"> >
</el-table-column> <template #default="scope">
<el-table-column label="仓库" prop="warehouse_name"> <div v-if="scope.row.assemb.length > 0">
</el-table-column> <div
<el-table-column label="数量" prop="count"> v-for="item in scope.row.assemb"
</el-table-column> :key="item.id"
<el-table-column >
label="组合件信息" <div>
v-if="cate == 'good'" {{ item.material_name }}
width="300" <span
> style="
<template #default="scope"> color: gray;
<div v-if="scope.row.assemb.length > 0"> font-size: 12px;
<div "
v-for="item in scope.row.assemb" >:</span
:key="item.id" >{{ item.batch }}
> <span
<div> style="
{{ item.material_name }} color: gray;
<span font-size: 12px;
style="color: gray; font-size: 12px" "
>:</span >:</span
>{{ item.batch }} >{{ item.rate }}
<span </div>
style="color: gray; font-size: 12px"
>:</span
>{{ item.rate }}
</div> </div>
</div> </div>
</div> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="不合格数量" prop="count_notok">
<el-table-column label="不合格数量" prop="count_notok"> </el-table-column>
</el-table-column> <el-table-column
<el-table-column label="创建时间"
label="创建时间" prop="create_time"
prop="create_time" show-overflow-tooltip
show-overflow-tooltip >
> </el-table-column>
</el-table-column> <el-table-column
<el-table-column label="操作"
label="操作" fixed="right"
fixed="right" align="center"
align="center" width="100px"
width="100px" >
> <template #default="scope">
<template #default="scope"> <el-button
<el-button link
link type="primary"
type="primary" @click="table_check(scope.row)"
@click="table_check(scope.row)" v-if="
v-if=" scope.row.test_date == null &&
scope.row.test_date == null && mioObj.state == 20 &&
mioObj.state == 20 && (type == 'pur_in' ||
(type == 'pur_in' || type == 'do_in' ||
type == 'do_in' || type == 'other_in')
type == 'other_in') "
" v-auth="'mioitem.test'"
v-auth="'mioitem.test'" >
> 检验
检验 </el-button>
</el-button> <el-button
<el-button link
link type="primary"
type="primary" @click="check_Show(scope.row)"
@click="check_Show(scope.row)" v-if="scope.row.test_date !== null"
v-if="scope.row.test_date !== null" >
> 查看
查看 </el-button>
</el-button> <el-button
<el-button link
link type="danger"
type="danger" @click="check_reSet(scope.row)"
@click="check_reSet(scope.row)" v-if="scope.row.test_date !== null"
v-if="scope.row.test_date !== null" >
> 撤回
撤回 </el-button>
</el-button> <el-button
<el-button link
link type="danger"
type="danger" @click="table_del(scope.row)"
@click="table_del(scope.row)" v-if="mioObj.state == 10"
v-if="mioObj.state == 10" >
> 删除
删除 </el-button>
</el-button> </template>
</template> </el-table-column>
</el-table-column> </scTable>
</scTable> </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

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

View File

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

View File

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

View File

@ -1,156 +1,233 @@
<template> <template>
<div style="padding: 8px"> <el-drawer
<div> v-model="visible"
<el-card style="width: 100%" header="基本信息" shadow="hover"> title="计划详情"
<el-descriptions> :size="'90%'"
<el-descriptions-item label="计划名称">{{ orderObj.name }}</el-descriptions-item> destroy-on-close
<el-descriptions-item label="计划编号">{{ orderObj.number }}</el-descriptions-item> @closed="$emit('closed')"
<el-descriptions-item label="计划状态">{{ stateOption[orderObj.state] }}</el-descriptions-item> >
</el-descriptions> <div style="padding: 8px">
</el-card> <div>
</div> <el-card style="width: 100%" header="基本信息" shadow="hover">
<div style="height:8px"></div> <el-descriptions>
<div> <el-descriptions-item label="计划名称">{{
<el-card style="width: 100%" header="计划明细" shadow="hover"> orderObj.name
<div> }}</el-descriptions-item>
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add" <el-descriptions-item label="计划编号">{{
v-if="orderObj.state == 10">新增</el-button> orderObj.number
</div> }}</el-descriptions-item>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination hideDo> <el-descriptions-item label="计划状态">{{
<el-table-column type="index" width="50" /> stateOption[orderObj.state]
<el-table-column label="所属物料" prop="material" show-overflow-tooltip> }}</el-descriptions-item>
<template #default="scope"> </el-descriptions>
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span> </el-card>
</template> </div>
</el-table-column> <div style="height: 8px"></div>
<el-table-column label="所属数量" prop="need_count"> <div>
</el-table-column> <el-card style="width: 100%" header="计划明细" shadow="hover">
<el-table-column label="需求日期" prop="need_date" show-overflow-tooltip> <div>
</el-table-column> <el-button
<el-table-column label="部门" prop="belong_dept_name"> type="primary"
</el-table-column> icon="el-icon-plus"
<el-table-column label="关联采购订单" prop="pu_order"> v-auth="'pu_planitem.create'"
<template #default="scope"> @click="add"
<span v-if="scope.row.pu_order"></span> v-if="orderObj.state == 10"
<span v-else></span> >新增</el-button
</template> >
</el-table-column> </div>
<el-table-column label="创建人" prop="create_by_name"> <scTable
</el-table-column> ref="table"
<el-table-column label="备注" prop="note" show-overflow-tooltip> :apiObj="apiObj"
</el-table-column> row-key="id"
<el-table-column label="操作" fixed="right" align="center" width="100px"> stripe
<template #default="scope"> :params="query"
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_planitem.update'" :query="query"
v-if="orderObj == 10"> hidePagination
编辑 hideDo
</el-button> >
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_planitem.delete'" <el-table-column type="index" width="50" />
v-if="orderObj == 10"> <el-table-column
删除 label="所属物料"
</el-button> prop="material"
</template> show-overflow-tooltip
</el-table-column> >
</scTable> <template #default="scope">
</el-card> <span v-if="scope.row.material_">
</div> {{ scope.row.material_.name }}</span
</div> >
<save-dialog v-if="dialog.save" ref="saveDialog" :puPlan="puPlan" @success="handleSaveSuccess" </template>
@closed="dialog.save = false"></save-dialog> </el-table-column>
<el-table-column label="所属数量" prop="need_count">
</el-table-column>
<el-table-column
label="需求日期"
prop="need_date"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="部门" prop="belong_dept_name">
</el-table-column>
<el-table-column label="关联采购订单" prop="pu_order">
<template #default="scope">
<span v-if="scope.row.pu_order"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column
label="备注"
prop="note"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_planitem.update'"
v-if="orderObj == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_planitem.delete'"
v-if="orderObj == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
</el-drawer>
<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";
export default { export default {
name: "rparty", name: "rparty",
components: { components: {
saveDialog, saveDialog,
}, },
data() { props: {
return { planId: {
dialog: { type: String,
save: false, default: "",
}, },
puPlan: '', },
orderObj: {}, data() {
apiObj: null, return {
query: { dialog: {
page: 1, save: false,
page_size: 20 },
}, puPlan: "",
stateOption: { orderObj: {},
10: "创建中", apiObj: null,
20: "已提交", query: {
30: "下单中", page: 1,
40: "下单完成", page_size: 20,
40: "已完成", pu_plan: "",
}, },
}; stateOption: {
}, 10: "创建中",
mounted() { 20: "已提交",
this.puPlan = this.$route.query.pu_plan; 30: "下单中",
this.query.pu_plan = this.$route.query.pu_plan; 40: "下单完成",
this.apiObj = this.$API.pum.planitem.list; 40: "已完成",
this.$refs.table.refresh(); },
this.getOrder(); visible: false,
}, };
methods: { },
getOrder() { mounted() {
this.$API.pum.plan.item.req(this.puPlan).then((res) => { this.puPlan = this.planId;
debugger; this.query.pu_plan = this.planId;
console.log(res); this.apiObj = this.$API.pum.planitem.list;
this.orderObj = res; // this.$refs.table.refresh();
}) this.getOrder();
}, },
// methods: {
add() { open() {
this.dialog.save = true; this.visible = true;
this.$nextTick(() => { },
this.$refs.saveDialog.open("add"); getOrder() {
}); this.$API.pum.plan.item.req(this.puPlan).then((res) => {
}, this.orderObj = res;
// });
table_edit(row) { },
this.dialog.save = true; //
this.$nextTick(() => { add() {
this.$refs.saveDialog.open("edit").setData(row); this.dialog.save = true;
}); this.$nextTick(() => {
}, this.$refs.saveDialog.open("add");
// });
table_show(row) { },
this.dialog.save = true; //
this.$nextTick(() => { table_edit(row) {
this.$refs.saveDialog.open("show").setData(row); this.dialog.save = true;
}); this.$nextTick(() => {
}, this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
// //
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.$message.success("删除成功"); this.$API.pum.planitem.delete
return res; .req(row.id)
}).catch((err) => { .then((res) => {
return err; this.$message.success("删除成功");
}); return res;
}).catch(() => { }); })
}, .catch((err) => {
return err;
});
})
.catch(() => {});
},
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
if (mode == "add") { if (mode == "add") {
this.$refs.table.refresh(); this.$refs.table.refresh();
} else if (mode == "edit") { } else if (mode == "edit") {
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 = {};
}, },
}, },
}; };
</script> </script>

View File

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

View File

@ -1,283 +1,291 @@
<template> <template>
<div style="padding: 8px"> <el-drawer
<div> v-model="visible"
<el-card style="width: 100%" header="基本信息" shadow="hover"> title="成品检验"
<el-descriptions> :size="'90%'"
<el-descriptions-item label="日期">{{ destroy-on-close
workObj.test_date @closed="$emit('closed')"
}}</el-descriptions-item> >
<el-descriptions-item label="批次号">{{ <div style="padding: 8px">
workObj.batch <div>
}}</el-descriptions-item> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions-item label="总数">{{ <el-descriptions>
workObj.count <el-descriptions-item label="日期">{{
}}</el-descriptions-item> workObj.test_date
</el-descriptions> }}</el-descriptions-item>
</el-card> <el-descriptions-item label="批次号">{{
</div> workObj.batch
<div style="height: 8px"></div> }}</el-descriptions-item>
<div> <el-descriptions-item label="总数">{{
<el-card style="width: 100%" header="检验记录" shadow="hover"> workObj.count
<!-- 预制棒 --> }}</el-descriptions-item>
<sc-form-table </el-descriptions>
ref="formTable" </el-card>
v-if="type == 'bang'" </div>
v-model="formTableData" <div style="height: 8px"></div>
:addTemplate="addTemplate" <div>
placeholder="暂无数据" <el-card style="width: 100%" header="检验记录" shadow="hover">
> <!-- 预制棒 -->
<el-table-column <sc-form-table
prop="val" ref="formTable"
label="抽检编号" v-if="type == 'bang'"
min-width="180" v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
> >
<template #default="scope"> <el-table-column
<!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> --> prop="val"
<el-input label="抽检编号"
:disabled="!scope.row.isEdit" min-width="180"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item0, $index) in ftestitems"
:key="item0.id"
> >
<el-table-column <template #default="scope">
prop="test_val" <!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> -->
:label="item0.name" <el-input
min-width="130" :disabled="!scope.row.isEdit"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item0, $index) in ftestitems"
:key="item0.id"
> >
<template #default="scope"> <el-table-column
<el-input-number prop="test_val"
v-model=" :label="item0.name"
scope.row.ftestitems[$index] min-width="130"
.test_val >
" <template #default="scope">
:disabled="!scope.row.isEdit" <el-input-number
:min="0" v-model="
style="width: 100%" scope.row.ftestitems[$index]
controls-position="right" .test_val
> "
</el-input-number> :disabled="!scope.row.isEdit"
</template> :min="0"
</el-table-column> style="width: 100%"
</template> controls-position="right"
</el-table-column> >
<el-table-column </el-input-number>
prop="test_val" </template>
label="合格判定" </el-table-column>
min-width="90" </template>
> </el-table-column>
<template #default="scope"> <el-table-column
<el-select prop="test_val"
v-model="scope.row.is_ok" label="合格判定"
placeholder="是否合格" min-width="90"
clearable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</template>
</el-table-column>
<el-table-column
prop="test_user"
label="检验人"
width="120"
>
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
<template #default="scope">
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.note"
placeholder="备注"
></el-input>
</template>
</el-table-column>
<el-table-column
prop="open"
label="操作"
fixed="right"
width="90"
align="center"
>
<template #default="scope">
<el-link
type="primary"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-link
>
<el-link
type="primary"
v-else
@click="editCheck(scope.row)"
>编辑</el-link
>
<el-link
type="danger"
@click="delCheck(scope.row.id)"
style="margin-left: 2px"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
<!-- 预制管 -->
<sc-form-table
ref="formTable"
v-else-if="type == 'guan'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column
prop="val"
label="抽检编号"
min-width="180"
>
<template #default="scope">
<!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> -->
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item, $index) in ftestitems"
:key="item.id"
> >
<el-table-column <template #default="scope">
prop="test_val" <el-select
:label="item.name" v-model="scope.row.is_ok"
min-width="130" placeholder="是否合格"
> clearable
<template #default="scope"> :disabled="!scope.row.isEdit"
<el-input-number style="width: 100%"
v-model=" >
scope.row.ftestitems[$index] <el-option label="是" :value="true" />
.test_val <el-option label="否" :value="false" />
" </el-select>
:disabled="!scope.row.isEdit" </template>
:min="0" </el-table-column>
style="width: 100%" <el-table-column
controls-position="right" prop="test_user"
> label="检验人"
</el-input-number> width="120"
</template> >
</el-table-column> <template #default="scope">
</template> <el-select
</el-table-column> v-model="scope.row.test_user"
<el-table-column placeholder="检验人"
prop="test_val" clearable
label="合格判定" filterable
min-width="90" :disabled="!scope.row.isEdit"
align="center" style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
<template #default="scope">
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.note"
placeholder="备注"
></el-input>
</template>
</el-table-column>
<el-table-column
prop="open"
label="操作"
fixed="right"
width="90"
align="center"
>
<template #default="scope">
<el-link
type="primary"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-link
>
<el-link
type="primary"
v-else
@click="editCheck(scope.row)"
>编辑</el-link
>
<el-link
type="danger"
@click="delCheck(scope.row.id)"
style="margin-left: 2px"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
<!-- 预制管 -->
<sc-form-table
ref="formTable"
v-else-if="type == 'guan'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
> >
<template #default="scope"> <el-table-column
<el-select prop="val"
v-model="scope.row.is_ok" label="抽检编号"
placeholder="是否合格" min-width="180"
clearable >
:disabled="!scope.row.isEdit" <template #default="scope">
style="width: 100%" <!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> -->
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item, $index) in ftestitems"
:key="item.id"
> >
<el-option label="是" :value="true" /> <el-table-column
<el-option label="否" :value="false" /> prop="test_val"
</el-select>
</template>
</el-table-column>
<el-table-column
prop="test_user"
label="检验人"
min-width="120"
align="center"
>
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name" :label="item.name"
:value="item.id" min-width="130"
/> >
</el-select> <template #default="scope">
</template> <el-input-number
</el-table-column> v-model="
<el-table-column prop="val" label="备注"> scope.row.ftestitems[$index]
<template #default="scope"> .test_val
<el-input "
:disabled="!scope.row.isEdit" :disabled="!scope.row.isEdit"
v-model="scope.row.note" :min="0"
placeholder="备注" style="width: 100%"
></el-input> controls-position="right"
</template> >
</el-table-column> </el-input-number>
<el-table-column </template>
prop="open" </el-table-column>
label="操作" </template>
fixed="right" </el-table-column>
width="90" <el-table-column
align="center" prop="test_val"
> label="合格判定"
<template #default="scope"> min-width="90"
<el-link align="center"
type="primary" >
v-if="scope.row.isEdit" <template #default="scope">
@click="saveCheck(scope.row)" <el-select
>保存</el-link v-model="scope.row.is_ok"
> placeholder="是否合格"
<el-link clearable
type="primary" :disabled="!scope.row.isEdit"
v-else style="width: 100%"
@click="editCheck(scope.row)" >
>编辑</el-link <el-option label="是" :value="true" />
> <el-option label="否" :value="false" />
<el-link </el-select>
type="danger" </template>
v-if="scope.row.id" </el-table-column>
@click="delCheck(scope.row.id)" <el-table-column
style="margin-left: 2px" prop="test_user"
>删除</el-link label="检验人"
> min-width="120"
</template> align="center"
</el-table-column> >
</sc-form-table> <template #default="scope">
</el-card> <el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
<template #default="scope">
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.note"
placeholder="备注"
></el-input>
</template>
</el-table-column>
<el-table-column
prop="open"
label="操作"
fixed="right"
width="90"
align="center"
>
<template #default="scope">
<el-link
type="primary"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-link
>
<el-link
type="primary"
v-else
@click="editCheck(scope.row)"
>编辑</el-link
>
<el-link
type="danger"
v-if="scope.row.id"
@click="delCheck(scope.row.id)"
style="margin-left: 2px"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
</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,9 +389,11 @@ 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
that.userList = res; .req({ page: 0, belong_dept__name: "检验管理部" })
}); .then((res) => {
that.userList = res;
});
}, },
// //
getCheckList(ftestwork) { getCheckList(ftestwork) {

View File

@ -1,152 +1,174 @@
<template> <template>
<el-dialog <el-dialog
title="首件检验任务" title="成品检验任务"
v-model="visible" v-model="visible"
:size="1000" :size="1000"
destroy-on-close destroy-on-close
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px"> <el-main style="padding: 0 20px 20px 20px">
<el-form <el-form
ref="dialogForm" ref="dialogForm"
:model="form" :model="form"
:rules="rules" :rules="rules"
label-width="100px" label-width="100px"
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="物料批次" prop="batch"> <el-form-item label="物料批次" prop="batch">
<el-select <el-select
v-model="form.batch" v-model="form.batch"
placeholder="物料批次" placeholder="物料批次"
clearable style="width:100%" clearable
@change="handleChange" style="width: 100%"
> @change="handleChange"
<el-option >
v-for="item in options" <el-option
:key="item.id" v-for="item in options"
:label="item.batch" :key="item.id"
:value="item.id"> :label="item.batch"
</el-option> :value="item.id"
</el-select> >
</el-form-item> </el-option>
</el-col> </el-select>
<el-col :md="12" :sm="24"> </el-form-item>
<el-form-item label="总数"> </el-col>
<el-input v-model="form.count" disabled></el-input> <el-col :md="12" :sm="24">
</el-form-item> <el-form-item label="总数">
</el-col> <el-input
<el-col :md="12" :sm="24"> v-model="form.count"
<el-form-item label="检验日期" prop="test_date"> disabled
<el-date-picker ></el-input>
v-model="form.test_date" </el-form-item>
type="date" </el-col>
value-format="YYYY-MM-DD" <el-col :md="12" :sm="24">
style="width:100%" <el-form-item label="检验日期" prop="test_date">
/> <el-date-picker
</el-form-item> v-model="form.test_date"
</el-col> type="date"
</el-row> value-format="YYYY-MM-DD"
</el-form> style="width: 100%"
</el-main> />
<el-footer> </el-form-item>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button> </el-col>
<el-button @click="visible = false">取消</el-button> </el-row>
</el-footer> </el-form>
</el-container> </el-main>
</el-dialog> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
return { return {
loading: false, loading: false,
form: { form: {},
}, rules: {
rules: { test_date: [
test_date: [{required: true, message: "请选择检验日期", trigger: "blur"}], {
batch: [{required: true, message: "请选择物料批次", trigger: "blur"}] required: true,
}, message: "请选择检验日期",
visible: false, trigger: "blur",
isSaveing: false, },
options: [], ],
selectionFilters: [], batch: [
setFiltersVisible: false, {
}; required: true,
}, message: "请选择物料批次",
mounted() { trigger: "blur",
this.getMaterialBatch(); },
}, ],
methods: { },
// visible: false,
open(mode = "add") { isSaveing: false,
this.mode = mode; options: [],
this.visible = true; selectionFilters: [],
return this; setFiltersVisible: false,
}, };
// },
getMaterialBatch(){ mounted() {
let that = this; this.getMaterialBatch();
this.$API.inm.warehouse.batch.req({page:0,material__type:10,count__gte:0}).then(res=>{ },
that.options = res; methods: {
}); //
}, open(mode = "add") {
handleChange(val){ this.mode = mode;
let that = this; this.visible = true;
console.log(val) return this;
that.options.forEach(item => { },
if(item.id==val){ //
that.form.count = item.count; getMaterialBatch() {
that.form.batch = item.batch; let that = this;
that.form.material = item.material; this.$API.inm.warehouse.batch
} .req({ page: 0, material__type: 10, count__gte: 0 })
}); .then((res) => {
}, that.options = res;
// });
submit() { },
this.$refs.dialogForm.validate(async (valid) => { handleChange(val) {
if (valid) { let that = this;
this.isSaveing = true; console.log(val);
try { that.options.forEach((item) => {
if (this.mode == "add") { if (item.id == val) {
this.$API.qm.ftestwork.create.req(this.form).then(res => { that.form.count = item.count;
this.isSaveing = false; that.form.batch = item.batch;
this.visible = false; that.form.material = item.material;
this.$emit("success"); }
this.$message.success("操作成功"); });
}); },
} else if (this.mode == "edit") { //
this.$API.qm.ftestwork.update.req(this.form.id,this.form).then(res => { submit() {
this.isSaveing = false; this.$refs.dialogForm.validate(async (valid) => {
this.visible = false; if (valid) {
this.$emit("success"); this.isSaveing = true;
this.$message.success("操作成功"); try {
}); if (this.mode == "add") {
} this.$API.qm.ftestwork.create
.req(this.form)
} catch (err) { .then((res) => {
// this.isSaveing = false;
this.isSaveing = false; this.visible = false;
return err; this.$emit("success");
} this.$message.success("操作成功");
} });
}); } else if (this.mode == "edit") {
}, this.$API.qm.ftestwork.update
// .req(this.form.id, this.form)
setData(data) { .then((res) => {
Object.assign(this.form, data); this.isSaveing = false;
this.form.test_group = this.form.split(',') this.visible = false;
}, this.$emit("success");
// this.$message.success("操作成功");
setFilters(filters) { });
this.selectionFilters = filters; }
this.setFiltersVisible = true; } catch (err) {
}, //
}, this.isSaveing = false;
return err;
}
}
});
},
//
setData(data) {
Object.assign(this.form, data);
this.form.test_group = this.form.split(",");
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
}; };
</script> </script>
<style> <style></style>
</style>

View File

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

View File

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

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