This commit is contained in:
caoqianming 2025-02-05 15:50:22 +08:00
commit 9a7dea317b
28 changed files with 1307 additions and 806 deletions

View File

@ -34,6 +34,7 @@
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"json-editor-vue3": "^1.0.6", "json-editor-vue3": "^1.0.6",
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"moment": "^2.30.1",
"node-polyfill-webpack-plugin": "^4.0.0", "node-polyfill-webpack-plugin": "^4.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"print-js": "^1.6.0", "print-js": "^1.6.0",

View File

@ -130,7 +130,9 @@ export default {
font-weight: bold; font-weight: bold;
color: #008000; color: #008000;
} }
#mlogbwList .el-table--default .cell{
padding: 0 5px !important;
}
#table1.el-table, #table1.el-table,
#table1.el-table tr, #table1.el-table tr,
#table1.el-table .el-table__body-wrapper, #table1.el-table .el-table__body-wrapper,

View File

@ -26,6 +26,13 @@ export default {
return await http.post(this.url, data); return await http.post(this.url, data);
}, },
}, },
updateQuastatGoal: {
url: `${config.API_URL}/qm/quastat/update_rate_pass_t/`,
name: "更新合格率目标值",
post: async function (data = {}) {
return await http.post(this.url, data);
},
},
//质检项目 //质检项目
getTestItem: { getTestItem: {
url: `${config.API_URL}/qm/testitem/`, url: `${config.API_URL}/qm/testitem/`,

View File

@ -460,8 +460,8 @@ export default {
prints: { prints: {
name: "打印", name: "打印",
req: async function (data) { req: async function (data) {
// return await http.post(`${config.API_URL}/prints/`, data);
return await http.post("http://localhost:8080/prints/", data); return await http.post("http://localhost:8080/prints/", data);
// return await http.post("http://127.0.0.1:8080/prints/", data);
}, },
}, },
ana:{ ana:{

View File

@ -91,7 +91,7 @@ export default {
mounted(){ mounted(){
let that = this; let that = this;
let host = window.location.host; let host = window.location.host;
let jsUrl = host.indexOf('localhost')>-1?'http://222.222.144.147:6013/jsmap/jsmap.js':window.location.protocol + "//" + host+'/jsmap/jsmap.js'; let jsUrl = host.indexOf('localhost')>-1?'http://111.11.19.54:6013/jsmap/jsmap.js':window.location.protocol + "//" + host+'/jsmap/jsmap.js';
console.log(jsUrl) console.log(jsUrl)
that.loadScript('mapId',jsUrl, () => { that.loadScript('mapId',jsUrl, () => {
that.canUseMap = true; that.canUseMap = true;

View File

@ -154,7 +154,7 @@ export default {
this.getArea(); this.getArea();
let that = this; let that = this;
let host = window.location.host; let host = window.location.host;
let jsUrl = host.indexOf('localhost') > -1 ? 'http://222.222.144.147:6013/jsmap/jsmap.js' : window.location.protocol + "//" + host+'/jsmap/jsmap.js'; let jsUrl = host.indexOf('localhost') > -1 ? 'http://111.11.19.54:6013/jsmap/jsmap.js' : window.location.protocol + "//" + host+'/jsmap/jsmap.js';
that.loadScript('mapId', jsUrl, () => { that.loadScript('mapId', jsUrl, () => {
that.canUseMap = true; that.canUseMap = true;
}) })

View File

@ -101,13 +101,13 @@
width="120" width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
label="合计" label="合计"
prop="sum" prop="sum"
width="130" width="130"
fixed="right" fixed="right"
> >
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<el-table <el-table
v-if="query.type==1" v-if="query.type==1"
@ -116,7 +116,7 @@
style="width: 100%" style="width: 100%"
border border
:height="tableHeight" :height="tableHeight"
@cell-click="handleCellClick1"
> >
<el-table-column <el-table-column
label="分类" label="分类"
@ -135,13 +135,13 @@
width="120" width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
label="合计" label="合计"
prop="sum" prop="sum"
width="130" width="130"
fixed="right" fixed="right"
> >
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<el-table <el-table
v-if="query.type==2" v-if="query.type==2"
@ -150,7 +150,7 @@
style="width: 100%" style="width: 100%"
border border
:height="tableHeight" :height="tableHeight"
@cell-click="handleCellClick_month"
> >
<el-table-column <el-table-column
label="分类" label="分类"
@ -169,13 +169,13 @@
width="120" width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
label="合计" label="合计"
prop="sum" prop="sum"
width="130" width="130"
fixed="right" fixed="right"
> >
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<el-table <el-table
v-if="query.type==3" v-if="query.type==3"
@ -184,7 +184,7 @@
style="width: 100%" style="width: 100%"
border border
:height="tableHeight" :height="tableHeight"
@cell-click="handleCellClick_range"
> >
<el-table-column <el-table-column
label="分类" label="分类"
@ -242,9 +242,49 @@
<script> <script>
let legend = { let legend = {
top: "2%", top: "2%",
data: ["碳排放量(t)"], data: ["碳排放量(t)", "碳排放强度(t/t)"],
}; };
let colors = ["##36492E", "#4BA328", "#C6F47D"]; let grid = {
right: "11%",
left: "11%",
top: "27%",
};
let colors = ["#518A3A", "#2DAEEF", "#C6F47D"];
let yAxis = [
{
type: "value",
name: "碳排放量(t)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "碳排放强度(t/t)",
position: "right",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
},
},
axisLabel: {
formatter: "{value}",
},
}
];
import scEcharts from "@/components/scEcharts"; import scEcharts from "@/components/scEcharts";
export default { export default {
components: { components: {
@ -278,7 +318,6 @@ export default {
{id:0,name:'日统计'}, {id:0,name:'日统计'},
{id:1,name:'月统计'}, {id:1,name:'月统计'},
{id:2,name:'年统计'}, {id:2,name:'年统计'},
{id:3,name:'时间段'},
], ],
tableDatas2: [], tableDatas2: [],
tableDatas_day:[], tableDatas_day:[],
@ -389,13 +428,14 @@ export default {
xAxisData_month: [], xAxisData_month: [],
xTtimeRange: [], xTtimeRange: [],
gyhourlyData : [], gyhourlyData : [],
lvhourlyData : [], mpointList_code:"3750125939653558272,3759456603624382464,3636975194725527552",
StrengthData : [],
shhourlyData : [], // shhourlyData : [], //
gyhourlyData_month : [], gyhourlyData_month : [],
lvhourlyData_month : [], StrengthData_month : [],
shhourlyData_month : [], // ProductionData_month : [], //
gyhourlyData_year : [], gyhourlyData_year : [],
lvhourlyData_year : [], StrengthData_year : [],
shhourlyData_year : [], // shhourlyData_year : [], //
}; };
}, },
@ -450,10 +490,10 @@ export default {
}, },
changeDate(){ changeDate(){
let obj = {}; let obj = {};
obj.type = "day"; obj.type = "hour";
obj.start_time = this.daterange[0]; obj.start_time = this.daterange[0];
obj.end_time = this.daterange[1]; obj.end_time = this.daterange[1];
obj.mpoint__in = "3750125939653558272"; obj.mpoint__in = '3750125939653558272,3759456603624382464';
obj.page = 0; obj.page = 0;
this.$API.enm.mpointstat.groupValues.req(obj).then((res) => { this.$API.enm.mpointstat.groupValues.req(obj).then((res) => {
//res total_val //res total_val
@ -501,7 +541,7 @@ export default {
// enabled: 1, // enabled: 1,
// need_display: 1, // need_display: 1,
ordering: "report_sortstr", ordering: "report_sortstr",
code__in: "tpfl", code__in: "tanpfqd, tpfl",
query: "{ id, name, nickname, mgroup_name, unit, report_sortstr }", query: "{ id, name, nickname, mgroup_name, unit, report_sortstr }",
}) })
.then((res) => { .then((res) => {
@ -518,6 +558,7 @@ export default {
_nameLength = [], _nameLength = [],
indexList = []; indexList = [];
let mgroupObj = {}; let mgroupObj = {};
console.log(that.mpointList);
that.mpointList.forEach((item, index) => { that.mpointList.forEach((item, index) => {
let indexs = _mgroup.indexOf(item.mgroup_name); let indexs = _mgroup.indexOf(item.mgroup_name);
if (indexs > -1) { if (indexs > -1) {
@ -551,12 +592,14 @@ export default {
that.tableDatas2.push(obj); that.tableDatas2.push(obj);
that.getData(item.id, index); that.getData(item.id, index);
}); });
that.updateChart(that.gyhourlyData, that.shhourlyData, that.lvhourlyData); that.updateChart(that.gyhourlyData, that.StrengthData);
that.mgroupObj = mgroupObj; that.mgroupObj = mgroupObj;
that.indexList = indexList; that.indexList = indexList;
}, },
getData(id, index) { getData(id, index) {
let that = this; let that = this;
that.StrengthData = [];
that.gyhourlyData = [];
let obj = {}; let obj = {};
obj.type = "hour"; obj.type = "hour";
obj.year = that.year; obj.year = that.year;
@ -574,6 +617,10 @@ export default {
that.tableDatas2[index][keyName] = item.val; that.tableDatas2[index][keyName] = item.val;
if (item.mpoint_nickname == "碳排放量"){ if (item.mpoint_nickname == "碳排放量"){
that.gyhourlyData[item.hour] = item.val; that.gyhourlyData[item.hour] = item.val;
}else if(
item.mpoint_nickname == "碳排放强度"
){
that.StrengthData[item.hour] = item.val;
} }
}); });
sum = sum * 100; sum = sum * 100;
@ -585,11 +632,12 @@ export default {
that.$forceUpdate(); that.$forceUpdate();
}); });
}, },
updateChart(gyhourlyData, shhourlyData, lvhourlyData) { updateChart(gyhourlyData, StrengthData) {
let that = this; let that = this;
// ECharts // ECharts
let option = { let option = {
legend: legend, legend: legend,
grid: grid,
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
@ -600,19 +648,28 @@ export default {
type: 'category', type: 'category',
data: ['0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时'], data: ['0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时'],
}, },
yAxis: { yAxis: yAxis,
type: 'value',
name: ''
},
series: [{ series: [{
name: '碳排放量(t)', // name: '碳排放量(t)', //
type: 'bar', type: 'bar',
data: gyhourlyData, // data: gyhourlyData,
yAxisIndex: 0,
itemStyle: { itemStyle: {
color: '#518A3A', color: '#518A3A',
}, },
}, },
{
name: '碳排放强度(t/t)',
type: 'bar',
data: StrengthData,
yAxisIndex: 1,
itemStyle: {
color: colors[1],
},
},
] ]
}; };
that.optionHour = option; that.optionHour = option;
@ -621,9 +678,7 @@ export default {
let that = this; let that = this;
that.tableDatas = []; that.tableDatas = [];
that.tableDatas_day = []; that.tableDatas_day = [];
let _mgroup = [], let _mgroup = [], _nameLength = [], indexList = [];
_nameLength = [],
indexList = [];
let mgroupObj = {}; let mgroupObj = {};
that.mpointList.forEach((item, index) => { that.mpointList.forEach((item, index) => {
let indexs = _mgroup.indexOf(item.mgroup_name); let indexs = _mgroup.indexOf(item.mgroup_name);
@ -638,42 +693,39 @@ export default {
for (let i = 0; i < _mgroup.length; i++) { for (let i = 0; i < _mgroup.length; i++) {
mgroupObj[_mgroup[i]] = _nameLength[i]; mgroupObj[_mgroup[i]] = _nameLength[i];
} }
let arr = []; let arr = [];
arr[0] = arr[0] = item.mgroup_name != null ? item.mgroup_name : item.nickname != null ? item.nickname : item.name;
item.mgroup_name != null
? item.mgroup_name
: item.nickname != null
? item.nickname
: item.name;
arr[1] = item.nickname != null ? item.nickname : item.name; arr[1] = item.nickname != null ? item.nickname : item.name;
arr[2] = item.unit; arr[2] = item.unit;
for (let i = 0; i < that.days; i++) { for (let i = 0; i < that.days; i++) {
arr[i + 2] = 0; arr[i + 2] = 0;
} }
that.tableDatas.push(arr); that.tableDatas.push(arr);
let obj = {}; let obj = {};
obj.mgroupName = obj.mgroupName = item.mgroup_name != null ? item.mgroup_name : item.name;
item.mgroup_name != null ? item.mgroup_name : item.name; obj.nickname = item.nickname != null && item.nickname != "" ? item.nickname : item.name;
obj.nickname =
item.nickname != null && item.nickname != ""
? item.nickname
: item.name;
obj.unit = item.unit; obj.unit = item.unit;
that.tableDatas_day.push(obj); that.tableDatas_day.push(obj);
that.getData1(item.id, index);
// getData1(index)
that.getData1(index);
}); });
that.updateMonthChart(that.gyhourlyData_month);
that.updateMonthChart(that.gyhourlyData_month, that.StrengthData_month, that.ProductionData_month);
that.mgroupObj = mgroupObj; that.mgroupObj = mgroupObj;
that.indexList = indexList; that.indexList = indexList;
},
},
updateMonthChart(gyhourlyData) { updateMonthChart(gyhourlyData, StrengthData, ) {
let that = this; let that = this;
// ECharts // ECharts
let option1 = { let option1 = {
legend: legend, legend: legend,
grid: grid,
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
@ -684,45 +736,79 @@ export default {
type: 'category', type: 'category',
data: [], data: [],
}, },
yAxis: { yAxis: yAxis,
type: 'value',
name: ''
},
series: [{ series: [{
name: '碳排放量(t)', // name: '碳排放量(t)',
type: 'bar', type: 'bar',
data: gyhourlyData, // data: gyhourlyData,
yAxisIndex: 0,
itemStyle: { itemStyle: {
color: '#518A3A', color: '#518A3A',
}, },
}, },
{
name: '碳排放强度(t/t)',
type: 'bar',
data: StrengthData,
yAxisIndex: 1,
itemStyle: {
color: colors[1],
},
},
] ]
}; };
option1.xAxis.data = that.xAxisData_day; option1.xAxis.data = that.xAxisData_day;
that.optionDay = option1; that.optionDay = option1;
}, },
getData1(id, index) { getData1(index) {
let that = this; let that = this;
that.StrengthData_month = [];
that.gyhourlyData_month = [];
let carbonEmission = []; //
let outputKiln = []; //
let emissionIntensity = []; //
let obj = {}; let obj = {};
obj.type = "day"; obj.type = "day";
obj.year = that.year; obj.year = that.year;
obj.month = that.month; obj.month = that.month;
obj.mpoint = id; obj.mpoint__in = this.mpointList_code;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => { this.$API.enm.mpoint.stat.req(obj).then((res) => {
let sum = 0; let sum = 0;
res.forEach((item) => { res.forEach((item) => {
let ind = item.day+2; let ind = item.day + 2;
that.tableDatas[index][ind] = item.val; that.tableDatas[index][ind] = item.val;
sum += Number(item.val); sum += Number(item.val);
let keyName = item.day + "日"; if (item.mpoint_nickname === "碳排放量") {
that.tableDatas_day[index][keyName] = item.val; carbonEmission[item.day - 1] = item.val; //
} else if (item.mpoint_nickname === "出窑熟料产量") {
outputKiln[item.day - 1] = item.val; //
}
if(item.mpoint_nickname == "碳排放强度"){
return;
}
// that.tableDatas_day[index][keyName] = item.val;
if (item.mpoint_nickname == "碳排放量"){ if (item.mpoint_nickname == "碳排放量"){
that.gyhourlyData_month[item.day-1] = item.val; that.gyhourlyData_month[item.day - 1] = item.val;
} else if(item.mpoint_nickname == "出窑熟料产量"){
that.ProductionData_month[item.day - 1] = item.val;
} }
}); });
// /
for (let i = 0; i < carbonEmission.length; i++) {
let keyName = i + 1 + "日";
if(index==1 && carbonEmission[i] && outputKiln[i]){
emissionIntensity[i] = carbonEmission[i] / outputKiln[i]; //
that.StrengthData_month[i] = emissionIntensity[i].toFixed(2); // StrengthData_month
that.tableDatas_day[index][keyName] = emissionIntensity[i].toFixed(2); // tableDatas_day
} else if(index==0 && carbonEmission[i]){
that.tableDatas_day[index][keyName] = carbonEmission[i];
}
}
sum = sum * 100; sum = sum * 100;
sum = Math.round(sum); sum = Math.round(sum);
sum = sum / 100; sum = sum / 100;
@ -732,7 +818,8 @@ export default {
that.tableDatas_day[index].sum = sum.toFixed(2); that.tableDatas_day[index].sum = sum.toFixed(2);
that.$forceUpdate(); that.$forceUpdate();
}); });
}, },
dataLoop_month() { dataLoop_month() {
let that = this; let that = this;
that.tableDatas = []; that.tableDatas = [];
@ -772,16 +859,17 @@ export default {
: item.name; : item.name;
obj.unit = item.unit; obj.unit = item.unit;
that.tableDatas_month.push(obj); that.tableDatas_month.push(obj);
that.getData_month(item.id, index); that.getData_month(index);
}); });
that.updateMonthChart_month(that.gyhourlyData_year, that.shhourlyData_year, that.lvhourlyData_year); that.updateMonthChart_month(that.gyhourlyData_year, that.StrengthData_year);
that.mgroupObj = mgroupObj; that.mgroupObj = mgroupObj;
that.indexList = indexList; that.indexList = indexList;
}, },
updateMonthChart_month(gyhourlyData) { updateMonthChart_month(gyhourlyData_year, StrengthData_year) {
let that = this; let that = this;
let option2 = { let option2 = {
legend: legend, legend: legend,
grid: grid,
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
@ -792,30 +880,42 @@ export default {
type: 'category', type: 'category',
data: [], data: [],
}, },
yAxis: { yAxis: yAxis,
type: 'value',
name: ''
},
series: [{ series: [{
name: '工业水', // name: '碳排放量(t)',
type: 'bar', type: 'bar',
data: gyhourlyData, // data: gyhourlyData_year,
yAxisIndex: 0,
itemStyle: { itemStyle: {
color: '#518A3A', color: '#518A3A',
}, },
},
{
name: '碳排放强度(t/t)',
type: 'bar',
data: StrengthData_year,
yAxisIndex: 1,
itemStyle: {
color: colors[1],
},
} }
] ]
}; };
option2.xAxis.data = that.xAxisData_month; option2.xAxis.data = that.xAxisData_month;
that.optionMonth = option2; that.optionMonth = option2;
}, },
getData_month(id, index) { getData_month(index) {
let that = this; let that = this;
that.StrengthData_year = [];
that.gyhourlyData_year = [];
let carbonEmission = []; //
let outputKiln = []; //
let emissionIntensity = []; //
let obj = {}; let obj = {};
obj.type = "month"; obj.type = "month";
obj.year = that.year; obj.year = that.year;
obj.mpoint = id; obj.mpoint__in = that.mpointList_code;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => { this.$API.enm.mpoint.stat.req(obj).then((res) => {
let sum = 0; let sum = 0;
@ -824,11 +924,34 @@ export default {
that.tableDatas[index][ind] = item.val; that.tableDatas[index][ind] = item.val;
sum += Number(item.val); sum += Number(item.val);
let keyName = item.month + "月"; let keyName = item.month + "月";
that.tableDatas_month[index][keyName] = item.val; // that.tableDatas_month[index][keyName] = item.val;
if (item.mpoint_nickname === "碳排放量") {
carbonEmission[item.month - 1] = item.val; //
} else if (item.mpoint_nickname === "出窑熟料产量") {
outputKiln[item.month - 1] = item.val; //
}
if(item.mpoint_nickname == "碳排放强度"){
return;
}
if (item.mpoint_nickname == "碳排放量"){ if (item.mpoint_nickname == "碳排放量"){
that.gyhourlyData_year[item.month-1] = item.val; that.gyhourlyData_year[item.month-1] = item.val;
}else if(item.mpoint_nickname == "碳排放强度"){
that.StrengthData_year[item.month-1] = item.val;
} }
}); });
// /
for (let i = 0; i < carbonEmission.length; i++) {
let keyName = i + 1 + "月";
if(index==1 && carbonEmission[i] && outputKiln[i]){
emissionIntensity[i] = carbonEmission[i] / outputKiln[i]; //
that.StrengthData_year[i] = emissionIntensity[i].toFixed(2); // StrengthData_month
that.tableDatas_month[index][keyName] = emissionIntensity[i].toFixed(2); // tableDatas_day
} else if(index==0 && carbonEmission[i]){
that.tableDatas_month[index][keyName] = carbonEmission[i];
}
}
sum = sum * 100; sum = sum * 100;
sum = Math.round(sum); sum = Math.round(sum);
sum = sum / 100; sum = sum / 100;
@ -853,9 +976,10 @@ export default {
handleCellClick1(row, column, cell, event) { handleCellClick1(row, column, cell, event) {
let that = this; let that = this;
let index = that.tableDatas_day.indexOf(row); let index = that.tableDatas_day.indexOf(row);
console.log('row', row) console.log("row", row, that.tableDatas_day, index);
that.tableName = `${row.nickname}-电量日统计` that.tableName = `${row.nickname}`
let lineData = that.tableDatas[index].slice(3, that.days + 3); console.log("tableDatas", that.tableDatas);
let lineData = that.tableDatas_day[index].slice(2, 13);
that.option.xAxis.data = that.xAxisData_day; that.option.xAxis.data = that.xAxisData_day;
that.option.series[0].data = lineData; that.option.series[0].data = lineData;
this.itemVisible = true; this.itemVisible = true;
@ -863,7 +987,7 @@ export default {
handleCellClick_month(row, column, cell, event) { handleCellClick_month(row, column, cell, event) {
let that = this; let that = this;
let index = that.tableDatas_month.indexOf(row); let index = that.tableDatas_month.indexOf(row);
that.tableName = `${row.nickname}-电量日统计` that.tableName = `${row.nickname}`
// //
let lineData = that.tableDatas[index].slice(2, 13); let lineData = that.tableDatas[index].slice(2, 13);
that.option.xAxis.data = that.xAxisData_month; that.option.xAxis.data = that.xAxisData_month;

View File

@ -338,6 +338,7 @@
</template> </template>
<script> <script>
const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#5f6694", "#cb9bff", "#7DDA58"]; const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#5f6694", "#cb9bff", "#7DDA58"];
const colors_hour = ["#5b9bd5", "#ffc000", "#5f6694", "#cb9bff", "#7DDA58"];
// ///// // /////
let tooltip = { let tooltip = {
show: true, show: true,
@ -723,7 +724,7 @@ export default {
{id:2,name:'年统计'} {id:2,name:'年统计'}
], ],
option1: { option1: {
color: colors, color: colors_hour,
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,

View File

@ -201,7 +201,7 @@ export default {
production_cost_unit:item.production_cost_unit, production_cost_unit:item.production_cost_unit,
CaO:item.出窑熟料_fCaO_rate_pass, CaO:item.出窑熟料_fCaO_rate_pass,
coal_consume_unit:item.coal_consume_unit, coal_consume_unit:item.coal_consume_unit,
Fe2o3:item.入窑生料_Fe2O3_rate_pass, lisz:item.出窑熟料_立升重_rate_pass,
elec:item.elec_consume_unit, elec:item.elec_consume_unit,
} }
); );
@ -411,20 +411,20 @@ export default {
} }
arr[29] += production_hour_score; arr[29] += production_hour_score;
// const production_cost_unit_itemValue = item.production_cost_unit; // const lisz_itemValue = item.出窑熟料_立升重_rate_pass; //
// const production_cost_unit_sortedData = monthData.sort((a, b) => parseFloat(b.production_cost_unit) - parseFloat(a.production_cost_unit)); const lisz_sortedData = monthData.sort((a, b) => parseFloat(b.lisz) - parseFloat(a.lisz));
// const production_cost_unit_index = production_cost_unit_sortedData.findIndex(obj => parseFloat(obj.production_cost_unit) === parseFloat(production_cost_unit_itemValue)); const lisz_index = lisz_sortedData.findIndex(obj => parseFloat(obj.lisz) === parseFloat(lisz_itemValue));
// let production_cost_unit_score = 0; let production_cost_unit_score = 0;
// if (production_cost_unit_index === 0){ if (lisz_index === 0){
// production_cost_unit_score= 10; production_cost_unit_score= 7;
// } else if (production_cost_unit_index === 1) { } else if (lisz_index === 1) {
// production_cost_unit_score= 7; production_cost_unit_score= 4;
// } else if (production_cost_unit_index === 2) { } else if (lisz_index === 2) {
// production_cost_unit_score= 3; production_cost_unit_score= 3;
// } else if (production_cost_unit_index === 3) { } else if (lisz_index === 3) {
// production_cost_unit_score= 0; production_cost_unit_score= 2;
// } }
// arr[29] += production_cost_unit_score; arr[29] += production_cost_unit_score;
const CaO_itemValue = item.出窑熟料_fCaO_rate_pass; // CaO const CaO_itemValue = item.出窑熟料_fCaO_rate_pass; // CaO
const CaO_sortedData = monthData.sort((a, b) => parseFloat(b.CaO) - parseFloat(a.CaO)); const CaO_sortedData = monthData.sort((a, b) => parseFloat(b.CaO) - parseFloat(a.CaO));

View File

@ -290,7 +290,8 @@
</div> </div>
</template> </template>
<script> <script>
const colors = ["#5b9bd5", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC", "#7DDA58", "#BCB69D"]; const colors = ["#5b9bd5", "#cbd3fe", "#B79C2C", "#EE6666", "#CC00CC", "#7DDA58", "#BCB69D","#0AF2FA", "#48D311"];
const colors1 = ["#5b9bd5", "#cbd3fe", "#B79C2C", "#EE6666", "#CC00CC", "#726691", "#48D311"];
let tooltip = { let tooltip = {
show: true, show: true,
trigger: "axis", trigger: "axis",
@ -337,7 +338,7 @@ let yAxis = [
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: colors[0], color: colors[7],
}, },
}, },
axisLabel: { axisLabel: {
@ -353,7 +354,7 @@ let yAxis = [
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: colors[1], color: colors[8],
}, },
}, },
axisLabel: { axisLabel: {
@ -478,12 +479,18 @@ export default {
yAxisIndex: 0, yAxisIndex: 0,
data: [], data: [],
}, },
{
name: "分布电耗",
type: "bar",
yAxisIndex: 1,
data: [],
},
], ],
}, },
option2: { option2: {
color: colors, color: colors1,
tooltip: tooltip, tooltip: tooltip,
legend: Object.assign(legend, {data:["袋装合计", "散装合计", "熟料出厂合计", "出厂水泥合计", "复合水泥合计", "分布电耗目标值","分布电耗"]}), legend: Object.assign(legend, {data:["袋装合计", "散装合计", "熟料出厂合计", "出厂水泥合计", "复合水泥合计", "分布电耗目标值","分布电耗"]}),
grid: grid, grid: grid,
@ -550,7 +557,7 @@ export default {
{ {
name: "分布电耗", name: "分布电耗",
type: "bar", type: "bar",
yAxisIndex: 0, yAxisIndex: 1,
data: [], data: [],
}, },
], ],
@ -878,7 +885,8 @@ export default {
seriesData2 = [], seriesData2 = [],
seriesData3 = [], seriesData3 = [],
seriesData4 = [], seriesData4 = [],
seriesData5 = []; seriesData5 = [],
seriesData6 = [];
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let ind = item.day_s - 1; let ind = item.day_s - 1;
@ -892,6 +900,8 @@ export default {
seriesData4[ind] = item.val; seriesData4[ind] = item.val;
}else if (item.mpoint_name == "复合水泥合计" || item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") { }else if (item.mpoint_name == "复合水泥合计" || item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") {
seriesData5[ind] = item.val; seriesData5[ind] = item.val;
}else if(item.mpoint_name == "包装进线"){
seriesData6[ind] = item.elec_consume_unit;
} }
}); });
@ -901,6 +911,7 @@ export default {
options.series[2].data = seriesData3; options.series[2].data = seriesData3;
options.series[3].data = seriesData4; options.series[3].data = seriesData4;
options.series[4].data = seriesData5; options.series[4].data = seriesData5;
options.series[5].data = seriesData6;
let dayXAxis = []; let dayXAxis = [];
for (let i = 1; i <= that.days; i++) { for (let i = 1; i <= that.days; i++) {
let item = i + "日"; let item = i + "日";

View File

@ -70,16 +70,6 @@
</el-header> </el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div class="tableContainer"> <div class="tableContainer">
<!-- <div>
<label for="threshold">输入合格率阈值</label>
<input
type="text"
id="threshold"
v-model="currentThreshold"
placeholder="例如80%"
@input="updateThreshold"
/>
</div> -->
<table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable"> <table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead"> <thead class="myTableHead">
<tr> <tr>
@ -113,7 +103,6 @@
title="设置合格率的阈值" title="设置合格率的阈值"
v-model="dialogVisible" v-model="dialogVisible"
width="30%" width="30%"
@close="resetDialog"
> >
<div> <div>
<label>当前阈值:</label> <label>当前阈值:</label>
@ -144,34 +133,11 @@
], ],
titleLength:1, titleLength:1,
mgroupOptions:[], mgroupOptions:[],
threshold: 80, // currentThreshold: 80, //
currentThreshold: "80%", //
tableTime:'', tableTime:'',
deptName:'', deptName:'',
typeName:'质检日报表', typeName:'质检日报表',
tableName:'', tableName:'',
tableDatas:[
['原料车间','辅料','细度', , , , , , ],
['原料车间','辅料','Fe2O3', , , , , , ],
['原料车间','辅料','水分', , , , , , ],
['原料车间','干混生料','细度', , , , , , ],
['原料车间','干混生料','Fe2O3', , , , , , ],
['原料车间','干混生料','水分', , , , , , ],
['原料车间','干混生料','CaO', , , , , , ],
['烧成车间','入窑生料','CaO', , , , , , ],
['烧成车间','入窑生料','Fe2O3', , , , , , ],
['烧成车间','入窑生料','细度'],
['烧成车间','入窑生料','水分'],
['烧成车间','熟料','立升重'],
['烧成车间','熟料','f-CaO'],
['烧成车间','煤粉','细度'],
['烧成车间','煤粉','水分'],
['水泥车间','出磨水泥','比表面积'],
['水泥车间','出磨水泥','SO3'],
['水泥车间','出磨水泥','掺量'],
],
tableDatas3:[], tableDatas3:[],
exportLoading:false, exportLoading:false,
header2:[], header2:[],
@ -181,17 +147,14 @@
header2Obj:[], header2Obj:[],
deptOptions:[], deptOptions:[],
dialogVisible: false, // dialogVisible: false, //
currentColumnIndex: null, // // thresholds: {}, // key
thresholds: {}, // key thresholdobj:{},
materialTestItemMap:{},
currentMaterialName: null, //
currentTestItemName: null, //
}; };
}, },
watch: {
header3: {
handler(newV, OldV) {
this.header3 = newV;
}
}
},
mounted() { mounted() {
var myDate = new Date(); var myDate = new Date();
let month = myDate.getMonth()+1; let month = myDate.getMonth()+1;
@ -211,35 +174,76 @@
let that = this; let that = this;
if(value==1){ if(value==1){
this.typeName = '质检日报表' this.typeName = '质检日报表'
}else if(value==1){ }else if(value==0){
this.typeName = '质检月报表' this.typeName = '质检月报表'
} }
that.tableName = that.deptName+that.typeName; that.tableName = that.deptName+that.typeName;
}, },
updateThreshold() { updateThreshold() {
const num = parseFloat(this.currentThreshold.replace("%", "")); let that = this;
if (!isNaN(num)) { const num = parseFloat(that.currentThreshold);
// if (!isNaN(num)){
this.thresholds[this.currentColumnIndex] = num; const key = `${that.currentMaterialName}-${that.currentTestItemName}`;
this.dialogVisible = false; // const mapEntry = that.materialTestItemMap[key];
} else { if (!mapEntry) {
this.$message.error("请输入有效的阈值例如80%"); return;
}
const payload = {
material_id: mapEntry.material_id,
testitem_id: mapEntry.testitem_id,
rate_pass_t: num,
month_s: mapEntry.month_s,
};
that.$API.qm.updateQuastatGoal.post(payload)
.then((res) => {
that.$message.success("阈值更新成功");
// this.thresholds[this.currentColumnIndex] = res.rate_pass_t; //
that.dialogVisible = false; //
})
.catch((error) => {
that.$message.error("阈值更新失败:" + error.message);
});
}else {
that.$message.error("请输入有效的阈值例如80%");
} }
}, },
// //
resetDialog() { // resetDialog() {
this.currentColumnIndex = null; // this.currentThreshold = "";
this.currentThreshold = ""; // },
},
// //
getCellClass(cell, cellIndex) { getCellClass(cell, cellIndex) {
if (cellIndex > 0 && ((cellIndex - 1) % 4 === 3)) { let that = this;
if (typeof cell === 'string' && cell.includes('%')) {
// //
const cellValue = String(cell); const cellValue = String(cell);
const value = parseFloat(cellValue.replace("%", "")); const value = parseFloat(cellValue.replace("%", ""));
const threshold = this.thresholds[cellIndex] || 0; // const header4Index = cellIndex - 1; // 0
if (!isNaN(value)) { const header3Index = Math.floor(header4Index / 4);
return value > threshold ? "green-text" : "red-text"; let cumulativeLength = 0;
let header2Index = -1;
for (let i = 0; i < that.header2Obj.length; i++) {
cumulativeLength += that.header2Obj[i].lengths * 4;
if (header4Index < cumulativeLength) {
header2Index = i;
break;
}
}
let currentMaterialNameClass = ''
let currentTestItemNameClass = ''
if (header2Index !== -1 && header3Index !== -1){
currentMaterialNameClass = that.header2Obj[header2Index].name; // header2Obj
currentTestItemNameClass = that.header3[header3Index]; // header3
}else {
currentMaterialNameClass = '';
currentTestItemNameClass = '';
}
const keyName = `${currentMaterialNameClass}-${currentTestItemNameClass}`;
const rate_g = that.thresholdobj[keyName] || 0;
if (rate_g >= value) {
return 'red-text';
} else {
return 'green-text';
} }
} }
return ""; return "";
@ -264,43 +268,67 @@
}); });
}, },
handleCellClick(cell, rowIndex, cellIndex){ handleCellClick(cell, rowIndex, cellIndex){
if ((cellIndex - 1) % 4 === 3) { // let that = this;
this.currentColumnIndex = cellIndex; // const header4Index_hd = cellIndex - 1 ; // 0
this.currentThreshold = this.thresholds[cellIndex] || ""; // const header3Index_hd = Math.floor(header4Index_hd / 4) ;
this.dialogVisible = true; // let cumulativeLength = 0;
let header2Index = -1;
//
for (let i = 0; i < this.header2Obj.length; i++) {
cumulativeLength += this.header2Obj[i].lengths * 4;
if (header4Index_hd < cumulativeLength) {
header2Index = i;
break;
} }
}
if (header2Index !== -1 && header3Index_hd !== -1){
that.currentMaterialName = this.header2Obj[header2Index].name; // header2Obj
that.currentTestItemName = this.header3[header3Index_hd]; // header3
}else {
that.currentMaterialName = '';
that.currentTestItemName = '';
}
const keyName = `${that.currentMaterialName}-${that.currentTestItemName}`;
that.currentThreshold = that.thresholdobj[keyName] || 0;
that.dialogVisible = true;
}, },
getTableData(){ getTableData(){
let that = this; let that = this;
that.tableDatas3 = []; that.tableDatas3 = [];
that.materialTestItemMap = {};
that.thresholdobj = {};
that.header3 = []; that.header3 = [];
let arr = [];
let update_start_time = '';
let update_end_time = '';
if(that.deptName=='原料车间'){ if(that.deptName=='原料车间'){
that.header2Obj=[{name:'辅料',lengths:3},{name:'干混生料',lengths:4}]; that.header2Obj=[{name:'辅料',lengths:3},{name:'干混生料',lengths:4}];
that.header2 = ['辅料','干混生料'];// that.header2 = ['辅料','干混生料'];//
// that.header3 = ['','Fe2O3','','','Fe2O3','','CaO'];//
that.header4 = ['平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率'];//
}else if(that.deptName=='烧成车间'){ }else if(that.deptName=='烧成车间'){
that.header2Obj=[{name:'入窑生料',lengths:4},{name:'熟料',lengths:4}]; that.header2Obj=[{name:'出窑熟料',lengths:4},{name:'熟料',lengths:4}];
that.header2 = ['入窑生料','熟料'];// that.header2 = ['出窑熟料','熟料'];//
// that.header3 = ['CaO','Fe2O3','','','','f-CaO','',''];//
that.header4 = ['平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率'];//
}else{ }else{
that.header2Obj=[{name:'出磨水泥',lengths:3}]; that.header2Obj=[{name:'出磨水泥',lengths:3}];
that.header2 = ['出磨水泥'];// that.header2 = ['出磨水泥'];//
// that.header3 = ['','SO3',''];//
that.header4 = ['平均值','检次','合次','合格率','平均值','检次','合次','合格率','平均值','检次','合次','合格率'];//
} }
let params = {page: 0}; let params = {page: 0};
let arr = [];
if(that.query.type==0){// if(that.query.type==0){//
arr = that.query.month.split('-'); arr = that.query.month.split('-');
params.year_s = arr[0]; params.year_s = arr[0];
params.month_s = arr[1]; params.month_s = parseInt(arr[1]);
params.type = 'day_s' params.type = 'day_s'
// const updateStartDate = new Date(params.year_s, params.month_s - 1, 1); // 0
// const updateEndDate = new Date(params.year_s, params.month_s, 0);
// update_start_time = updateStartDate.toISOString().split('T')[0]; // 'YYYY-MM-DD'
// update_end_time = updateEndDate.toISOString().split('T')[0]; //
}else if(that.query.type==1){// }else if(that.query.type==1){//
params.type = 'month_s' params.type = 'month_s'
params.year_s = that.query.year; params.year_s = that.query.year;
// const updateStartDate = new Date(params.year_s, 0, 1); // 1 1
// const updateEndDate = new Date(params.year_s, 11, 31); // 12 31
// update_start_time = updateStartDate.toISOString().split('T')[0]; // 'YYYY-MM-DD'
// update_end_time = updateEndDate.toISOString().split('T')[0];
} }
params.mgroup__belong_dept = that.query.belong_dept; params.mgroup__belong_dept = that.query.belong_dept;
this.$API.enm.enstat.req(params).then((res) => { this.$API.enm.enstat.req(params).then((res) => {
@ -321,24 +349,27 @@
wrapArr[ind] = []; wrapArr[ind] = [];
} }
if(that.deptName=='原料车间'){ if(that.deptName=='原料车间'){
wrapArr[ind].push(item) if (item.mgroup_name=='生料工序(二次配料)'){
wrapArr[ind][0]=item
}else if(item.mgroup_name=='原料磨'){
wrapArr[ind][1]=item
}
}else if(that.deptName=='烧成车间'){ }else if(that.deptName=='烧成车间'){
if(item.mgroup_name=='回转窑'){ if(item.mgroup_name=='回转窑'){
wrapArr[ind][1]=item wrapArr[ind][1]=item
}else{ }else if(item.mgroup_name=='煤磨'){
wrapArr[ind][0]=item wrapArr[ind][0]=item
} }
}else{ }else{
wrapArr[ind].push(item) wrapArr[ind].push(item)
} }
}); });
wrapArr = wrapArr.filter(item=>{ wrapArr = wrapArr.filter(item => item && item.length > 0);
return item console.log(wrapArr, "-------------wrapArr")
})
wrapArr.forEach((item1,index1)=>{ wrapArr.forEach((item1,index1)=>{
if(item1!=undefined){// if(item1!=undefined){//
let itemArr = []; let itemArr = [];
// _
let header2tem=[],header2Objtem=[],header3tem=[],header4tem=[]; let header2tem=[],header2Objtem=[],header3tem=[],header4tem=[];
let time =item1[0].day_s!=null? item1[0].year_s+'.'+item1[0].month_s+'.'+item1[0].day_s:item1[0].year_s+'.'+item1[0].month_s; let time =item1[0].day_s!=null? item1[0].year_s+'.'+item1[0].month_s+'.'+item1[0].day_s:item1[0].year_s+'.'+item1[0].month_s;
itemArr.push(time) itemArr.push(time)
@ -348,6 +379,15 @@
// //
data2.forEach((item3,index3)=>{ data2.forEach((item3,index3)=>{
//item3 //item3
let key = `${item3.material_name}-${item3.testitem_name}`;
if (!that.materialTestItemMap[key]) {
that.materialTestItemMap[key] = {
material_id: item3.material,
testitem_id: item3.testitem,
month_s:params.month_s,
// end_time:update_end_time
};
}
if(header2tem.indexOf(item3.material_name)>-1){ if(header2tem.indexOf(item3.material_name)>-1){
let indexObj = header2tem.indexOf(item3.material_name); let indexObj = header2tem.indexOf(item3.material_name);
header2Objtem[indexObj].lengths = header2Objtem[indexObj].lengths+1; header2Objtem[indexObj].lengths = header2Objtem[indexObj].lengths+1;
@ -369,7 +409,6 @@
}else{ }else{
itemArr[ind] = 0; itemArr[ind] = 0;
} }
// itemArr[ind] = (item3.val_avg).toFixed(2);
itemArr.push(item3.num_test) itemArr.push(item3.num_test)
itemArr.push(item3.num_ok) itemArr.push(item3.num_ok)
let pass = 0; let pass = 0;
@ -380,15 +419,18 @@
pass = Number(item3.rate_pass).toFixed(2) + '%'; pass = Number(item3.rate_pass).toFixed(2) + '%';
itemArr.push(pass) itemArr.push(pass)
} }
if(!that.thresholdobj[item3.material_name+"-"+item3.testitem_name]){
// pass= pass+'%'; that.thresholdobj[item3.material_name+"-"+item3.testitem_name] = item3.rate_g;
}
}else{ }else{
itemArr.push(Number(item3.val_avg).toFixed(2)); itemArr.push(Number(item3.val_avg).toFixed(2));
itemArr.push(item3.num_test); itemArr.push(item3.num_test);
itemArr.push(item3.num_ok) itemArr.push(item3.num_ok)
let pass = Number(item3.rate_pass).toFixed(2); let pass = Number(item3.rate_pass).toFixed(2);
pass= pass+'%'; pass= pass+'%';
if(!that.thresholdobj[item3.material_name+"-"+item3.testitem_name]){
that.thresholdobj[item3.material_name+"-"+item3.testitem_name] = item3.rate_g;
}
itemArr.push(pass) itemArr.push(pass)
} }
that.titleLength =itemArr.length; that.titleLength =itemArr.length;
@ -419,7 +461,6 @@
if(header4.length>0){ if(header4.length>0){
that.header4 = header4; that.header4 = header4;
} }
this.$forceUpdate();
innerArr.forEach(item=>{ innerArr.forEach(item=>{
if(item.length>1){ if(item.length>1){
that.tableDatas3.push(item) that.tableDatas3.push(item)

View File

@ -691,7 +691,6 @@ export default {
let form = this.$TOOL.data.get("sflogItem"); let form = this.$TOOL.data.get("sflogItem");
this.form = JSON.parse(form); this.form = JSON.parse(form);
console.log('----------------',this.form);
this.querystlog.mgroup = this.mgroupId; this.querystlog.mgroup = this.mgroupId;
this.querystlog.sflogs = this.form.id; this.querystlog.sflogs = this.form.id;
this.apiObjStlog = this.$API.wpm.stlog.list; this.apiObjStlog = this.$API.wpm.stlog.list;
@ -903,7 +902,6 @@ export default {
}, },
//stlogsflogexp //stlogsflogexp
stlogRowClick(row) { stlogRowClick(row) {
console.log(row);
this.clickItem = row; this.clickItem = row;
this.getSflogexp(row.id); this.getSflogexp(row.id);
}, },

View File

@ -1164,7 +1164,7 @@ export default {
); );
that.tableDatas[6][5] = that.tableDatas[6][5] =
data1.production_cost_unit; data1.production_cost_unit;
that.tableDatas[6][9] = precen( that.tableDatas[6][9] = consume_precen(
(that.tableDatas[6][8] - that.tableDatas[6][5]), (that.tableDatas[6][8] - that.tableDatas[6][5]),
that.tableDatas[6][8] that.tableDatas[6][8]
); );

View File

@ -0,0 +1,352 @@
<template>
<el-drawer
v-model="visible"
title="检验"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="formbw"
:rules="rules"
label-width="140px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="检验时间" prop="test_date">
<el-date-picker
v-model="formbw.test_date"
type="date"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验员" prop="test_user">
<el-select
v-model="formbw.test_user"
placeholder="检验员"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input v-model="formbw.note"> </el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 检测项 -->
<el-row>
<el-col>检测项</el-col>
<el-col v-for="(item) in qct_testitems" :key="item.id" :md="12" :sm="24">
<el-form-item :label="item.testitem_name">
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="formbw[item.testitem_name]"
:min="0"
class="width-100"
controls-position="right"
@change="defectCountSun"
>
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="formbw[item.testitem_name]"
:min="0"
class="width-100"
controls-position="right"
@change="defectCountSun"
>
</el-input-number>
<el-input
v-if="item.testitem_field_type=='input-text'"
v-model="formbw[item.testitem_name]"
class="width-100"
@change="defectCountSun"
>
</el-input>
<el-select
v-if="item.testitem_field_type=='select-text'"
v-model="formbw[item.testitem_name]"
clearable
class="width-100"
@change="defectCountSun"
>
<el-option
v-for="item0 in item.testitem_choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="formbw[item.testitem_name]"
clearable
multiple
class="width-100"
@change="defectCountSun"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 缺陷项 -->
<el-row>
<el-col>缺陷项</el-col>
<el-col v-for="item in qct_defects" :key="item.id" :md="12" :sm="24">
<el-form-item :label="item.defect_name">
<el-switch v-model="formbw[item.defect_name]" style="--el-switch-on-color: #FF0000; --el-switch-off-color: green;"></el-switch>
<span v-if="item.note!==null&&item.note!==''" style="font-size: 12px; color: #a9a7a7;">({{ item.note }})</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer v-if="mode == 'add'">
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["success", "closed"],
props: {
material: { type: String, default: "" },
mioitemw: { type: Object, default: () => {} },
},
data() {
return {
loading: false,
form: {
weight_kgs: [],
ftestitems: [],
},
rules: {
test_date: [
{
required: true,
message: "请选择检验日期",
trigger: "blur",
},
],
test_time: [
{
required: true,
message: "请选择检验时间",
trigger: "blur",
},
],
test_user: [
{
required: true,
message: "请选择检验人",
trigger: "blur",
},
],
},
formbw:{
number:'',
note:'',
mioitem:'',
test_date:'',
test_user:'',
},
project_code: null,
mioItem: {},
visible: false,
isSaveing: false,
userList: [],
qct_testitems:[],
qct_defects:[],
qctId:'',
mioitemwId:'',
};
},
watch: {
qct_testitems: {
handler() {
//
this.qct_testitems.forEach(item => {
if (!(item.testitem_name in this.form)) {
this.form[item.testitem_name] = ''
}
});
},
immediate: true
},
qct_defects: {
handler() {
this.qct_defects.forEach(item => {
if (!(item.defect_name in this.form)) {
this.form[item.defect_name] = false;
// let str = item.rule_expression.replace(/`/g, '');
// this.form[item.defect_name] = str.replace(/\${(.*?)}/g, 'this.form.\$1')?'':'';
}
});
},
immediate: true
}
},
mounted() {
let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code;
that.getUserList();
that.mioitemwId = that.mioitemw.id;
that.formbw.number = that.mioitemw.number;
that.formbw.mioitem = that.mioitemw.mioitem;
this.getQctDetail();
},
methods: {
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
getQctDetail(){
let that = this;
that.$API.qm.qct.list.req({ qctmat__material: that.material,page:0 }).then((res) => {
if(res.length>0){
that.qctId = res[0].id;
that.$API.qm.qct.item.req(that.qctId).then((res0) => {
//testitemdefectitem
that.qct_defects = [];
that.qct_testitems = [];
if(res0.qct_defects.length>0){
res0.qct_defects.forEach((item1) => {
let obj = Object.assign({}, item1);
obj.value = '';
that.qct_defects.push(obj);
})
}else{
that.qct_defects = [];
}
if(res0.qct_testitems.length>0){
res0.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){
let str = obj2.testitem_choices.replace(/'/g, '"');
let arr = JSON.parse(str);
obj2.testitem_choices = arr;
}
that.qct_testitems.push(obj2);
})
}else{
that.qct_testitems = [];
}
that.defectCountSun();
})
}
});
},
//
getUserList() {
let that = this;
this.$API.system.user.list
.req({ page: 0, posts__code__contains: "check" })
.then((res) => {
that.userList = res;
});
},
defectCountSun(){
let that = this;
that.qct_defects.forEach(item => {
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'this.formbw.\$1');
let judge = eval(str);
that.formbw[item.defect_name] = judge;
}else{
that.formbw[item.defect_name] = false;
}
});
},
//
submit() {
let that = this;
let ftestdefects = [],ftestitems = [];
that.qct_testitems.forEach((item) => {
let obj0 = {};
obj0.testitem = item.testitem;
obj0.test_user = that.formbw.test_user;
obj0.testitem_name = item.testitem_name;
obj0.test_val_json = that.formbw[item.testitem_name];
ftestitems.push(obj0);
})
that.qct_defects.forEach((item1) => {
let obj1 = {};
obj1.defect = item1.defect;
obj1.test_user = that.formbw.test_user;
obj1.defect_name = item1.defect_name;
obj1.has = that.formbw[item1.defect_name];
ftestdefects.push(obj1);
})
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
let obj = {};
obj.ftest = {};
obj.note = that.formbw.note;
obj.number = that.formbw.number;
obj.mioitem = that.formbw.mioitem;
obj.ftest.qct = that.qctId;
obj.ftest.test_user = that.formbw.test_user;
obj.ftest.test_date = that.formbw.test_date;
obj.ftest.ftestitems = ftestitems;
obj.ftest.ftestdefects = ftestdefects;
that.$API.inm.mioitemw.update.req(that.mioitemwId,obj).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
})
}
})
},
//
setData(data) {
let that = this;
Object.assign(that.formbw, data);
data.ftestitems.forEach((item) => {
that.formbw[item.testitem_name] = item.test_val_json;
})
},
},
};
</script>
<style>
.width-100{
width: 100%;
}
</style>

