Quellcode durchsuchen

任务切换修改

duy vor 1 Jahr
Ursprung
Commit
d6e93898fa
2 geänderte Dateien mit 28 neuen und 8 gelöschten Zeilen
  1. 14 5
      src/views/tasks/components/TableCard.vue
  2. 14 3
      src/views/tasks/hc-data.vue

+ 14 - 5
src/views/tasks/components/TableCard.vue

@@ -118,9 +118,13 @@ const props = defineProps({
         type: String,
         default: '',
     },
+    selectContracId:{
+        type: String,
+        default: '',
+    },
 })
 //事件
-const emit = defineEmits(['rowTaskName', 'signRules', 'batchApproval'])
+const emit = defineEmits(['rowTaskName', 'signRules', 'batchApproval', 'changeselectContracId'])
 //初始变量
 const useAppState = useAppStore()
 //变量
@@ -128,12 +132,14 @@ const projectId = ref(props.projectId)
 const contractId = ref(props.contractId)
 const isTableKey = ref(props.tableKey)
 const currentContractId = ref(useAppState.getContractId)
+const selectContracId = ref(props.selectContracId)
 
 //监听
 watch(() => [
-    props.tableKey,
-], ([Key]) => {
+    props.tableKey, props.selectContracId,
+], ([Key, Sid]) => {
     isTableKey.value = Key
+    selectContracId.value = Sid
     setQueryData()
 })
 
@@ -144,7 +150,8 @@ nextTick(() => {
 
 //获取相关数据
 const setQueryData = () => {
-    searchForm.value.contractIdValue = contractId.value
+    // searchForm.value.contractIdValue = contractId.value
+     searchForm.value.contractIdValue = selectContracId.value
     queryTaskType()
     queryTaskStatus()
     searchClick()
@@ -178,11 +185,13 @@ const queryTaskStatus = async () => {
 }
 
 //合同段
-const ContractIdChange = () => {
+const ContractIdChange = (val) => {
     searchForm.value.batch = null
+   emit('changeselectContracId', val)
     queryBatchList()
     // queryUserStartFlow()
     getTableData()
+   
 }
 
 //获取上报批次

+ 14 - 3
src/views/tasks/hc-data.vue

@@ -6,8 +6,10 @@
                     v-if="sbTableKey === 'key1'" :contract-id="contractId"
                     :contract-list="contractList"
                     :project-id="projectId" :table-key="sbTableKey"
-                    @batchApproval="batchApprovalTaskClick" @rowTaskName="rowTaskName"
+                    :select-contrac-id="selectContracId" @batchApproval="batchApprovalTaskClick"
+                    @rowTaskName="rowTaskName"
                     @signRules="setSignRulesClick"
+                    @changeselectContracId="changeselectContracId"
                 />
             </template>
             <template #tab-key2>
@@ -15,8 +17,10 @@
                     v-if="sbTableKey === 'key2'" :contract-id="contractId"
                     :contract-list="contractList"
                     :project-id="projectId" :table-key="sbTableKey"
-                    @batchApproval="batchApprovalTaskClick" @rowTaskName="rowTaskName"
+                    :select-contrac-id="selectContracId" @batchApproval="batchApprovalTaskClick"
+                    @rowTaskName="rowTaskName"
                     @signRules="setSignRulesClick"
+                    @changeselectContracId="changeselectContracId"
                 />
             </template>
             <template #tab-key3>
@@ -24,8 +28,10 @@
                     v-if="sbTableKey === 'key3'" :contract-id="contractId"
                     :contract-list="contractList"
                     :project-id="projectId" :table-key="sbTableKey"
-                    @batchApproval="batchApprovalTaskClick" @rowTaskName="rowTaskName"
+                    :select-contrac-id="selectContracId" @batchApproval="batchApprovalTaskClick"
+                    @rowTaskName="rowTaskName"
                     @signRules="setSignRulesClick"
+                    @changeselectContracId="changeselectContracId"
                 />
             </template>
         </HcTabsSimple>
@@ -139,6 +145,7 @@ const projectId = ref(useAppState.getProjectId)
 const contractId = ref(useAppState.getContractId)
 const projectInfo = ref(useAppState.getProjectInfo)
 
+
 //渲染完成
 onMounted(() => {
     checkSmsCode()
@@ -413,6 +420,10 @@ const setSignRulesClick = () => {
 const dateUpdateValue = (val) => {
     formReport.value.date = val
 }
+const selectContracId = ref(useAppState.getContractId)
+const changeselectContracId = (val)=>{
+    selectContracId.value = val
+}
 </script>
 
 <style lang="scss" scoped>