| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <work-search @search="reload"> </work-search>
- <!-- 数据表格 -->
- <!-- :default-sort="{ prop: 'createTime', order: 'ascending' }" -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- cache-key="systemRoleTable"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <!-- <el-button
- size="small"
- type="primary"
- class="ele-btn-icon"
- @click="goDetail()"
- >
- 详情
- </el-button> -->
- </template>
- <template v-slot:code="{ row }">
- <el-link type="primary" :underline="false" @click="goDetail(row)">
- {{ row.code }}
- </el-link>
- </template>
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-link
- v-if="row.orderStatus === 3"
- type="primary"
- :underline="false"
- @click="handleExport(row)"
- >
- 预览打印
- </el-link>
- <el-link
- v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
- type="primary"
- :underline="false"
- icon="el-icon-truck"
- @click="addSpareItems(row)"
- >
- 申请备品备件
- </el-link>
- <el-link
- v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="toSigningUpWork(row)"
- >
- 报工
- </el-link>
- <el-link
- v-if="
- row.orderStatus !== 3 && row.orderStatus !== 4 && row.isGroup != 1
- "
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="toRedeploy(row)"
- >
- 转派
- </el-link>
- <!-- <el-link
- type="primary"
- :underline="false"
- @click="handlePrint(row, 1)"
- v-if="row.orderStatus == 3"
- >
- 一级表
- </el-link> -->
- </template>
- </ele-pro-table>
- </el-card>
- <!-- 转派弹窗 -->
- <redeployOther ref="redeployOtherRef" @refresh="reload" />
- <!-- 报工弹框 -->
- <signingUpWork ref="signingUpWorkRef" @refresh="reload" />
- <edit @refresh="reload" ref="edit" />
- <printWorkOrder ref="printRef11"></printWorkOrder>
- </div>
- </template>
- <script>
- import WorkSearch from './components/work-search.vue';
- // import { pageRoles } from '@/api/system/role';
- import edit from '@/views/sparePartsApply/components/edit';
- import { workPage } from '@/api/equipment/work';
- import redeployOther from '@/views/maintenance/components/redeployOther.vue';
- import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
- import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
- import printWorkOrder from './components/printWorkOrder.vue';
- import { getToken } from '@/utils/token-util';
- export default {
- components: {
- WorkSearch,
- redeployOther,
- signingUpWork,
- edit,
- printWorkOrder
- },
- data() {
- return {
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- columnKey: 'code',
- slot: 'code',
- prop: 'code',
- label: '工单单号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 140
- },
- {
- prop: 'planCode',
- label: '计划单号',
- align: 'center',
- showOverflowTooltip: true,
- slot: 'planCode',
- minWidth: 140
- },
- {
- prop: 'planName',
- label: '保养名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- {
- prop: 'executeGroupName',
- label: '保养部门',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- {
- prop: 'executeUserName',
- label: '保养人员',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'ruleName',
- label: '规则名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'createTime',
- label: '工单生成时间',
- // sortable: true,
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 170
- },
- {
- prop: 'acceptTime',
- label: '开工时间',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'finishTime',
- label: '报工时间',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- columnKey: 'orderHour',
- label: '实际工时(分钟)',
- align: 'center',
- resizable: false,
- showOverflowTooltip: true,
- minWidth: 120,
- formatter: (row) => {
- if (row.finishTime && row.acceptTime) {
- return parseInt(
- (new Date(row.finishTime).getTime() -
- new Date(row.acceptTime).getTime()) /
- 60000
- );
- }
- }
- },
- {
- prop: 'orderStatus',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (row) => {
- return {
- 0: '待接收',
- 1: '已接收',
- 2: '执行中',
- 3: '已完成'
- }[row.orderStatus];
- }
- },
- {
- prop: 'executeResult',
- label: '执行结果',
- align: 'center',
- showOverflowTooltip: true,
- formatter(row) {
- return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
- }
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 300,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- }
- ],
- // 加载状态
- loading: false,
- pageType: 'add',
- dialogTitle: '',
- isBindPlan: false
- };
- },
- computed: {},
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- where.type = 2;
- return workPage({ pageNum: page, size: limit, ...where });
- },
- async changeEnable(row) {
- const res = await putRoles(row);
- if (res.code == 0) {
- this.$message({
- type: 'success',
- message: '修改成功',
- customClass: 'ele-message-border'
- });
- this.reload();
- }
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ page: 1, where });
- },
- // 添加备品备件
- async addSpareItems(row) {
- let data = await getWordOrderDetail(row.id);
- data.deviceList = data.deviceList.map((item) => {
- return item.substance;
- });
- this.$refs.edit.open(data, 'add');
- },
- goDetail({ id }) {
- this.$router.push({
- path: '/maintenance/equipment/workOrder/details',
- query: {
- id
- }
- });
- },
- // 转派
- toRedeploy(row) {
- this.$refs.redeployOtherRef.open(row);
- },
- // 报工
- toSigningUpWork(row) {
- this.$refs.signingUpWorkRef.open(row);
- },
- handlePrint(row, val) {
- this.$refs.printRef11.open(row.id, val);
- },
- handleExport(row) {
- const url = `http://192.168.1.251:8085/jmreport/view/1057242475693346816?token=${getToken()}&id=${
- row.id
- }`;
- window.open(url, '_blank');
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|