Ver código fonte

是否为组长字段修改

duy 1 ano atrás
pai
commit
08d46d975e

+ 1 - 1
src/global/components/hc-report-experts/index.vue

@@ -85,7 +85,7 @@ watch(() => [
 //是否为组件
 const groupSelectData = [
     { label: '是', value: 1 },
-    { label: '否', value: 2 },
+    { label: '否', value: 0 },
 ]
 
 //表单

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

@@ -60,7 +60,7 @@
                     <span class="text-orange text-sm">为您分配抽检范围,若有异动,可手动勾选想要验收的部分</span>
                 </template>
 
-                <HcTree ref="treeRef" style="margin-bottom: 10px;" :tree-data="ElTreeData" @getCheckKeys="getCheckKeys" />
+                <HcTree ref="treeRef" style="margin-bottom: 10px;" :tree-data="ElTreeData" @check="checkChange" />
 
                 <template #action>
                     <div class="hc-card-action-diy">
@@ -87,7 +87,7 @@ import { useAppStore } from '~src/store'
 import { useRouter } from 'vue-router'
 import HcTree from './components/entry-sampling/hc-tree.vue'
 import initialgApi from '~api/initial/initial'
-import { getArrValue } from 'js-fast-way'
+import { arrUnion, getArrValue } from 'js-fast-way'
 
 //变量
 const router = useRouter()
@@ -131,10 +131,14 @@ const getElTreeData = async ()=>{
 const ElTreeData = ref( [])
 const treeRef = ref(null)
 const checkKeys = ref([])
-const getCheckKeys = (val)=>{
-    checkKeys.value = val
-}
 
+const checkChange = ( val, val1 )=>{
+
+    const { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys } = val1
+
+   const arr = arrUnion(checkedKeys, halfCheckedKeys)
+    checkKeys.value = arr
+}
 //确认分配
 const confirmAllocationClick = async () => {
     isNull.value = false