fix:禅道364完善,添加排一次棒

This commit is contained in:
shijing 2026-04-16 10:50:41 +08:00
parent 685985561b
commit 1f10186c10
1 changed files with 71 additions and 246 deletions

View File

@ -25,9 +25,15 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick" style="height: 100%;" lazy> <el-tabs type="border-card" v-model="query.mgroup_name" @tab-click="handleClick" style="height: 100%;" lazy>
<el-tab-pane name="ladansi" label="拉单丝" style="height: 100%;"> <el-tab-pane
<el-container v-if="activeName=='ladansi'"> v-for="tab in tabs"
:key="tab"
:name="tab"
:label="tab"
style="height: 100%;"
>
<el-container v-if="query.mgroup_name === tab">
<el-main> <el-main>
<scTable <scTable
v-if="showTable" v-if="showTable"
@ -39,185 +45,8 @@
stripe stripe
> >
<el-table-column type="index" width="50" fixed="left"/> <el-table-column type="index" width="50" fixed="left"/>
<el-table-column label="员工" prop="员工"> <el-table-column label="员工" prop="员工"/>
</el-table-column> <el-table-column label="物料名" prop="物料名" :filters="nameFilters" :filter-method="filterName" filter-placement="bottom-end"/>
<el-table-column label="物料名" prop="物料名" :filters="nameFilters" :filter-method="filterName" filter-placement="bottom-end">
</el-table-column>
<el-table-column label="总数">
<template #default="scope">
<!-- @click="numberClick(scope.row)" style="color:#0052d9;" -->
<span v-if="scope.row.总切片数">{{ scope.row.总切片数 }}</span>
</template>
</el-table-column>
<el-table-column label="剪切">
<template #default="scope">
<span v-if="scope.row.剪切合格">{{((scope.row.剪切合格/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="剪切加工率">
<template #default="scope">
<span v-if="scope.row['剪切¢18.3mm不合格']">{{ (((scope.row.总切片数-scope.row['剪切18.3mm不合格'].含)/scope.row.总切片数)*100).toFixed(2) }}%</span>
<span v-else>100%</span>
</template>
</el-table-column>
<el-table-column label="暗点">
<template #default="scope">
<span v-if="scope.row.暗点合格">{{((scope.row.暗点合格.含/scope.row.总切片数)*100).toFixed(2) }}%</span>
<span v-else>0%</span>
</template>
</el-table-column>
<el-table-column label="长点率">
<template #default="scope">
<span>{{((scope.row.长点数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="加工率">
<template #default="scope">
<span>{{((scope.row.加工率数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="合格率" prop="合格率">
<template #default="scope">
<span>{{((scope.row.合格率数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-tab-pane>
<el-tab-pane name="yicifusi" label="一次复丝" style="height: 100%;">
<el-container v-if="activeName=='yicifusi'">
<el-main>
<scTable
v-if="showTable"
ref="table1"
:data="tableData"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
<el-table-column label="员工" prop="员工">
</el-table-column>
<el-table-column label="物料名" prop="物料名" :filters="nameFilters" :filter-method="filterName" filter-placement="bottom-end">
</el-table-column>
<el-table-column label="总数">
<template #default="scope">
<span v-if="scope.row.总切片数">{{ scope.row.总切片数 }}</span>
</template>
</el-table-column>
<el-table-column label="剪切">
<template #default="scope">
<span v-if="scope.row.剪切合格">{{((scope.row.剪切合格/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="剪切加工率">
<template #default="scope">
<span v-if="scope.row['剪切¢18.3mm不合格']">{{ (((scope.row.总切片数-scope.row['剪切18.3mm不合格'].含)/scope.row.总切片数)*100).toFixed(2) }}%</span>
<span v-else>100%</span>
</template>
</el-table-column>
<el-table-column label="暗点">
<template #default="scope">
<span v-if="scope.row.暗点合格">{{((scope.row.暗点合格.含/scope.row.总切片数)*100).toFixed(2) }}%</span>
<span v-else>0%</span>
</template>
</el-table-column>
<el-table-column label="长点率">
<template #default="scope">
<span>{{((scope.row.长点数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="加工率">
<template #default="scope">
<span>{{((scope.row.加工率数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="合格率" prop="合格率">
<template #default="scope">
<span>{{((scope.row.合格率数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-tab-pane>
<el-tab-pane name="ercifusi" label="二次复丝" style="height: 100%;">
<el-container v-if="activeName=='ercifusi'">
<el-main>
<scTable
v-if="showTable"
ref="table1"
:data="tableData"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
<el-table-column label="员工" prop="员工">
</el-table-column>
<el-table-column label="物料名" prop="物料名" :filters="nameFilters" :filter-method="filterName" filter-placement="bottom-end">
</el-table-column>
<el-table-column label="总数">
<template #default="scope">
<span v-if="scope.row.总切片数">{{ scope.row.总切片数 }}</span>
</template>
</el-table-column>
<el-table-column label="剪切">
<template #default="scope">
<span v-if="scope.row.剪切合格">{{((scope.row.剪切合格/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="剪切加工率">
<template #default="scope">
<span v-if="scope.row['剪切¢18.3mm不合格']">{{ (((scope.row.总切片数-scope.row['剪切18.3mm不合格'].含)/scope.row.总切片数)*100).toFixed(2) }}%</span>
<span v-else>100%</span>
</template>
</el-table-column>
<el-table-column label="暗点">
<template #default="scope">
<span v-if="scope.row.暗点合格">{{((scope.row.暗点合格.含/scope.row.总切片数)*100).toFixed(2) }}%</span>
<span v-else>0%</span>
</template>
</el-table-column>
<el-table-column label="长点率">
<template #default="scope">
<span>{{((scope.row.长点数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="加工率">
<template #default="scope">
<span>{{((scope.row.加工率数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="合格率" prop="合格率">
<template #default="scope">
<span>{{((scope.row.合格率数/scope.row.总切片数)*100).toFixed(2) }}%</span>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-tab-pane>
<el-tab-pane name="paiercibang" label="排二次棒" style="height: 100%;">
<el-container v-if="activeName=='paiercibang'">
<el-main>
<scTable
v-if="showTable"
ref="table1"
:data="tableData"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
<el-table-column label="员工" prop="员工">
</el-table-column>
<el-table-column label="物料名" prop="物料名" :filters="nameFilters" :filter-method="filterName" filter-placement="bottom-end">
</el-table-column>
<el-table-column label="总数"> <el-table-column label="总数">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.总切片数">{{ scope.row.总切片数 }}</span> <span v-if="scope.row.总切片数">{{ scope.row.总切片数 }}</span>
@ -279,7 +108,7 @@ export default {
visible: false, visible: false,
showTable: false, showTable: false,
userName: '', userName: '',
activeName: 'ladansi', tabs: ['拉单丝' , '一次复丝', '排一次棒', '二次复丝', '排二次棒'],
query: { query: {
end_date: '', end_date: '',
start_date: '', start_date: '',
@ -317,19 +146,17 @@ export default {
} }
params.query = query; params.query = query;
console.log('params', params); console.log('params', params);
if(that.activeName=='ladansi'){ if (that.query.mgroup_name == '拉单丝') {
biStr = 'product_defect_lds'; biStr = 'product_defect_lds';
}else if(that.activeName=='yicifusi'||that.activeName=='ercifusi'||that.activeName=='paiercibang'){ } else if (that.query.mgroup_name == '一次复丝' || that.query.mgroup_name == '排一次棒' || that.query.mgroup_name == '二次复丝' || that.query.mgroup_name == '排二次棒') {
biStr = 'product_defect_jjcj'; biStr = 'product_defect_jjcj';
}else{
biStr = 'product_defect_sg';
} }
that.$API.bi.dataset.exec.req(biStr, params).then((res) => { that.$API.bi.dataset.exec.req(biStr, params).then((res) => {
let data = res.data2.ds0; let data = res.data2.ds0;
data.forEach(item => { data.forEach(item => {
if (names.indexOf(item.物料名) > -1) {} else { if (names.indexOf(item.物料名) > -1) {} else {
names.push(item.物料名); names.push(item.物料名);
nameList.push({text:item.物料名,value:item.物料名}) nameList.push({ text: item.物料名, value: item.物料名 });
} }
if (item.缺陷分布 !== null) { if (item.缺陷分布 !== null) {
let defect = JSON.parse(item.缺陷分布); let defect = JSON.parse(item.缺陷分布);
@ -355,20 +182,19 @@ export default {
count_hgls = count_hgls - item['剪切¢18.3mm不合格+暗点合格']; count_hgls = count_hgls - item['剪切¢18.3mm不合格+暗点合格'];
} }
} }
item.加工率数 = count1;//-.-.-.+ item.加工率数 = count1;
item.合格率数 = count_hgls;// item.合格率数 = count_hgls;
}) });
that.$nextTick(() => { that.$nextTick(() => {
console.log('data', data); console.log('data', data);
that.nameFilters = nameList; that.nameFilters = nameList;
that.tableData = data; that.tableData = data;
that.showTable = true; that.showTable = true;
}) });
}); });
}, },
handleQuery2() { handleQuery2() {
let that = this; this.getData();
that.getData();
}, },
filterName(value, row) { filterName(value, row) {
return row.物料名 == value; return row.物料名 == value;
@ -377,8 +203,7 @@ export default {
let that = this; let that = this;
that.query.end_date = that.end_date; that.query.end_date = that.end_date;
that.query.start_date = that.start_date; that.query.start_date = that.start_date;
that.query.mgroup_name = that.mgroup_name; that.query.mgroup_name = e.props.name;
that.activeName = e.props.name;
that.showTable = false; that.showTable = false;
that.getData(); that.getData();
}, },