瀏覽代碼

约检确认增加前台备注

xy 1 周之前
父節點
當前提交
a7e932e2ca

+ 5 - 0
yudao-ui-admin-vue3/src/api/pressure/appointmentconfirmorder/index.ts

@@ -136,6 +136,11 @@ export const AppointmentConfirmOrderApi = {
     return await request.put({ url: `/pressure/appointment-confirm-order/warning`, data })
   },
 
+  // 更新备注
+  updateRemark: async (data: any) => {
+    return await request.put({ url: `/pressure2/appointment-confirm-order/update-remark`, data })
+  },
+
   // 设备调整
   updateAppointmentConfirmOrderEquip: async (data: any) => {
     return await request.post({ url: `/pressure/task-order/equip/update`, data })

+ 123 - 8
yudao-ui-admin-vue3/src/views/pressure/orderConfirm/index.vue

@@ -139,15 +139,8 @@
         show-overflow-tooltip
         tooltip-effect="dark"
       >   
-        <el-table-column label="操作" width="150" align="center">
+        <el-table-column label="操作" width="180" align="center">
           <template #default="scope">
-            <!-- <el-button
-              link
-              type="primary"
-              @click="handleAppointment(scope.row)"
-            >
-              约检
-            </el-button> -->
             <el-button
               v-if="scope.row.status === 100"
               link
@@ -156,6 +149,14 @@
             >
               发送确认
             </el-button>
+            <el-button
+              v-if="scope.row.status === 100"
+              link
+              type="warning"
+              @click="handleRemark(scope.row)"
+            >
+              备注
+            </el-button>
           </template>
         </el-table-column>
         <el-table-column label="约检状态" prop="status" align="center" width="100">
@@ -243,6 +244,14 @@
         <el-table-column label="街道" prop="equipStreetName" align="center" sortable width="100" />
         <!-- 备注 -->
         <el-table-column label="备注" prop="remark" align="center" width="150" />
+        <!-- 备注人 -->
+        <el-table-column label="备注人" prop="annotatorName" align="center" width="100" />
+        <!-- 备注时间 -->
+        <el-table-column label="备注时间" prop="annotatorDate" align="center" width="170">
+          <template #default="scope">
+            {{ scope.row.annotatorDate ? dayjs(scope.row.annotatorDate).format('YYYY-MM-DD HH:mm:ss') : '-' }}
+          </template>
+        </el-table-column>
         <!-- 是否受理 -->
         <el-table-column label="是否受理" prop="createAcceptOrder" align="center" width="100">
           <template #default="scope">
@@ -348,6 +357,52 @@
       </template>
     </el-dialog>
     <unitContainerForm ref="unitContainerFormRef" />
+
+    <!-- 备注弹窗 -->
+    <el-dialog
+      v-model="remarkDialogVisible"
+      title="备注"
+      width="500px"
+      destroy-on-close
+      append-to-body
+    >
+      <el-form
+        ref="remarkFormRef"
+        :model="remarkForm"
+        :rules="remarkRules"
+        label-width="80px"
+      >
+        <el-form-item label="备注类型" prop="remarkType">
+          <el-select
+            v-model="remarkForm.remarkType"
+            placeholder="请选择备注类型"
+            class="!w-full"
+            @change="handleRemarkTypeChange"
+          >
+            <el-option
+              v-for="item in remarkOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="remarkForm.remarkType === 'other'" label="备注内容" prop="customRemark">
+          <el-input
+            v-model="remarkForm.customRemark"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入备注内容"
+            maxlength="200"
+            show-word-limit
+          />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="remarkDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitRemark">确 定</el-button>
+      </template>
+    </el-dialog>
   </template>
   
   <script setup lang="ts">
@@ -713,6 +768,66 @@
     getList();
   })
 
