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>
<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>
</el-config-provider>
</template>
<script>
import colorTool from '@/utils/color';
import colorTool from "@/utils/color";
export default {
name: 'App',
name: "App",
data() {
return {
config: {
size: "default",
zIndex: 2000,
button: {
autoInsertSpace: false
}
}
}
autoInsertSpace: false,
},
},
};
},
computed: {
locale() {
return this.$i18n.messages[this.$i18n.locale].el
return this.$i18n.messages[this.$i18n.locale].el;
},
},
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) {
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++) {
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++) {
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>
<style lang="scss">
@import '@/style/style.scss';
@import "@/style/style.scss";
.card-header {
display: flex;
@ -134,7 +149,7 @@ export default {
border-radius: 15px;
}
.el-calendar>.el-calendar__body {
.el-calendar > .el-calendar__body {
padding: 0 20px 20px;
}
@ -160,19 +175,19 @@ export default {
background: linear-gradient(to right, #053949, #107b90);
}
.enpMenu>.el-dropdown-menu__item {
.enpMenu > .el-dropdown-menu__item {
margin-bottom: 0.5vh;
//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, #053949, #107b90);
color: #ffffff;
}
.enpMenu>.el-dropdown-menu__item {
.enpMenu > .el-dropdown-menu__item {
color: #ffffff;
}
@ -205,8 +220,12 @@ export default {
color: #ffffff !important;
}
#enpTable .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
background-color: rgba(0, 50, 45, .5) !important;
#enpTable
.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,
@ -231,18 +250,22 @@ export default {
background: none !important;
}
#enpTable .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
background-color: rgba(0, 50, 45, .5) !important;
#enpTable
.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 {
background: none !important;
}
.bigScreenTable table th{
font-size: 0.8vw!important;
.bigScreenTable table th {
font-size: 0.8vw !important;
}
.bigScreenTable table td{
font-size: 0.7vw!important;
.bigScreenTable table td {
font-size: 0.7vw !important;
}
// .searchSelect>.select-trigger>.el-input>.el-input__wrapper {
@ -263,9 +286,16 @@ export default {
// 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;
}
//
</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: {
name: "测点采集数据",
req: async function(data){

View File

@ -805,7 +805,7 @@ const routes = [
"title": "环保模块",
"icon": "el-icon-grid",
"type": "menu",
// "perms": ["enm_hb"]
"perms": ["enm_hb"]
},
"children": [
{
@ -814,7 +814,7 @@ const routes = [
"meta": {
"title": "排放口",
"icon": "el-icon-cellphone",
// "perms": ["enm_hb"]
"perms": ["enm_hb"]
},
"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",
@ -2440,6 +2451,7 @@ const routes = [
"meta": {
"title": "日志详情",
"icon": "el-icon-document-copy",
"perms": ["enm_base"],
"hidden": true
},
"component": "enm_rm/logDetail"
@ -2450,7 +2462,7 @@ const routes = [
"meta": {
"title": "计算系数",
"icon": "el-icon-grid",
"perms": ["enm_base"]
"perms": ["enm_formula"]
},
"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="操作"
fixed="right"
align="center"
width="140"
width="120"
>
<template #default="scope">
<el-button
link
size="small"
@click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
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-divider direction="vertical"></el-divider>
<!-- <el-divider direction="vertical"></el-divider> -->
<el-button
link
size="small"

View File

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

View File

@ -104,12 +104,13 @@
link
size="small"
@click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
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-divider direction="vertical"></el-divider>
<!-- <el-divider direction="vertical"></el-divider> -->
<el-button
link
size="small"

View File

@ -97,19 +97,20 @@
label="操作"
fixed="right"
align="center"
width="140"
width="120"
>
<template #default="scope">
<el-button
link
size="small"
@click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
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-divider direction="vertical"></el-divider>
<!-- <el-divider direction="vertical"></el-divider> -->
<el-button
link
size="small"

View File

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

View File

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

View File

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

View File

@ -96,19 +96,20 @@
label="操作"
fixed="right"
align="center"
width="140"
width="120"
>
<template #default="scope">
<el-button
link
size="small"
@click="sflog_edit(scope.row)"
v-auth="'sflog.update'"
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-divider direction="vertical"></el-divider>
<!-- <el-divider direction="vertical"></el-divider> -->
<el-button
link
size="small"

View File

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

View File

@ -1,160 +1,251 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" @click="add('do_in')" v-auth="'mio.do'">生产入库</el-button>
<el-button type="primary" @click="add('sale_out')" v-auth="'mio.sale'">销售发货</el-button>
<el-select v-model="query.type" clearable style="width: 120px; margin-left: 2px" placeholder="出入库类型"
@change="handleQuery">
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-select v-model="query.state" clearable style="width: 120px; margin-left: 2px" placeholder="状态"
@change="handleQuery">
<el-option v-for="item in stateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</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" :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>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="add('do_in')"
v-auth="'mio.do'"
>生产入库</el-button
>
<el-button
type="primary"
@click="add('sale_out')"
v-auth="'mio.sale'"
>销售发货</el-button
>
<el-select
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
placeholder="出入库类型"
@change="handleQuery"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.state"
clearable
style="width: 120px; margin-left: 2px"
placeholder="状态"
@change="handleQuery"
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</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"
: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>
<script>
import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default {
name: "mio",
components: {
saveDialog
},
data() {
return {
stateDict: {
10: '创建中',
20: '已提交'
},
stateOptions: [
{ id: 10, name: '创建中' },
{ id: 20, name: '已提交' },
],
typeDict: {
'sale_out': '销售发货',
'do_in': '生产入库',
},
cateOptions: [
{ id: 'sale_out', name: '销售发货' },
{ id: 'do_in', name: '生产入库' },
],
dialog: {
save: false,
},
query: {
},
params: {
type__in: 'sale_out,do_in',
materials__type: 10
},
form: {
},
apiObj: this.$API.inm.mio.list,
selection: [],
};
},
methods: {
//
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_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id, type: row.type, cate: 'good' }
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.inm.mio.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then(res => {
this.$message.success("提交成功");
this.$refs.table.refresh()
})
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
handleSaveSuccess() {
this.$refs.table.refresh()
}
},
name: "mio",
components: {
saveDialog,
recordDialog,
},
data() {
return {
stateDict: {
10: "创建中",
20: "已提交",
},
stateOptions: [
{ id: 10, name: "创建中" },
{ id: 20, name: "已提交" },
],
typeDict: {
sale_out: "销售发货",
do_in: "生产入库",
},
cateOptions: [
{ id: "sale_out", name: "销售发货" },
{ id: "do_in", name: "生产入库" },
],
dialog: {
save: false,
record: false,
},
query: {},
params: {
type__in: "sale_out,do_in",
materials__type: 10,
},
form: {},
apiObj: this.$API.inm.mio.list,
selection: [],
type: "",
cate: "good",
mioId: "",
visibleDrawer: false,
};
},
methods: {
//
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_detail(row) {
this.type = row.type;
this.mioId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.inm.mio.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
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"
@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>
<script>
import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default {
name: "mio",
components: {
recordDialog,
saveDialog,
},
data() {
@ -178,6 +188,7 @@ export default {
],
dialog: {
save: false,
record: false,
},
query: {},
params: {
@ -187,6 +198,10 @@ export default {
form: {},
apiObj: this.$API.inm.mio.list,
selection: [],
type: "",
cate: "halfgood",
mioId: "",
visibleDrawer: false,
};
},
methods: {
@ -206,9 +221,11 @@ export default {
},
//
table_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id, type: row.type, cate: "halfgood" },
this.type = row.type;
this.mioId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
//

View File

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

View File

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

View File

@ -1,170 +1,262 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<!-- <el-button type="primary" @click="add('do_in')">生产入库</el-button>
<el-container>
<el-header>
<div class="left-panel">
<!-- <el-button type="primary" @click="add('do_in')">生产入库</el-button>
<el-button type="primary" @click="add('do_out')">生产领料</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="primary" @click="add('pur_in')">采购入库</el-button>
<el-button type="primary" @click="add('sale_out')">销售发货</el-button>
<el-divider direction="vertical"></el-divider> -->
<el-button type="primary" @click="add('other_in')" v-auth="'mio.other'">其他入库</el-button>
<el-button type="primary" @click="add('other_out')" v-auth="'mio.other'">其他出库</el-button>
<el-select v-model="query.type" clearable style="width: 120px; margin-left: 2px" placeholder="出入库类型"
@change="handleQuery">
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-select v-model="query.state" clearable style="width: 120px; margin-left: 2px" placeholder="状态"
@change="handleQuery">
<el-option v-for="item in stateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</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-button
type="primary"
@click="add('other_in')"
v-auth="'mio.other'"
>其他入库</el-button
>
<el-button
type="primary"
@click="add('other_out')"
v-auth="'mio.other'"
>其他出库</el-button
>
<el-select
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
placeholder="出入库类型"
@change="handleQuery"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.state"
clearable
style="width: 120px; margin-left: 2px"
placeholder="状态"
@change="handleQuery"
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</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>
<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&&(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>
<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 &&
(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>
<script>
import saveDialog from "./mio_form.vue";
import recordDialog from "./mioitem.vue";
export default {
name: "mio",
components: {
saveDialog
},
data() {
return {
stateDict: {
10: '创建中',
20: '已提交'
},
stateOptions: [
{ id: 10, name: '创建中' },
{ id: 20, name: '已提交' },
],
typeDict: {
'do_out': '生产领料',
'sale_out': '销售发货',
'pur_in': '采购入库',
'do_in': '生产入库',
'other_in': '其他入库',
'other_out': '其他出库',
},
cateOptions: [
{ id: 'do_out', name: '生产领料' },
{ id: 'sale_out', name: '销售发货' },
{ id: 'pur_in', name: '采购入库' },
{ id: 'do_in', name: '生产入库' },
{ id: 'other_in', name: '其他入库' },
{ id: 'other_out', name: '其他出库' },
],
dialog: {
save: false,
},
query: {
search: ''
},
form: {
},
apiObj: this.$API.inm.mio.list,
selection: [],
};
},
methods: {
//
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_detail(row) {
this.$router.push({
name: "mioitem",
query: { mio: row.id ,type:row.type}
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.inm.mio.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then(res => {
this.$message.success("提交成功");
this.$refs.table.refresh()
})
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
handleSaveSuccess() {
this.$refs.table.refresh()
}
},
name: "mio",
components: {
saveDialog,
recordDialog,
},
data() {
return {
stateDict: {
10: "创建中",
20: "已提交",
},
stateOptions: [
{ id: 10, name: "创建中" },
{ id: 20, name: "已提交" },
],
typeDict: {
do_out: "生产领料",
sale_out: "销售发货",
pur_in: "采购入库",
do_in: "生产入库",
other_in: "其他入库",
other_out: "其他出库",
},
cateOptions: [
{ id: "do_out", name: "生产领料" },
{ id: "sale_out", name: "销售发货" },
{ id: "pur_in", name: "采购入库" },
{ id: "do_in", name: "生产入库" },
{ id: "other_in", name: "其他入库" },
{ id: "other_out", name: "其他出库" },
],
dialog: {
save: false,
record: false,
},
visibleDrawer: false,
query: {
search: "",
},
form: {},
apiObj: this.$API.inm.mio.list,
selection: [],
type: "",
mioId: "",
};
},
methods: {
//
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_detail(row) {
this.type = row.type;
this.mioId = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.inm.mio.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
table_submit(row) {
this.$API.inm.mio.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
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>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="编号">{{
mioObj.number
}}</el-descriptions-item>
<el-descriptions-item label="出入库类型">{{
typeDict[mioObj.type]
}}</el-descriptions-item>
<el-descriptions-item label="状态">{{
stateDict[mioObj.state]
}}</el-descriptions-item>
<el-descriptions-item label="部门/车间">{{
mioObj.belong_dept_name
}}</el-descriptions-item>
<el-descriptions-item label="执行人">{{
mioObj.do_user_name
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
mioObj.create_time
}}</el-descriptions-item>
<el-descriptions-item
label="采购订单"
v-if="mioObj.type == 'pur_in'"
>{{ mioObj.order_number }}</el-descriptions-item
>
<el-descriptions-item
label="供应商"
v-if="mioObj.type == 'pur_in'"
>{{ mioObj.supplier_name }}</el-descriptions-item
>
<el-descriptions-item
label="销售订单"
v-if="mioObj.type == 'sale_out'"
>{{ mioObj.pu_order_number }}</el-descriptions-item
>
<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-drawer
v-model="visible"
title="出入库记录"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="编号">{{
mioObj.number
}}</el-descriptions-item>
<el-descriptions-item label="出入库类型">{{
typeDict[mioObj.type]
}}</el-descriptions-item>
<el-descriptions-item label="状态">{{
stateDict[mioObj.state]
}}</el-descriptions-item>
<el-descriptions-item label="部门/车间">{{
mioObj.belong_dept_name
}}</el-descriptions-item>
<el-descriptions-item label="执行人">{{
mioObj.do_user_name
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
mioObj.create_time
}}</el-descriptions-item>
<el-descriptions-item
label="采购订单"
v-if="mioObj.type == 'pur_in'"
>{{ mioObj.order_number }}</el-descriptions-item
>
<el-descriptions-item
label="供应商"
v-if="mioObj.type == 'pur_in'"
>{{ mioObj.supplier_name }}</el-descriptions-item
>
<el-descriptions-item
label="销售订单"
v-if="mioObj.type == 'sale_out'"
>{{ mioObj.pu_order_number }}</el-descriptions-item
>
<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-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-if="mioObj.state == 10"
>新增</el-button
</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-if="mioObj.state == 10"
>新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
hideDo
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column
label="组合件信息"
v-if="cate == 'good'"
width="300"
>
<template #default="scope">
<div v-if="scope.row.assemb.length > 0">
<div
v-for="item in scope.row.assemb"
:key="item.id"
>
<div>
{{ item.material_name }}
<span
style="color: gray; font-size: 12px"
>:</span
>{{ item.batch }}
<span
style="color: gray; font-size: 12px"
>:</span
>{{ item.rate }}
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column
label="组合件信息"
v-if="cate == 'good'"
width="300"
>
<template #default="scope">
<div v-if="scope.row.assemb.length > 0">
<div
v-for="item in scope.row.assemb"
:key="item.id"
>
<div>
{{ item.material_name }}
<span
style="
color: gray;
font-size: 12px;
"
>:</span
>{{ item.batch }}
<span
style="
color: gray;
font-size: 12px;
"
>:</span
>{{ item.rate }}
</div>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="不合格数量" prop="count_notok">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
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_check(scope.row)"
v-if="
scope.row.test_date == null &&
mioObj.state == 20 &&
(type == 'pur_in' ||
type == 'do_in' ||
type == 'other_in')
"
v-auth="'mioitem.test'"
>
检验
</el-button>
<el-button
link
type="primary"
@click="check_Show(scope.row)"
v-if="scope.row.test_date !== null"
>
查看
</el-button>
<el-button
link
type="danger"
@click="check_reSet(scope.row)"
v-if="scope.row.test_date !== null"
>
撤回
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-if="mioObj.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</template>
</el-table-column>
<el-table-column label="不合格数量" prop="count_notok">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
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_check(scope.row)"
v-if="
scope.row.test_date == null &&
mioObj.state == 20 &&
(type == 'pur_in' ||
type == 'do_in' ||
type == 'other_in')
"
v-auth="'mioitem.test'"
>
检验
</el-button>
<el-button
link
type="primary"
@click="check_Show(scope.row)"
v-if="scope.row.test_date !== null"
>
查看
</el-button>
<el-button
link
type="danger"
@click="check_reSet(scope.row)"
v-if="scope.row.test_date !== null"
>
撤回
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-if="mioObj.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
</div>
</el-drawer>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@ -203,6 +217,20 @@ export default {
saveDialog,
checkDialog,
},
props: {
type: {
type: String,
default: "",
},
cate: {
type: String,
default: "",
},
mioId: {
type: String,
default: "",
},
},
data() {
return {
dialog: {
@ -211,7 +239,7 @@ export default {
},
apiObj: null,
params: {},
mioId: "",
// mioId: "",
mioObj: {},
selection: [],
stateDict: {
@ -226,21 +254,26 @@ export default {
other_in: "其他入库",
other_out: "其他出库",
},
visible: false,
mioitemId: "",
type: "",
cate: "",
// type: "",
// cate: "",
objitem: {},
};
},
mounted() {
this.type = this.$route.query.type;
this.cate = this.$route.query.cate;
this.mioId = this.$route.query.mio;
this.params.mio = this.$route.query.mio;
// this.type = this.$route.query.type;
// this.cate = this.$route.query.cate;
// this.mioId = this.$route.query.mio;
// this.params.mio = this.$route.query.mio;
this.params.mio = this.mioId;
this.apiObj = this.$API.inm.mioitem.list;
this.getMio();
},
methods: {
open() {
this.visible = true;
},
getMio() {
this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.mioObj = res;

View File

@ -1,153 +1,229 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_order.create'">新增</el-button>
</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 :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" prop="number">
</el-table-column>
<el-table-column label="供应商" prop="supplier_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="物料信息" prop="materials_">
<template #default="scope">
<div v-for="item in scope.row.materials_" v-bind:key="item.id">
<span>{{ item.name }}[{{ item.specification }}][{{ item.model }}]</span>
</div>
</template>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<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>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_order.create'"
>新增</el-button
>
</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
:params="query"
>
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" prop="number">
</el-table-column>
<el-table-column
label="供应商"
prop="supplier_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="物料信息" prop="materials_">
<template #default="scope">
<div
v-for="item in scope.row.materials_"
v-bind:key="item.id"
>
<span
>{{ item.name }}[{{ item.specification }}][{{
item.model
}}]</span
>
</div>
</template>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<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>
<script>
import saveDialog from "./order_form.vue";
import detailDialog from "./orderitem.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.pum.order.list,
query: {
page: 1,
page_size: 20
},
selection: [],
stateOption: {
10: { "label": "创建中", "color": "" },
20: { "label": "已提交", "color": "" },
30: { "label": "到货中", "color": "" },
40: { "label": "已完成", "color": "success" },
},
name: "rparty",
components: {
saveDialog,
detailDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.pum.order.list,
query: {
page: 1,
page_size: 20,
},
selection: [],
stateOption: {
10: { label: "创建中", color: "" },
20: { label: "已提交", color: "" },
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(() => {});
},
};
},
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.$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 = {};
},
},
//
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>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
<el-descriptions-item label="供应商">{{ orderObj.supplier_name }}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{ orderObj.belong_dept_name }}</el-descriptions-item>
<el-descriptions-item label="创建人">{{ orderObj.create_by_name }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ orderObj.create_time }}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height:8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button type="primary" @click="addLinkPlanItem" v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10">计划明细变更采购明细</el-button>
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10">手动新增</el-button>
</div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" 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>
<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>
<el-drawer
v-model="visible"
title="订单详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{
stateOption[orderObj.state]
}}</el-descriptions-item>
<el-descriptions-item label="供应商">{{
orderObj.supplier_name
}}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{
orderObj.belong_dept_name
}}</el-descriptions-item>
<el-descriptions-item label="创建人">{{
orderObj.create_by_name
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
orderObj.create_time
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button
type="primary"
@click="addLinkPlanItem"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>计划明细变更采购明细</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>手动新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
:query="query"
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
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>
<script>
import saveDialog from "./orderitem_form.vue";
import planDialog from "./orderitemplan.vue";
export default {
name: "rparty",
components: {
saveDialog, planDialog
},
data() {
return {
dialog: {
save: false,
splan: false,
},
apiObj: null,
params: {},
query: {},
puOrder: '',
orderObj: {},
selection: [],
stateOption: {
10: "创建中",
20: "已提交",
30: "到货中",
40: "已完成",
},
};
},
mounted() {
this.puOrder = this.$route.query.pu_order;
this.params.pu_order = this.$route.query.pu_order;
this.apiObj = this.$API.pum.orderitem.list;
this.getOrder();
},
methods: {
getOrder() {
this.$API.pum.order.item.req(this.puOrder).then((res) => {
this.orderObj = res;
})
},
//
add() {
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
// }
// });
},
name: "rparty",
components: {
saveDialog,
planDialog,
},
props: {
orderId: {
type: String,
default: "",
},
},
data() {
return {
dialog: {
save: false,
splan: false,
},
apiObj: null,
params: {
pu_order: "",
},
query: {},
puOrder: "",
orderObj: {},
selection: [],
stateOption: {
10: "创建中",
20: "已提交",
30: "到货中",
40: "已完成",
},
visible: false,
};
},
mounted() {
this.puOrder = this.orderId;
this.params.pu_order = this.orderId;
this.apiObj = this.$API.pum.orderitem.list;
this.getOrder();
},
methods: {
open() {
this.visible = true;
},
getOrder() {
this.$API.pum.order.item.req(this.puOrder).then((res) => {
this.orderObj = res;
});
},
//
add() {
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) {
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) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.orderitem.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();
}
},
handlePlanSuccess() {
this.dialog.plan = false;
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
//
table_edit(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) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.pum.orderitem.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();
}
},
handlePlanSuccess() {
this.dialog.plan = false;
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
},
};
</script>
</script>

View File

@ -1,140 +1,215 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_plan.create'">新增</el-button>
</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 :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="计划名称" prop="name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="计划编号" prop="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<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" 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>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_plan.create'"
>新增</el-button
>
</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
:params="query"
>
<el-table-column type="index" width="50" />
<el-table-column
label="计划名称"
prop="name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="计划编号" prop="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<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"
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>
<script>
import saveDialog from "./plan_form.vue";
import detailDialog from "./planitem.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.pum.plan.list,
query: {
page: 1,
page_size: 20,
type: 10
},
selection: [],
stateOption: {
10: { "label": "创建中", "color": "" },
20: { "label": "已提交", "color": "" },
30: { "label": "下单中", "color": "" },
40: { "label": "下单完成", "color": "" },
40: { "label": "已完成", "color": "success" },
},
};
},
methods: {
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_detail(row) {
this.$nextTick(() => {
this.$router.push({
name: "planitem",
query: { pu_plan: row.id }
});
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_submit(row) {
console.log(row.id)
this.$API.pum.plan.submit.req(row.id).then((res) => {
this.$refs.table.refresh();
debugger;
this.$message.success("提交成功");
});
},
//
table_del(row) {
this.$confirm(`确定删除该计划吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.plan.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 = {};
},
},
name: "rparty",
components: {
saveDialog,
detailDialog,
},
data() {
return {
dialog: {
save: false,
detail: false,
},
apiObj: this.$API.pum.plan.list,
query: {
page: 1,
page_size: 20,
type: 10,
},
selection: [],
stateOption: {
10: { label: "创建中", color: "" },
20: { label: "已提交", color: "" },
30: { label: "下单中", color: "" },
40: { label: "下单完成", color: "" },
40: { label: "已完成", color: "success" },
},
planId: "",
};
},
methods: {
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_detail(row) {
this.planId = row.id;
this.dialog.detail = true;
this.$nextTick(() => {
this.$refs.detailDialogs.open();
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_submit(row) {
this.$API.pum.plan.submit.req(row.id).then((res) => {
this.$refs.table.refresh();
this.$message.success("提交成功");
});
},
//
table_del(row) {
this.$confirm(`确定删除该计划吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.pum.plan.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,156 +1,233 @@
<template>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="计划名称">{{ orderObj.name }}</el-descriptions-item>
<el-descriptions-item label="计划编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
</el-descriptions>
</el-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" v-auth="'pu_planitem.create'" @click="add"
v-if="orderObj.state == 10">新增</el-button>
</div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="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="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>
<save-dialog v-if="dialog.save" ref="saveDialog" :puPlan="puPlan" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<el-drawer
v-model="visible"
title="计划详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="计划名称">{{
orderObj.name
}}</el-descriptions-item>
<el-descriptions-item label="计划编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{
stateOption[orderObj.state]
}}</el-descriptions-item>
</el-descriptions>
</el-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"
v-auth="'pu_planitem.create'"
@click="add"
v-if="orderObj.state == 10"
>新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:query="query"
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
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="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>
<script>
import saveDialog from "./planitem_form.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
puPlan: '',
orderObj: {},
apiObj: null,
query: {
page: 1,
page_size: 20
},
stateOption: {
10: "创建中",
20: "已提交",
30: "下单中",
40: "下单完成",
40: "已完成",
},
};
},
mounted() {
this.puPlan = this.$route.query.pu_plan;
this.query.pu_plan = this.$route.query.pu_plan;
this.apiObj = this.$API.pum.planitem.list;
this.$refs.table.refresh();
this.getOrder();
},
methods: {
getOrder() {
this.$API.pum.plan.item.req(this.puPlan).then((res) => {
debugger;
console.log(res);
this.orderObj = res;
})
},
//
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_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
name: "rparty",
components: {
saveDialog,
},
props: {
planId: {
type: String,
default: "",
},
},
data() {
return {
dialog: {
save: false,
},
puPlan: "",
orderObj: {},
apiObj: null,
query: {
page: 1,
page_size: 20,
pu_plan: "",
},
stateOption: {
10: "创建中",
20: "已提交",
30: "下单中",
40: "下单完成",
40: "已完成",
},
visible: false,
};
},
mounted() {
this.puPlan = this.planId;
this.query.pu_plan = this.planId;
this.apiObj = this.$API.pum.planitem.list;
// this.$refs.table.refresh();
this.getOrder();
},
methods: {
open() {
this.visible = true;
},
getOrder() {
this.$API.pum.plan.item.req(this.puPlan).then((res) => {
this.orderObj = res;
});
},
//
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_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
table_del(row) {
this.$confirm(`确定删除该计划详情吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.planitem.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
table_del(row) {
this.$confirm(`确定删除该计划详情吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.pum.planitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
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 = {};
},
},
//
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,132 +1,170 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<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
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="日期" prop="test_date" show-overflow-tooltip>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="总数" prop="count">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)">编辑</el-link>
<el-divider direction="vertical"></el-divider>
<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="handleCheckSuccess" @closed="dialog.check = false">
</save-dialog>
</el-container>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
></el-button>
</div>
<div class="right-panel">
<el-date-picker
v-model="query.date"
type="date"
value-format="YYYY-MM-DD"
/>
<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
:params="query"
>
<el-table-column type="index" width="50" />
<el-table-column
label="日期"
prop="test_date"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="批次号" prop="batch"> </el-table-column>
<el-table-column label="总数" prop="count"> </el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)"
>编辑</el-link
>
<el-divider direction="vertical"></el-divider>
<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>
<script>
import saveDialog from "./product_form.vue";
export default {
name: "rparty",
components:{
saveDialog
},
data() {
return {
apiObj: this.$API.qm.ftestwork.list,
dialog:{
check:false,
},
query: {
page:1,
page_size:20,
type:10
},
selection: [],
};
},
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_del(row){
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show",10).setData(row);
});
},
table_check(row){
// console.log('ftestWork',row)
let type = '';
if(row.material_name.indexOf('棒')>-1){
type = 'bang';
}else{
type='guan';
}
this.$router.push({
name: "productDetail",
query: {
type:type,
ftestWork:row.id
},
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
handleCheckSuccess(){
this.dialog.save = false;
this.$refs.table.refresh();
},
},
};
</script>
import checkDialog from "./productCheck.vue";
export default {
name: "rparty",
components: {
saveDialog,
checkDialog,
},
data() {
return {
apiObj: this.$API.qm.ftestwork.list,
dialog: {
save: false,
check: false,
},
query: {
page: 1,
page_size: 20,
type: 10,
},
selection: [],
};
},
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_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.qm.ftestwork.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show", 10).setData(row);
});
},
table_check(row) {
debugger;
console.log(row);
let that = this;
let type = "";
if (row.material_name.indexOf("棒") > -1) {
type = "bang";
} else {
type = "guan";
}
that.product_type = type;
that.ftestWork = row.id;
that.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialogs.open();
});
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
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>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="日期">{{
workObj.test_date
}}</el-descriptions-item>
<el-descriptions-item label="批次号">{{
workObj.batch
}}</el-descriptions-item>
<el-descriptions-item label="总数">{{
workObj.count
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="检验记录" shadow="hover">
<!-- 预制棒 -->
<sc-form-table
ref="formTable"
v-if="type == 'bang'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column
prop="val"
label="抽检编号"
min-width="180"
<el-drawer
v-model="visible"
title="成品检验"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="日期">{{
workObj.test_date
}}</el-descriptions-item>
<el-descriptions-item label="批次号">{{
workObj.batch
}}</el-descriptions-item>
<el-descriptions-item label="总数">{{
workObj.count
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="检验记录" shadow="hover">
<!-- 预制棒 -->
<sc-form-table
ref="formTable"
v-if="type == 'bang'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<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="(item0, $index) in ftestitems"
:key="item0.id"
<el-table-column
prop="val"
label="抽检编号"
min-width="180"
>
<el-table-column
prop="test_val"
:label="item0.name"
min-width="130"
<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="(item0, $index) in ftestitems"
:key="item0.id"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
>
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
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
prop="test_val"
:label="item0.name"
min-width="130"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
>
<el-table-column
prop="test_val"
:label="item.name"
min-width="130"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
align="center"
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
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="暂无数据"
>
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
:disabled="!scope.row.isEdit"
style="width: 100%"
<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-option label="是" :value="true" />
<el-option label="否" :value="false" />
</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"
<el-table-column
prop="test_val"
: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>
min-width="130"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
align="center"
>
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
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="检验人"
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"
: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>
</el-drawer>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@ -295,6 +303,17 @@
import saveDialog from "./product_check.vue";
export default {
name: "mioitem",
emits: ["success", "closed"],
props: {
ftestWork: {
type: String,
default: "",
},
type: {
type: String,
default: "",
},
},
components: {
saveDialog,
},
@ -318,10 +337,11 @@ export default {
apiObj: null,
params: {},
formTableData: [],
ftestWork: "",
type: "",
// ftestWork: "",
// type: "",
userList: [],
workObj: {},
visible: false,
};
},
watch: {
@ -332,8 +352,8 @@ export default {
},
mounted() {
let that = this;
that.type = that.$route.query.type;
that.ftestWork = that.$route.query.ftestWork;
// that.type = that.$route.query.type;
// that.ftestWork = that.$route.query.ftestWork;
that.addTemplate.ftest_work = that.ftestWork;
that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => {
that.workObj = res;
@ -345,6 +365,9 @@ export default {
that.getUserList(that.ftestWork);
},
methods: {
open() {
this.visible = true;
},
//
getTestItem(tag, ftestWork) {
let that = this;
@ -366,9 +389,11 @@ export default {
//
getUserList() {
let that = this;
this.$API.system.user.list.req({ page: 0 }).then((res) => {
that.userList = res;
});
this.$API.system.user.list
.req({ page: 0, belong_dept__name: "检验管理部" })
.then((res) => {
that.userList = res;
});
},
//
getCheckList(ftestwork) {

View File

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

View File

@ -1,148 +1,230 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.create'">新增</el-button>
</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 :params="query">
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" prop="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
{{ stateOption[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="客户" prop="customer_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="所属合同" prop="contract_number" show-overflow-tooltip>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<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>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'order.create'"
>新增</el-button
>
</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
:params="query"
:query="query"
>
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" prop="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
{{ stateOption[scope.row.state] }}
</template>
</el-table-column>
<el-table-column
label="客户"
prop="customer_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="所属合同"
prop="contract_number"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<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>
<script>
import saveDialog from "./order_form.vue";
import detailDialog from "./orderitem.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.sam.order.list,
query: {
page: 1,
page_size: 20
},
selection: [],
stateOption: {
10: '创建中',
20: '已提交',
30: '进行中',
40: '已交付',
},
};
},
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_submit(row) {
this.$API.sam.order.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
this.handleQuery();
return res;
}).catch((err) => {
return err;
});
},
//
table_detail(row) {
this.$router.push({
name: "samOrderitem",
query: { order: row.id }
});
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.sam.order.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
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 = {};
},
},
name: "rparty",
components: {
saveDialog,
detailDialog,
},
data() {
return {
dialog: {
save: false,
detail: false,
},
apiObj: this.$API.sam.order.list,
query: {
page: 1,
page_size: 20,
},
selection: [],
stateOption: {
10: "创建中",
20: "已提交",
30: "进行中",
40: "已交付",
},
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_submit(row) {
this.$API.sam.order.submit
.req(row.id)
.then((res) => {
this.$message.success("提交成功");
this.handleQuery();
return res;
})
.catch((err) => {
return err;
});
},
//
table_detail(row) {
this.orderId = row.id;
this.dialog.detail = true;
this.$nextTick(() => {
this.$refs.detailDialogs.open();
});
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.sam.order.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
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,142 +1,213 @@
<template>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="客户">{{ orderObj.customer_name }}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{ orderObj.state }}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{ orderObj.delivery_date }}</el-descriptions-item>
</el-descriptions>
</el-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>
<el-drawer
v-model="visible"
title="订单详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="客户">{{
orderObj.customer_name
}}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{
orderObj.state
}}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{
orderObj.delivery_date
}}</el-descriptions-item>
</el-descriptions>
</el-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">
<span v-if="scope.row.order_"> {{ scope.row.order_.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="操作" fixed="right" align="center" width="100px">
<template #default="scope">
<el-link type="primary" @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>
<save-dialog v-if="dialog.save" ref="saveDialog" :orderId="orderId" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<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="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-link
type="primary"
@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>
<script>
import saveDialog from "./orderitem_form.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: null,
params: {},
orderId: '',
orderObj: {},
selection: [],
state_: {
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
},
};
},
mounted() {
this.orderId = this.$route.query.order;
this.params.order = this.$route.query.order;
this.apiObj = this.$API.sam.orderitem.list;
this.getOrder();
},
methods: {
getOrder() {
this.$API.sam.order.item.req(this.orderId).then((res) => {
this.orderObj = res;
})
},
//
table_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_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.sam.orderitem.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
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 = {};
},
},
name: "rparty",
components: {
saveDialog,
},
props: {
orderId: {
type: String,
default: "",
},
},
data() {
return {
dialog: {
save: false,
},
apiObj: null,
params: {},
orderObj: {},
selection: [],
state_: {
10: "完好",
20: "限用",
30: "在修",
40: "禁用",
},
visible: false,
};
},
mounted() {},
methods: {
open() {
this.visible = true;
this.params.order = this.orderId;
this.apiObj = this.$API.sam.orderitem.list;
this.getOrder();
},
getOrder() {
this.$API.sam.order.item.req(this.orderId).then((res) => {
this.orderObj = res;
});
},
//
table_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_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.sam.orderitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
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

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

View File

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

View File

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

View File

@ -1,248 +1,431 @@
<template>
<el-container>
<!-- 任务信息 -->
<el-header style="height: 20%; padding: 0">
<el-card style="width: 100%; height: 100%">
<template #header>
<div class="card-header">
<span>任务信息</span>
</div>
</template>
<el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item>
<el-descriptions-item label="产品全称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_name }}</span>
</el-descriptions-item>
<el-descriptions-item label="计划数量">{{ currentMtask.count }}</el-descriptions-item>
<el-descriptions-item label="计划日期">{{ currentMtask.start_date }}</el-descriptions-item>
<el-descriptions-item label="合格数">{{ currentMtask.count_ok }}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-header>
<!-- 日志 -->
<el-main style="padding: 0;">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog"
v-if="currentMtask && currentMtask.state == 20" v-auth="'mlog.create'">新增</el-button>
</div>
</el-header>
<el-main style="padding: 0;">
<scTable ref="mtaskMlogs" :apiObj="apiObj" row-key="id" :params="params" stripe hidePagination hideDo>
<el-table-column label="工序" prop="mgroup_name"></el-table-column>
<el-table-column label="产品名称" prop="material_out_" min-width="120">
<template #default="scope">
<span v-if="scope.row.material_out_">{{scope.row.material_out_.name}}</span>
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch"></el-table-column>
<el-table-column label="加工设备" prop="equipment_name"></el-table-column>
<el-table-column label="领用数量" prop="count_use"> </el-table-column>
<el-table-column label="加工数量" prop="count_real"> </el-table-column>
<el-table-column label="合格数量" prop="count_ok"></el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column prop="count_n_hs" label="划伤" />
<el-table-column prop="count_n_zs" label="挫伤" />
<el-table-column prop="count_n_zz" label="杂质" />
<el-table-column prop="count_n_tw" label="条纹" />
<el-table-column prop="count_n_zdd" label="锥度大" />
<el-table-column prop="count_n_d" label="短" />
<!-- -->
<!-- <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>
<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>
<el-container>
<el-drawer
v-model="visible"
title="进度详情"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<!-- 任务信息 -->
<el-header style="height: 20%; padding: 0">
<el-card style="width: 100%; height: 100%">
<template #header>
<div class="card-header">
<span>任务信息</span>
</div>
</template>
<el-descriptions>
<el-descriptions-item label="任务编号">{{
currentMtask.number
}}</el-descriptions-item>
<el-descriptions-item label="产品全称">
<span v-if="currentMtask.material_out_">{{
currentMtask.material_out_name
}}</span>
</el-descriptions-item>
<el-descriptions-item label="计划数量">{{
currentMtask.count
}}</el-descriptions-item>
<el-descriptions-item label="计划日期">{{
currentMtask.start_date
}}</el-descriptions-item>
<el-descriptions-item label="合格数">{{
currentMtask.count_ok
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-header>
<!-- 日志 -->
<el-main style="padding: 0">
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="addMlog"
v-if="currentMtask && currentMtask.state == 20"
v-auth="'mlog.create'"
>新增</el-button
>
</div>
</el-header>
<el-main style="padding: 0">
<scTable
ref="mtaskMlogs"
:apiObj="apiObj"
row-key="id"
:params="params"
stripe
hidePagination
hideDo
>
<el-table-column
label="工序"
prop="mgroup_name"
></el-table-column>
<el-table-column
label="产品名称"
prop="material_out_"
min-width="120"
>
<template #default="scope">
<span v-if="scope.row.material_out_">{{
scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column
label="批次号"
prop="batch"
></el-table-column>
<el-table-column
label="加工设备"
prop="equipment_name"
></el-table-column>
<el-table-column label="领用数量" prop="count_use">
</el-table-column>
<el-table-column label="加工数量" prop="count_real">
</el-table-column>
<el-table-column
label="合格数量"
prop="count_ok"
></el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column
prop="count_n_hs"
label="划伤"
/>
<el-table-column
prop="count_n_zs"
label="挫伤"
/>
<el-table-column
prop="count_n_zz"
label="杂质"
/>
<el-table-column
prop="count_n_tw"
label="条纹"
/>
<el-table-column
prop="count_n_zdd"
label="锥度大"
/>
<el-table-column prop="count_n_d" label="短" />
<!-- -->
<!-- <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>
<script>
import saveDialog from "./mlog6_form.vue";
import showDrawer from "./mlog_drawer.vue";
export default {
components: {
saveDialog, showDrawer
},
data() {
return {
mlogHandleLoading: false,
dialog: {
save: false,
},
state_: {
10: '创建中',
20: '已下达',
30: '生产中',
40: '已提交',
},
hideDo: true,
currentMtask: {},
apiObj: null,
params: {
mtask: ''
},
mlogId: '',
handledate: '',
dialogSave: false,
visibleDrawer: false,
}
},
mounted() {
this.mtaskId = this.$route.query.mtaskId;
console.log(this.$route.query)
debugger;
this.getMtask(this.mtaskId);
},
methods: {
getMtask(id) {
let that = this;
this.$API.pm.mtask.item.req(id).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;
components: {
saveDialog,
showDrawer,
},
props: {
mtaskId: {
type: String,
default: "",
},
},
data() {
return {
mlogHandleLoading: false,
dialog: {
save: false,
},
state_: {
10: "创建中",
20: "已下达",
30: "生产中",
40: "已提交",
},
hideDo: true,
currentMtask: {},
apiObj: null,
params: {
mtask: "",
},
mlogId: "",
handledate: "",
visible: false,
dialogSave: false,
visibleDrawer: false,
};
},
mounted() {
console.log(this.mtaskId);
this.getMtask();
},
methods: {
open() {
this.visible = true;
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.apiObj = this.$API.wpm.mlog.list;
})
},
table_show(row) {
this.visibleDrawer = true;
this.mlogId = row.id;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
this.params.mtask = this.mtaskId;
this.apiObj = this.$API.wpm.mlog.list;
});
},
table_show(row) {
this.visibleDrawer = true;
this.mlogId = row.id;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
handleQueryMtask() {
this.$refs.table.refresh();
},
//
addMlog() {
let that = this;
that.mgroup = that.currentMtask.mgroup;
that.material_out = that.currentMtask.material_out;
that.dialogSave = true;
that.$nextTick(() => {
that.$refs.saveDialog.open("add");
});
},
//
table_edit(row) {
this.dialogSave = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.mtaskMlogs.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
handleQueryMtask() {
this.$refs.table.refresh();
},
//
addMlog() {
let that = this;
that.mgroup = that.currentMtask.mgroup;
that.material_out = that.currentMtask.material_out;
that.dialogSave = true;
that.$nextTick(() => {
that.$refs.saveDialog.open("add");
});
},
//
table_edit(row) {
this.dialogSave = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.wpm.mlog.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.mtaskMlogs.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
//
handleSaveSuccess(data, mode) {
this.$refs.mtaskMlogs.refresh();
},
resetQuery() {
this.query = {};
},
mlog_submit(row) {
this.$API.wpm.mlog.submit.req(row.id).then(res => {
this.$message.success('操作成功')
this.getMtask(row.mtask)
}).catch(err => { })
},
mlog_revert(row) {
this.mlogHandleLoading = true;
this.$API.wpm.mlog.revert.req(row.id).then(res => {
this.$message.success("撤回成功");
this.getMtask(row.mtask)
this.mlogHandleLoading = false;
}).catch(e => {
this.mlogHandleLoading = false;
})
},
}
}
//
handleSaveSuccess(data, mode) {
this.$refs.mtaskMlogs.refresh();
},
resetQuery() {
this.query = {};
},
mlog_submit(row) {
let that = this;
this.$API.wpm.mlog.submit
.req(row.id)
.then((res) => {
that.$message.success("操作成功");
that.getMtask(that.mtask);
that.$refs.mtaskMlogs.refresh();
})
.catch((err) => {});
},
mlog_revert(row) {
let that = this;
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>
<style scoped>
.tabsHeader {
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index: 100
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index: 100;
}
.right-panel>*+* {
margin-left: 10px;
.right-panel > * + * {
margin-left: 10px;
}
.el-main.nopadding {
padding: 0 20px 0 20px
padding: 0 20px 0 20px;
}
.tableTitle {
height: 40px;
line-height: 40px;
font-size: 14px;
box-sizing: border-box;
border-bottom: 1px solid #eeeeee;
height: 40px;
line-height: 40px;
font-size: 14px;
box-sizing: border-box;
border-bottom: 1px solid #eeeeee;
}
</style>
</style>