| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout v-permissions="['ext:workorderrecordext:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" label-suffix="ï¼" inline> |
| | | <el-form-item label="ç产人å" prop="userId"> |
| | | <el-select v-model="searchForm.userId" clearable filterable placeholder="è¯·éæ©"> |
| | | <el-option |
| | | v-for="item in proUsers" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.userId"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç©æä¿¡æ¯" prop="materialName"> |
| | | <el-input v-model="searchForm.materialName" placeholder="请è¾å
¥ç©æåç§°/ç¼ç " @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åº" prop="procedureId"> |
| | | <el-select v-model="searchForm.procedureId" filterable clearable placeholder="è¯·éæ©"> |
| | | <el-option |
| | | v-for="(item, index) in procedures" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥å·¥æ¶é´"> |
| | | <el-date-picker |
| | | v-model="planDate" |
| | | type="daterange" |
| | | value-format="yyyy-MM-dd" |
| | | range-separator="~" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | @change="dateChange" |
| | | ></el-date-picker> |
| | | </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="['ext:workorderrecordext:exportExcel']" --> |
| | | <li ><el-button type="primary" :loading="isWorking.export" @click="exportExcel">导åº</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | border |
| | | > |
| | | <el-table-column type="index" :index="customIndex" label="åºå·" fixed="left" min-width="80px"></el-table-column> |
| | | <el-table-column prop="userInfo.userName" label="ç产人å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="userInfo.departName" label="é¨é¨" min-width="100px"> </el-table-column> |
| | | <el-table-column prop="materialName" label="ç©æåç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="materialCode" label="ç©æç¼ç " min-width="140px"></el-table-column> |
| | | <el-table-column prop="procedureName" label="å·¥åºåç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="workorderCode" label="å·¥åç¼ç " min-width="150px"></el-table-column> |
| | | <el-table-column prop="unitName" label="åä½" min-width="100px"></el-table-column> |
| | | <el-table-column prop="num" label="æ¥å·¥æ°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="qualifiedNum" label="è¯åæ°" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | {{ row.qualifiedNum || 0 }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unQualifiedNum" label="ä¸è¯åæ°" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | {{ row.unQualifiedNum || 0 }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="rate" label="åæ ¼ç(%)" min-width="100px"></el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | ></pagination> |
| | | </template> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { getDeviceByCondition } from '@/api/ext/deviceExt' |
| | | import { productesGroup } from '@/api/ext/proceduresExt' |
| | | import { companyUserExtAllUser } from '@/api/ext/companyUserExt' |
| | | import { addPrecision } from '@/utils/util' |
| | | export default { |
| | | name: 'WorkorderRecordExt', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | procedureId: '', |
| | | userId: '', |
| | | startDate: '', |
| | | endDate: '', |
| | | materialName: '', |
| | | }, |
| | | procedures: [ |
| | | ], |
| | | proUsers: [ |
| | | ], |
| | | |
| | | orderStatus:[ |
| | | // 0å·²å建ã1已颿ã2å·²å®å·¥æ£ã3å·²æ£éªã4å·²è¿å·¥ã5å·²å
¥åºã6å·²æåã7已忶ã8å·²å
³é |
| | | // 0å·²å建ã1已夿ã2å·²å®å·¥æ£ã3å·²æ£éªã4å·²æ¥å·¥ã5å·²å
¥åºã6已忶 |
| | | { name: 'å·²å建', id: 0 }, |
| | | { name: '已夿', id: 1 }, |
| | | { name: 'å·²å®å·¥æ£', id: 2 }, |
| | | { name: 'å·²æ£éª', id: 3 }, |
| | | { name: 'å·²æ¥å·¥', id: 4 }, |
| | | { name: '已忶', id: 6 } |
| | | ], |
| | | planDate: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'æ¥å·¥è®°å½', |
| | | api: '/ext/userSalary', |
| | | 'field.id': 'id', |
| | | 'field.main': 'name', |
| | | sorts: [{ direction: 'DESC', property: 'CREATE_TIME' }] |
| | | }) |
| | | let tempDate = new Date() |
| | | let year = tempDate.getFullYear() |
| | | let month = tempDate.getMonth() + 1 |
| | | let day = tempDate.getDate() |
| | | this.searchForm.startDate = `${year}-${month}-01` |
| | | this.searchForm.endDate = `${year}-${month}-${day}` |
| | | this.planDate = [this.searchForm.startDate, this.searchForm.endDate] |
| | | this.search() |
| | | }, |
| | | activated() { |
| | | productesGroup({}) |
| | | .then(res => { |
| | | this.procedures = res |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | companyUserExtAllUser({ departmentId: this.$store.state.userInfo.curComDepartment.id }) |
| | | .then(res => { |
| | | this.proUsers = res |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | methods: { |
| | | dateChange (v) { |
| | | // console.log('æ¥æéæ©äº') |
| | | this.searchForm.startDate = v[0] |
| | | this.searchForm.endDate = v[1] |
| | | }, |
| | | reset () { |
| | | // console.log('rest', this.searchDate) |
| | | this.planDate = [] |
| | | this.searchForm.startDate = '' |
| | | this.searchForm.endDate = '' |
| | | this.$refs.searchForm.resetFields() |
| | | this.search() |
| | | }, |
| | | statusToStr (row) { |
| | | for (const item of this.orderStatus) { |
| | | if (item.id === row.omodel.status) { |
| | | return item.name |
| | | } |
| | | } |
| | | return '-' |
| | | }, |
| | | getSummaries (param) { |
| | | const { columns, data } = param; |
| | | const sums = []; |
| | | columns.forEach((column, index) => { |
| | | if (index === 0) { |
| | | sums[index] = 'å计'; |
| | | return; |
| | | } else if (index === 4 || index === 8 || index === 6 || index === 10) { |
| | | // || index === 8 || index === 9 || index === 16 || index === 17 |
| | | sums[index] = '-'; |
| | | return; |
| | | } |
| | | const values = data.map(item => { |
| | | if (index === 6) { |
| | | return Number(item.omodel.planNum) |
| | | } else { |
| | | return Number(item[column.property]) |
| | | } |
| | | |
| | | }); |
| | | if (!values.every(value => isNaN(value))) { |
| | | sums[index] = 0 |
| | | values.forEach(item => { |
| | | sums[index] = addPrecision(item, sums[index]) |
| | | }) |
| | | } else { |
| | | sums[index] = '-'; |
| | | } |
| | | }); |
| | | return sums |
| | | }, |
| | | customIndex(index) { |
| | | console.log(); |
| | | return (this.tableData.pagination.pageIndex-1) * this.tableData.pagination.pageSize + index + 1 |
| | | } |
| | | } |
| | | } |
| | | |
| | | </script> |