View File

@ -751,159 +751,56 @@
> >
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px"> <el-main style="padding: 0 20px 20px 20px">
<el-form <el-table :data="mioitemwList" border>
ref="dialogForm" <el-table-column label="物料编号" prop="number">
:model="form" </el-table-column>
:rules="rules" <el-table-column label="操作" fixed="right" width="130">
label-width="140px" <template #default="scope">
> <el-button @click="changeCheckItem(scope.row)" type="text">检验</el-button>
<!-- 入厂检验 --> <el-button @click="changeCheckRecord(scope.row)" type="text">检验记录</el-button>
<el-row v-if="type == 'pur_in'"> </template>
<el-col :md="12" :sm="24"> </el-table-column>
<el-form-item label="产品名称:"> </el-table>
{{ objitem.material_name }} <scTable v-if="checkRecordShow" :data="recordList" row-key="id" height="300px" stripe>
</el-form-item> <el-table-column type="index" width="50" />
</el-col> <el-table-column label="检验日期" prop="test_date"></el-table-column>
<el-col :md="12" :sm="24"> <el-table-column label="检验人" prop="test_user_name"></el-table-column>
<el-form-item label="入厂批次号:"> <el-table-column label="是否合格" prop="is_ok">
{{ objitem.batch }} <template #default="scope">
</el-form-item> <el-tag v-if="scope.row.is_ok" type="success">合格</el-tag>
</el-col> <el-tag v-else type="warning">不合格</el-tag>
<el-col :md="12" :sm="24"> </template>
<el-form-item label="检验时间" prop="test_time"> </el-table-column>
<el-date-picker <el-table-column label="操作" fixed="right" width="80">
v-model="form.test_time" <template #default="scope">
type="datetime" <el-button @click="checkFormDetail(scope.row)" type="text">查看</el-button>
value-format="YYYY-MM-DD HH:mm:ss" </template>
style="width: 100%" </el-table-column>
/> </scTable>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验员" prop="test_user">
<el-select
v-model="form.test_user"
placeholder="检验员"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验合格" prop="is_testok">
<el-select
v-model="form.is_testok"
placeholder="检验合格"
clearable
style="width: 100%"
>
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input v-model="form.test_note"> </el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 检测项 -->
<el-row>
<el-col>检测项</el-col>
<el-col v-for="(item) in qct_testitems" :key="item.id" :md="12" :sm="24">
<el-form-item :label="item.testitem_name">
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="form[item.testitem_name]"
:min="0"
class="width-100"
controls-position="right"
@change="defectCountSun"
>
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="form[item.testitem_name]"
:min="0"
class="width-100"
controls-position="right"
@change="defectCountSun"
>
</el-input-number>
<el-input
v-if="item.testitem_field_type=='input-text'"
v-model="form[item.testitem_name]"
class="width-100"
@change="defectCountSun"
>
</el-input>
<el-select
v-if="item.testitem_field_type=='select-text'"
v-model="form[item.testitem_name]"
clearable
class="width-100"
@change="defectCountSun"
>
<el-option
v-for="item0 in item.testitem_choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="form[item.testitem_name]"
clearable
multiple
class="width-100"
@change="defectCountSun"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 缺陷项 -->
<el-row>
<el-col>缺陷项</el-col>
<el-col v-for="item in qct_defects" :key="item.id" :md="12" :sm="24">
<el-form-item :label="item.defect_name">
<span v-if="form[item.defect_name]" style="background: red;width: 10px;height: 10px;border-radius: 5px;"></span>
<span v-else style="background: green;width: 10px;height: 10px;border-radius: 5px;"></span>
<!-- <el-input v-model="form[item.defect_name]" class="width-100"></el-input> -->
<span v-if="item.note!==null&&item.note!==''" style="font-size: 12px; color: #a9a7a7;">({{ item.note }})</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main> </el-main>
<el-footer v-if="mode == 'add'"> <!-- <el-footer v-if="mode == 'add'">
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button> <el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
<el-button @click="visibleDrawer = false">取消</el-button> <el-button @click="visibleDrawer = false">取消</el-button>
</el-footer> </el-footer> -->
</el-container> </el-container>
</el-drawer> </el-drawer>
<checkform-dialog
v-if="checkShow"
ref="checkFormDialog"
:material="objitem.material"
:mioitemw="mioitemw"
@success="checkFormSuccess"
@closed="checkShow= false"
>
</checkform-dialog>
</template> </template>
<script> <script>
import checkformDialog from "./mioitemCheckForm.vue";
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
components: {
checkformDialog
},
props: { props: {
mioitemId: { type: String, default: "" }, mioitemId: { type: String, default: "" },
type: { type: String, default: "" }, type: { type: String, default: "" },
@ -912,13 +809,7 @@ export default {
}, },
data() { data() {
return { return {
addTemplate: { tableData:[],
name: "",
sort: "",
user: "",
post: "",
dept: "",
},
loading: false, loading: false,
form: { form: {
weight_kgs: [], weight_kgs: [],
@ -947,12 +838,23 @@ export default {
}, },
], ],
}, },
formbw:{
number:'',
note:'',
mioitem:'',
test_date:'',
test_user:'',
},
project_code: null, project_code: null,
mioItem: {}, mioItem: {},
weight_kgs: [{ value: 0 }], weight_kgs: [{ value: 0 }],
checkShow:false,
checkShowsss:false,
visible: false, visible: false,
visibleDrawer:false, visibleDrawer:false,
isSaveing: false, isSaveing: false,
checkRecordShow:false,
recordList:[],
userList: [], userList: [],
processOptions: [], processOptions: [],
deptOptions: [], deptOptions: [],
@ -960,46 +862,21 @@ export default {
setFiltersVisible: false, setFiltersVisible: false,
belong_dept_options: [], belong_dept_options: [],
group: [], group: [],
qct_testitems:[], mioitemwList:[],
qct_defects:[],
qctId:'', qctId:'',
wproductId:'', mioitemwId:'',
}; };
}, },
watch: {
qct_testitems: {
handler() {
//
this.qct_testitems.forEach(item => {
if (!(item.testitem_name in this.form)) {
this.form[item.testitem_name] = ''
}
});
},
immediate: true
},
qct_defects: {
handler() {
this.qct_defects.forEach(item => {
if (!(item.defect_name in this.form)) {
this.form[item.defect_name] = false;
// let str = item.rule_expression.replace(/`/g, '');
// this.form[item.defect_name] = str.replace(/\${(.*?)}/g, 'this.form.\$1')?'':'';
}
});
},
immediate: true
}
},
mounted() { mounted() {
let that = this; let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base; let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code; that.project_code = config_base.base_code;
that.getUserList(); that.getUserList();
if(that.project_code=='bxerp'){ if(that.project_code=='bxerp'){
that.wproductId = that.objitem.mioitemw[0].wpr; that.mioitemwId = that.objitem.mioitemw[0].id;
// that.wproductId = that.objitem.wproducts[0].id; that.formbw.number = that.objitem.mioitemw[0].number;
this.getQctDetail(); that.formbw.mioitem = that.objitem.mioitemw[0].mioitem;
this.getMioitemw();
}else{ }else{
if (that.type == "pur_in") { if (that.type == "pur_in") {
console.log("objitem", that.objitem); console.log("objitem", that.objitem);
@ -1066,42 +943,37 @@ export default {
} }
return this; return this;
}, },
// changeCheckItem(row){
getQctDetail(){
let that = this; let that = this;
that.$API.qm.qct.list.req({ qctmat__material: that.objitem.material,page:0 }).then((res) => { that.mioitemw = row;
if(res.length>0){ that.checkShow = true;
that.qctId = res[0].id; console.log("row",row);
that.$API.qm.qct.item.req(that.qctId).then((res0) => { console.log("checkFormDialog");
//testitemdefectitem that.$nextTick(() => {
that.qct_defects = []; that.$refs.checkFormDialog.open("add");
that.qct_testitems = [];
if(res0.qct_defects.length>0){
res0.qct_defects.forEach((item1) => {
let obj = Object.assign({}, item1);
obj.value = '';
that.qct_defects.push(obj);
}) })
}else{ },
that.qct_defects = []; checkFormDetail(row){
} let that = this;
if(res0.qct_testitems.length>0){ that.mioitemw = row;
res0.qct_testitems.forEach((item2) => { that.checkShow = true;
let obj2 = Object.assign({}, item2); that.$nextTick(() => {
obj2.value = ''; that.$refs.checkFormDialog.open("show").setData(row);
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){
let str = obj2.testitem_choices.replace(/'/g, '"');
let arr = JSON.parse(str);
obj2.testitem_choices = arr;
}
that.qct_testitems.push(obj2);
}) })
}else{ },
that.qct_testitems = []; changeCheckRecord(row){
} let that = this;
that.defectCountSun(); this.mioitemwWpr = row.wpr;
that.$API.qm.ftest.list.req({ mioitemw_ftest__wpr: row.wpr,page:0 }).then((res) => {
that.recordList = res;
}) })
} that.checkShow = false;
that.checkRecordShow = true;
},
getMioitemw(){
let that = this;
that.$API.inm.mioitemw.list.req({ mioitem: that.mioitemId,page:0 }).then((res) => {
that.mioitemwList = res;
}); });
}, },
// //
@ -1121,18 +993,6 @@ export default {
this.weight_kgs.splice(index, 1); this.weight_kgs.splice(index, 1);
this.form.count_sampling = this.weight_kgs.length; this.form.count_sampling = this.weight_kgs.length;
}, },
defectCountSun(){
let that = this;
that.qct_defects.forEach(item => {
console.log(item.defect_name,':',item.rule_expression);
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'this.form.\$1')
console.log(item.defect_name,':',str);
let judge = eval(str);
console.log(item.defect_name,':',judge);
that.form[item.defect_name] = judge;
});
},
countSun() { countSun() {
let that = this; let that = this;
let sum = 0; let sum = 0;
@ -1195,42 +1055,6 @@ export default {
// //
submit() { submit() {
let that = this; let that = this;
if(that.project_code=='bxerp'){
let defect_json = [],test_json = {};
that.qct_testitems.forEach((item) => {
let val = that.form[item.testitem_name];
let obj0 = {};
obj0.testitem_name = item.testitem_name;
obj0.val = val;
test_json[item.id] =obj0;
})
that.qct_defects.forEach((item) => {
if(that.form[item.defect_name]){
defect_json.push(item.id);
}
})
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
let obj = {};
obj.test_user = that.form.test_user;
obj.test_time = that.form.test_time;
obj.is_testok = that.form.is_testok;
obj.qct = that.qctId;
obj.note = that.form.test_note;
obj.test_json = test_json;//
obj.defect_json = defect_json;//defecttrueid
that.$API.inm.mioitem.wtest.req(that.wproductId,obj).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
})
}
})
}else{
if ( if (
(that.type == "do_in" && that.cate == "halfgood") || (that.type == "do_in" && that.cate == "halfgood") ||
that.type == "other_in" that.type == "other_in"
@ -1313,7 +1137,6 @@ export default {
} }
} }
}); });
}
}, },
// //
setData(data) { setData(data) {
@ -1334,6 +1157,7 @@ export default {
(sum / data.weight_kgs.length) * data.count_bag; (sum / data.weight_kgs.length) * data.count_bag;
} }
}, },
checkFormSuccess(){},
// //
setFilters(filters) { setFilters(filters) {
this.selectionFilters = filters; this.selectionFilters = filters;

View File

@ -127,9 +127,9 @@ export default {
showWechatLogin: false, showWechatLogin: false,
isWechatLoginResult: false, isWechatLoginResult: false,
showApp: false, showApp: false,
appUrl: 'http://222.222.144.147:6013/media/zc_ehs.apk', appUrl: 'http://111.11.19.54:6013/media/zc_ehs.apk',
showH5: false, showH5: false,
h5Url: 'http://222.222.144.147:6013/h5/', h5Url: 'http://111.11.19.54:6013/h5/',
loginType:'password', loginType:'password',
loginTypeOptions: [ loginTypeOptions: [
{label: "账号登录", value: "password"}, {label: "账号登录", value: "password"},

View File

@ -107,6 +107,12 @@
width="80" width="80"
> >
</el-table-column> </el-table-column>
<el-table-column label="追踪方式" prop="tracking" v-if="project_code=='bxerp'">
<template #default="scope">
<el-tag v-if="scope.row.tracking == 10">批次</el-tag>
<el-tag v-else>单个</el-tag>
</template>
</el-table-column>
<el-table-column label="总库存" prop="count"> <el-table-column label="总库存" prop="count">
</el-table-column> </el-table-column>
<el-table-column label="安全库存" prop="count_safe"> <el-table-column label="安全库存" prop="count_safe">
@ -216,6 +222,7 @@ export default {
30: "主要原料", 30: "主要原料",
40: "辅助材料", 40: "辅助材料",
}, },
project_code:"",
materialId: "", materialId: "",
materialName: "", materialName: "",
showHidden: false, showHidden: false,
@ -226,6 +233,7 @@ export default {
this.apiObj = this.$API.mtm.material.list; this.apiObj = this.$API.mtm.material.list;
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
this.materialTemplate = this.materialTemplate+"?t=" + new Date().getTime(); this.materialTemplate = this.materialTemplate+"?t=" + new Date().getTime();
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
}, },
methods: { methods: {
rowClick(row) { rowClick(row) {

View File

@ -86,6 +86,14 @@
<el-button link type="info" v-else disabled <el-button link type="info" v-else disabled
>编辑 >编辑
</el-button> </el-button>
<el-button
link
type="danger"
v-auth="'mtask.delete'"
v-if="scope.row.state == 10"
@click="table_delete(scope.row)"
>删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
@ -174,6 +182,13 @@ export default {
this.form = Object.assign(item, this.form); this.form = Object.assign(item, this.form);
this.dialogVisible = true; this.dialogVisible = true;
}, },
table_delete(row){
let that = this;
that.$API.pm.mtask.delete.req(row.id).then((res) => {
that.$message.success("删除成功");
that.$refs.drawer_table.refresh();
})
},
updateMtaskSubmit() { updateMtaskSubmit() {
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {

View File

@ -87,7 +87,7 @@
code: "", code: "",
cate: "尺寸", cate: "尺寸",
note: "", note: "",
okcate:10, okcate:20,
}; };
export default { export default {
name: 'dept', name: 'dept',
@ -112,7 +112,7 @@
], ],
cateOptions: ['尺寸', '外观','内质'], cateOptions: ['尺寸', '外观','内质'],
okcate_: { okcate_: {
10: '合格', // 10: '',
20: 'B类合格', 20: 'B类合格',
30: '不合格', 30: '不合格',
}, },
@ -151,7 +151,7 @@
this.addForm.code=""; this.addForm.code="";
this.addForm.note=""; this.addForm.note="";
this.addForm.cate="尺寸"; this.addForm.cate="尺寸";
this.addForm.okcate=10; this.addForm.okcate=20;
this.limitedVisible = true; this.limitedVisible = true;
// //
// this.$refs.addForm.clearValidate(); // this.$refs.addForm.clearValidate();

View File

@ -127,6 +127,14 @@
</xtSelect> </xtSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="addto_wpr" label="加入物料信息">
<template #default="scope">
<el-switch
:disabled="!scope.row.isEdit"
v-model="scope.row.addto_wpr"
></el-switch>
</template>
</el-table-column>
<el-table-column prop="type" label="备注"> <el-table-column prop="type" label="备注">
<template #default="scope"> <template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span> <span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
@ -290,14 +298,15 @@ export default {
tracing: "", tracing: "",
qct: this.qctId, qct: this.qctId,
material: "", material: "",
edit: false, isEdit: true,
}, },
defectaddTemplate:{ defectaddTemplate:{
qct: this.qctId, qct: this.qctId,
defect: "", defect: "",
note:'', note:'',
sort:'', sort:'',
edit: false, isEdit: true,
addto_wpr:false,
rule_expression:'', rule_expression:'',
}, },
testitemaddTemplate:{ testitemaddTemplate:{
@ -305,7 +314,7 @@ export default {
note:'', note:'',
sort:'', sort:'',
testitem:'', testitem:'',
edit: false, isEdit: true,
}, },
defectrow:{}, defectrow:{},
testitemrow:{}, testitemrow:{},

View File

@ -618,7 +618,7 @@ export default {
this.getRoutePack(); this.getRoutePack();
} else if (this.cateType === "backfire") { } else if (this.cateType === "backfire") {
// 退 // 退
} else { } else if (this.cateType === "opl") {
this.getOpl(); this.getOpl();
} }
this.getticketItem(); this.getticketItem();

View File

@ -31,8 +31,13 @@
</el-table-column> </el-table-column>
<el-table-column label="合格数" prop="count_ok"> <el-table-column label="合格数" prop="count_ok">
</el-table-column> </el-table-column>
<el-table-column label="不合格数" prop="count_notok"> <!-- <el-table-column label="不合格数" prop="count_notok">
<el-table-column v-for="item in qct_defects" :label="item.defect_name" :key="item.id">
<template #default="scope">
{{ scope.row.}}
</template>
</el-table-column> </el-table-column>
</el-table-column> -->
<el-table-column label="检验日期" prop="test_date"> <el-table-column label="检验日期" prop="test_date">
</el-table-column> </el-table-column>
<el-table-column label="检验人" prop="test_user_name"> <el-table-column label="检验人" prop="test_user_name">
@ -47,6 +52,7 @@ export default {
emits: ["closed"], emits: ["closed"],
props: { props: {
wm: { type: String, default: "" }, wm: { type: String, default: "" },
material: { type: String, default: "" },
}, },
data() { data() {
return { return {
@ -58,17 +64,32 @@ export default {
10: "抽检", 10: "抽检",
20: "全检", 20: "全检",
}, },
qct_defects:[],
isSaveing: false, isSaveing: false,
}; };
}, },
mounted() {}, mounted() {
},
methods: { methods: {
open() { open() {
this.visible = true; this.visible = true;
this.paramsObj.wm = this.wm; this.paramsObj.wm = this.wm;
this.apiObj = this.$API.qm.ftestwork.list; this.apiObj = this.$API.qm.ftestwork.list;
this.getdefects();
return this; return this;
}, },
//
getdefects(){
let that = this;
that.$API.qm.qct.list.req({ page: 0, qctmat__material: that.material }).then((res) => {
if(res.length>0){
that.$API.qm.qct.item.req(res[0].id).then((res) => {
that.qct_defects = res;
})
}
});
},
table_del(row){ table_del(row){
this.$API.qm.ftestwork.delete.req(row.id).then((res) => { this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$refs.drawer_table.fetch(); this.$refs.drawer_table.fetch();

View File

@ -180,14 +180,17 @@
</el-col> </el-col>
<el-col :span="7" > <el-col :span="7" >
<el-form-item label="" style="position: relative;"> <el-form-item label="" style="position: relative;">
<div style="position: absolute; <el-link
:underline="false"
style="position: absolute;
top: 0; top: 0;
left: -80px; left: -80px;
width: 80px; width: 80px;
height: 32px; height: 32px;
color: #0052d9;
line-height: 32px;" line-height: 32px;"
@click="showbw($index)" @click="showbw($index)"
>交接数量</div> >交接数量</el-link>
<el-input-number <el-input-number
v-model="listItem.count" v-model="listItem.count"
controls-position="right" controls-position="right"
@ -509,14 +512,30 @@ export default {
let data = that.materialOptions.filter((item) => { let data = that.materialOptions.filter((item) => {
return that.selectItems.indexOf(item.id)>-1; return that.selectItems.indexOf(item.id)>-1;
}); });
data.forEach(item=>{ data.forEach((item,index)=>{
item.wm = item.id; item.wm = item.id;
item.count = item.count_cando; item.count = item.count_cando;
totalCount += item.count_cando; totalCount += item.count_cando;
item.handoverbw = [];
that.getWprList(item.id,index);
}) })
that.totalCount = totalCount; that.totalCount = totalCount;
that.form.handoverb = data; that.form.handoverb = data;
}, },
getWprList(id,index){
console.log('id',id,'index',index);
let that = this;
let handoverbw = [];
that.$API.wpm.wpr.list.req({wm:id,page:0}).then((res) => {
res.forEach(wpritem=>{
let obj = {};
obj.wpr = wpritem.id;
obj.number = wpritem.number;
handoverbw.push(obj);
})
that.form.handoverb[index].handoverbw = handoverbw;
})
},
countChange(){ countChange(){
let that = this; let that = this;
let totalCount = 0; let totalCount = 0;
@ -571,7 +590,7 @@ export default {
}, },
// //
setData(data) { setData(data) {
this.totalCount = data.count; this.totalCount = data.count?data.count:data.handoverb.count;
Object.assign(this.form, data); Object.assign(this.form, data);
if(data.type==30){ if(data.type==30){
this.getUserList3(); this.getUserList3();
@ -670,15 +689,24 @@ export default {
obj.batch = item.batch; obj.batch = item.batch;
obj.count_cando = item.count; obj.count_cando = item.count;
obj.count = item.count; obj.count = item.count;
obj.handoverbw = [];
that.$API.wpm.wpr.list.req({wm:item.id}).then((res) => {
let handoverbw = [];
let list = res.results;
list.forEach(item1=>{
let obj1 = {};
obj1.wpr = item1.id;
obj1.number = item1.number;
handoverbw.push(obj1);
})
obj.handoverbw = handoverbw;
that.form.handoverb.push(obj); that.form.handoverb.push(obj);
// console.log('4',that.form); })
} }
}) })
} }
}) })
} }
//
// this.scanVisible = false;
}, },
}, },
}; };

