Prechádzať zdrojové kódy

修改审核校验和下拉选择

yls 1 rok pred
rodič
commit
41e50e5654

+ 8 - 4
src/views/servicePublish/Detail.vue

@@ -21,8 +21,8 @@
             <el-input v-model="form.basicInfo.serviceName" placeholder="请输入内容" clearable></el-input>
           </el-form-item>
           <el-form-item label="资源名称" prop="resourceId">
-            <el-select v-model="form.basicInfo.resourceId" placeholder="请选择" clearable>
-              <el-option v-for="item in select_resource" :key="item.id" :label="item.tresourceName" :value="item.id"></el-option>
+            <el-select v-model="form.basicInfo.resourceId" placeholder="请选择" clearable :options="select_resource">
+              <el-option v-for="item in select_resource" :key="item.value" :label="item.label" :value="item.value"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="服务类型" prop="serviceType">
@@ -226,8 +226,12 @@ onBeforeMount(()=> {
     })
   }
   ServiceList(currentPage.value, pageSize.value, quickSearch.value).then(res => {
-    if (res.code === 200) {
-      select_resource.value = res.data.records;
+    if (res.code === 'SUCCESS') {
+      const options = res.data.records.map(record => ({
+        value: record.id,
+        label: record.tresourceName
+      }));
+      select_resource.value = options;
     }
   })
 })

+ 15 - 16
src/views/warrantManage/Detail.vue

@@ -79,7 +79,6 @@
             <el-input type="textarea" :rows="4" v-model="form.applyInfo.applicationReason"></el-input>
           </el-form-item>
         </el-form>
-
         <span class="detail-part-title">审核信息</span>
         <el-form :model="form.CheckInfo" label-position="top" ref="CheckInfo" class="form-detail">
           <template v-if="route.params.type==='Detail'">
@@ -137,9 +136,10 @@ const form = reactive({
     applyReason: ''
   },
   CheckInfo: {
-    checkBy: '',
+    auditorId: '',
     checkTime: '',
-    checkDes: '',
+    auditReason: '',
+    auditState:''
   }
 })
 
@@ -149,7 +149,9 @@ function handleClose() {
   })
 }
 const CheckInfo = ref(null)
-function handleSave(auditState) {
+const state = ref(null)
+function handleSave(stateValue) {
+  state.value = stateValue
   Promise.all([CheckInfo.value.validate()]).then(valid => {
     if(valid.findIndex(val => val===false)===-1) {
       // 校验通过
@@ -157,9 +159,9 @@ function handleSave(auditState) {
       for (const k in form.CheckInfo) {
         pForm[k] = form.CheckInfo[k]
       }
-      pForm.auditState=auditState.value;
+      pForm['auditState'] = state.value;
       console.log(pForm);
-        pForm['primaryId'] = route.params.id
+        pForm['primaryId'] = route.params.id2
       AuditSave(pForm).then(res => {
           if(res.code=='200'&&res.data==='保存成功') {
             ElMessage({type:'success', message: '修改成功'})
@@ -169,9 +171,7 @@ function handleSave(auditState) {
     }
   })
 }
-function handleSave1() {
 
-}
 onBeforeMount(()=> {
   if(route.params.type!=='add') {
     ServiceManageDetail(route.params.id).then(res => {
@@ -223,8 +223,8 @@ onBeforeMount(()=> {
 
         })
         ApplicationDetail(data.id).then(res => {
-          console.log(res)
-          form.applyInfo.accessIp = res.data.accessIp  // xx
+          form.applyInfo.accessIp = res.data.accessIp
+          form.applyInfo.id = res.data.id
           form.applyInfo.serviceLife = res.data.serviceLife
           form.applyInfo.dailyVisits = res.data.dailyVisits
           form.applyInfo.developmentVolume = res.data.developmentVolume
@@ -236,12 +236,11 @@ onBeforeMount(()=> {
       } else {
         ElMessage({type:'error', message: '查询失败'})
       }
-    })
-    AuditDetail(route.params.id2).then(res => {
-      form.CheckInfo.auditorId = res.data.auditorId
-      form.CheckInfo.auditorTime = res.data.auditorTime
-      form.CheckInfo.auditReason = res.data.auditReason
-      console.log(form)
+      AuditDetail(route.params.id2).then(res => {
+        console.log(res)
+        form.CheckInfo.auditorTime = res.data.auditorTime
+        form.CheckInfo.auditReason = res.data.auditReason
+      })
     })
   }
 })

+ 5 - 5
src/views/warrantManage/Index.vue

@@ -8,7 +8,7 @@
         <el-table-column label="服务类型" min-width="100" prop="serviceTypeName" show-overflow-tooltip/>
         <el-table-column label="资源名称" min-width="100" prop="tresourceName" show-overflow-tooltip/>
         <el-table-column label="资源类别" min-width="100" prop="resourceTypeName" show-overflow-tooltip/>
-        <el-table-column label="服务状态" min-width="100">
+        <el-table-column label="审核状态" min-width="100">
           <template #default="scope">
             <span
             class="table-column-state"
@@ -70,16 +70,16 @@ function getData(page, size) {
     tableTotal.value = res.data.total
     for (let data of tableData.value) {
       switch (data.applicationStatus) {
-        case 1:
+        case 0:
           data.applicationStatusName = '待审核'
           break
-        case 2:
+        case 3:
           data.applicationStatusName = '审核通过'
           break
-        case 3:
+        case 1:
           data.applicationStatusName = '未通过'
           break
-        case 4:
+        case 2:
           data.applicationStatusName = '过期'
           break
       }