Jelajahi Sumber

确认并进入抽检修改

duy 1 tahun lalu
induk
melakukan
48f2173376

+ 8 - 0
src/api/modules/initial/initial.js

@@ -49,4 +49,12 @@ export default {
             params: form,
         }, msg)
     },
+    //档案在线验收-确认并进入抽检
+    async saveAllSelectNodes(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/archiveTreeContract/saveAllSelectNodes',
+            method: 'post',
+            data: form,
+        }, msg)
+     },
 }

+ 13 - 2
src/views/transfer/components/entry-sampling/hc-tree.vue

@@ -1,6 +1,6 @@
 <template>
     <el-tree
-        ref="ElTreeRef" v-loading="treeLoaing"
+        ref="ElTreeRef" 
         :class="ui"
         :data="treeData"
         :indent="0"
@@ -10,12 +10,14 @@
         highlight-current
         node-key="id"
         show-checkbox
+        :default-checked-keys="defaultCheckedKeys"
+        @check="treeCheck"
     >
         <template #default="{ node, data }">
             <div :id="`'entry-sampling-'${data.id}`" class="data-custom-tree-node">
                 <div class="label">
                     <span> {{ data.nodeName }}</span>
-                    <span v-if="data.nodeInfo" class="text-orange text-sm">(该目录已分属XX专家,如需调整,请联系该专家进行转让)</span>
+                    <span v-if="data.nodeInfo" class="text-orange text-sm">{{ data.nodeInfo }}</span>
                 </div>
             </div>
         </template>
@@ -35,9 +37,18 @@ const props = defineProps({
         default:()=>[],
     },
 })
+const emit = defineEmits(['getCheckKeys'])
+
 
 const treeData = ref(props.treeData)
+const defaultCheckedKeys = ref([])
+
+const treeCheck = (data, checkedKeys)=>{
+ 
+        console.log(checkedKeys.checkedKeys, 'checkedKeys')
+        emit('getCheckKeys', (checkedKeys.checkedKeys))
 
+}
 //监听
 watch(() => [
     props.treeData,

+ 2 - 1
src/views/transfer/components/table-collect.vue

@@ -37,7 +37,7 @@
                                 is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
                                 @selection-change="tableSelection"
                             /> -->
-                            <visualTable :table-data="item1.list " @getTableKeys="getTableKeys" />
+                            <visualTable ref="visuatable" :table-data="item1.list " @getTableKeys="getTableKeys" />
                         </div>
                     </HcCardItem>
                 </template>
@@ -186,6 +186,7 @@ const visuatable = ref(null)
 //上报的审批内容移除
 const reportTaskTagClose = (index) => {
     // const row = tableKeys.value[index]
+    console.log(visuatable.value[0])
     tableKeys.value.splice(index, 1)
 
     // // tableRef.value?.toggleRowSelection(row, false)

+ 10 - 5
src/views/transfer/components/visual-table.vue

@@ -3,23 +3,26 @@
     <HcTable
         ref="tableRef"
         :column="tableColumn" :datas="tableData" :loading="tableLoaing"
-        is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
+        is-new :index-style="{ width: 60 }" :is-check="isCheck" :check-style="{ width: 29 }"
         @selection-change="tableSelection" @select-all="tableSelectAll"
     />
 </template>
 
 <script setup>
-import { getCurrentInstance, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
+import { onMounted, onUnmounted, ref, watch } from 'vue'
 const props = defineProps({
     tableData: {
         type: Array,
         default: () => ([]),
     },
+    isCheck:{
+      type:Boolean,
+      default:true,
+    },
 })
 //事件
 const emit = defineEmits(['getTableKeys'])
-const { proxy } = getCurrentInstance()
-
+const isCheck = ref(props.isCheck)
 const allData = ref(props.tableData)
 const needle = ref(10)//数据指针 默认19
 const tableData = ref([])
@@ -49,8 +52,10 @@ const tableColumn = ref([
 //监听
 watch(() => [
     props.tableData,
-], ([Data]) => {
+    props.isCheck,
+], ([Data, Check]) => {
     allData.value = Data
+    isCheck.value = Check
     tableData.value = []
         //判断数据长度有没有9个,有就先添加9个,没有直接获取所有数据
         if (allData.value.length > 9) {

+ 30 - 5
src/views/transfer/entry-sampling.vue

@@ -60,7 +60,7 @@
                     <span class="text-orange text-sm">为您分配抽检范围,若有异动,可手动勾选想要验收的部分</span>
                 </template>
 
-                <HcTree style="margin-bottom: 10px;" :tree-data="ElTreeData" />
+                <HcTree ref="treeRef" style="margin-bottom: 10px;" :tree-data="ElTreeData" @getCheckKeys="getCheckKeys" />
 
                 <template #action>
                     <div class="hc-card-action-diy">
@@ -68,7 +68,7 @@
                             <HcIcon name="refresh" />
                             <span>清空重置</span>
                         </el-button>
-                        <el-button hc-btn type="primary" @click="ToInspection">
+                        <el-button hc-btn type="primary" :loading="inspectionLoaing" @click="ToInspection">
                             <HcIcon name="check" />
                             <span>确认并进入抽检</span>
                         </el-button>
@@ -129,6 +129,11 @@ const getElTreeData = async ()=>{
     }
 }
 const ElTreeData = ref( [])
+const treeRef = ref(null)
+const checkKeys = ref([])
+const getCheckKeys = (val)=>{
+    checkKeys.value = val
+}
 
 //确认分配
 const confirmAllocationClick = async () => {
@@ -141,12 +146,32 @@ const confirmAllocationClick = async () => {
 
 //确认并进入抽检
 const ToInspection = () => {
-    router.push({
-        name: 'transfer-preliminary-examination',
+  console.log( checkKeys.value, '  checkKeys.value')
+  const ids = checkKeys.value.join(',')
+  goInspection(ids)
+    // router.push({
+    //     name: 'transfer-preliminary-examination',
+    // })
+    
+}
+//抽检
+const inspectionLoaing = ref(false)
+const goInspection = async (ids)=>{
+    inspectionLoaing.value = true
+    const { error, code, data, msg } = await initialgApi.saveAllSelectNodes({
+        ids: ids,
+       
     })
+    inspectionLoaing.value = false
+    if (!error && code === 200) {
+        window.$message.success(msg)
+         router.push({
+            name: 'transfer-preliminary-examination',
+        })
+        
+    } 
 }
 
-
 //清空重置
 const clearResetClick = () => {
     isNull.value = true

+ 1 - 1
src/views/transfer/initial-expert.vue

@@ -48,7 +48,7 @@
                                     is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
                                     @selection-change="tableSelection"
                                 /> -->
-                                <visualTable :table-data="item1.list " @getTableKeys="getTableKeys" />
+                                <visualTable :table-data="item1.list " :is-check="false" @getTableKeys="getTableKeys" />
                             </div>
                         </HcCardItem>
                     </template>