Kaynağa Gözat

委托单任务名称显示修改

duy 2 ay önce
ebeveyn
işleme
49d28bdf7c
1 değiştirilmiş dosya ile 20 ekleme ve 3 silme
  1. 20 3
      src/views/tentative/detect/commission.vue

+ 20 - 3
src/views/tentative/detect/commission.vue

@@ -207,6 +207,7 @@ import samplingApi from '~api/tentative/material/sampling'
 import TestTree from '~src/views/tentative/material/components/TestTree.vue'
 import SamplingPage from './commission/sampling.vue'
 import { isCancel } from 'axios'
+import wbsApi from '~api/data-fill/wbs'
 
 //变量
 const router = useRouter()
@@ -221,8 +222,17 @@ const contractInfo = ref(useAppState.getContractInfo)
 onActivated(() => {
     getContractData()
     getEntrustStatusData()
+    setContractType(contractInfo.value?.contractType)
 })
-
+const authBtnTabKey = ref('1')
+const setContractType = (contractType) => {
+    let typeValue = '1'
+    if (contractType > 0) {
+        typeValue = contractType + ''
+    }
+    authBtnTabKey.value = typeValue
+ 
+}
 //搜索表单
 const searchForm = ref({ entrustName: null, current: 1, size: 20, total: 0 })
 
@@ -592,7 +602,7 @@ const reportIds = ref('')
 const reportTaskName = ref('')
 const showReportModal = ref(false)
 const reportAddition = ref({})
-const reportClick = () => {
+const reportClick = async () => {
     const rows = tableCheckedKeys.value
     if (rows.length <= 0) {
         window.$message.warning('请先勾选一条需要上报的数据')
@@ -611,7 +621,7 @@ const reportClick = () => {
     classifyType.value = '1'
     //其它数据
     reportIds.value = rows[0].id //数据ID
-    reportTaskName.value = entrustName //任务名称
+    // reportTaskName.value = entrustName //任务名称
     //附加数据
     const { contractIdRelation } = nodeDataInfo.value
     reportAddition.value = {
@@ -619,6 +629,13 @@ const reportClick = () => {
         classify: classifyType.value,
         contractIdRelation: contractIdRelation,
     }
+     //请求文件题名
+     const { data } = await wbsApi.queryDocumentTitle({
+                    // primaryKeyId: info['primaryKeyId'],
+                    primaryKeyId: rows[0].id,
+                    classify: authBtnTabKey.value,
+                })
+                reportTaskName.value = isString(data) ? data : ''
     //显示任务上报
     showReportModal.value = true
 }