<template>
|
<div class="mod-config">
|
<basic-container>
|
<ttable
|
:table="table"
|
@handleSelectionChange="handleSelectionChange"
|
:uploadInfo="uploadInfo"
|
:prelang="prelang"
|
:options="options"
|
:ajaxFun="ajaxFun"
|
ref="dutyRecordTable"
|
:bottomOffset="400"
|
:fixedHeight="400"
|
@tableRowClassName="tableRowClassName"
|
>
|
<template #toolbar>
|
<el-button
|
@click="addButton.fun"
|
:type="addButton.type"
|
:disabled="addButton.disabled"
|
>{{ addButton.text }}
|
</el-button>
|
<el-button
|
v-for="item in toolbar"
|
:disabled="item.disabled"
|
:type="item.type"
|
:v-if="item.isShow"
|
@click="handleCommand(item.ref)"
|
>{{ item.text }}
|
</el-button>
|
<el-button
|
@click="computationButton.fun"
|
:type="computationButton.type"
|
:disabled="computationButton.disabled"
|
v-if="computationButton.isShow"
|
:loading="computationButton.loading"
|
>{{ computationButton.text }}
|
</el-button>
|
<el-button
|
@click="exportPageButton.fun"
|
:type="exportPageButton.type"
|
v-if="exportPageButton.isShow"
|
:loading="exportPageButton.loading"
|
>{{ exportPageButton.text }}
|
</el-button>
|
</template>
|
</ttable>
|
<div style="background-color: #F0F2F5;height: 10px" />
|
<el-tabs type="border-card" ref="tabs">
|
<el-tab-pane
|
label="原始数据"
|
type="card"
|
v-if="permissions.production_dutyrecord_view_originaldata"
|
>
|
<el-row style="background-color: #F0F2F5">
|
<el-col :span="7" style="height: 600px">
|
<el-table
|
stripe
|
ref="personList"
|
:data="personList"
|
height="100%"
|
:row-style="{ height: '26px' }"
|
:cell-style="{ padding: '0' }"
|
>
|
<el-table-column
|
label="序号"
|
type="index"
|
align="center"
|
width="45px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="人员名称"
|
prop="staffName"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="人员编号"
|
prop="staffNo"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="班次编号"
|
prop="dutyNo"
|
align="center"
|
min-width="85px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="班次日期"
|
prop="nowDutyDate"
|
align="center"
|
min-width="85px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="生产班次"
|
prop="shiftName"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="出勤时间"
|
prop="dutyTime"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
>
|
<template scope="scope">
|
<el-input
|
size="small"
|
v-model="scope.row.dutyTime"
|
placeholder=""
|
v-if="scope.row.isUpdate"
|
></el-input>
|
<template v-if="!scope.row.isUpdate"
|
>{{ scope.row.dutyTime }}
|
</template>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="出勤总时间"
|
prop="totalDutyTime"
|
align="center"
|
min-width="80px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column align="center" width="90px" fixed="right">
|
<template slot="header" slot-scope="scope">
|
<el-button
|
type="text"
|
@click="openSelectStaff()"
|
:disabled="commitLimit || currentRows.length !== 1"
|
class="commonButton"
|
>添加人员
|
</el-button>
|
</template>
|
<template slot-scope="scope">
|
<el-button
|
type="text"
|
@click="deletePersonBoard(scope.$index, scope.row)"
|
:disabled="commitLimit"
|
class="commonButton"
|
>删除
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-col>
|
<el-col :span="17" style="height: 600px;padding-left: 10px">
|
<artificialTable
|
ref="artificialTable"
|
:personList="personList"
|
:workstationId="workstationId"
|
:commitLimit="commitLimit"
|
:currentDutyRecord="currentDutyRecord"
|
@refreshPersonList="refreshPersonList"
|
></artificialTable>
|
</el-col>
|
</el-row>
|
</el-tab-pane>
|
<el-tab-pane
|
label="杂工工资"
|
type="card"
|
v-if="permissions.production_dutyrecord_view_handyman"
|
>
|
<el-row style="background-color: #F0F2F5">
|
<el-col :span="6" style="height: 600px">
|
<el-table
|
border
|
ref="handymanTypeTable"
|
:data="handymanTypeList"
|
height="100%"
|
:row-style="{ height: '26px' }"
|
:cell-style="{ padding: '0' }"
|
highlight-current-row
|
@row-click="changeHandymanType"
|
>
|
<el-table-column
|
label="序号"
|
type="index"
|
align="center"
|
width="45px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="人工名称"
|
prop="handymanName"
|
align="center"
|
min-width="50%"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="标准定额"
|
prop="standardHourWage"
|
align="center"
|
min-width="25%"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="转换系数"
|
prop="conversionCoefficient"
|
align="center"
|
min-width="25%"
|
show-overflow-tooltip
|
/>
|
</el-table>
|
</el-col>
|
<el-col :span="18" style="height: 600px;padding-left: 10px">
|
<el-table
|
border
|
height="100%"
|
ref="artificialInformationTable"
|
:data="artificialInformationList"
|
:row-style="{ height: '26px' }"
|
:cell-style="cellStyle"
|
:span-method="objectSpanMethod"
|
>
|
<el-table-column
|
label="序号"
|
type="index"
|
align="center"
|
width="45px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="处理"
|
prop="processed"
|
align="center"
|
min-width="5%"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
label="人员"
|
prop="staffName"
|
align="center"
|
min-width="10%"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
label="班次编号"
|
prop="dutyNo"
|
align="center"
|
min-width="10%"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="班次日期"
|
prop="nowDutyDate"
|
align="center"
|
min-width="10%"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="生产班次"
|
prop="shiftName"
|
align="center"
|
min-width="10%"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="个人工时"
|
prop="workingHours"
|
align="center"
|
min-width="10%"
|
show-overflow-tooltip
|
></el-table-column>
|
<!--<el-table-column
|
label="个人次数"
|
prop="personNumber"
|
align="center"
|
min-width="10%"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
label="个人产量"
|
prop="personOutput"
|
align="center"
|
min-width="10%"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
label="结算"
|
prop="settlement"
|
align="center"
|
min-width="10%"
|
show-overflow-tooltip
|
></el-table-column>-->
|
<el-table-column
|
label="杂工工资"
|
prop="handymanWage"
|
align="center"
|
min-width="10%"
|
show-overflow-tooltip
|
></el-table-column>
|
<!--<el-table-column
|
label="各项总和"
|
prop="totalSettlement"
|
align="center"
|
min-width="10%"
|
show-overflow-tooltip
|
></el-table-column>-->
|
<el-table-column
|
label="备注"
|
prop="remark"
|
align="center"
|
min-width="20%"
|
show-overflow-tooltip
|
></el-table-column>
|
</el-table>
|
</el-col>
|
</el-row>
|
</el-tab-pane>
|
<el-tab-pane
|
label="产量工资"
|
type="card"
|
v-if="permissions.production_dutyrecord_view_output"
|
>
|
<el-row>
|
<el-col :span="24" style="height: 600px">
|
<el-table
|
stripe
|
ref="outputList"
|
:data="outputList"
|
height="100%"
|
border
|
:row-style="{ height: '26px' }"
|
:cell-style="{ padding: '0' }"
|
>
|
<el-table-column
|
label="序号"
|
type="index"
|
align="center"
|
width="45px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="班次编号"
|
prop="dutyNo"
|
align="center"
|
min-width="85px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="班次日期"
|
prop="nowDutyDate"
|
align="center"
|
min-width="85px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="生产班次"
|
prop="shiftName"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="产出序列号"
|
prop="systemNo"
|
align="center"
|
min-width="120px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="缆号"
|
prop="outBatchNo"
|
align="center"
|
min-width="120px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="零件编号"
|
prop="partNo"
|
align="center"
|
min-width="150px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="零件规格"
|
prop="specs"
|
align="center"
|
min-width="150px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="工单编号"
|
prop="optaskNo"
|
align="center"
|
min-width="120px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="数量"
|
prop="productQty"
|
align="center"
|
min-width="80px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="单位"
|
prop="unit"
|
align="center"
|
min-width="70px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="单位工时系数"
|
prop="unitWorkFactor"
|
align="center"
|
min-width="100px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="产量工资"
|
prop="qtySalary"
|
align="center"
|
min-width="90px"
|
show-overflow-tooltip
|
/>
|
</el-table>
|
</el-col>
|
</el-row>
|
</el-tab-pane>
|
|
<el-tab-pane label="工资汇总" type="card">
|
<el-row>
|
<el-col :span="24" style="height: 600px">
|
<div style="margin-bottom:5px;">
|
<el-button
|
type="success"
|
plain
|
round
|
:disabled="!salarySummaryList.length"
|
@click="toExaminePayrollSummary"
|
>
|
批量审核
|
</el-button>
|
<el-button
|
plain
|
round
|
@click="toCalAgain"
|
:loading="calLoading"
|
:disabled="!currentRows.length"
|
>
|
重新汇总
|
</el-button>
|
</div>
|
<el-table
|
stripe
|
ref="salarySummaryList"
|
:data="salarySummaryList"
|
border
|
:row-style="{ height: '26px' }"
|
:cell-style="{ padding: '0' }"
|
:height="580"
|
>
|
<el-table-column
|
label="序号"
|
type="index"
|
align="center"
|
width="45px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="人员名称"
|
prop="staffName"
|
align="center"
|
min-width="70px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="人员编号"
|
prop="staffNo"
|
align="center"
|
min-width="90px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="人员部门"
|
prop="divisionName"
|
align="center"
|
min-width="160px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="班次编号"
|
prop="dutyNo"
|
align="center"
|
min-width="85px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="班次日期"
|
prop="nowDutyDate"
|
align="center"
|
min-width="85px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="生产班次"
|
prop="shiftName"
|
align="center"
|
min-width="75px"
|
:show-overflow-tooltip="true"
|
/>
|
<el-table-column
|
label="零件描述"
|
prop="partDesc"
|
align="center"
|
min-width="160px"
|
>
|
<template slot-scope="scope">
|
<div
|
v-for="(item, index) in scope.row.partDesc != null
|
? scope.row.partDesc.split('$')
|
: ''"
|
v-bind:key="item"
|
style="margin-left: 10px;"
|
>
|
{{ item }}
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件产量"
|
prop="partQuantity"
|
align="center"
|
min-width="110px"
|
>
|
<template slot-scope="scope">
|
<div
|
v-for="(item, index) in scope.row.partQuantity != null
|
? scope.row.partQuantity.split('$')
|
: ''"
|
v-bind:key="item"
|
style="margin-left: 10px;"
|
>
|
{{ item }}
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件产量(组)"
|
prop="partQuantityGroup"
|
align="center"
|
min-width="110px"
|
>
|
<template slot-scope="scope">
|
<div
|
v-for="(item, index) in scope.row.partQuantityGroup !=
|
null
|
? scope.row.partQuantityGroup.split('$')
|
: ''"
|
v-bind:key="item"
|
style="margin-left: 10px;"
|
>
|
{{ item }}
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="产量工资"
|
prop="productionWage"
|
align="center"
|
min-width="100px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="杂工工资"
|
prop="handymanWage"
|
align="center"
|
min-width="100px"
|
show-overflow-tooltip
|
/>
|
<el-table-column
|
label="工序系数"
|
prop="operationCoeff"
|
align="center"
|
min-width="100px"
|
show-overflow-tooltip
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-if="scope.row.staffName !== '合计'"
|
v-model="scope.row.operationCoeff"
|
@blur="blurChangeCallback(scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="辅助机台数"
|
prop="auxiliaryWorkstationNum"
|
align="center"
|
min-width="100px"
|
show-overflow-tooltip
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-if="scope.row.staffName !== '合计'"
|
v-model="scope.row.auxiliaryWorkstationNum"
|
@blur="blurWorkstationNumChange(scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="汇总工资"
|
prop="summaryWage"
|
align="center"
|
min-width="100px"
|
show-overflow-tooltip
|
/>
|
</el-table>
|
</el-col>
|
</el-row>
|
</el-tab-pane>
|
</el-tabs>
|
|
<!-- 弹窗, 新增 / 修改 -->
|
<table-form
|
v-if="addOrUpdateVisible"
|
ref="addOrUpdate"
|
@refreshDataList="getData"
|
></table-form>
|
<staffDialog
|
:currshowlist.sync="showStaff"
|
:multiSelect="true"
|
:dutyRecord="currentDutyRecord"
|
@handleSelectionChange="selectStaff"
|
/>
|
</basic-container>
|
</div>
|
</template>
|
|
<script>
|
import {
|
fetchListDutyRecord,
|
delDutyRecord,
|
getPersonByDutyRecordId,
|
exportDutyRecord,
|
putDutyRecord,
|
updateBatchById,
|
getOutputByDutyRecordId,
|
getOutputByDutyRecordIdList,
|
getPersonByDutyRecordIdList
|
} from '@/api/product/dutyrecord'
|
import { deletePersonBoard, addPersonBoard } from '@/api/product/personboard'
|
import {
|
computeByDutyRecordId,
|
computeByDutyRecordIdList
|
} from '@/api/product/computation'
|
import {
|
getHandymanTypeByDutyRecordId,
|
getComputationArtificialInformation,
|
getComputationArtificialInformationByList
|
} from '@/api/product/artificialinformation'
|
import TableForm from './dutyrecord-form'
|
import { mapGetters } from 'vuex'
|
import ttable from '@/views/common/ztt-table.vue'
|
import staffDialog from '@/views/common/workstaff.vue'
|
import artificialTable from './artificial-table'
|
import { dateFormat } from '@/util/date'
|
import { transform } from '@/util/fileTransform'
|
import { highPrecisionAdd } from '@/util/highPrecision'
|
import {
|
addShiftWage,
|
getShiftWageByDutyRecordId,
|
qryShiftWageByDutyRecordIdList,
|
countSalary,
|
summary,
|
summaryAll
|
} from '@/api/product/shiftWage'
|
|
export default {
|
provide() {
|
return {
|
currentRows: () => this.currentRows
|
}
|
},
|
data() {
|
return {
|
ajaxFun: fetchListDutyRecord,
|
dataListLoading: false,
|
addOrUpdateVisible: false,
|
isShowQuery: false,
|
multipleSelection: [],
|
uploadInfo: {
|
// 是否展示上传EXCEL以及对应的url
|
isShow: false,
|
url: ''
|
},
|
dateTimeFilters: {},
|
calLoading: false,
|
prelang: 'operation',
|
options: {
|
height: 300, // 默认高度-为了表头固定
|
stripe: false, // 是否为斑马纹 table
|
highlightCurrentRow: false, // 是否要高亮当前行
|
border: true, // 是否有纵向边框
|
lazy: false, // 是否需要懒加载
|
fit: true, // 列的宽度是否自撑开
|
multiSelect: true, //
|
seqNo: true,
|
isRefresh: true, // 是否显示刷新按钮
|
isShowHide: true, // 是否显示显影按钮
|
isSearch: false, // 高级查询按钮
|
defaultOrderBy: { column: 'dutyDate', direction: 'desc' }
|
},
|
table: {
|
total: 0,
|
currentPage: 1,
|
pageSize: 20,
|
data: [],
|
// 标题
|
column: [
|
{
|
width: '100',
|
prop: 'dutyNo',
|
label: '班次编号',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text',
|
render: { fun: this.addOrUpdateHandle }
|
},
|
{
|
width: '80',
|
prop: 'isSubmit',
|
label: '提交',
|
sort: false,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'select',
|
formatter: this.formatBoolean,
|
optList: () => {
|
return this.booleanOptions
|
}
|
},
|
{
|
width: '80',
|
prop: 'isConfirm',
|
label: '确认',
|
sort: false,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'select',
|
formatter: (row, column, cellValue) => {
|
var formatVal
|
if (cellValue) {
|
formatVal = '<span>是</span>'
|
} else {
|
formatVal = '<span style="color:red">否</span>'
|
}
|
return formatVal
|
},
|
optList: () => {
|
return this.booleanOptions
|
}
|
},
|
{
|
width: '80',
|
prop: 'isAudit',
|
label: '审核',
|
sort: false,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'select',
|
formatter: (row, column, cellValue) => {
|
return cellValue ? '是' : '否'
|
},
|
optList: () => {
|
return this.booleanOptions
|
}
|
},
|
{
|
width: '100',
|
prop: 'dutyDate',
|
label: '班次日期',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'datetimerange',
|
formatter: this.formatDutyDate
|
},
|
{
|
width: '80',
|
prop: 'shiftName',
|
label: '生产班次',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '100',
|
prop: 'workstationName',
|
label: '工作站',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '80',
|
prop: 'dutyTime',
|
label: '班次时间',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '80',
|
prop: 'crewName',
|
label: '生产班组',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '100',
|
prop: 'dutyOutput',
|
label: '班次产量',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '80',
|
prop: 'pending',
|
label: '待处理',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '140',
|
prop: 'receiveRemark',
|
label: '接班记录',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '140',
|
prop: 'deliveryRemark',
|
label: '交班记录',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '140',
|
prop: 'startTime',
|
label: '开始',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'datetimerange'
|
},
|
{
|
width: '140',
|
prop: 'endTime',
|
label: '结束',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'datetimerange'
|
},
|
{
|
width: '80',
|
prop: 'createUser',
|
label: '创建人',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '140',
|
prop: 'createTime',
|
label: '创建时间',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'datetimerange'
|
},
|
{
|
width: '100',
|
prop: 'staffName',
|
label: '人员姓名',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
},
|
{
|
width: '100',
|
prop: 'deptName',
|
label: '所属部门',
|
sort: true,
|
isTrue: true,
|
isSearch: true,
|
searchInfoType: 'text'
|
}
|
],
|
toolbar: [],
|
operator: [
|
{
|
text: '删除',
|
type: 'text',
|
size: 'small',
|
fun: this.deleteHandle,
|
show: {
|
val: 'false',
|
key: 'isConfirm'
|
}
|
}
|
],
|
operatorConfig: {
|
fixed: 'right',
|
label: '操作',
|
width: 100,
|
minWidth: 100
|
}
|
},
|
addButton: {
|
text: '新增',
|
type: 'primary',
|
fun: this.addOrUpdateHandle
|
},
|
computationButton: {
|
text: '计算',
|
ref: 'computation',
|
type: 'primary',
|
disabled: true,
|
isShow: true,
|
fun: this.computation,
|
loading: false
|
},
|
exportPageButton: {
|
text: '导出',
|
type: 'primary',
|
isShow: true,
|
fun: this.exportPage,
|
loading: false
|
},
|
dropdownShow: true,
|
toolbar: [
|
{
|
text: '提交',
|
ref: 'submit',
|
type: 'primary',
|
disabled: true,
|
isShow: true,
|
fun: this.submitDutyRecord
|
},
|
{
|
text: '取消提交',
|
ref: 'cancel',
|
type: 'primary',
|
disabled: true,
|
isShow: true,
|
fun: this.cancelDutyRecord
|
},
|
|
{
|
text: '确认',
|
ref: 'confirm',
|
type: 'primary',
|
disabled: true,
|
isShow: true,
|
fun: this.confirmDutyRecord
|
},
|
{
|
text: '取消确认',
|
ref: 'return',
|
type: 'primary',
|
disabled: true,
|
isShow: true,
|
fun: this.returnDutyRecord
|
}
|
],
|
personList: [],
|
currentRows: [],
|
currentDutyRecord: null,
|
workstationId: null,
|
showStaff: false,
|
booleanOptions: [
|
{ value: true, label: '是' },
|
{ value: false, label: '否' }
|
],
|
commitLimit: false,
|
outputList: [],
|
artificialInformationList: [],
|
handymanTypeList: [],
|
spanArr: [],
|
summaryArr: [],
|
fullPermission: false,
|
salarySummaryListRes: [],
|
timer: null
|
}
|
},
|
components: {
|
TableForm,
|
ttable,
|
staffDialog,
|
artificialTable
|
},
|
computed: {
|
...mapGetters(['permissions']),
|
salarySummaryList() {
|
let r = JSON.parse(JSON.stringify(this.salarySummaryListRes))
|
const Heji = this.getHeji_tab4(r)
|
console.log(Heji)
|
Heji.forEach((e) => {
|
const idx = r.findLastIndex((x) => e.staffId === x.staffId)
|
r = [...r.slice(0, idx + 1), e, ...r.slice(idx + 1)]
|
})
|
return r
|
}
|
},
|
created() {
|
this.showCancelButton()
|
},
|
watch: {
|
currentRows: {
|
handler: function(newVal, oldVal) {
|
const submitButton = this.toolbar.find((item) => item.ref == 'submit') // 提交
|
const cancelButton = this.toolbar.find((item) => item.ref == 'cancel') // 取消提交
|
const confirmButton = this.toolbar.find((item) => item.ref == 'confirm') // 确认
|
const returnButton = this.toolbar.find((item) => item.ref == 'return') // 取消确认
|
const computationButton = this.computationButton // 计算
|
const btns = [
|
submitButton,
|
cancelButton,
|
confirmButton,
|
returnButton,
|
computationButton
|
]
|
btns.forEach((e) => {
|
if (e) {
|
e.disabled = true
|
}
|
})
|
if (this.currentDutyRecord && this.currentDutyRecord.id) {
|
// 提交取消按钮是否可用
|
if (submitButton && !this.currentDutyRecord.isConfirm) {
|
submitButton.disabled = this.currentDutyRecord.isSubmit
|
}
|
if (cancelButton && !this.currentDutyRecord.isConfirm) {
|
cancelButton.disabled = !this.currentDutyRecord.isSubmit
|
}
|
// 计算提交取消按钮是否可用
|
if (confirmButton && this.currentDutyRecord.isSubmit) {
|
confirmButton.disabled = this.currentDutyRecord.isConfirm
|
}
|
if (returnButton && this.currentDutyRecord.isSubmit) {
|
returnButton.disabled = !this.currentDutyRecord.isConfirm
|
}
|
if (computationButton && this.currentDutyRecord.isSubmit) {
|
computationButton.disabled = !this.currentDutyRecord.isConfirm
|
}
|
// 人员和人工操作点击事件限制
|
if (this.fullPermission) {
|
this.commitLimit = false
|
} else if (this.currentDutyRecord.isConfirm) {
|
this.commitLimit = true
|
} else {
|
this.commitLimit = false
|
}
|
// 改变工作站id
|
if (this.currentDutyRecord.workstationId) {
|
this.workstationId = this.currentDutyRecord.workstationId
|
}
|
} else {
|
if (this.currentRows.length > 1) {
|
const theFirstOne = this.currentRows[0]
|
if (
|
this.currentRows.every((e) => {
|
return (
|
e.isSubmit === theFirstOne.isSubmit &&
|
e.isConfirm === theFirstOne.isConfirm &&
|
e.isAudit === theFirstOne.isAudit
|
)
|
})
|
) {
|
// 提交取消按钮是否可用
|
if (submitButton && !theFirstOne.isConfirm) {
|
submitButton.disabled = theFirstOne.isSubmit
|
}
|
if (cancelButton && !theFirstOne.isConfirm) {
|
cancelButton.disabled = !theFirstOne.isSubmit
|
}
|
// 计算提交取消按钮是否可用
|
if (confirmButton && theFirstOne.isSubmit) {
|
confirmButton.disabled = theFirstOne.isConfirm
|
}
|
if (returnButton && theFirstOne.isSubmit) {
|
returnButton.disabled = !theFirstOne.isConfirm
|
}
|
if (computationButton && theFirstOne.isSubmit) {
|
computationButton.disabled = !theFirstOne.isConfirm
|
}
|
}
|
} else {
|
if (this.fullPermission) {
|
this.commitLimit = false
|
} else if (this.currentRows.some((e) => e.isConfirm)) {
|
this.commitLimit = true
|
} else {
|
this.commitLimit = false
|
}
|
}
|
}
|
},
|
immediate: true,
|
deep: true
|
}
|
},
|
methods: {
|
// 更新当前选择的班次记录数据
|
refreshCurrentDutyRecord() {
|
fetchListDutyRecord(
|
Object.assign({ id: this.currentDutyRecord.id })
|
).then((response) => {
|
const dutyRecord = response.data.data.records
|
if (dutyRecord && dutyRecord.length == 1) {
|
this.$set(this.currentDutyRecord, 'isSubmit', dutyRecord[0].isSubmit)
|
this.$set(
|
this.currentDutyRecord,
|
'isConfirm',
|
dutyRecord[0].isConfirm
|
)
|
this.$set(this.currentDutyRecord, 'pending', dutyRecord[0].pending)
|
}
|
})
|
},
|
// 刷新全页面数据
|
refreshDutyRecord() {
|
this.getData()
|
this.clearData()
|
},
|
// 获取数据列表
|
getData() {
|
this.$refs.dutyRecordTable.refreshData()
|
this.currentRows = []
|
this.currentDutyRecord = null
|
},
|
// 获取人工列表--tab2
|
getHandymanType() {
|
// 1.获取人工类型
|
getHandymanTypeByDutyRecordId(this.currentRows.map((e) => e.id)).then(
|
(response) => {
|
this.handymanTypeList = response.data.data
|
}
|
)
|
// 2.获取所有的人工
|
this.getArtificialInformation()
|
},
|
// 获取人工
|
getArtificialInformation(paramObj = { handymanTypeId: '' }) {
|
getComputationArtificialInformationByList({
|
...paramObj,
|
dutyRecordIdList: this.currentRows.map((e) => e.id)
|
}).then((response) => {
|
let r = response.data.data
|
const Heji = this.getHeji(r)
|
Heji.forEach((e) => {
|
const idx = r.findLastIndex((x) => e.staffId === x.staffId)
|
r = [...r.slice(0, idx + 1), e, ...r.slice(idx + 1)]
|
})
|
this.artificialInformationList = r
|
this.getSpanArr(this.artificialInformationList)
|
})
|
},
|
getHeji(list, props = ['workingHours', 'handymanWage'], key = 'staffId') {
|
const obj = {}
|
const sumMap = {}
|
const keyList = list.reduce((preValue, item, index) => {
|
if (!obj[item[key]]) {
|
obj[item[key]] = true
|
const childrens = list.filter((e) => e[key] === item[key])
|
props.forEach((prop) => {
|
sumMap[prop] = childrens.reduce((t, e) => {
|
return highPrecisionAdd(t, +e[prop])
|
}, 0)
|
})
|
preValue.push({
|
processed: '合计',
|
staffName: item.staffName,
|
staffId: item.staffId,
|
...sumMap,
|
children: childrens
|
})
|
}
|
return preValue
|
}, [])
|
return keyList
|
},
|
getHeji_tab4(list, key = 'staffId') {
|
const props = [
|
'partQuantity',
|
'partQuantityGroup',
|
'productionWage',
|
'handymanWage',
|
'summaryWage'
|
]
|
const obj = {}
|
const sumMap = {}
|
const keyList = list.reduce((preValue, item, index) => {
|
if (!obj[item[key]]) {
|
obj[item[key]] = true
|
const childrens = list.filter((e) => e[key] === item[key])
|
props.forEach((prop) => {
|
sumMap[prop] = childrens.reduce((t, e) => {
|
const vals = ((e[prop] || 0) + '').split('$')
|
const addVal = vals.reduce((t2, e2) => {
|
return highPrecisionAdd(t2, +e2) + ''
|
})
|
return highPrecisionAdd(t, +addVal) + ''
|
}, 0)
|
})
|
preValue.push({
|
staffName: '合计',
|
staffId: item.staffId,
|
...sumMap
|
})
|
}
|
return preValue
|
}, [])
|
return keyList
|
},
|
// 新增 / 修改
|
addOrUpdateHandle(row) {
|
this.addOrUpdateVisible = true
|
this.$nextTick(() => {
|
this.$refs.addOrUpdate.init(row == null ? null : row.id)
|
})
|
},
|
// 删除
|
deleteHandle(row) {
|
this.$confirm('是否确认删除换班记录名称为:' + row.dutyNo, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnClickModal: false,
|
type: 'warning'
|
})
|
.then(function() {
|
return delDutyRecord(row.id)
|
})
|
.then((data) => {
|
this.$message.success('删除成功')
|
this.getData()
|
this.clearData()
|
})
|
.catch(() => {})
|
},
|
clearData() {
|
this.currentDutyRecord = null
|
this.currentHandymanTypeId = 0
|
this.personList = []
|
this.$refs.artificialTable.clear()
|
this.outputList = []
|
this.handymanTypeList = []
|
this.artificialInformationList = []
|
this.salarySummaryList = []
|
},
|
handleSelectionChange(val) {
|
if (this.timer) {
|
clearTimeout(this.timer)
|
}
|
this.timer = setTimeout(() => {
|
if (val.length === 1) {
|
this.currentDutyRecord = val[0]
|
} else {
|
this.currentDutyRecord = null
|
}
|
this.currentRows = val
|
if (val.length === 0) {
|
this.clearData()
|
} else {
|
// 1.出勤时间--TAB1-原始数据
|
this.getPersonList()
|
this.$refs.artificialTable.getArtificialInformation()
|
// 2.产量--TAB3-产量工资
|
getOutputByDutyRecordIdList(this.currentRows.map((e) => e.id)).then(
|
(response) => {
|
this.outputList = response.data.data
|
}
|
)
|
// 3.人工--TAB2-杂工工资
|
this.getHandymanType()
|
// 4.工资汇总--TAB4-工资汇总
|
this.getSalarySummary()
|
// 5.清数据
|
this.currentHandymanTypeId = 0
|
}
|
}, 600)
|
},
|
// 查询工资汇总
|
getSalarySummary() {
|
qryShiftWageByDutyRecordIdList(this.currentRows.map((e) => e.id)).then(
|
(response) => {
|
const r = response.data.data
|
this.salarySummaryListRes = r
|
}
|
)
|
},
|
// 人工记录变化,刷新页面数据
|
refreshPersonList() {
|
this.getPersonList()
|
this.getHandymanType()
|
this.refreshCurrentDutyRecord()
|
},
|
// 获取人员信息
|
getPersonList() {
|
getPersonByDutyRecordIdList(this.currentRows.map((e) => e.id)).then(
|
(response) => {
|
this.personList = response.data.data
|
}
|
)
|
},
|
// 格式化日期
|
formatDutyDate(row, column, cellValue) {
|
if (cellValue) {
|
const dutyDateList = /\d{4}-\d{1,2}-\d{1,2}/g.exec(cellValue)
|
if (dutyDateList && dutyDateList.length > 0) {
|
return dutyDateList[0]
|
}
|
}
|
return ''
|
},
|
// 打开选择人员页面
|
openSelectStaff() {
|
if (this.currentDutyRecord) {
|
this.showStaff = true
|
} else {
|
this.$message.warning('请选择一条上班记录')
|
}
|
},
|
// 选中人员,并记录员工上机信息
|
selectStaff(staffs) {
|
if (staffs.length > 0) {
|
// 校验选中的员工是否已经上机,若已经上机,则过滤
|
var personBoards = []
|
for (var i = 0; i < staffs.length; i++) {
|
var pb = this.personList.find((item) => item.staffId === staffs[i].id)
|
if (pb == null) {
|
personBoards.push(
|
Object.assign({
|
workTime: dateFormat(new Date()),
|
workstationId: this.currentDutyRecord.workstationId,
|
staffId: staffs[i].id,
|
dutyRecordId: this.currentDutyRecord.id
|
})
|
)
|
}
|
}
|
if (personBoards.length > 0) {
|
addPersonBoard(personBoards).then((response) => {
|
this.$message.success('人员添加成功')
|
this.getPersonList()
|
})
|
} else {
|
this.$message.warning('选择人员已在当前上班记录')
|
}
|
} else {
|
this.$message.warning('未选择人员')
|
}
|
},
|
// 删除人员
|
deletePersonBoard(index, row) {
|
this.$confirm('是否确认删除人员:' + row.staffName, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnClickModal: false,
|
type: 'warning'
|
})
|
.then(function() {
|
return deletePersonBoard([row.id])
|
})
|
.then((data) => {
|
this.personList.splice(index, 1)
|
this.$message.success('人员删除成功')
|
})
|
.catch(() => {})
|
},
|
|
// 导出
|
exportPage() {
|
this.exportPageButton.loading = true
|
exportDutyRecord(this.$refs.dutyRecordTable.getQueryParam())
|
.then((response) => {
|
transform(response)
|
this.exportPageButton.loading = false
|
})
|
.catch(() => {
|
this.exportPageButton.loading = false
|
})
|
},
|
// 提交/确认列中文格式化
|
formatBoolean(row, column, cellValue) {
|
if (cellValue) {
|
return '是'
|
} else {
|
return '否'
|
}
|
},
|
// 提交上班记录
|
submitDutyRecord() {
|
this.$confirm('是否确认提交', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnClickModal: false,
|
type: 'warning'
|
})
|
.then(() => {
|
updateBatchById(
|
this.currentRows.map((e) => {
|
return {
|
id: e.id,
|
isSubmit: true,
|
operationType: '提交'
|
}
|
})
|
).then((data) => {
|
this.$message.success('提交成功')
|
this.refreshDutyRecord()
|
})
|
})
|
.catch(() => {})
|
},
|
// 取消上班记录
|
cancelDutyRecord() {
|
updateBatchById(
|
this.currentRows.map((e) => {
|
return {
|
id: e.id,
|
isSubmit: false,
|
operationType: '取消提交'
|
}
|
})
|
).then((data) => {
|
this.$message.success('取消提交成功')
|
this.refreshDutyRecord()
|
})
|
},
|
// 计算已确认班次的工资
|
computation() {
|
this.computationButton.loading = true
|
computeByDutyRecordIdList(this.currentRows.map((e) => e.id))
|
.then((data) => {
|
this.$message.success('计算完成')
|
this.getHandymanType()
|
this.getPersonList()
|
this.refreshCurrentDutyRecord()
|
this.computationButton.loading = false
|
})
|
.catch(() => {
|
this.computationButton.loading = false
|
})
|
},
|
// 确认班次报工信息
|
confirmDutyRecord() {
|
this.$confirm('是否确认', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
closeOnClickModal: false,
|
type: 'warning'
|
})
|
.then(() => {
|
updateBatchById(
|
this.currentRows.map((e) => {
|
return {
|
id: e.id,
|
isConfirm: true,
|
operationType: '确认'
|
}
|
})
|
).then((data) => {
|
this.$message.success('确认成功')
|
// 如果仅是审核权限,立即刷新页面(用来隐藏数据)
|
if (
|
this.permissions.production_dutyrecord_audit &&
|
!this.permissions.production_dutyrecord_all
|
) {
|
this.getData()
|
this.clearData()
|
} else {
|
this.refreshDutyRecord()
|
}
|
})
|
})
|
.catch(() => {})
|
},
|
// 取消确认班次报工信息
|
returnDutyRecord() {
|
updateBatchById(
|
this.currentRows.map((e) => {
|
return {
|
id: e.id,
|
isConfirm: false,
|
operationType: '取消确认'
|
}
|
})
|
).then((data) => {
|
this.$message.success('取消确认成功')
|
this.refreshDutyRecord()
|
})
|
},
|
// 状态改变
|
handleCommand(event) {
|
if (event == 'submit') {
|
this.submitDutyRecord()
|
} else if (event == 'cancel') {
|
this.cancelDutyRecord()
|
} else if (event == 'confirm') {
|
this.confirmDutyRecord()
|
} else if (event == 'return') {
|
this.returnDutyRecord()
|
}
|
},
|
// 默认条件已提交
|
defaultSubmit() {
|
const isSubmitColumn = this.table.column.find(
|
(column) => column.prop === 'isSubmit'
|
)
|
if (isSubmitColumn) {
|
isSubmitColumn.propVal = true
|
}
|
},
|
// 根据权限显示取消按钮
|
showCancelButton() {
|
if (this.permissions.production_dutyrecord_all) {
|
// 完全权限,只能看已提交的班次记录
|
this.fullPermission = true
|
this.checkButtonPermission()
|
this.defaultSubmit()
|
} else if (this.permissions.production_dutyrecord_audit) {
|
// 审核权限,只能看已提交、未确认的班次记录
|
this.toolbar = this.toolbar.filter((item) => item.ref != 'return')
|
this.computationButton.isShow = false
|
this.defaultSubmit()
|
const isConfirmColumn = this.table.column.find(
|
(column) => column.prop === 'isConfirm'
|
)
|
if (isConfirmColumn) {
|
isConfirmColumn.propVal = false
|
}
|
} else {
|
this.checkButtonPermission()
|
}
|
this.checkExportButtonPermission()
|
},
|
checkButtonPermission() {
|
if (!this.permissions.production_dutyrecord_submit) {
|
this.toolbar = this.toolbar.filter((item) => item.ref != 'submit')
|
}
|
if (!this.permissions.production_dutyrecord_cancel) {
|
this.toolbar = this.toolbar.filter((item) => item.ref != 'cancel')
|
}
|
if (!this.permissions.production_dutyrecord_confirm) {
|
this.toolbar = this.toolbar.filter((item) => item.ref != 'confirm')
|
}
|
if (!this.permissions.production_dutyrecord_return) {
|
this.toolbar = this.toolbar.filter((item) => item.ref != 'return')
|
}
|
if (this.toolbar && this.toolbar.length == 0) {
|
this.dropdownShow = false
|
}
|
if (!this.permissions.production_dutyrecord_computation) {
|
this.computationButton.isShow = false
|
}
|
},
|
checkExportButtonPermission() {
|
if (!this.permissions.production_dutyrecord_export) {
|
this.exportPageButton.isShow = false
|
}
|
},
|
|
// 单行点击人工项目
|
changeHandymanType(row) {
|
if (row && row.id && row.id != this.currentHandymanTypeId) {
|
this.currentHandymanTypeId = row.id
|
this.getArtificialInformation({ handymanTypeId: row.id })
|
} else {
|
this.currentHandymanTypeId = 0
|
this.$refs.handymanTypeTable.setCurrentRow(-1)
|
this.getArtificialInformation()
|
}
|
},
|
// 单元格-处理上色
|
cellStyle({ row, column, rowIndex, columnIndex }) {
|
if (column.label == '处理' && row.processed == '是') {
|
return 'background: #007D65;color:white;padding: 0px'
|
}
|
return 'padding: 0px'
|
},
|
// 合并行
|
getSpanArr(data) {
|
this.spanArr.length = 0
|
this.summaryArr.length = 0
|
for (var i = 0; i < data.length; i++) {
|
if (i === 0) {
|
this.spanArr.push(1)
|
this.summaryArr.push(data[i].settlement)
|
this.pos = 0
|
} else {
|
// 判断人员是否相同
|
if (data[i].staffId && data[i].staffId === data[i - 1].staffId) {
|
this.spanArr[this.pos] += 1
|
if (data[i].settlement) {
|
this.summaryArr[this.pos] = highPrecisionAdd(
|
this.summaryArr[this.pos],
|
data[i].settlement
|
)
|
}
|
this.spanArr.push(0)
|
this.summaryArr.push(0)
|
} else {
|
this.spanArr.push(1)
|
this.summaryArr.push(data[i].settlement)
|
this.pos = i
|
}
|
}
|
}
|
},
|
// 单元格合并
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
if (columnIndex === 2) {
|
const _row = this.spanArr[rowIndex]
|
const _col = _row > 0 ? 1 : 0
|
return {
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数
|
rowspan: _row,
|
colspan: _col
|
}
|
}
|
if (columnIndex === 10) {
|
const _row = this.spanArr[rowIndex]
|
const _col = _row > 0 ? 1 : 0
|
row.totalSettlement = this.summaryArr[rowIndex]
|
return {
|
// [0,0] 表示这一行不显示, [2,1]表示行的合并数
|
rowspan: _row,
|
colspan: _col
|
}
|
}
|
},
|
// 背景色
|
tableRowClassName(row, callback) {
|
let result = ''
|
if (row.pending > 0) {
|
result = 'danger-row'
|
}
|
callback(result)
|
},
|
blurWorkstationNumChange(row) {
|
const checkFlag = this.checkIntegerNumber(row.auxiliaryWorkstationNum)
|
if (!checkFlag) {
|
this.$message.error('请填写正确的辅助机台数')
|
} else {
|
// 计算工资,并且更新
|
countSalary(row).then((response) => {
|
const resData = response.data
|
if (resData.code == 0) {
|
row.summaryWage = resData.data.summaryWage
|
const t = this.salarySummaryListRes.find(
|
(e) => e.staffId === row.staffId
|
)
|
Object.assign(t, row)
|
}
|
})
|
}
|
},
|
// 实时计算工资
|
blurChangeCallback(row) {
|
const checkFlag = this.checkNumber(row.operationCoeff)
|
if (!checkFlag) {
|
this.$message.error('请填写正确的工序系数')
|
} else {
|
// 计算工资,并且更新
|
countSalary(row).then((response) => {
|
const resData = response.data
|
if (resData.code == 0) {
|
row.summaryWage = resData.data.summaryWage
|
const t = this.salarySummaryListRes.find(
|
(e) => e.staffId === row.staffId
|
)
|
Object.assign(t, row)
|
}
|
})
|
}
|
},
|
// 审核提交数据
|
toExaminePayrollSummary() {
|
const theList = this.salarySummaryList.filter(
|
(e) => e.staffName !== '合计'
|
)
|
let flag = true
|
let oneFlag = true
|
for (let i = 0; i < theList.length; i++) {
|
if (!this.checkNumber(theList[i].operationCoeff)) {
|
flag = false
|
}
|
if (!this.checkIntegerNumber(theList[i].auxiliaryWorkstationNum)) {
|
oneFlag = false
|
}
|
}
|
if (flag) {
|
if (oneFlag) {
|
// 提交审核数据
|
addShiftWage(theList).then((response) => {
|
const resData = response.data
|
if (resData.code == 0) {
|
this.$message.success('审核成功')
|
this.currentRows.forEach((e) => {
|
e.isAudit = true
|
})
|
// this.currentDutyRecord.isAudit = true
|
this.getSalarySummary()
|
}
|
})
|
} else {
|
this.$message.error('辅助机台数格式不正确')
|
}
|
} else {
|
this.$message.error('工序系数格式不正确')
|
}
|
},
|
|
toCalAgain() {
|
if (this.calLoading) {
|
return
|
}
|
this.calLoading = true
|
summaryAll(this.currentRows.map((e) => e.id))
|
.then((respose) => {
|
this.calLoading = false
|
if (respose.data && respose.data.code === 0) {
|
// this.currentDutyRecord.isAudit = false
|
// tocheck isAudit
|
this.currentRows.forEach((e) => {
|
e.isAudit = false
|
})
|
this.getSalarySummary()
|
}
|
})
|
.catch(() => {
|
this.calLoading = false
|
})
|
},
|
// 校验整数
|
checkIntegerNumber(val) {
|
if (val && val != null && (val + '').trim() !== '') {
|
if (Number(val) === 0) {
|
return false
|
} else {
|
return /^[0-9]?$/.test(val)
|
}
|
} else {
|
return false
|
}
|
},
|
// 校验数字
|
checkNumber(val) {
|
if (val && val != null && (val + '').trim() !== '') {
|
if (Number(val) === 0) {
|
return false
|
} else {
|
return /^[0-9]+(.[0-9]{1,2})?$/.test(val)
|
}
|
} else {
|
return false
|
}
|
},
|
getSummaries(param) {
|
const { columns, data } = param
|
const sums = []
|
const props = [
|
'partQuantity',
|
'partQuantityGroup',
|
'productionWage',
|
'handymanWage',
|
'summaryWage'
|
]
|
columns.forEach((column, index) => {
|
if (index === 0) {
|
sums[index] = '合计'
|
return
|
}
|
if (props.includes(column.property)) {
|
const values = data.map((item) => Number(item[column.property]))
|
if (!values.every((value) => isNaN(value))) {
|
sums[index] = values.reduce((prev, curr) => {
|
const value = Number(curr)
|
if (!isNaN(value)) {
|
return highPrecisionAdd(prev, curr)
|
} else {
|
return prev
|
}
|
}, 0)
|
} else {
|
sums[index] = ''
|
}
|
} else {
|
sums[index] = ''
|
}
|
})
|
|
return sums
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.el-table .warning-row {
|
background: oldlace;
|
}
|
|
.img-onlyRead {
|
pointer-events: none;
|
}
|
</style>
|