| | |
| | | <template> |
| | | <div class="productionRreport-container"> |
| | | <div class="filter-card"> |
| | | <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch"> |
| | | <CommonSearch |
| | | :show-add="false" |
| | | :amount-view="false" |
| | | placeholder="请输入关键词" |
| | | @searchClick="onFilterSearch" |
| | | > |
| | | <template slot="leftButton"> |
| | | <el-button size="small" type="primary" @click="exportBtnClick">导出</el-button> |
| | | <el-select |
| | | v-model="marketId" |
| | | placeholder="请选择" |
| | | class="select-width margin_right_10px" |
| | | multiple |
| | | collapse-tags |
| | | > |
| | | <el-option |
| | | v-for="item in marketList" |
| | | :key="item.ID" |
| | | :label="item.name" |
| | | :value="item.ID" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <el-button size="small" type="primary" @click="exportBtnClick" |
| | | >导出</el-button |
| | | > |
| | | </template> |
| | | </CommonSearch> |
| | | </div> |
| | | <div class="body-card"> |
| | | <div class="list-view"> |
| | | <TableCommonView ref="tableListRef" v-loading="loading" :table-list="tableList" @selTableCol="selTableCol"> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | v-loading="loading" |
| | | :table-list="tableList" |
| | | @selTableCol="selTableCol" |
| | | > |
| | | </TableCommonView> |
| | | </div> |
| | | <!-- <div class="btn-pager"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getAttendanceStatistic } from "@/api/employeeSalary/attendanceManage.js"; |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin"; |
| | | import { getDictList } from "@/api/productManage/silkRegisterForm.js"; |
| | | export default { |
| | | name: "productionReport", |
| | | props: {}, |
| | |
| | | return { |
| | | loading: false, |
| | | tableList: {}, |
| | | marketId: [], |
| | | marketList: [], //庄口 |
| | | tableColumn: [ |
| | | { label: "车间", prop: "name", default: true }, |
| | | { label: "机组", prop: "member_name" }, |
| | |
| | | { label: "纤度偏差", prop: "detail_address" }, |
| | | { label: "日产量", prop: "client_status" }, |
| | | { label: "等级", prop: "contact_name" }, |
| | | { label: "综合等级", prop: "contact_phone" } |
| | | { label: "综合等级", prop: "contact_phone" }, |
| | | ], |
| | | showCol: [ |
| | | "车间", |
| | |
| | | "纤度偏差", |
| | | "日产量", |
| | | "等级", |
| | | "综合等级" |
| | | ] |
| | | } |
| | | "综合等级", |
| | | ], |
| | | }; |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getSelectDataList(); |
| | | this.setTable(); |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | getSelectDataList() { |
| | | //庄口 |
| | | getDictList({ |
| | | dictType: 0, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.marketList = res.data || []; |
| | | } |
| | | }); |
| | | }, |
| | | setTable() { |
| | | this.tableList = { |
| | | selectIndex: true, |
| | | tableInfomation: [], |
| | | allcol: [], |
| | | showcol: this.showCol, |
| | | tableColumn: this.setColumnVisible(this.showCol) |
| | | } |
| | | this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | this.searchOptions = [] |
| | | tableColumn: this.setColumnVisible(this.showCol), |
| | | }; |
| | | this.tableList.allcol = this.tableList.tableColumn |
| | | .filter((ele) => !ele.default) |
| | | .map((ele) => ele.label); |
| | | this.searchOptions = []; |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | const value = this.tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | const label = this.tableList.tableColumn[i].label; |
| | | const value = this.tableList.tableColumn[i].prop; |
| | | this.searchOptions.push({ value: value, label: label }); |
| | | } |
| | | }, |
| | | setColumnVisible(showCol) { |
| | | return this.tableColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn: showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | isShowColumn: showCol.includes(ele.label), |
| | | }; |
| | | }); |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val) |
| | | this.showcol = val; |
| | | this.tableList.tableColumn = this.setColumnVisible(val); |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true; |
| | | await getAttendanceStatistic({ |
| | | keyword: this.keyword, |
| | | month: "2024-04", |
| | | // page: this.pagerOptions.currPage, |
| | | // pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | }; |
| | | }); |
| | | this.tableList.tableInfomation = list || []; |
| | | this.pagerOptions.totalCount = res.total; |
| | | } else { |
| | | this.tableList.tableInfomation = []; |
| | | } |
| | | } else { |
| | | this.tableList.tableInfomation = []; |
| | | } |
| | | this.loading = false; |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | this.tableList.tableInfomation = []; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | | console.log(searchText) |
| | | this.keyword = searchText ?? ""; |
| | | this.pagerOptions.currPage = 1; |
| | | this.getData(); |
| | | }, |
| | | // 导出 |
| | | exportBtnClick() {} |
| | | } |
| | | } |
| | | exportBtnClick() {}, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |