|
@@ -371,6 +371,9 @@
|
|
|
@click="handleBatchConcat"
|
|
@click="handleBatchConcat"
|
|
|
:disabled="isTaskCancelled"
|
|
:disabled="isTaskCancelled"
|
|
|
>批量修改约检联系人</el-button>
|
|
>批量修改约检联系人</el-button>
|
|
|
|
|
+ <el-button type="danger" @click="handleAbortTask"
|
|
|
|
|
+ :disabled="isTaskCompleted || selectedEquipDetails.length === 0 || taskOrder?.taskStatus === PressureTaskOrderTaskStatus['AUDITING_CANCEL']">移除设备
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<el-table
|
|
<el-table
|
|
|
:data="taskOrderDetail.orderItems"
|
|
:data="taskOrderDetail.orderItems"
|
|
@@ -938,6 +941,47 @@
|
|
|
:templateInfo="calcTemplateInfo"
|
|
:templateInfo="calcTemplateInfo"
|
|
|
@save="handleSaveCalcFee"
|
|
@save="handleSaveCalcFee"
|
|
|
/>
|
|
/>
|
|
|
|
|
+
|
|
|
|
|
+ <Dialog title="客户拒检原因" v-model="dialogVisible" align-center>
|
|
|
|
|
+ <el-form ref="abortFormRef" :model="formData" :rules="rules" label-width="100px" v-loading="formLoading">
|
|
|
|
|
+ <el-form-item label="拒绝原因" prop="reasonDict">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="formData.reasonDict"
|
|
|
|
|
+ placeholder="请选择拒绝原因"
|
|
|
|
|
+ prop="reasonDict"
|
|
|
|
|
+ @change=" () => { formData.reason = '' }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in getStrDictOptions('refuseInspectedCategory')"
|
|
|
|
|
+ :key="dict.value"
|
|
|
|
|
+ :label="dict.label"
|
|
|
|
|
+ :value="dict.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-if="formData.reasonDict == '5'"
|
|
|
|
|
+ label="其他"
|
|
|
|
|
+ prop="reason"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="formData.reason"
|
|
|
|
|
+ placeholder="请输入其他原因"
|
|
|
|
|
+ maxlength="150"
|
|
|
|
|
+ show-word-limit
|
|
|
|
|
+ :autosize="{ minRows: 5, maxRows: 20 }"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <el-button @click="submitForm" type="primary" :disabled="formLoading">上报市局</el-button>
|
|
|
|
|
+ <el-button @click="submitFormNoReport" :disabled="formLoading" style="background-color: #F56C6C; border-color: #F56C6C; color: #ffffff;">无需上报</el-button>
|
|
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Dialog>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="tsx">
|
|
<script setup lang="tsx">
|
|
@@ -1134,6 +1178,7 @@ const typeOptions = [
|
|
|
const formRef = ref()
|
|
const formRef = ref()
|
|
|
// 选中的设备
|
|
// 选中的设备
|
|
|
const selectedEquips = ref<PipeTaskOrderItemVO[]>([])
|
|
const selectedEquips = ref<PipeTaskOrderItemVO[]>([])
|
|
|
|
|
+const selectedEquipDetails = ref<any[]>([])
|
|
|
const inspectionNatureTypeList = ref([])
|
|
const inspectionNatureTypeList = ref([])
|
|
|
watch(() => props.taskOrder, (newVal) => {
|
|
watch(() => props.taskOrder, (newVal) => {
|
|
|
if (newVal) {
|
|
if (newVal) {
|
|
@@ -2636,8 +2681,11 @@ const handleCancelDocs = async (item) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleChildSelectionChange = (selection: [], parentId: string | number) => {
|
|
|
|
|
-
|
|
|
|
|
|
|
+const handleChildSelectionChange = (selection: any[], parentId: string | number) => {
|
|
|
|
|
+ selectedEquipDetails.value = selectedEquipDetails.value.filter((item) => item.equipPipeId !== parentId)
|
|
|
|
|
+ selection.forEach((sel) => {
|
|
|
|
|
+ selectedEquipDetails.value.push({ ...sel, equipPipeId: parentId })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const indexMethod = (index: number) => {
|
|
const indexMethod = (index: number) => {
|
|
@@ -2748,6 +2796,79 @@ const refreshDetail = () => {
|
|
|
emit('refresh')
|
|
emit('refresh')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/** 处理中止检验 */
|
|
|
|
|
+const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
+const abortFormRef = ref<InstanceType<typeof ElForm>>()
|
|
|
|
|
+const formLoading = ref(false)
|
|
|
|
|
+const formData = ref<Record<string, any>>({
|
|
|
|
|
+ reasonDict: '',
|
|
|
|
|
+ reason: ''
|
|
|
|
|
+})
|
|
|
|
|
+const rules = reactive({
|
|
|
|
|
+ reasonDict: [{ required: true, message: '请选择拒绝原因', trigger: 'change' }],
|
|
|
|
|
+ reason: [{ required: true, message: '请输入其他原因', trigger: 'blur' }]
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const submitForm = async () => {
|
|
|
|
|
+ abortFormRef.value &&
|
|
|
|
|
+ abortFormRef.value.validate().then(() => {
|
|
|
|
|
+ const params: any = {
|
|
|
|
|
+ ...unref(formData),
|
|
|
|
|
+ orderItemDetails: selectedEquipDetails.value,
|
|
|
|
|
+ flag: 1
|
|
|
|
|
+ }
|
|
|
|
|
+ if (params.reasonDict != 5) {
|
|
|
|
|
+ params.reason = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ formLoading.value = true
|
|
|
|
|
+ PipeTaskOrderApi.abortTask(params)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ // 刷新数据
|
|
|
|
|
+ ElMessage.success('检验任务已中止')
|
|
|
|
|
+ emit('refresh')
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ formLoading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const submitFormNoReport = async () => {
|
|
|
|
|
+ const params: any = {
|
|
|
|
|
+ ...unref(formData),
|
|
|
|
|
+ orderItemDetails: selectedEquipDetails.value,
|
|
|
|
|
+ flag: 0
|
|
|
|
|
+ }
|
|
|
|
|
+ if (params.reasonDict != 5) {
|
|
|
|
|
+ params.reason = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('params', params)
|
|
|
|
|
+ formLoading.value = true
|
|
|
|
|
+ PipeTaskOrderApi.abortTask(params)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ // 刷新数据
|
|
|
|
|
+ ElMessage.success('无需上报操作成功')
|
|
|
|
|
+ emit('refresh')
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ formLoading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+const handleAbortTask = () => {
|
|
|
|
|
+ if (selectedEquipDetails.value.length === 0) {
|
|
|
|
|
+ ElMessage.warning('请至少选择一条记录')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // 主报告状态,为报告办结的不能中止
|
|
|
|
|
+ const hasReportEnd = selectedEquips.value.some((row) => row.taskStatus === 800)
|
|
|
|
|
+ if (hasReportEnd) {
|
|
|
|
|
+ ElMessage.warning('主报告状态为报告办结的不能进行客户拒检')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ abortFormRef.value && abortFormRef.value.resetFields()
|
|
|
|
|
+ dialogVisible.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|