ZaiZai 1 vuosi sitten
vanhempi
commit
6158f2ffa9
1 muutettua tiedostoa jossa 58 lisäystä ja 0 poistoa
  1. 58 0
      src/views/tentative/detect/commission.vue

+ 58 - 0
src/views/tentative/detect/commission.vue

@@ -137,6 +137,22 @@
                 <el-button hc-btn type="primary" :loading="rowActionLoading" @click="rowActionSave">创建</el-button>
             </template>
         </hc-new-dialog>
+
+        <!-- 上报审批 -->
+        <hc-report-modal
+            :show="showReportModal"
+            :classify-type="classifyType"
+            :addition="reportAddition"
+            :contract-id="delegateContractId"
+            :ids="reportIds"
+            :project-id="projectId"
+            :task-name="reportTaskName"
+            :trial-self-inspection-record-id="1"
+            title="上报审批" type="wbs"
+            url="informationWriteQuery/batchTask"
+            @finish="showReportFinish"
+            @hide="hideReport"
+        />
     </hc-body>
 </template>
 
@@ -456,8 +472,50 @@ const batchPrinting = () => {
 }
 
 //上报
+const classifyType = ref('')
+const reportIds = ref('')
+const reportTaskName = ref('')
+const showReportModal = ref(false)
+const reportAddition = ref({})
 const reportClick = () => {
+    const rows = tableCheckedKeys.value
+    if (rows.length <= 0) {
+        window.$message.warning('请先勾选一条需要上报的数据')
+        return
+    } else if (rows.length > 1) {
+        window.$message.warning('只能选择其中一条数据进行上报')
+        return
+    }
+    //判断状态
+    const { id, status, name } = { ...rows[0] }
+    if (status === 1) {
+        window.$message.warning('只能选择未上报的数据进行上报')
+        return
+    }
+    //处理类型
+    const { contractType } = contractInfo.value
+    classifyType.value = contractType > 0 ? contractType + '' : '1'
+    //其它数据
+    reportIds.value = id //数据ID
+    reportTaskName.value = name //任务名称
+
+    //显示任务上报
+    showReportModal.value = true
+}
+
+//上报完成
+const showReportFinish = () => {
+    hideReport()
+    getTableData()
+}
 
+//关闭上报弹窗
+const hideReport = () => {
+    showReportModal.value = false
+    classifyType.value = ''
+    reportAddition.value = {}
+    reportIds.value = ''
+    reportTaskName.value = ''
 }
 
 //打印空表