Bläddra i källkod

添加筛选功能

xiaoxin 1 år sedan
förälder
incheckning
86675762b3
2 ändrade filer med 132 tillägg och 7 borttagningar
  1. 9 0
      src/api/project.js
  2. 123 7
      src/views/project-management/index.vue

+ 9 - 0
src/api/project.js

@@ -27,6 +27,15 @@ export const invalidProjectList = (data) => {
   })
 }
 
+// 回复请求
+export const replyProjectList = (data) => {
+  return request({
+    url: '/informationReporting/reply',
+    method: 'post',
+    data
+  })
+}
+
 // 删除项目管理列表
 export const deleteProjectList = (data) => {
   return request({

+ 123 - 7
src/views/project-management/index.vue

@@ -86,6 +86,26 @@
 
       <!-- 导出表单按钮区域 -->
       <el-row class="card_button">
+        <el-col :span="5">
+          审批内容:
+          <el-input
+            style="width: 180px"
+            placeholder="请输入审批内容关键字"
+            clearable
+            v-model="spContent"
+          >
+          </el-input>
+        </el-col>
+        <el-col :span="4">
+          回复内容:
+          <el-input
+            style="width: 180px"
+            placeholder="请输入回复内容关键字"
+            clearable
+            v-model="replyContent"
+          >
+          </el-input>
+        </el-col>
         <el-button type="primary" @click="hanleExportForm">
           <el-icon><Download /></el-icon>
           <span> 导出表单</span>
@@ -213,7 +233,20 @@
           prop="reportingTime"
           label="提交时间"
         />
-        <el-table-column fixed="right" width="380" align="center" label="操作">
+        <el-table-column
+          width="200"
+          align="center"
+          prop="spContent"
+          label="审批内容"
+        />
+        <el-table-column width="200" align="center" label="回复内容">
+          <template #default="{ row }">
+            <div v-for="(item, index) in row.replyContent" :key="index">
+              {{ index + 1 }}:{{ item }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column fixed="right" width="450" align="center" label="操作">
           <template #default="{ row }">
             <el-button type="success" plain @click="handleCheckDetail(row)">
               详情
@@ -233,6 +266,7 @@
             >
               失效
             </el-button>
+            <el-button type="primary" @click="handleReply(row)">回复</el-button>
             <el-button
               :disabled="row.status == 0"
               type="info"
@@ -385,6 +419,35 @@
         </span>
       </template>
     </el-dialog>
+
+    <!-- 回复弹窗区域 -->
+    <el-dialog
+      v-model="dialogVisibleReply"
+      title="回复"
+      center
+      width="40%"
+      :close-on-click-modal="false"
+    >
+      <div class="dialog_box2">
+        <el-input
+          v-model="textareaValue"
+          show-word-limit
+          maxlength="20"
+          :rows="10"
+          resize="none"
+          type="textarea"
+          placeholder="请输入回复 (回复可叠加,每次回复限20个字符以内)"
+        />
+      </div>
+      <template #footer>
+        <span>
+          <el-button @click="dialogVisibleReply = false">取消</el-button>
+          <el-button type="primary" @click="handleConfirmReply">
+            确认
+          </el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -397,7 +460,8 @@ import {
   deleteProjectList,
   closeProjectList,
   validProjectList,
-  invalidProjectList
+  invalidProjectList,
+  replyProjectList
 } from '@/api/project'
 
 onMounted(() => {
@@ -445,13 +509,18 @@ const getData = async () => {
     status: searchType.value,
     reportingTime: searchTime.value,
     currPage: currentPage.value,
-    pageSize: pageSize.value
+    pageSize: pageSize.value,
+    spContent: spContent.value,
+    replyContent: replyContent.value
   })
   // console.log(res)
   res.list.forEach((item) => {
     if (item.file) {
       item.file = item.file.split(',')
     }
+    if (item.replyContent) {
+      item.replyContent = item.replyContent.split(',')
+    }
   })
   tableData.value = res.list
   total.value = res.totalCount
@@ -464,6 +533,8 @@ const searchAddress = ref('')
 const searchIndustry = ref('')
 const searchType = ref('')
 const searchTime = ref('')
+const spContent = ref('')
+const replyContent = ref('')
 // 表单元素DOM标识
 const multipleTable = ref(null)
 // 仓库
@@ -491,6 +562,8 @@ const tableData = ref([])
 
 const chooseObj = ref({})
 
+const dialogVisibleReply = ref(false)
+
 // 点击勾选框回调
 const handleChooseList = (list) => {
   downIds.value = []
@@ -509,7 +582,7 @@ const hanleExportForm = () => {
     type: 'warning'
   })
     .then(() => {
-      window.location.href = `/reporting/informationReporting/download?name=${searchName.value}&trade=${searchIndustry.value}&company=${searchAddress.value}&reportingTime=${searchTime.value}&status=${searchType.value}&ids=${id}`
+      window.location.href = `/reporting/informationReporting/download?name=${searchName.value}&trade=${searchIndustry.value}&company=${searchAddress.value}&reportingTime=${searchTime.value}&status=${searchType.value}&ids=${id}&spContent=${spContent.value}&replyContent=${replyContent.value}`
       multipleTable.value.clearSelection()
     })
     .catch(() => {
@@ -528,7 +601,7 @@ const handleCheckDetail = (row) => {
 // 点击有效失效按钮回调
 const handleValid = (row, type) => {
   // 1为有效,2为失效
-  console.log(row)
+  // console.log(row)
   textareaValue.value = ''
   chooseObj.value = row
   if (type === 1) {
@@ -538,6 +611,14 @@ const handleValid = (row, type) => {
   }
   dialogVisibleStatus.value = true
 }
+
+// 点击回复按钮回调
+const handleReply = (row) => {
+  // console.log(row)
+  textareaValue.value = ''
+  chooseObj.value = row
+  dialogVisibleReply.value = true
+}
 // 点击关闭按钮回调
 const handleClose = (row) => {
   ElMessageBox.confirm(`确定关闭 ${row.entryName} 吗?`, '提示', {
@@ -610,6 +691,22 @@ const handleConfirm = () => {
       ElMessage.info('已取消')
     })
 }
+
+// 点击回复弹窗确认按钮回调
+const handleConfirmReply = () => {
+  ElMessageBox.confirm('确定回复该条数据吗?', '提示', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(() => {
+      handleReplyReq()
+      dialogVisibleReply.value = false
+    })
+    .catch(() => {
+      ElMessage.info('已取消')
+    })
+}
 // 有效请求
 const handleValidReq = async () => {
   const res = await validProjectList({
@@ -618,7 +715,7 @@ const handleValidReq = async () => {
     itemId: chooseObj.value.id,
     ps: textareaValue.value
   })
-  console.log(res)
+  // console.log(res)
   if (res == null) {
     ElMessage.success('有效成功')
     getData()
@@ -633,12 +730,27 @@ const handleInvalidReq = async () => {
     itemId: chooseObj.value.id,
     ps: textareaValue.value
   })
-  console.log(res)
+  // console.log(res)
   if (res == null) {
     ElMessage.success('失效成功')
     getData()
   }
 }
+
+// 回复请求
+const handleReplyReq = async () => {
+  const res = await replyProjectList({
+    name: store.getters.userInfo.name,
+    id: store.getters.userInfo.id,
+    itemId: chooseObj.value.id,
+    replyContent: textareaValue.value
+  })
+  // console.log(res)
+  if (res == null) {
+    ElMessage.success('回复成功')
+    getData()
+  }
+}
 // 改变每页条数回调
 const handleSizeChange = (val) => {
   pageSize.value = val
@@ -656,6 +768,8 @@ const handleReset = () => {
   searchIndustry.value = ''
   searchType.value = ''
   searchTime.value = ''
+  spContent.value = ''
+  replyContent.value = ''
   getData()
 }
 </script>
@@ -682,6 +796,8 @@ const handleReset = () => {
   }
   .card_button {
     height: 53px;
+    font-size: 13px;
+    font-weight: bold;
   }
 
   .blue {