shish 11 mesiacov pred
rodič
commit
176cd498ec

+ 7 - 7
hdApp/src/admin/member/detail.vue

@@ -367,13 +367,13 @@
               <div class="type-buttons">
               <div class="type-buttons">
                 <button 
                 <button 
                   class="admin-button-com middle" 
                   class="admin-button-com middle" 
-                  :class="[birthdayType == 0 ? 'blue' : 'default']" 
-                  @click="birthdayType = 0"
+                  :class="[lunar == 0 ? 'blue' : 'default']" 
+                  @click="lunar = 0"
                 >公历</button>
                 >公历</button>
                 <button 
                 <button 
                   class="admin-button-com middle" 
                   class="admin-button-com middle" 
-                  :class="[birthdayType == 1 ? 'blue' : 'default']" 
-                  @click="birthdayType = 1"
+                  :class="[lunar == 1 ? 'blue' : 'default']" 
+                  @click="lunar = 1"
                 >农历</button>
                 >农历</button>
               </div>
               </div>
             </div>
             </div>
@@ -540,7 +540,7 @@ export default {
       upgradeModal: false,
       upgradeModal: false,
       remarkModal: false,
       remarkModal: false,
       birthdayModal: false,
       birthdayModal: false,
-      birthdayType: 0, // 0公历 1农历
+      lunar: 0, // 0公历 1农历
       birthdayMonth: '', // 选择的月份
       birthdayMonth: '', // 选择的月份
       birthdayDate: '', // 选择的日期
       birthdayDate: '', // 选择的日期
       dateArray: Array.from({length: 31}, (_, i) => i + 1), // 1-31的数组
       dateArray: Array.from({length: 31}, (_, i) => i + 1), // 1-31的数组
@@ -887,7 +887,7 @@ export default {
     },
     },
     changeBirthday() {
     changeBirthday() {
       // 初始化生日数据
       // 初始化生日数据
-      this.birthdayType = this.data.lunar || 0;
+      this.lunar = this.data.lunar || 0;
       this.birthdayMonth = this.data.birthdayMonth || '';
       this.birthdayMonth = this.data.birthdayMonth || '';
       this.birthdayDate = this.data.birthdayDate || '';
       this.birthdayDate = this.data.birthdayDate || '';
       
       
@@ -917,7 +917,7 @@ export default {
         // 保存生日信息
         // 保存生日信息
         const params = {
         const params = {
           customId: this.data.id,
           customId: this.data.id,
-          lunar: this.birthdayType,
+          lunar: this.lunar,
           birthdayMonth: this.birthdayMonth,
           birthdayMonth: this.birthdayMonth,
           birthdayDate: this.birthdayDate
           birthdayDate: this.birthdayDate
         }
         }

+ 14 - 63
hdPad/src/pages/home/components/birthdayEdit.vue

@@ -6,13 +6,13 @@
             <div class="type-buttons">
             <div class="type-buttons">
                 <button 
                 <button 
                     class="birthday-type-btn" 
                     class="birthday-type-btn" 
-                    :class="{active: birthdayType == 0}" 
-                    @click="birthdayType = 0"
+                    :class="{active: lunar == 0}" 
+                    @click="lunar = 0"
                 >公历</button>
                 >公历</button>
                 <button 
                 <button 
                     class="birthday-type-btn" 
                     class="birthday-type-btn" 
-                    :class="{active: birthdayType == 1}" 
-                    @click="birthdayType = 1"
+                    :class="{active: lunar == 1}" 
+                    @click="lunar = 1"
                 >农历</button>
                 >农历</button>
             </div>
             </div>
         </div>
         </div>
@@ -69,7 +69,6 @@
         
         
         <!-- 操作按钮 -->
         <!-- 操作按钮 -->
         <div class="birthday-actions">
         <div class="birthday-actions">
-            <button class="birthday-action-btn cancel-btn" @click="cancelBirthday">取消</button>
             <button class="birthday-action-btn save-btn" @click="saveBirthday">保存</button>
             <button class="birthday-action-btn save-btn" @click="saveBirthday">保存</button>
         </div>
         </div>
     </div>
     </div>
@@ -88,22 +87,14 @@ export default {
     },
     },
     data() {
     data() {
         return {
         return {
-            birthdayType: 0, // 0公历 1农历
-            birthdayMonth: new Date().getMonth() + 1, // 默认当前月份
-            birthdayDate: new Date().getDate(), // 默认当前日期
+            lunar: 0, // 0公历 1农历
+            birthdayMonth:1, // 默认当前月份
+            birthdayDate:1, // 默认当前日期
             dateArray: [], // 日期数组
             dateArray: [], // 日期数组
-            originalBirthday: {}, // 原始生日信息,用于取消操作
         }
         }
     },
     },
     watch: {
     watch: {
-        customId: {
-            immediate: true,
-            handler(val) {
-                if (val) {
-                    this.getCustomBirthday()
-                }
-            }
-        }
+
     },
     },
     created() {
     created() {
         // 初始化日期数组为1-31
         // 初始化日期数组为1-31
@@ -111,40 +102,9 @@ export default {
     },
     },
     methods: {
     methods: {
         showBirth(info){
         showBirth(info){
-            console.log(info)
-        },
-        // 获取客户生日信息
-        getCustomBirthday() {
-            if (!this.customId) {
-                uni.showToast({
-                    title: '请先选择客户',
-                    icon: 'none'
-                })
-                return
-            }
-            
-            // 这里应该调用API获取客户生日信息
-            this.$api.member.getCustomDetail({id: this.customId}).then(res => {
-                if (res.code === 0) {
-                    const data = res.data
-                    // 保存原始生日信息,用于取消操作
-                    this.originalBirthday = {
-                        type: data.birthdayType || 0,
-                        month: data.birthdayMonth || 1,
-                        date: data.birthdayDate || 1
-                    }
-                    
-                    this.birthdayType = data.birthdayType || 0
-                    this.birthdayMonth = data.birthdayMonth || 1
-                    this.birthdayDate = data.birthdayDate || 1
-                    this.updateDateArray()
-                }
-            }).catch(err => {
-                uni.showToast({
-                    title: '获取客户信息失败',
-                    icon: 'none'
-                })
-            })
+            this.birthdayMonth = info.birthdayMonth
+            this.birthdayDate = info.birthdayDate
+            this.lunar = info.lunar
         },
         },
         // 更新日期数组
         // 更新日期数组
         updateDateArray() {
         updateDateArray() {
@@ -152,28 +112,19 @@ export default {
             this.dateArray = Array.from({length: 31}, (_, i) => i + 1)
             this.dateArray = Array.from({length: 31}, (_, i) => i + 1)
         },
         },
         // 保存生日信息
         // 保存生日信息
-        saveBirthday() {
-            if (!this.customId) return
-            
+        saveBirthday() {           
             const params = {
             const params = {
                 customId: this.customId,
                 customId: this.customId,
-                birthdayType: this.birthdayType,
+                lunar: this.lunar,
                 birthdayMonth: this.birthdayMonth,
                 birthdayMonth: this.birthdayMonth,
                 birthdayDate: this.birthdayDate
                 birthdayDate: this.birthdayDate
             }
             }
             modifyBirthday(params).then(res=>{
             modifyBirthday(params).then(res=>{
                 if(res.code == 1){
                 if(res.code == 1){
+                    this.$emit('refreshCustomInfo',this.customId)
                     this.$msg('修改成功')
                     this.$msg('修改成功')
                 }
                 }
             })
             })
-        },
-        // 取消修改
-        cancelBirthday() {
-            // 恢复原始值
-            this.birthdayType = this.originalBirthday.type
-            this.birthdayMonth = this.originalBirthday.month
-            this.birthdayDate = this.originalBirthday.date
-            this.$emit('cancel')
         }
         }
     }
     }
 };
 };

+ 7 - 1
hdPad/src/pages/home/custom.vue

@@ -11,13 +11,15 @@
             <view class="custom-info">
             <view class="custom-info">
                 <customInfo ref="customInforRef" :selectCustomId="selectCustomId" @goBalance="goBalance" @changeBirthday="changeBirthday"></customInfo>
                 <customInfo ref="customInforRef" :selectCustomId="selectCustomId" @goBalance="goBalance" @changeBirthday="changeBirthday"></customInfo>
             </view>
             </view>
+
             <view class="custom-asset" v-if="showIndex == 0"></view>
             <view class="custom-asset" v-if="showIndex == 0"></view>
             <view class="custom-asset" v-if="showIndex == 1">
             <view class="custom-asset" v-if="showIndex == 1">
                 <balanceChange ref="balanceChangeRef" :customId="selectCustomId"></balanceChange>
                 <balanceChange ref="balanceChangeRef" :customId="selectCustomId"></balanceChange>
             </view>
             </view>
             <view class="custom-asset" v-if="showIndex == 2">
             <view class="custom-asset" v-if="showIndex == 2">
-                <birthdayEdit ref="birthRef" :customId="selectCustomId"></birthdayEdit>
+                <birthdayEdit ref="birthRef" :customId="selectCustomId" @refreshCustomInfo="refreshCustomInfo"></birthdayEdit>
             </view>
             </view>
+
         </view>
         </view>
     </view>
     </view>
 </view>
 </view>
@@ -48,6 +50,10 @@ export default {
     watch: {
     watch: {
     },
     },
     methods: {
     methods: {
+        refreshCustomInfo(id){
+            this.showIndex = 0
+            this.$refs.customInforRef.getCustomDetail(this.selectCustomId)
+        },
         changeBirthday(info){
         changeBirthday(info){
             this.showIndex = 2
             this.showIndex = 2
             this.$nextTick(() => {
             this.$nextTick(() => {