| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <template>
- <ele-pro-table
- ref="table"
- :columns="columns"
- height="320px"
- :datasource="datasource"
- :selection.sync="selection"
- @selection-change="handleSelectionChange"
- cache-key="produceOrderZ"
- highlight-current-row
- @row-click="rowClick"
- :need-page="false"
- >
- <template v-slot:toolbar>
- <div class="c_title">工单列表 </div>
- </template>
- <template v-slot:code="{ row }">
- <el-link type="primary" :underline="false">{{ row.code }}</el-link>
- </template>
- </ele-pro-table>
- </template>
- <script>
- import { workorderPage } from '@/api/produce/workOrder.js';
- export default {
- components: {},
- data() {
- return {
- loading: false,
- selection: []
- };
- },
- computed: {
- // 表格列配置
- columns() {
- return [
- {
- width: 45,
- type: 'selection',
- columnKey: 'selection',
- align: 'center',
- fixed: true
- },
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'batchNo',
- label: '批号',
- align: 'center'
- },
- {
- prop: 'code',
- slot: 'code',
- label: '生产工单号',
- align: 'center',
- },
- {
- prop: '',
- label: '计划编号',
- align: 'center'
- },
- {
- prop: '',
- label: '计划类型',
- align: 'center'
- },
- {
- prop: 'produceRoutingName',
- label: '工艺路线',
- align: 'center'
- },
- {
- prop: 'productCode',
- label: '产品编码',
- align: 'center',
- },
- {
- prop: 'productName',
- label: '产品名称',
- align: 'center',
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center'
- },
- {
- prop: 'model',
- label: '型号',
- align: 'center'
- }
- ];
- },
- taskObj() {
- return this.$store.state.user.taskObj;
- }
- },
- watch: {
- taskObj: {
- handler(val) {
- this.reload();
- },
- immediate: true,
- deep: true
- }
- },
- created() {},
- methods: {
- /* 表格数据源 */
- datasource({ page, where }) {
- return workorderPage({
- pageNum: page,
- size: 200,
- taskId: this.taskObj && this.taskObj.id,
- ...where
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$nextTick(() => {
- this.$refs.table.reload({ page: 1, where });
- });
- },
- handleSelectionChange(val) {
- let ids = [];
- ids = val.map((item) => {
- return item.id;
- });
- console.log(ids);
- this.$emit('workSelect', ids);
- },
- rowClick() {}
- }
- };
- </script>
- <style lang="scss" scoped>
- .table {
- height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
- }
- </style>
|