|
|
@@ -335,6 +335,13 @@
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['gxt:repairOrder:remove']"
|
|
|
><i class="fa fa-trash"></i>删除</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.workOrderStatus !== 'invalid'"
|
|
|
+ type="danger"
|
|
|
+ link
|
|
|
+ @click="handleInvalidate(scope.row)"
|
|
|
+ v-hasPermi="['gxt:repairOrder:invalidate']"
|
|
|
+ ><i class="fa fa-ban"></i>作废</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -1295,6 +1302,80 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 作废对话框 -->
|
|
|
+ <el-dialog title="作废工单" v-model="invalidateDialogVisible" width="800px" append-to-body @close="closeInvalidateDialog">
|
|
|
+ <el-alert type="warning" :closable="false" style="border-color: #f59e0b; background-color: #fffbeb; color: #92400e; height: 35px;">
|
|
|
+ <template #default>
|
|
|
+ <i class="fa fa-exclamation-triangle mr-2" style="color: #92400e;"> 作废后工单将不可恢复,请谨慎操作。</i>
|
|
|
+ </template>
|
|
|
+ </el-alert>
|
|
|
+ <el-form ref="invalidateFormRef" :model="invalidateForm" :rules="invalidateRules" label-width="120px" label-position="top">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工单编码"><el-input v-model="invalidateForm.workOrderProjectNo" disabled /></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="风机编号"><el-input v-model="invalidateForm.pcsDeviceName" disabled /></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工单状态">
|
|
|
+ <el-select v-model="invalidateForm.workOrderStatus" style="width: 100%" disabled>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in gxt_work_order_status"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维保中心"><el-input v-model="invalidateForm.gxtCenter" disabled /> </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="场站"><el-input v-model="invalidateForm.pcsStationName" disabled /> </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="品牌"><el-input v-model="invalidateForm.brand" disabled /> </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="故障代码"><el-input v-model="invalidateForm.faultCode" disabled /></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="故障信息">
|
|
|
+ <el-input
|
|
|
+ v-model="invalidateForm.faultBarcode"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入故障信息"
|
|
|
+ maxlength="100"
|
|
|
+ show-word-limit
|
|
|
+ :rows="3"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="作废原因" prop="invalidReason">
|
|
|
+ <el-input
|
|
|
+ v-model="invalidateForm.invalidReason"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入作废原因"
|
|
|
+ maxlength="200"
|
|
|
+ show-word-limit
|
|
|
+ :rows="4"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="closeInvalidateDialog">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitInvalidate">确认作废</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 查看工单详情对话框 -->
|
|
|
<el-dialog title="查看工单详情" v-model="viewDialogVisible" width="1000px" append-to-body>
|
|
|
<el-row :gutter="20">
|
|
|
@@ -1516,7 +1597,8 @@ import {
|
|
|
finalizeRepairOrder,
|
|
|
restartRepairOrder,
|
|
|
getRepairOrderByMisOrderNo,
|
|
|
- revokeRepairOrder
|
|
|
+ revokeRepairOrder,
|
|
|
+ invalidateRepairOrder
|
|
|
} from "@/api/gxt/repairOrder";
|
|
|
import { listDept,getDept } from "@/api/system/dept";
|
|
|
import { listFaultCodes } from "@/api/gxt/faultCodes"
|
|
|
@@ -1566,6 +1648,7 @@ const completeFormRef = ref(null)
|
|
|
const ratingFormRef = ref(null)
|
|
|
const startFormRef = ref(null) // 添加开始处理表单引用
|
|
|
const restartFormRef = ref(null) // 添加复运表单引用
|
|
|
+const invalidateFormRef = ref(null) // 添加作废表单引用
|
|
|
|
|
|
// 各种表单数据
|
|
|
const form = ref({})
|
|
|
@@ -1595,6 +1678,7 @@ const completeForm = ref({})
|
|
|
const finalizeForm = ref({
|
|
|
repairOrderPersonList: []
|
|
|
})
|
|
|
+const invalidateForm = ref({}) // 添加作废表单
|
|
|
const ratingForm = ref({
|
|
|
score: null
|
|
|
})
|
|
|
@@ -1619,6 +1703,7 @@ const suspendDialogVisible = ref(false)
|
|
|
const approveDialogVisible = ref(false)
|
|
|
const completeDialogVisible = ref(false)
|
|
|
const finalizeDialogVisible = ref(false)
|
|
|
+const invalidateDialogVisible = ref(false) // 添加作废对话框显示控制
|
|
|
const ratingDialogVisible = ref(false)
|
|
|
const equipmentSelectVisible = ref(false)
|
|
|
const restartDialogVisible = ref(false) // 添加复运对话框显示控制
|
|
|
@@ -1996,6 +2081,13 @@ const finalizeRules = ref({
|
|
|
]
|
|
|
})
|
|
|
|
|
|
+// 作废表单验证规则
|
|
|
+const invalidateRules = ref({
|
|
|
+ invalidReason: [
|
|
|
+ { required: true, message: "请输入作废原因", trigger: "blur" }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
// 评分表单验证规则
|
|
|
const ratingRules = ref({
|
|
|
score: [
|
|
|
@@ -2079,6 +2171,13 @@ function closeRestartDialog() {
|
|
|
proxy.resetForm("restartFormRef")
|
|
|
}
|
|
|
|
|
|
+// 关闭作废对话框并重置表单
|
|
|
+function closeInvalidateDialog() {
|
|
|
+ invalidateDialogVisible.value = false
|
|
|
+ invalidateForm.value = {}
|
|
|
+ proxy.resetForm("invalidateFormRef")
|
|
|
+}
|
|
|
+
|
|
|
// 关闭查看详情对话框并重置表单
|
|
|
function closeViewDialog() {
|
|
|
viewDialogVisible.value = false
|
|
|
@@ -2905,7 +3004,7 @@ async function submitFinalize() {
|
|
|
proxy.$modal.msgError("请选择维修方式!")
|
|
|
return
|
|
|
}*/
|
|
|
-
|
|
|
+
|
|
|
proxy.$refs["finalizeFormRef"].validate(async valid => {
|
|
|
if (valid) {
|
|
|
try {
|
|
|
@@ -3148,6 +3247,32 @@ function onMisInfoSelected(row) {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+/** 提交作废 */
|
|
|
+async function submitInvalidate() {
|
|
|
+ proxy.$refs["invalidateFormRef"].validate(async valid => {
|
|
|
+ if (!valid) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ await invalidateRepairOrder(invalidateForm.value);
|
|
|
+ proxy.$modal.msgSuccess("作废成功");
|
|
|
+ invalidateDialogVisible.value = false;
|
|
|
+ getList();
|
|
|
+ } catch (error) {
|
|
|
+ proxy.$modal.msgError("操作失败: " + error.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/** 作废操作 */
|
|
|
+function handleInvalidate(row) {
|
|
|
+ getRepairOrder(row.id).then(response => {
|
|
|
+ invalidateForm.value = { ...response.data }
|
|
|
+ invalidateDialogVisible.value = true
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|