| | |
| | | :data="tableData" |
| | | :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" |
| | | border |
| | | :summary-method="getSummaries" |
| | | show-summary |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" |
| | | highlight-current-row |
| | |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="good_qty" |
| | | prop="report_qty" |
| | | label="报工数量" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.good_qty">{{ row.good_qty }}</div> |
| | | <div v-if="row.report_qty">{{ row.report_qty }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.unprice">{{ row.unprice }}元</div> |
| | | <div v-if="row.unprice">{{ row.unprice }} 元</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="usermoney" |
| | | label="班组记件工资" |
| | | label="个人记件工资" |
| | | width="130" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.usermoney">{{ row.usermoney }}元</div> |
| | | <div v-if="row.usermoney">{{ row.usermoney }} 元</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="lm_user" |
| | | prop="username" |
| | | label="报工人员" |
| | | width="110" |
| | | sortable="custom" |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getSummaries(param) { |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | |
| | | columns.forEach((column, index) => { |
| | | if (index === 10) { |
| | | sums[index] = '总价' |
| | | return |
| | | } |
| | | const values = data.map(item => Number(item[column.property])) |
| | | if (column.property === 'usermoney') { |
| | | sums[index] = values.reduce((prev, curr) => { |
| | | const value = Number(curr) |
| | | if (!isNaN(value)) { |
| | | return prev + curr |
| | | } else { |
| | | return prev |
| | | } |
| | | }, 0) |
| | | |
| | | sums[index] += ' 元' |
| | | } else { |
| | | // sums[index] = 'N/A' |
| | | sums[index] = ' ' |
| | | } |
| | | }) |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | |
| | | return sums |
| | | }, |
| | | async getPeopleSalaryReportSearch() { |
| | | let tempDate = this.form.reportdate |
| | | if (tempDate.length > 0) { |