| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <template>
- <el-dialog
- title="工单列表"
- :visible.sync="visible"
- :before-close="handleClose"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- append-to-body
- width="70%"
- >
- <produceOrderSearch @search="reload"></produceOrderSearch>
- <ele-pro-table
- ref="table"
- height="55vh"
- :columns="columns"
- width="30%"
- :initLoad="false"
- :datasource="datasource"
- :selection.sync="selection"
- cache-key="produceOrderZ"
- highlight-current-row
- >
- <template v-slot:code="{ row }">
- <el-link type="primary" :underline="false">{{ row.code }}</el-link>
- </template>
- <template v-slot:singleReport="{ row }">
- <el-tag> {{ row.singleReport == 1 ? '单个报工' : '批量报工' }}</el-tag>
- </template>
- <template v-slot:formingNum="{ row }">
- <span> {{ row.formingNum }} {{ row.unit }} </span>
- </template>
- <template v-slot:formingWeight="{ row }">
- <span> {{ row.formingNum }} {{ row.weightUnit }} </span>
- </template>
- </ele-pro-table>
- <template slot="footer">
- <el-button size="mini" @click="handleClose">取 消</el-button>
- <el-button size="mini" type="primary" @click="handleSelect()"
- >确 定</el-button
- >
- </template>
- </el-dialog>
- </template>
- <script>
- import { pickTaskReportPage } from '@/api/produce/workOrder.js';
- import produceOrderSearch from './produceOrder-search.vue';
- export default {
- components: { produceOrderSearch,
- },
- data() {
- return {
- loading: false,
- selection: [],
- visible: true,
- taskId: null
- };
- },
- watch: {},
- 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',
- minWidth: '110'
- },
- {
- prop: '',
- label: '计划编号',
- align: 'center'
- },
- {
- prop: '',
- label: '计划类型',
- align: 'center'
- },
- {
- prop: 'productCode',
- label: '产品编码',
- align: 'center'
- },
- {
- prop: 'productName',
- label: '产品名称',
- align: 'center'
- },
- {
- prop: 'singleReport',
- slot: 'singleReport',
- label: '报工类型',
- align: 'center',
- width: 100
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center'
- },
- {
- prop: 'model',
- label: '型号',
- align: 'center'
- },
- {
- prop: 'priority',
- label: '优先级',
- align: 'center',
- minWidth: 120
- },
- {
- prop: 'formingNum',
- label: '要求生产数量',
- align: 'center',
- slot: 'formingNum',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formingWeight',
- label: '要求生产重量',
- slot: 'formingWeight',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formedNum',
- label: '已生产数量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'formedWeight',
- label: '已生产重量',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'planStartTime',
- label: '计划开始时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'planCompleteTime',
- label: '计划结束时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'startTime',
- label: '实际开始时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- }
- ];
- }
- },
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where }) {
- return pickTaskReportPage({
- pageNum: page,
- size: limit,
-
- ...where
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.taskId = where.taskId || '';
- this.$nextTick(() => {
- this.$refs.table.reload({ page: 1, where });
- });
- },
- handleSelect() {
- let ids = [];
- ids = this.selection.map((item) => {
- return item.id;
- });
- if (!this.taskId) {
- return this.$message.warning('请选择工序');
- }
- this.$emit('workSelect', ids, this.taskId);
- },
- handleClose() {
- this.$emit('close');
- }
- }
- };
- </script>
|