| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <search @search="reload" ref="searchRef"> </search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- cache-key="workOrderTable"
- >
- <template v-slot:feedStatus="{ row }">
- {{
- row.feedStatus === 1
- ? '报工中'
- : row.feedStatus === 0
- ? '投料中'
- : row.feedStatus === 5
- ? '委外中'
- : ''
- }}
- </template>
- <template v-slot:taskStayTimeDuration="{ row }">
- <span>{{ getTimeData(row.taskStayTimeDuration) }}</span>
- </template>
- <template v-slot:weight="{ row }">
- <span v-if="row.extInfo.newWeight">
- {{ row.extInfo.newWeight }} {{ row.extInfo.weightUnit }}</span
- >
- <span v-else>
- {{ row.extInfo.weight }}{{ row.extInfo.weightUnit }}
- </span>
- </template>
- </ele-pro-table>
- </el-card>
- </div>
- </template>
- <script>
- import { detailPage } from '@/api/InTheSystem/index.js';
- import search from './tg-details-search.vue';
- export default {
- components: {
- search
- },
- data() {
- return {
- loading: false
- };
- },
- computed: {
- // 表格列配置
- columns() {
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'batchNo',
- label: '批次号',
- align: 'center',
- fixed: 'left',
- showOverflowTooltip: true
- },
- {
- prop: 'workOrderCode',
- label: '工单编码',
- align: 'center',
- minWidth: 110,
- fixed: 'left',
- showOverflowTooltip: true
- },
- {
- prop: 'qualityTaskName',
- label: '当前工序',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'taskName',
- label: '处置工序',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'categoryCode',
- label: '物品编码',
- align: 'center',
- minWidth: 160,
- showOverflowTooltip: true
- },
- {
- prop: 'name',
- label: '物品名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- slot: 'feedStatus',
- label: '类型',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'extInfo.engrave',
- label: '刻码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'extInfo.materielDesignation',
- label: '物料代号 ',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'quantity',
- label: '数量',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'taskStayTimeDuration',
- slot: 'taskStayTimeDuration',
- label: '停留时间',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'weight',
- slot: 'weight',
- label: '重量',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'deviceName',
- label: '设备名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'workstationName',
- label: '工位',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'modelType',
- label: '型号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'factoriesName',
- label: '所属工厂',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'createName',
- label: '创建人',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'updateTime',
- label: '更新时间',
- align: 'center',
- minWidth: 90,
- showOverflowTooltip: true
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- minWidth: 90,
- showOverflowTooltip: true
- }
- ];
- }
- },
- created() {},
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where }) {
- where = { rootCategoryLevelId: ['2'], ...where };
- return detailPage({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$nextTick(() => {
- this.$refs.table.reload({ page: 1, where });
- });
- },
- getTimeData(time) {
- if (time) {
- var hours = Math.floor(time / 60);
- var remainingMinutes = time - hours * 60;
- return hours + '小时' + remainingMinutes + '分钟';
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|