+  // 备注相关
+  const remarkDialogVisible = ref(false)
+  const remarkFormRef = ref()
+  const remarkCurrentRow = ref<AppointmentConfirmOrderVO>()
+  const remarkOptions = [
+    { value: 'unable_contact', label: '无法联系用户' },
+    { value: 'notified_waiting', label: '已通知用户待回复' },
+    { value: 'transfer_pending', label: '用户计划办理过户或迁移手续,待回复' },
+    { value: 'other', label: '其他' }
+  ]
+  const remarkForm = reactive({
+    remarkType: '',
+    customRemark: ''
+  })
+  const remarkRules = {
+    remarkType: [{ required: true, message: '请选择备注类型', trigger: 'change' }],
+    customRemark: [{ required: true, message: '请输入备注内容', trigger: 'blur' }]
+  }
+
+  const handleRemark = (row: AppointmentConfirmOrderVO) => {
+    remarkCurrentRow.value = row
+    remarkForm.remarkType = ''
+    remarkForm.customRemark = ''
+    remarkDialogVisible.value = true
+  }
+
+  const handleRemarkTypeChange = () => {
+    remarkForm.customRemark = ''
+  }
+
+  const submitRemark = async () => {
+    if (!remarkFormRef.value) return
+    await remarkFormRef.value.validate(async (valid: boolean) => {
+      if (valid) {
+        try {
+          let remarkContent = ''
+          if (remarkForm.remarkType === 'other') {
+            remarkContent = remarkForm.customRemark
+          } else {
+            const selected = remarkOptions.find(item => item.value === remarkForm.remarkType)
+            remarkContent = selected ? selected.label : ''
+          }
+          if (!remarkContent) {
+            ElMessage.warning('备注内容不能为空')
+            return
+          }
+          await AppointmentConfirmOrderApi.updateRemark({
+            id: remarkCurrentRow.value?.id,
+            remark: remarkContent
+          })
+          ElMessage.success('备注保存成功')
+          remarkDialogVisible.value = false
+          getList()
+        } catch (error) {
+          console.error('备注保存失败:', error)
+        }
+      }
+    })
+  }
+
   /** 初始化 **/
   onMounted(() => {
     // const { unitName } = route.query as Recordable

+ 36 - 0
yudao-ui-admin-vue3/src/views/pressure2/orderConfirm/boilerDetail.vue

@@ -1,5 +1,19 @@
 <template>
   <div class="app-container">
+    <!-- 受检单位基本信息 -->
+    <ContentWrap title="受检单位基本信息" v-if="unitData.id">
+      <div class="mb-[5px]">
+        <el-button class="mb-[10px]" type="primary" @click="handleUnitCodeFn(unitData.id)">工商信息</el-button>
+        <el-descriptions :column="3" border class="flex-1">
+          <el-descriptions-item label="单位名称">{{ unitData.name || '-' }}</el-descriptions-item>
+          <el-descriptions-item label="登记状态">{{ unitData.regstateCn || '-' }}</el-descriptions-item>
+          <el-descriptions-item label="市场主体类型">{{ unitData.enterpriseType || '-' }}</el-descriptions-item>
+          <el-descriptions-item label="单位地址">{{ unitData.addr || '-' }}</el-descriptions-item>
+        </el-descriptions>
+      </div>
+    </ContentWrap>
+    <unitContainerForm ref="unitContainerFormRef" />
+
     <!-- 受检信息表单 -->
     <ContentWrap title="受检信息">
       <el-form :model="formData" :rules="formRules" ref="formRef" label-width="120px" class="p-3">
@@ -666,6 +680,8 @@ import {
 } from '@/utils/constants'
 import { useEmitt } from '@/hooks/web/useEmitt'
 import { getUnitNewList, getUnitContacts } from '@/api/laboratory/unit'
+import { getUnitInfo, UpdateUnitVO } from '@/api/laboratory/unit'
+import unitContainerForm from '@/components/unitContainerForm/index.vue'
 import { numberToChinese } from '@/utils/formatter'
 import FileUploadModal from './components/ImportFile.vue'
 import { buildFileUrl } from '@/utils'
@@ -701,6 +717,21 @@ const checkTypeMap = PressureCheckTypeMap
 
 const boilerTypeOptions = getStrDictOptions(DICT_TYPE.SYSTEM_EQUIP_BOILER_TYPE)
 
+const unitData = ref<UpdateUnitVO>({} as UpdateUnitVO)
+const unitContainerFormRef = ref<InstanceType<typeof unitContainerForm>>()
+const getUnitDetail = async (unitId: string) => {
+  try {
+    const res = await getUnitInfo({ id: unitId })
+    unitData.value = res
+  } catch (error) {
+    console.error('获取单位详情失败:', error)
+  }
+}
+const handleUnitCodeFn = (id) => {
+  if (!id) { return ElMessage.warning('该单位信息异常!') }
+  unitContainerFormRef.value?.open(id)
+}
+
 const formData = ref<Record<string,any>>({
   checkType: '', //检验性质
   appointmentDate: '',
@@ -994,6 +1025,11 @@ const getDetail = async () => {
       await nextTick()
       checkerSelectRef.value?.getCheckerList(deptId)
     }
+
+    // 加载单位详细信息
+    if (orderDetail.value?.useUnitId) {
+      await getUnitDetail(orderDetail.value.useUnitId)
+    }
   } catch (error) {
     console.error('获取计划详情失败:', error)
     ElMessage.error('获取计划详情失败')

+ 37 - 0
yudao-ui-admin-vue3/src/views/pressure2/orderConfirm/pipeDetail.vue

@@ -264,6 +264,21 @@
         />
       </ContentWrap>
     </ContentWrap>
+
+    <!-- 受检单位基本信息 -->
+    <ContentWrap title="受检单位基本信息" v-if="unitData.id">
+      <div class="mb-[5px]">
+        <el-button class="mb-[10px]" type="primary" @click="handleUnitCodeFn(unitData.id)">工商信息</el-button>
+        <el-descriptions :column="3" border class="flex-1">
+          <el-descriptions-item label="单位名称">{{ unitData.name || '-' }}</el-descriptions-item>
+          <el-descriptions-item label="登记状态">{{ unitData.regstateCn || '-' }}</el-descriptions-item>
+          <el-descriptions-item label="市场主体类型">{{ unitData.enterpriseType || '-' }}</el-descriptions-item>
+          <el-descriptions-item label="单位地址">{{ unitData.addr || '-' }}</el-descriptions-item>
+        </el-descriptions>
+      </div>
+    </ContentWrap>
+    <unitContainerForm ref="unitContainerFormRef" />
+
     <!-- 受检信息表单 -->
     <ContentWrap title="受检信息">
       <el-form :model="formData" :rules="formRules" ref="formRef" label-width="120px" class="p-3">
@@ -712,6 +727,8 @@ import {
 } from '@/utils/constants'
 import { useEmitt } from '@/hooks/web/useEmitt'
 import { getUnitNewList, getUnitContacts } from '@/api/laboratory/unit'
+import { getUnitInfo, UpdateUnitVO } from '@/api/laboratory/unit'
+import unitContainerForm from '@/components/unitContainerForm/index.vue'
 import { numberToChinese } from '@/utils/formatter'
 import FileUploadModal from './components/ImportFile.vue'
 import { buildFileUrl } from '@/utils'
@@ -735,6 +752,21 @@ const router = useRouter()
 const tagsViewStore = useTagsViewStore()
 const batchEditFormRef = ref()
 
+const unitData = ref<UpdateUnitVO>({} as UpdateUnitVO)
+const unitContainerFormRef = ref<InstanceType<typeof unitContainerForm>>()
+const getUnitDetail = async (unitId: string) => {
+  try {
+    const res = await getUnitInfo({ id: unitId })
+    unitData.value = res
+  } catch (error) {
+    console.error('获取单位详情失败:', error)
+  }
+}
+const handleUnitCodeFn = (id) => {
+  if (!id) { return ElMessage.warning('该单位信息异常!') }
+  unitContainerFormRef.value?.open(id)
+}
+
 const batchEditLocationVisible = ref(false)
 const batchEditLocationLoading = ref(false)
 const batchEditLocationFormRef = ref()
@@ -1064,6 +1096,11 @@ const getDetail = async () => {
       await nextTick()
       checkerSelectRef.value?.getCheckerList(deptId)
     }
+
+    // 加载单位详细信息
+    if (orderDetail.value?.useUnitId) {
+      await getUnitDetail(orderDetail.value.useUnitId)
+    }
   } catch (error) {
     console.error('获取计划详情失败:', error)
     ElMessage.error('获取计划详情失败')