| <template> | 
|   <TableLayout :permissions="['business:salaryparam:query']"> | 
|     <!-- 搜索表单 --> | 
|     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
|        | 
|       <el-form-item label="物料信息" prop="keyWord"> | 
|         <el-input v-model="searchForm.keyWord" placeholder="请输入物料名称/编码" @keypress.enter.native="search"></el-input> | 
|       </el-form-item> | 
|       <el-form-item label="工序" prop="procedureName"> | 
|         <el-input v-model="searchForm.procedureName" placeholder="请输入工序" @keypress.enter.native="search"></el-input> | 
|       </el-form-item> | 
|       <el-form-item label="计价方式" prop="type"> | 
|         <el-select v-model="searchForm.type" placeholder="请选择计价方式" clearable> | 
|           <el-option | 
|             v-for="item in type" | 
|             :key="item.value" | 
|             :label="item.label" | 
|             :value="item.value" | 
|           > | 
|           </el-option> | 
|         </el-select> | 
|       </el-form-item> | 
|       <section> | 
|         <el-button type="primary" @click="search">搜索</el-button> | 
|          | 
|         <el-button @click="reset">重置</el-button> | 
|       </section> | 
|     </el-form> | 
|     <!-- 表格和分页 --> | 
|     <template v-slot:table-wrap> | 
|       <ul class="toolbar" v-permissions="['business:salaryparam:create', 'business:salaryparam:delete', 'business:salaryparam:exportExcel', 'business:salaryparam:importExcel']"> | 
|         <li><el-button type="primary" @click="$refs.operaSalaryParamWindow.open('新建绩效工资配置')" v-permissions="['business:salaryparam:create']">新建</el-button></li> | 
|         <li><el-button type="primary" @click="deleteByIdInBatch" v-permissions="['business:salaryparam:delete']">批量删除</el-button></li> | 
|         <li> | 
|           <el-button type="primary" :loading="isWorking.export" v-permissions="['business:salaryparam:exportExcel']" @click="exportExcel">导出</el-button> | 
|         </li> | 
|         <li v-permissions="['business:salaryparam:importExcel']"> | 
|           <ImportButton | 
|             text="导入" | 
|             template-name="salary_import_template.xlsx" | 
|             template-path="/template/salary_import_template.xlsx" | 
|             action="/business/salaryParam/importBatch" | 
|             @success="search" | 
|           /> | 
|         </li> | 
|       </ul> | 
|       <el-table | 
|         v-loading="isWorking.search" | 
|         :data="tableData.list" | 
|         stripe | 
|         border | 
|         @selection-change="handleSelectionChange" | 
|       > | 
|         <el-table-column type="selection" width="55"></el-table-column> | 
|         <!-- align="center" --> | 
|         <el-table-column prop="id" label="序号" min-width="100px"></el-table-column> | 
|         <el-table-column prop="type" label="计价方式" min-width="100px"> | 
|           <template slot-scope="{row}"> | 
|             {{ row.type == 0 ? '计件' : '计时' }} | 
|           </template> | 
|         </el-table-column> | 
|         <el-table-column prop="materialName" label="物料名称" min-width="140px"></el-table-column> | 
|         <el-table-column prop="materialCode" label="物料编码" min-width="100px"></el-table-column> | 
|         <el-table-column prop="procedureName" label="工序名称" min-width="100px"></el-table-column> | 
|         <el-table-column prop="salary" label="工资单价(元)" min-width="100px"> | 
|           <!-- <template slot-scope="{row}"> | 
|             {{ accDiv(row.salary, 100) }} | 
|           </template> --> | 
|         </el-table-column> | 
|         <el-table-column prop="num" label="标准产出" min-width="100px"> | 
|           <template slot-scope="{row}"> | 
|             {{ (row.num == 0 || !row.num) ? '-' : row.num }} | 
|           </template> | 
|         </el-table-column> | 
|         <el-table-column prop="times" label="标准工时" min-width="100px"> | 
|           <template slot-scope="{row}"> | 
|             {{ timesToStr(row.times) }} | 
|           </template> | 
|         </el-table-column> | 
|         <el-table-column prop="unqualified" label="不良品是否计入" min-width="110px"> | 
|           <template slot-scope="{row}"> | 
|             {{ row.unqualified == 0 ? '否' : '是' }} | 
|           </template> | 
|         </el-table-column> | 
|         <el-table-column prop="createTime" label="创建时间" min-width="150px"></el-table-column> | 
|         <el-table-column prop="createUserName" label="创建人" min-width="100px"></el-table-column> | 
|         <!-- <el-table-column prop="updateTime" label="更新时间" min-width="100px"></el-table-column> | 
|         <el-table-column prop="remark" label="备注" min-width="100px"></el-table-column> | 
|         <el-table-column prop="rootDepartId" label="主组织编码(关联department表根组织)" min-width="100px"></el-table-column> | 
|         <el-table-column prop="departId" label="工厂编码(关联department表)" min-width="100px"></el-table-column> | 
|         <el-table-column prop="bomId" label="bom编码(关联bom表)" min-width="100px"></el-table-column> --> | 
|          | 
|         <el-table-column | 
|           v-if="containPermissions(['business:salaryparam:update', 'business:salaryparam:delete'])" | 
|           label="操作" | 
|           min-width="120" | 
|           fixed="right" | 
|         > | 
|           <template slot-scope="{row}"> | 
|             <el-button type="text" @click="$refs.operaSalaryParamWindow.open('编辑绩效工资配', row)" v-permissions="['business:salaryparam:update']">编辑</el-button> | 
|             <el-button type="text" @click="deleteById(row)" v-permissions="['business:salaryparam:delete']">删除</el-button> | 
|           </template> | 
|         </el-table-column> | 
|       </el-table> | 
|       <pagination | 
|         @size-change="handleSizeChange" | 
|         @current-change="handlePageChange" | 
|         :pagination="tableData.pagination" | 
|       > | 
|       </pagination> | 
|     </template> | 
|     <!-- 新建/修改 --> | 
|     <OperaSalaryParamWindow ref="operaSalaryParamWindow" @success="handlePageChange"/> | 
|   </TableLayout> | 
| </template> | 
|   | 
| <script> | 
| import BaseTable from '@/components/base/BaseTable' | 
| import TableLayout from '@/layouts/TableLayout' | 
| import Pagination from '@/components/common/Pagination' | 
| import ImportButton from '@/components/common/ImportButton' | 
| import OperaSalaryParamWindow from '@/components/business/OperaSalaryParamWindow' | 
| export default { | 
|   name: 'SalaryParam', | 
|   extends: BaseTable, | 
|   components: { TableLayout, Pagination, OperaSalaryParamWindow, ImportButton }, | 
|   data () { | 
|     return { | 
|       // 搜索 | 
|       searchForm: { | 
|         keyWord: '', | 
|         procedureName: '', | 
|         type: '' | 
|       }, | 
|       type: [ | 
|         { label: '计件', value: '0' }, | 
|         { label: '计时', value: '1' }, | 
|       ] | 
|     } | 
|   }, | 
|   created () { | 
|     this.config({ | 
|       module: '设置类-绩效工资配置表', | 
|       api: '/business/salaryParam', | 
|       'field.id': 'id', | 
|       'field.main': 'id' | 
|     }) | 
|     this.search() | 
|   }, | 
|   methods: { | 
|     timesToStr(times) { | 
|       if (times==0||!times) { | 
|         return '-' | 
|       } | 
|       let sec = times%60 | 
|       let lesMin = Math.floor(times/60) | 
|       let min = lesMin%60 | 
|       let hours =  Math.floor(lesMin/60) | 
|       return `${hours}时${min}分${sec}秒` | 
|     } | 
|   }, | 
| } | 
| </script> |