浏览代码

上报弹窗新增审批内容

iZaiZaiA 2 年之前
父节点
当前提交
a070114a11

+ 48 - 3
src/global/components/hc-report-modal/index.vue

@@ -4,6 +4,13 @@
             <el-form-item label="任务名称" prop="taskName">
                 <el-input v-model="formModel.taskName" disabled/>
             </el-form-item>
+            <el-form-item label="审批内容" v-if="isDatas && reportDatas.length > 0">
+                <div class="task-tag-data-box">
+                    <template v-for="(item,index) in reportDatas" :key="item.id">
+                        <el-tag type="info" size="default" closable @close="taskTagClose(index)">{{item.name}}</el-tag>
+                    </template>
+                </div>
+            </el-form-item>
             <el-form-item label="任务描述" prop="taskContent">
                 <el-input type="textarea" v-model="formModel.taskContent" placeholder="请输入任务描述" :autosize="{ minRows: 3, maxRows: 5 }"/>
             </el-form-item>
@@ -68,6 +75,14 @@ const props = defineProps({
         type: [String,Number],
         default: ''
     },
+    datas: {
+        type: Array,
+        default: () => ([])
+    },
+    isDatas: {
+        type: Boolean,
+        default: false
+    },
     addition: {
         type: Object,
         default: () => ({})
@@ -89,6 +104,7 @@ const contractId = ref(props.contractId)
 const ApiUrl = ref(props.url)
 const isTypes = ref(props.type)
 const typeDatas = ref(props.typeData)
+const reportDatas = ref(props.datas)
 
 //表单
 const formRef = ref(null)
@@ -126,8 +142,9 @@ watch(() => [
     props.url,
     props.addition,
     props.type,
-    props.typeData
-], ([val,pid,cid,name,ids,url,addition, type, typeData]) => {
+    props.typeData,
+    props.datas
+], ([val,pid,cid,name,ids,url,addition, type, typeData, datas]) => {
     isShow.value = val
     projectId.value = pid
     contractId.value = cid
@@ -140,6 +157,7 @@ watch(() => [
     }
     isTypes.value = type
     typeDatas.value = typeData
+    reportDatas.value = datas
     if (val) {
         getProcessDatasApi()
     }
@@ -233,8 +251,18 @@ const restrictDayUpdateValue = (val) => {
     formModel.value.restrictDay = val
 }
 
+const emit = defineEmits(['hide','finish', 'tagClose'])
+
+//审批内容的标签移除
+const taskTagClose = (index) => {
+    reportDatas.value.splice(index, 1)
+    emit('tagClose', index)
+    if (reportDatas.value.length <= 0) {
+        window.$message?.warning('请重新选择要上报的内容')
+        cancelReportClick()
+    }
+}
 
-const emit = defineEmits(['hide','finish'])
 //取消
 const cancelReportClick = () => {
     linkUserJoinString.value = ''
@@ -269,3 +297,20 @@ const batchApprovalApi = async () => {
     }
 }
 </script>
+
+<style lang="scss" >
+.task-tag-data-box {
+    position: relative;
+    border: 1px solid #e0e0e6;
+    border-radius: 4px;
+    padding: 5px;
+    min-height: 40px;
+    display: flex;
+    align-items: center;
+    flex-flow: row wrap;
+    width: 100%;
+    .el-tag {
+        margin: 5px;
+    }
+}
+</style>

+ 7 - 1
src/global/components/hc-table/index.vue

@@ -111,6 +111,11 @@ const getSelectionRows = () => {
     tableRef.value?.getSelectionRows()
 }
 
+//用于多选表格,切换某一行的选中状态, 如果使用了第二个参数,则可直接设置这一行选中与否
+const toggleRowSelection = (row, selected) => {
+    tableRef.value?.toggleRowSelection(row, selected)
+}
+
 //多选
 const tableSelectionChange = (rows) => {
     let tableRows = rows.filter((item) => {
@@ -152,7 +157,8 @@ const tableCellContextmenu = (row, column, cell, event) => {
 // 暴露出去
 defineExpose({
     clearSelection,
-    getSelectionRows
+    getSelectionRows,
+    toggleRowSelection
 })
 </script>
 

+ 34 - 17
src/views/data-fill/query.vue

@@ -145,16 +145,18 @@
         </div>
 
         <!--批量上报审批-->
-        <HcReportModal  title="批量上报审批"
-                        url="informationWriteQuery/batchTask"
-                        :show="showReportModal"
-                        :projectId="projectId"
-                        :contractId="contractId"
-                        :taskName="reportTaskName"
-                        :ids="reportIds"
-                        :addition="reportAddition"
-                        @hide="showReportModal = false"
-                        @finish="showReportFinish"
+        <HcReportModal title="批量上报审批"
+                    url="informationWriteQuery/batchTask"
+                    :show="showReportModal"
+                    :projectId="projectId"
+                    :contractId="contractId"
+                    :taskName="reportTaskName"
+                    :ids="reportIds"
+                    isDatas
+                    :datas="reportDatas"
+                    @hide="showReportModal = false"
+                    @finish="showReportFinish"
+                    @tagClose="reportTaskTagClose"
         />
     </div>
 </template>
@@ -278,9 +280,7 @@ const getReportNumber = async () => {
     })
     //判断状态
     if (!error && code === 200) {
-        console.log(data)
-        //let res = getArrValue(data);
-        reportBatchData.value = []
+        reportBatchData.value = getArrValue(data)
     } else {
         reportBatchData.value = []
     }
@@ -405,7 +405,7 @@ const tableRowName = (row) => {
 //上报
 const reportIds = ref('')
 const reportTaskName = ref('')
-const reportAddition = ref({})
+const reportDatas = ref([])
 const showReportModal = ref(false)
 const reportLoading = ref(false)
 const reportModalClick = async () => {
@@ -421,20 +421,37 @@ const reportModalClick = async () => {
             projectId: projectId.value,
             contractId: contractId.value
         })
-        reportLoading.value = false
         if (taskCheck) {
-            //const info = nodeDataInfo.value;
+            //初始ID
             const row = getObjValue(rows[0])
             reportIds.value = rowsToId(rows)
+            //设置任务数据
+            let reportDataArr = []
+            rows.forEach(item => {
+                reportDataArr.push({
+                    id: item?.id,
+                    name: item?.name
+                })
+            })
+            reportDatas.value = reportDataArr
             //设置任务名称
             reportTaskName.value = rows.length > 1 ? `${row.name}等${rows.length}个文件` : row.name
-            //reportAddition.value = {contractIdRelation: info['contractIdRelation']}
+            reportLoading.value = false
             showReportModal.value = true
+        } else {
+            reportLoading.value = false
         }
     } else {
         window.$message?.warning('已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报')
     }
 }
+
+//上报的审批内容移除
+const reportTaskTagClose = (index) => {
+    const row = tableCheckedKeys.value[index];
+    tableListRef.value?.toggleRowSelection(row,false)
+}
+
 //上报完成
 const showReportFinish = () => {
     showReportModal.value = false

+ 37 - 3
src/views/ledger/components/table-list.vue

@@ -59,8 +59,21 @@
         </HcCard>
 
         <!--批量上报审批-->
-        <HcReportModal  title="批量上报审批" url="contractLog/batchTask" :show="showReportModal" :projectId="projectId" :contractId="contractId" type="log" :typeData="menuItem.primaryKeyId"
-                        :taskName="reportTaskName" :ids="reportIds" @hide="showReportModal = false" @finish="showReportFinish"/>
+        <HcReportModal title="批量上报审批"
+                       url="contractLog/batchTask"
+                       :show="showReportModal"
+                       :projectId="projectId"
+                       :contractId="contractId"
+                       type="log"
+                       :typeData="menuItem.primaryKeyId"
+                       :taskName="reportTaskName"
+                       :ids="reportIds"
+                       isDatas
+                       :datas="reportDatas"
+                       @hide="showReportModal = false"
+                       @finish="showReportFinish"
+                       @tagClose="reportTaskTagClose"
+        />
     </div>
 </template>
 
@@ -194,6 +207,7 @@ const tableSelectionChange = (rows) => {
 //批量上报
 const reportIds = ref('')
 const reportTaskName = ref('')
+const reportDatas = ref([])
 const reportLoading = ref(false)
 const showReportModal = ref(false)
 const reportModalClick = async () => {
@@ -209,17 +223,37 @@ const reportModalClick = async () => {
             projectId: projectId.value,
             contractId: contractId.value
         })
-        reportLoading.value = false
         if (taskCheck) {
+            //初始ID
             const row = getObjValue(rows[0])
             reportIds.value = rowsToId(rows)
+            //设置任务数据
+            let reportDataArr = []
+            rows.forEach(item => {
+                reportDataArr.push({
+                    id: item?.id,
+                    name: item?.fileName
+                })
+            })
+            reportDatas.value = reportDataArr
+            //设置任务名称
             reportTaskName.value = rows.length > 1 ? `${row.fileName}等${rows.length}个文件` : row.fileName
+            reportLoading.value = false
             showReportModal.value = true
+        } else {
+            reportLoading.value = false
         }
     } else {
         window.$message?.warning('已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报')
     }
 }
+
+//上报的审批内容移除
+const reportTaskTagClose = (index) => {
+    const row = tableCheckedKeys.value[index];
+    tableListRef.value?.toggleRowSelection(row,false)
+}
+
 //上报完成
 const showReportFinish = () => {
     showReportModal.value = false

+ 34 - 3
src/views/other-file/project-scanning.vue

@@ -170,8 +170,20 @@
         </el-dialog>
 
         <!--批量上报审批-->
-        <HcReportModal  title="批量上报审批" url="archiveFile/batchApproval" :show="showReportModal" :projectId="projectId" :contractId="contractId"
-                        :taskName="reportTaskName" :ids="reportIds" @hide="showReportModal = false" @finish="showReportFinish"/>
+        <HcReportModal
+            title="批量上报审批"
+            url="archiveFile/batchApproval"
+            :show="showReportModal"
+            :projectId="projectId"
+            :contractId="contractId"
+            :taskName="reportTaskName"
+            :ids="reportIds"
+            isDatas
+            :datas="reportDatas"
+            @hide="showReportModal = false"
+            @finish="showReportFinish"
+            @tagClose="reportTaskTagClose"
+        />
 
         <!--批量认证-->
         <el-dialog v-model="showCertificationModal" title="批量认证" width="80vw" class="hc-modal-border hc-modal-table">
@@ -691,6 +703,7 @@ const batchDownload = async () => {
 //批量上报
 const reportIds = ref('')
 const reportTaskName = ref('')
+const reportDatas = ref([])
 const showReportModal = ref(false)
 const reportLoading = ref(false)
 const reportModalClick = async () => {
@@ -704,17 +717,35 @@ const reportModalClick = async () => {
             projectId: projectId.value,
             contractId: contractId.value
         })
-        reportLoading.value = false
         if (taskCheck) {
             reportIds.value = rowsToId(rows)
+            //设置任务数据
+            let reportDataArr = []
+            rows.forEach(item => {
+                reportDataArr.push({
+                    id: item?.id,
+                    name: item?.fileName
+                })
+            })
+            reportDatas.value = reportDataArr
+            //设置任务名称
             reportTaskName.value = rows.length > 1?`${rows[0].fileName}等${rows.length}个文件`:rows[0].fileName
+            reportLoading.value = false
             showReportModal.value = true
+        } else {
+            reportLoading.value = false
         }
     } else {
         window.$message?.warning('已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报')
     }
 }
 
+//上报的审批内容移除
+const reportTaskTagClose = (index) => {
+    const row = tableCheckedKeys.value[index];
+    tableListRef.value?.toggleRowSelection(row,false)
+}
+
 //上报完成
 const showReportFinish = () => {
     showReportModal.value = false

+ 34 - 2
src/views/other/first-item.vue

@@ -153,8 +153,22 @@
         </HcDrawer>
 
         <!--上报审批-->
-        <HcReportModal title="上报审批" url="informationWriteQuery/taskOne" :show="showReportModal" :projectId="projectId" :contractId="contractId" type="first" :typeData="reportTypeData"
-                       :taskName="reportTaskName" :ids="reportIds" @hide="showReportModal = false" @finish="showReportFinish"/>
+        <HcReportModal
+            title="上报审批"
+            url="informationWriteQuery/taskOne"
+            :show="showReportModal"
+            :projectId="projectId"
+            :contractId="contractId"
+            type="first"
+            :typeData="reportTypeData"
+            :taskName="reportTaskName"
+            :ids="reportIds"
+            :isDatas="tabTypeKey === 'query'"
+            :datas="reportDatas"
+            @hide="showReportModal = false"
+            @finish="showReportFinish"
+            @tagClose="reportTaskTagClose"
+        />
     </div>
 </template>
 
@@ -553,6 +567,7 @@ const reportTaskName = ref('')
 const reportAddition = ref({})
 const reportLoading = ref(false)
 const reportTypeData = ref('')
+const reportDatas = ref([])
 const reportModalClick = async () => {
     const { primaryKeyId, contractIdRelation } = treeItem.value
     let rows = [];
@@ -582,12 +597,23 @@ const reportModalClick = async () => {
                 reportTaskName.value = ''
             }
         } else {
+            //设置任务数据
+            let reportDataArr = []
+            rows.forEach(item => {
+                reportDataArr.push({
+                    id: item?.id,
+                    name: item?.name
+                })
+            })
+            reportDatas.value = reportDataArr
+            //其他数据
             reportTypeData.value = rows[0]['id']
             reportTaskName.value = rows.length > 1?`${rows[0].name}等${rows.length}个文件`:rows[0].name
         }
         reportLoading.value = false
         if (taskCheck) {
             reportIds.value = rowsToId(rows)
+            //附加数据
             reportAddition.value = {
                 classify: 1,
                 isFirst: 1,
@@ -601,6 +627,12 @@ const reportModalClick = async () => {
     }
 }
 
+//上报的审批内容移除
+const reportTaskTagClose = (index) => {
+    const row = tableSelectionKeys.value[index];
+    tableListRef.value?.toggleRowSelection(row,false)
+}
+
 //上报完成
 const showReportFinish = () => {
     showReportModal.value = false