View File

@ -154,6 +154,7 @@
ref="showDrawer" ref="showDrawer"
v-if="visibleDrawer" v-if="visibleDrawer"
:wm="wm" :wm="wm"
:material="wmMaterial"
@closed="visibleDrawer = false" @closed="visibleDrawer = false"
> >
</showDrawer> </showDrawer>
@ -172,8 +173,16 @@
<h4>关联产品</h4> <h4>关联产品</h4>
</template> </template>
<template #default> <template #default>
<scTable ref="wprTable" :apiObj="wprApiObj" :params="wprParams"> <scTable ref="wprTable" :data="wprList">
<el-table-column label="产品编号" prop="number"></el-table-column> <el-table-column label="产品编号" prop="number"></el-table-column>
<el-table-column label="记录数据" prop="oinfo">
<template #default="scope">
<div v-for="(item,index) in scope.row.oinfo" :key="item.id">
{{ item.name }}:{{ item.val}}
<span v-if="index<(scope.row.oinfo.length-1)">,</span>
</div>
</template>
</el-table-column>
<el-table-column label="缺陷项"> <el-table-column label="缺陷项">
<template #default="scope"> <template #default="scope">
<span v-for="item in scope.row.wprdefect" :key="item.id"> <span v-for="item in scope.row.wprdefect" :key="item.id">
@ -273,6 +282,7 @@ export default {
wprParams:{ wprParams:{
wm: "" wm: ""
}, },
wmMaterial:'',
cate_type:'', cate_type:'',
process:'', process:'',
materialType: "wm", materialType: "wm",
@ -345,6 +355,7 @@ export default {
// //
tableCheckList(row){ tableCheckList(row){
this.wm = row.id; this.wm = row.id;
this.wmMaterial = row.material;
this.visibleDrawer = true; this.visibleDrawer = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.showDrawer.open(); this.$refs.showDrawer.open();
@ -376,9 +387,11 @@ export default {
}, },
showWpr(row){ showWpr(row){
let that = this; let that = this;
that.wprParams.wm='';
that.wprParams.wm = row.id; that.wprParams.wm = row.id;
that.wprVisibleDrawer = true; that.wprVisibleDrawer = true;
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
that.wprList = res.results;
})
}, },
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {

View File

@ -340,7 +340,7 @@
:tracking="tracking" :tracking="tracking"
:materialIn="materialIn" :materialIn="materialIn"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="saveMlogbInClose"
> >
</save-dialog> </save-dialog>
<check-dialog <check-dialog
@ -636,12 +636,20 @@ export default {
handleCheckSuccess() { handleCheckSuccess() {
this.$refs.tableOut.refresh(); this.$refs.tableOut.refresh();
}, },
handlesCheckSuccess(){}, handlesCheckSuccess(){
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();
},
fileUPSuccess(res) { fileUPSuccess(res) {
let that = this; let that = this;
console.log('res',res); console.log('res',res);
this.test_file = res.path; this.test_file = res.path;
}, },
saveMlogbInClose(){
this.dialog.save = false;
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();
},
// //
handleEditSuccess() { handleEditSuccess() {
this.getMlogItem(); this.getMlogItem();

View File

@ -127,6 +127,7 @@ export default {
materialOptions: [], materialOptions: [],
mgroup_code:'', mgroup_code:'',
mlogbInId:'', mlogbInId:'',
mlogbInCount:0,
hasMlogbIn:false, hasMlogbIn:false,
visible: false, visible: false,
isSaveing: false, isSaveing: false,
@ -196,7 +197,6 @@ export default {
}, },
// //
formWminChange(code){ formWminChange(code){
console.log('code',code)
let that = this,codeId='',keys="",arr=[]; let that = this,codeId='',keys="",arr=[];
if(code.indexOf("#")>-1){ if(code.indexOf("#")>-1){
let arrs = code.split("#"); let arrs = code.split("#");
@ -204,6 +204,8 @@ export default {
codeId = arrs[1]; codeId = arrs[1];
that.scanKyes = keys; that.scanKyes = keys;
if(keys=='wpr'){// if(keys=='wpr'){//
console.log('wpr',codeId)
that.form.parent = '';
that.$API.wpm.wpr.item.req(codeId).then((res) => { that.$API.wpm.wpr.item.req(codeId).then((res) => {
if(res){ if(res){
let bwitem = {}; let bwitem = {};
@ -216,18 +218,15 @@ export default {
if (arr.length > 0) {// if (arr.length > 0) {//
let batch = arr[0].batch; let batch = arr[0].batch;
that.wm_in = arr[0].batch; that.wm_in = arr[0].batch;
that.form.count_use =1; that.mlogbInCount = arr[0].count;//
console.log('batch',batch);
// //
let arr0= that.mlogbIns.filter((item)=>{ let arr0= that.mlogbIns.filter((item)=>{
return item.batch == batch; return item.batch == batch;
}) })
console.log('arr0',arr0)
if (arr0.length > 0) { if (arr0.length > 0) {
that.hasMlogbIn = true; that.hasMlogbIn = true;
that.form.count_use = 1;
bwitem.mlogb = arr0[0].id; bwitem.mlogb = arr0[0].id;
that.form.parent = '';
console.log('bwitem',bwitem)
}else{ }else{
that.form.batch = arr[0].batch; that.form.batch = arr[0].batch;
that.form.wm_in = arr[0].id; that.form.wm_in = arr[0].id;
@ -306,7 +305,8 @@ export default {
that.form.batch = ''; that.form.batch = '';
that.form.parent = ''; that.form.parent = '';
that.form.count_use = 0; that.form.count_use = 0;
if(that.scanKyes=='wpr'){ if(that.scanKyes=='wpr'&&that.mlogbInCount>1){
//1
that.bwItemForm.mlogb = res.id; that.bwItemForm.mlogb = res.id;
that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {}) that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {})
} }

View File

@ -2,13 +2,16 @@
<el-drawer <el-drawer
:title="headTitle[mode]" :title="headTitle[mode]"
v-model="visible" v-model="visible"
:size="'80%'" :size="'90%'"
destroy-on-close destroy-on-close
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<el-container>
<el-main id="mlogbwMain">
<sc-form-table <sc-form-table
hideDelete hideDelete
:tableHeight="500" id="mlogbwlist"
:tableHeight="tableHeight"
v-model="mlogbwlist" v-model="mlogbwlist"
:addTemplate="addTemplate" :addTemplate="addTemplate"
placeholder="暂无数据" placeholder="暂无数据"
@ -41,6 +44,7 @@
v-if="item.testitem_field_type=='input-number'" v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]" v-model="scope.row[item.testitem_name]"
:min="0" :min="0"
:disabled="!scope.row.isEdit"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="defectCountSun(scope.row)" @change="defectCountSun(scope.row)"
@ -50,6 +54,7 @@
v-if="item.testitem_field_type=='input-int'" v-if="item.testitem_field_type=='input-int'"
v-model="scope.row[item.testitem_name]" v-model="scope.row[item.testitem_name]"
:min="0" :min="0"
:disabled="!scope.row.isEdit"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="defectCountSun(scope.row)" @change="defectCountSun(scope.row)"
@ -59,6 +64,7 @@
v-if="item.testitem_field_type=='input-text'" v-if="item.testitem_field_type=='input-text'"
v-model="scope.row[item.testitem_name]" v-model="scope.row[item.testitem_name]"
class="width-100" class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)" @change="defectCountSun(scope.row)"
> >
</el-input> </el-input>
@ -67,6 +73,7 @@
v-model="scope.row[item.testitem_name]" v-model="scope.row[item.testitem_name]"
clearable clearable
class="width-100" class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)" @change="defectCountSun(scope.row)"
> >
<el-option <el-option
@ -83,6 +90,7 @@
clearable clearable
multiple multiple
class="width-100" class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)" @change="defectCountSun(scope.row)"
> >
<el-option <el-option
@ -95,7 +103,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id"> <el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="70px">
<template #default="scope"> <template #default="scope">
<el-switch <el-switch
:disabled="!scope.row.isEdit" :disabled="!scope.row.isEdit"
@ -105,13 +113,13 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="note" label="备注"> <el-table-column prop="note" label="备注" width="80px">
<template #default="scope"> <template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span> <span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input> <el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="open" label="操作" width="120" align="center"> <el-table-column prop="open" label="操作" width="60" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@ -121,6 +129,14 @@
@click="formTableSave(scope.row)" @click="formTableSave(scope.row)"
>保存</el-button >保存</el-button
> >
<el-button
v-if="scope.row.isEdit"
text
type="primary"
size="small"
@click="formTableCancel(scope.row)"
>取消</el-button
>
<el-button <el-button
v-else v-else
text text
@ -140,6 +156,9 @@
</template> </template>
</el-table-column> </el-table-column>
</sc-form-table> </sc-form-table>
</el-main>
</el-container>
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
@ -191,6 +210,7 @@ export default {
note: "", note: "",
isEdit: true, isEdit: true,
}, },
tableHeight:500,
apiObjPrint:this.$API.cm.labelmat.fromWm, apiObjPrint:this.$API.cm.labelmat.fromWm,
printer_name:localStorage.getItem("printer_name") printer_name:localStorage.getItem("printer_name")
}; };
@ -198,7 +218,6 @@ export default {
mounted() { mounted() {
let that = this; let that = this;
that.params.mlogb = that.addTemplate.mlogb = that.mlogb; that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.getList();
that.getOptions(); that.getOptions();
that.getdefects(); that.getdefects();
}, },
@ -207,6 +226,10 @@ export default {
this.mode = mode; this.mode = mode;
console.log(this.mode); console.log(this.mode);
this.visible = true; this.visible = true;
setTimeout(() => {
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
},500)
}, },
getdefects(){ getdefects(){
let that = this; let that = this;
@ -219,17 +242,25 @@ export default {
that.qct_defects = res.qct_defects; that.qct_defects = res.qct_defects;
that.qct_testitems = []; that.qct_testitems = [];
res.qct_testitems.forEach((item2) => { res.qct_testitems.forEach((item2) => {
that.addTemplate[item2.testitem_name] = '';
let obj2 = Object.assign({}, item2); let obj2 = Object.assign({}, item2);
obj2.value = ''; obj2.value = '';
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){ obj2.addto_wpr = item2.addto_wpr;
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
obj2.value = 0;
that.addTemplate[item2.testitem_name] = 0;
}
if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
let str = obj2.testitem_choices.replace(/'/g, '"'); let str = obj2.testitem_choices.replace(/'/g, '"');
let arr = JSON.parse(str); let arr = JSON.parse(str);
obj2.testitem_choices = arr; obj2.testitem_choices = arr;
that.addTemplate[item2.testitem_name] = '';
} }
that.qct_testitems.push(obj2); that.qct_testitems.push(obj2);
}) })
that.getList();
}) })
}else{
that.getList();
} }
}, },
getOptions(){ getOptions(){
@ -251,35 +282,39 @@ export default {
}, },
getList(){ getList(){
let that = this; let that = this;
that.mlogbwlist = [];
that.$API.wpm.mlogbw.list.req(that.params).then((res) => { that.$API.wpm.mlogbw.list.req(that.params).then((res) => {
if(res.length>0){ if(res.length>0){
that.mlogbwlist = [];
res.forEach((item) => { res.forEach((item) => {
let obj = Object.assign({},item); let obj = {};
obj = Object.assign({},item);
obj.isEdit = false; obj.isEdit = false;
if(that.qct!==null&&that.qct!==''){ if(that.qct!=null&&that.qct!=''&&item.ftest!=null){
if(item.ftest&&item.ftest.ftestdefects&&item.ftest.ftestdefects.length>0){ if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
item.ftest.ftestdefects.forEach((item1) => { item.ftest.ftestdefects.forEach((item1) => {
obj[item1.defect_name] = item1.has; obj[item1.defect_name] = item1.has;
}) })
}
if(item.ftest.ftestitems!==undefined&&item.ftest.ftestitems!==''&&item.ftest.ftestitems!==null&&item.ftest.ftestitems.length>0){
item.ftest.ftestitems.forEach((item2) => {
obj[item2.testitem_name] = item2.test_val_json;
})
}
}else{ }else{
that.qct_defects.forEach((item1) => { that.qct_defects.forEach((item1) => {
obj[item1.defect_name] = false; obj[item1.defect_name] = false;
}) })
}
if(item.ftest&&item.ftest.ftestitems&&item.ftest.ftestitems.length>0){
item.ftest.ftestitems.forEach((item2) => {
obj[item2.testitem_name] = item2.test_val_json;
})
}else{
that.qct_testitems.forEach((item2) => { that.qct_testitems.forEach((item2) => {
if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
obj[item2.testitem_name] = 0;
}else{
obj[item2.testitem_name] = ""; obj[item2.testitem_name] = "";
})
} }
})
} }
that.mlogbwlist.push(obj); that.mlogbwlist.push(obj);
}) })
console.log('mlogbwlistmlogbwlist',that.mlogbwlist);
} }
}) })
}, },
@ -291,35 +326,24 @@ export default {
obj.mlogb = row.mlogb; obj.mlogb = row.mlogb;
obj.wpr = row.wpr; obj.wpr = row.wpr;
obj.note = row.note; obj.note = row.note;
//qct
if(that.qct!==null&&that.qct!==''){ if(that.qct!==null&&that.qct!==''){
//
if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){
console.log('已填过');
obj.ftest =row.ftest;
obj.ftest.ftestdefects.forEach((item) => {
item.has = row[item.defect_name];
})
row.ftest.ftestitems.forEach((item1) => {
item1.test_val_json = row[item1.testitem_name];
})
console.log('obj',obj);
}else{//
console.log('未填过');
obj.ftest = {}; obj.ftest = {};
obj.ftest.ftestitems = []; obj.ftest.ftestitems = [];
obj.ftest.ftestdefects = []; obj.ftest.ftestdefects = [];
if(row.ftest&&row.ftest.id){
obj.ftest.id =row.ftest.id;
}
// obj.ftest.id = (row.ftest&&row.ftest.id)?row.ftest.id:'';
if(row.id!=''&&row.id!==undefined&&row.id!==null&&row.ftest&&row.ftest.ftestdefects){
obj.ftest.qct = row.ftest.qct;
obj.ftest.test_date = row.ftest.test_date;
obj.ftest.test_user = row.ftest.test_user;
row.ftest.ftestdefects.forEach((item) => {
let itemObj = {};
itemObj.id = item.id;
itemObj.defect = item.defect;
itemObj.test_user = item.test_user;
itemObj.has = row[item.defect_name]?row[item.defect_name]:false;
obj.ftest.ftestdefects.push(itemObj);
})
row.ftest.ftestitems.forEach((item1) => {
let itemObj1 = {};
itemObj1.id = item1.id;
itemObj1.testitem = item1.testitem;
itemObj1.test_user = item1.test_user;
itemObj1.test_val_json = row[item1.testitem_name];
obj.ftest.ftestitems.push(itemObj1);
})
}else{
obj.ftest.qct = that.qct; obj.ftest.qct = that.qct;
obj.ftest.test_date = that.handle_date; obj.ftest.test_date = that.handle_date;
obj.ftest.test_user = that.handle_user; obj.ftest.test_user = that.handle_user;
@ -334,6 +358,7 @@ export default {
let itemObj1 = {}; let itemObj1 = {};
itemObj1.testitem = item1.testitem; itemObj1.testitem = item1.testitem;
itemObj1.test_user = that.handle_user; itemObj1.test_user = that.handle_user;
itemObj1.addto_wpr = item1.addto_wpr;
itemObj1.test_val_json = row[item1.testitem_name]; itemObj1.test_val_json = row[item1.testitem_name];
obj.ftest.ftestitems.push(itemObj1); obj.ftest.ftestitems.push(itemObj1);
}) })
@ -358,6 +383,13 @@ export default {
}); });
} }
}, },
formTableCancel(row){
this.mlogbwlist.forEach((item, index) => {
if (item.id == row.id) {
this.mlogbwlist[index].isEdit = false;
}
});
},
formTableEdit(row) { formTableEdit(row) {
this.mlogbwlist.forEach((item, index) => { this.mlogbwlist.forEach((item, index) => {
if (item.id == row.id) { if (item.id == row.id) {
@ -405,10 +437,15 @@ export default {
let that = this; let that = this;
let index = that.mlogbwlist.indexOf(row); let index = that.mlogbwlist.indexOf(row);
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
console.log('item.rule_expression',item.rule_expression);
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, ''); let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1') str = str.replace(/\${(.*?)}/g, 'row.\$1')
let judge = eval(str); let judge = eval(str);
that.mlogbwlist[index][item.defect_name] = judge; that.mlogbwlist[index][item.defect_name] = judge;
}else{
that.mlogbwlist[index][item.defect_name] = false;
}
}); });
}, },
// //

View File

@ -59,7 +59,8 @@ export default {
formData.append("printer_name", "GP-3150TN"); // formData.append("printer_name", "GP-3150TN"); //
// POST // POST
http.post("http://localhost:8080/prints/", formData) that.$API.wpm.prints.req(formData)
// http.post("http://localhost:8080/prints/", formData)
.then((response) => { .then((response) => {
console.log("postRes", response); console.log("postRes", response);
}) })
@ -103,8 +104,8 @@ export default {
let obj = {}; let obj = {};
obj.printer_commands = str; obj.printer_commands = str;
obj.printer_name = "GP-3150TNS"; obj.printer_name = "GP-3150TNS";
http.post("http://localhost:8080/prints/", obj) that.$API.wpm.prints.req(obj)
// http.post("http://192.168.1.242:8080/prints/", obj) // http.post("http://localhost:8080/prints/", obj)
.then((response) => { .then((response) => {
console.log("postRes", response); console.log("postRes", response);
}) })