|
|
@@ -89,25 +89,51 @@
|
|
|
type="textarea"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
+ <template v-slot:disposalStatus="{ row }">
|
|
|
+ <el-tag v-if="row.disposalStatus == 0" type="success">待接收</el-tag>
|
|
|
+ <el-tag v-if="row.disposalStatus == 1" type="success">已接收</el-tag>
|
|
|
+ <el-tag v-if="row.disposalStatus == 2" type="danger">已拒绝</el-tag>
|
|
|
+ </template>
|
|
|
<template v-slot:action="{ row }">
|
|
|
<!-- <el-popconfirm title="确定完成这个任务?" @confirm="sureData(row)">
|
|
|
<template v-slot:reference>
|
|
|
<el-link :underline="false" type="primary">确定 </el-link>
|
|
|
</template>
|
|
|
</el-popconfirm> -->
|
|
|
- <el-popconfirm title="确认本次报工?" @confirm="saveData(row)">
|
|
|
+ <el-popconfirm
|
|
|
+ v-if="canReport(row)"
|
|
|
+ title="确认本次报工?"
|
|
|
+ @confirm="saveData(row)"
|
|
|
+ >
|
|
|
<template v-slot:reference>
|
|
|
<el-link :underline="false" type="primary">报工 </el-link>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
|
|
|
<el-link
|
|
|
+ v-if="row.disposalStatus == 1"
|
|
|
style="margin-left: 10px"
|
|
|
:underline="false"
|
|
|
type="primary"
|
|
|
@click="viewRecords(row.id)"
|
|
|
>报工修改记录</el-link
|
|
|
>
|
|
|
+ <el-popconfirm
|
|
|
+ v-if="canReceiveTask(row)"
|
|
|
+ icon="el-icon-info"
|
|
|
+ title="确定接收任务吗?"
|
|
|
+ @confirm="receiveTask(row.id, '1')"
|
|
|
+ >
|
|
|
+ <el-button slot="reference" type="text">接收</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
+ <el-popconfirm
|
|
|
+ v-if="canReceiveTask(row)"
|
|
|
+ icon="el-icon-info"
|
|
|
+ title="确定拒绝任务吗?"
|
|
|
+ @confirm="receiveTask(row.id, '2')"
|
|
|
+ >
|
|
|
+ <el-button slot="reference" type="text">拒绝</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
<modifyDialog ref="modifyRef" />
|
|
|
@@ -119,7 +145,8 @@
|
|
|
batchUpdateRealTime,
|
|
|
listUpdateRealTimeRecord,
|
|
|
pageAssigneeByTask,
|
|
|
- batchUpdateRealTimeConfirm
|
|
|
+ batchUpdateRealTimeConfirm,
|
|
|
+ taskManagement
|
|
|
} from '@/api/workOrderList';
|
|
|
import modifyDialog from '@/views/taskList/components/modifyDialog.vue';
|
|
|
|
|
|
@@ -208,6 +235,14 @@
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
+ {
|
|
|
+ slot: 'disposalStatus',
|
|
|
+ label: '接收状态',
|
|
|
+ prop: 'disposalStatus',
|
|
|
+ width: 120,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
{
|
|
|
slot: 'reportQuantity',
|
|
|
label: '报工数',
|
|
|
@@ -253,7 +288,7 @@
|
|
|
slot: 'action',
|
|
|
label: '操作',
|
|
|
align: 'center',
|
|
|
- width: 165,
|
|
|
+ width: 220,
|
|
|
resizable: false,
|
|
|
showOverflowTooltip: true,
|
|
|
fixed: 'right'
|
|
|
@@ -317,6 +352,34 @@
|
|
|
this.$message.error(err.message);
|
|
|
});
|
|
|
},
|
|
|
+ canReport(row) {
|
|
|
+ if (row.disposalStatus != 1) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!row.hasFirstArticleDualInspection) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ row.hasFirstArticleDualInspection == 0 ||
|
|
|
+ row.totalFirstArticleDualInspectionStatus == 2
|
|
|
+ );
|
|
|
+ },
|
|
|
+ canReceiveTask(row) {
|
|
|
+ return row.disposalStatus != 1 && row.disposalStatus != 2;
|
|
|
+ },
|
|
|
+ receiveTask(id, type) {
|
|
|
+ taskManagement({
|
|
|
+ id,
|
|
|
+ disposalStatus: Number(type)
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.getData();
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error(err.message);
|
|
|
+ });
|
|
|
+ },
|
|
|
buildReportRow(row) {
|
|
|
const reportQuantityReported = Number(row.reportQuantity) || 0;
|
|
|
const lossQuantityReported = Number(row.lossQuantity) || 0;
|