Browse Source

Merge branch 'v2.0' of http://8.136.199.33:3000/eta_forum/eta_forum_admin_front into v2.0

chenlei 2 months ago
parent
commit
a8ca6d7a01

+ 7 - 3
src/components/SelectBusiness.vue

@@ -1,5 +1,6 @@
 <script setup>
 import {businessCustomInterence} from '@/api/modules/businessCustom'
+import { useDebounceFn } from '@vueuse/core'
 
 const value=defineModel('value')
 const emits=defineEmits(['change'])
@@ -43,9 +44,11 @@ async function remoteMethod(search){
 // 默认获取一次
 remoteMethod('')
 
-function handleChange(value,context){
-  emits('change',value,context)
-}
+// 组件库1.10.6版本 当清空选项时会触发tag-remove 然后再触发clear 导致两次触发change
+const handleChange=useDebounceFn((value,context)=>{
+  const data=options.value.filter(i=>i.EtaBusinessId===value)[0]
+  emits('change',value,context,data)
+},300)
 
 </script>
 
@@ -62,6 +65,7 @@ function handleChange(value,context){
     :disabled="props.disabled"
     @search="remoteMethod"
     @change="handleChange"
+    @focus="remoteMethod('')"
   >
     <t-option 
       v-for="item in options" 

+ 8 - 1
src/views/customer/user/components/MoveUser.vue

@@ -11,6 +11,11 @@ const props=defineProps({
   }
 })
 
+const SellerName=ref('')
+function handleSelectChange(value,context,data){
+  SellerName.value=data.SellerName
+}
+
 const FORM_RULES = { 
   company: [{ required: true, message: '请选择客户' }],
 };
@@ -39,6 +44,7 @@ watch(
   (n)=>{
     if(!n){
       formIns.value.reset()
+      SellerName.value=''
       return
     }
   }
@@ -70,11 +76,12 @@ watch(
           v-model="formData.company"
           placeholder="输入社会信用码或客户名称"
           filterable
+          @change="handleSelectChange"
         />
       </t-form-item>
       
       <t-form-item label="所属销售" name="customer">
-        <t-select disabled :value="props.data?.SellerName">
+        <t-select disabled :value="SellerName" placeholder="请选择客户">
         </t-select>
       </t-form-item>
     </t-form>

+ 4 - 3
src/views/etaChart/components/ClassifyWrap.vue

@@ -138,6 +138,7 @@ function showClassifyOpt(data) {
   return (classifyActived.value === data.ChartClassifyId) && data.ChartClassifyId !== 0 && data.ChartInfoId === 0
 }
 
+const moveClassifyIns=useTemplateRef('moveClassifyIns')
 // 分类编辑
 const formEl = ref(null)
 const FORM_RULES = { name: [{ required: true, message: '名称不能为空' }] };
@@ -173,9 +174,8 @@ async function handleConfirmClassify() {
     MessagePlugin.success('操作成功')
     showEditClassify.value = false
     getClassify()
+    moveClassifyIns.value?.getClassifyOpts()
   }
-
-
 }
 function handleClassifyOpt(node, type) {
   const data=node.data
@@ -205,6 +205,7 @@ function handleClassifyOpt(node, type) {
       if (res.Ret === 200) {
         MessagePlugin.success('操作成功')
         getClassify()
+        moveClassifyIns.value?.getClassifyOpts()
       }
     })
   }
@@ -420,7 +421,7 @@ const showBatchMove = ref(false)
   </t-dialog>
 
   <!-- 批量移动图表 -->
-  <MoveClassify v-model:show="showBatchMove" @success="getClassify" />
+  <MoveClassify ref="moveClassifyIns" v-model:show="showBatchMove" @success="getClassify" />
 </template>
 
 <style lang="scss">

+ 4 - 0
src/views/etaChart/components/MoveClassify.vue

@@ -124,6 +124,10 @@ watch(
   }
 )
 
+defineExpose({
+  getClassifyOpts
+})
+
 const selectedRowKeys = ref([])
 let cancelSelectRowKeys=[]//取消选择的keys
 function tableSelectChange(value, ctx) {