浏览代码

Merge branch 'v2.0' of eta_forum/eta_forum_admin_front into debug

leichen 2 月之前
父节点
当前提交
8ed63de83f

+ 14 - 13
src/views/business_manage/addBusiness.vue

@@ -559,6 +559,7 @@ const editEtaBusiness = async () => {
 
 // 编辑签约信息
 const handleShowRenewal = (data) => {
+  renewalDiaTitle.value = "添加续约";
   showRenewal.value = true;
 };
 
@@ -595,19 +596,19 @@ const editRenewal = (row) => {
   showRenewal.value = true;
 };
 
-const handleAddRenewal = ({ signDate, expirationDate, id }) => {
-  // 处理添加续约逻辑
-  businessCustomInterence.editContract({
-      EtaBusinessContractId: id || 0,
-      EtaBusinessId: businessId.value,
-      SigningTime: signDate,
-      ExpiredTime: expirationDate,
-  }).then(res=>{
-      if(res.Ret!==200) return 
-      MessagePlugin.success('编辑续约成功')
-      showRenewal.value = false
-      getTableData()
-  })
+const handleAddRenewal = async ({ signDate, expirationDate, id }) => {
+  // 处理续约逻辑
+  const params = {
+    EtaBusinessContractId: id || 0,
+    EtaBusinessId: businessId.value,
+    SigningTime: signDate,
+    ExpiredTime: expirationDate
+  }
+  const res = renewalDiaTitle.value === '编辑续约' ? await businessCustomInterence.editContract(params) : await businessCustomInterence.addNewContract(params);
+  if(res.Ret!==200) return 
+  MessagePlugin.success(renewalDiaTitle.value === '编辑续约' ? '编辑续约成功' : '添加续约成功')
+  showRenewal.value = false
+  getTableData()
 };
 </script>
 <style lang="scss" scoped>

+ 0 - 1
src/views/business_manage/components/AddRenewal.vue

@@ -80,7 +80,6 @@ const handleSave = async () => {
 };
 
 const initForm = () => {
-  ruleForm.value = { id: 0, signDate: '', expirationDate: '' };
   nextTick(() => {
     validateRef.value?.reset({ fields: ['signDate', 'expirationDate'] }); // 重置表单验证状态
   });

+ 6 - 3
src/views/business_manage/components/SetPermission.vue

@@ -33,6 +33,9 @@
 <script setup>
 import { ref, watch, nextTick } from 'vue';
 import { SearchIcon } from 'tdesign-icons-vue-next';
+import { useRoute } from 'vue-router'
+
+const route = useRoute()
 const props = defineProps({
   isShowFoot: {
     type: Boolean,
@@ -80,7 +83,7 @@ const treeKeys = reactive({
 
 const filterNodes = (arr) => {
   arr.length && arr.forEach((item) => {
-    console.log(item);
+    // console.log(item);
     props.allCheckedList.includes(item.ChartClassifyId) && (item.expanded = true);
     item.Children&&item.Children.length && containsAnyValue(item.Children, props.allCheckedList) && (item.expanded = true);
     item.Children&&item.Children.length && filterNodes(item.Children);
@@ -134,7 +137,7 @@ watch(
 watch(
   () => props.currentStep,
   (newValue) => {
-    if (newValue === 3) {
+    if (newValue === 3 && route.name !== 'addBusiness') {
       emit('getSearch', searchTxt.value);
     }
   },
@@ -165,7 +168,7 @@ const onChange = (checked, context) => {
     } else {                                            // 如果当前节点有子节点,则直接加上该节点的id
       actuallyAllChecked.value = [...new Set([...actuallyAllChecked.value, node.value])];                                                  
     }
-  } else {    
+  } else {
     if (node.data.Children.length) {                    // 如果当前节点有子节点,则直接去掉该节点和子节点的所有id 
       const temp = [...getAllChildIds(node.data.Children), node.value];
       allChecked.value = removeChildren(allChecked.value, temp);