Browse Source

Merge branch 'master' of http://124.70.211.186:3000/zxh/prsx-crm

xiaohaizhao 4 months ago
parent
commit
8098490b63

+ 6 - 2
app.json

@@ -93,7 +93,10 @@
                 "hospital/Surgery/update",
                 "select/area/index",
                 "select/task/index",
-                "calendar/index"
+                "calendar/index",
+                "calendar/task/index",
+                "calendarN/index",
+                "calendar/task/detail"
             ]
         },
         {
@@ -168,7 +171,8 @@
         "van-checkbox-group": "@vant/weapp/checkbox-group/index",
         "van-transition": "@vant/weapp/transition/index",
         "viewDate": "/components/viewDate/index",
-        "filtrate": "/components/filtrate/filtrate"
+        "filtrate": "/components/filtrate/filtrate",
+        "personnel": "/components/personnel/index"
     },
     "tabBar": {
         "custom": true,

+ 4 - 1
components/Yl_field/index.js

@@ -297,6 +297,7 @@ Component({
     },
     /* 单选 选择器改变 */
     radioChange(e) {
+      console.log(e,'输出111')
       let item = e.currentTarget.dataset.item,
         index = this.data.form.findIndex(v => v.valueName == item.valueName);
       if (this.data.form[index].value == e.detail) return;
@@ -304,6 +305,8 @@ Component({
         [`form[${index}].value`]: e.detail,
         [`form[${index}].error`]: false,
       });
+      this.confirm();
+      console.log(item.interrupt,this.data.form[index],this.data.form,item)
       if (item.interrupt) this.triggerEvent("interrupt", {
         data: this.data.form[index],
         form: this.data.form,
@@ -312,7 +315,7 @@ Component({
           index
         }
       });
-      this.confirm();
+      
     },
     /* 提交 */
     submit() {

+ 198 - 0
components/personnel/index.js

@@ -0,0 +1,198 @@
+const _Http = getApp().globalData.http;
+Component({
+  properties: {
+    isdep: {
+      type: Boolean,
+      value: true
+    },
+    isusers: {
+      type: Boolean,
+      value: true
+    },
+    defaultMy: {
+      type: Boolean,
+      value: true
+    },
+    exclution: {
+      type: Boolean,
+      value: true
+    },
+    dimissionF: {
+      type: Boolean
+    },
+    defaultIsleave: {
+      type: [Number, String],
+      value: 0
+    }
+  },
+  data: {
+    takeEffect: "", //生效筛选项
+    result: {
+      name: ""
+    },
+    users: {
+      active: {}
+    },
+    isleave: 1,
+    tabs: [{
+      value: 0,
+      name: "全部"
+    }, {
+      value: 1,
+      name: "在职"
+    }, {
+      value: 2,
+      name: "离职"
+    }],
+    searchValue: "",
+    depGroud: []
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+    }
+  },
+  methods: {
+    userList() {
+      const nowUserid = wx.getStorageSync('userMsg').userid
+      const userid = this.data.users.active != nowUserid ? this.data.users.active : nowUserid
+
+      console.log(wx.getStorageSync('userMsg').userid)
+      console.log(userid,'userid555')
+      this.setData({
+        'users.active':userid
+      })
+      _Http.basic({
+        "id": 2025122211095302,
+        "content": {}
+      }).then(res => {
+        console.log(res,'数据222')
+        res.data.unshift({
+          name:"我",
+          userid: 2800
+        })
+        this.setData({
+          'users.list':res.data
+        })
+      })
+    },
+    searchChange({
+      detail
+    }) {
+      console.log('输出底层', detail)
+      if (detail.length == 0) return this.searchClear()
+      let list = JSON.parse(JSON.stringify(this.data.users.copyList));
+      this.setData({
+        'users.list': list.filter(v => v.name.includes(detail) || v.accountno.includes(detail))
+      })
+    },
+    searchClear() {
+      this.setData({
+        'users.list': JSON.parse(JSON.stringify(this.data.users.copyList))
+      })
+    },
+    changLeave(e) {
+      this.setData({
+        isleave: e.currentTarget.dataset.value,
+        'result.isleave': e.currentTarget.dataset.value
+      })
+      console.log("result", this.data.result)
+      this.initDepAndUser(false);
+    },
+    initDepAndUser(init = true) {
+      if (init) this.setData({
+        takeEffect: "", //生效筛选项
+        result: {},
+      })
+      let content = {
+        isleave: this.data.isleave
+      }
+      return new Promise((resolve) => {
+        _Http.basic({
+          "id": 20230620102004,
+          content
+        }).then(res => {
+          console.log("获取部门", res)
+          if (this.data.isdep && this.data.depGroud.length == 0) this.setData({
+            depGroud: [{
+              label: "部门",
+              list: res.data.dep,
+              active: ""
+            }]
+          })
+          console.log("depGroud", this.data.depGroud)
+          console.log("result", this.data.result)
+          console.log("active", this.data.active)
+
+          if (this.data.isusers) {
+            let active = this.data.users.active;
+            if (this.data.defaultMy && this.data.result.name == '') {
+              let user = res.data.hr.find(v => v.userid == wx.getStorageSync('userMsg').userid)
+              if (user) {
+                active = user.userid;
+                resolve(user)
+                this.setData({
+                  takeEffect: "user",
+                  result: user
+                })
+              } else {
+                this.setData({
+                  takeEffect: "",
+                  result: {}
+                })
+              }
+            }
+            this.setData({
+              users: {
+                label: "业务员",
+                list: res.data.hr,
+                copyList: res.data.hr,
+                active
+              }
+            })
+          }
+          if (init) this.setData({
+            isleave: this.data.defaultIsleave
+          })
+          resolve({})
+        })
+      })
+    },
+    selectDep(e) {
+      const {
+        item,
+        index
+      } = e.currentTarget.dataset;
+      let depGroud = this.data.depGroud.slice(0, index + 1);
+      depGroud[index].active = item.sa_saleareaid;
+      if (item.subdep.length) {
+        item.subdep.unshift(JSON.parse(JSON.stringify(item)))
+        item.subdep[0].depname = getApp().globalData.Language.getMapText('全部');
+        item.subdep[0].subdep = [];
+        depGroud.push({
+          label: item.depname + getApp().globalData.Language.getMapText('下级部门'),
+          list: item.subdep,
+          active: item.sa_saleareaid
+        })
+      }
+      item.name = item.depname
+      item.isleave = this.data.isleave;
+      this.setData({
+        depGroud,
+        takeEffect: "dep",
+        result: item
+      })
+    },
+    selectUser(e) {
+      console.log(e,'输出3333')
+      const {
+        item
+      } = e.currentTarget.dataset;
+      this.setData({
+        'users.active': item.userid,
+        takeEffect: "user",
+        result: item
+      })
+    },
+  }
+})

+ 3 - 0
components/personnel/index.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 119 - 0
components/personnel/index.scss

@@ -0,0 +1,119 @@
+/* components/personnel/index.wxss */
+.groud {
+  width: 100%;
+  padding: 30rpx;
+  border-bottom: 1px solid #DDDDDD;
+  overflow: hidden;
+
+  .title {
+      display: flex;
+      justify-content: space-between;
+      box-sizing: border-box;
+
+      .label {
+          height: 40rpx;
+          font-size: 28rpx;
+          font-family: PingFang SC-Regular, PingFang SC;
+          color: #333333;
+      }
+
+      .tabs-box {
+          display: flex;
+          align-items: center;
+          height: 50rpx;
+          background: #F5F5F5;
+          border-radius: 30rpx;
+          padding: 4rpx;
+          background-color: #F5F5F5;
+          box-sizing: content-box;
+          margin-right: 50rpx;
+
+          .item {
+              font-size: 24rpx;
+              font-family: PingFang SC-Regular, PingFang SC;
+              color: #FFFFFF;
+              height: 42rpx;
+              line-height: 42rpx;
+              padding: 0 16rpx;
+              background-color: #F5F5F5;
+              color: #999999;
+              border-radius: 26rpx;
+              box-sizing: border-box;
+          }
+
+          .active {
+              background-color: #3874F6;
+              color: #FFFFFF;
+              transition: color 0.3s;
+          }
+      }
+  }
+
+
+
+
+  .content {
+      display: flex;
+      flex-wrap: wrap;
+      width: 100%;
+
+      .but {
+          min-width: 188rpx;
+          height: 72rpx;
+          background: #F5F5F5;
+          border-radius: 8rpx;
+          font-size: 28rpx;
+          font-family: PingFang SC-Regular, PingFang SC;
+          color: #333333;
+          margin-right: 20rpx;
+          margin-top: 20rpx;
+          padding: 0 20rpx;
+          box-sizing: border-box;
+      }
+
+      .active {
+          border: 1px solid #3874F6;
+          color: #3874F6;
+          font-weight: bold;
+          background-color: #F5F5F5;
+      }
+  }
+
+
+  .time {
+      .partition {
+          margin-right: 20rpx;
+          display: flex;
+          align-items: center;
+      }
+
+      .tbox {
+          width: 220rpx;
+          height: 72rpx;
+          text-align: center;
+          line-height: 72rpx;
+          background: #F5F5F5;
+          border-radius: 8rpx;
+          font-size: 28rpx;
+          font-family: PingFang SC-Regular, PingFang SC;
+          color: #333333;
+          box-sizing: border-box;
+          margin-right: 20rpx;
+          margin-top: 20rpx;
+      }
+  }
+}
+
+.exclution {
+  opacity: .7;
+
+  .content {
+      .active {
+          border: 0px solid #3874F6;
+          color: #333333;
+          font-weight: bold;
+          background-color: #F5F5F5;
+      }
+  }
+
+}

+ 19 - 0
components/personnel/index.wxml

@@ -0,0 +1,19 @@
+<!--components/personnel/index.wxml-->
+<!-- 人员筛选 -->
+<view  class="groud {{exclution && takeEffect != 'user'? 'exclution' : ''}}" wx:key="label">
+    <view class="title" style="align-items: center;">
+        <view class="label">
+            {{'业务员日历'}}
+        </view>
+        <view class="tabs-box" style="margin-right: 20rpx;">
+            <van-search value="{{ searchValue }}" shape='round' bind:change='searchChange' bind:clear='searchClear' placeholder="{{language['搜索姓名/账号']||'搜索姓名/账号'}}" />
+        </view>
+    </view>
+    <view class="content">
+        <van-button custom-class='but {{item.userid == users.active?" active":""}}' 
+        wx:for="{{users.list}}" wx:key="userid" data-item="{{item}}" bindtap="selectUser">{{item.name}} {{item.userid}}</van-button>
+    </view>
+</view>
+
+
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 5 - 1
components/wx-calendar/index.js

@@ -87,6 +87,10 @@ Component({
         checkedShow: {
             type: Boolean,
             value: true
+        },
+        user_show: {
+          type: Boolean,
+          value: false
         }
     },
     data: {
@@ -116,7 +120,7 @@ Component({
         _selDay: null,
         _selWeek: 0,
         _rects: [],
-        _today: {}
+        _today: {},
     },
     attached() {
         this._rectsLoading = true

+ 4 - 1
components/wx-calendar/index.json

@@ -1,4 +1,7 @@
 {
     "component": true,
-    "styleIsolation": "isolated"
+    "styleIsolation": "isolated",
+    "options": {
+      "multipleSlots": true  
+    }
 }

+ 90 - 161
components/wx-calendar/index.wxml

@@ -1,174 +1,103 @@
 <wxs module="calendar_wxs" src="./index.wxs"></wxs>
 <view class="wd-calendar-container {{ darkmode ? 'darkmode' : '' }} {{ checkedShow ? '' : 'sel-hidden' }}" style="{{ style }}">
-    <view 
-        id="calendar" 
-        class="wd-calendar {{ !loading ? 'load' : '' }}" 
-        style="height: {{ view == 'week' ? minHeight : calendarHeight }}px;"
-        catchtransitionend="handleCalendarTransEnd"
-        mark:panel="{{ panelHeight }}"
-        mark:calendar="{{ calendarHeight }}"
-        mark:max="{{ maxHeight }}"
-        mark:min="{{ minHeight }}"
-        mark:view="{{ currView }}"
-        data-panel="{{ panelHeight }}"
-        data-calendar="{{ calendarHeight }}"
-        data-min="{{ minHeight }}">
-        <view class="wd-calendar-bar">
-            <view class="wd-calendar-title" data-info="{{ titleInfo }}" bindtap="{{ calendar_wxs.handleYearPanelShow }}">
-                <text >{{ months[currTab].year }}</text><text class="wd-calendar-title-cn">{{language['年']?',':'年'}}</text>
-                <text >{{ months[currTab].month }}</text>
-                <text class="wd-calendar-title-cn">{{language['月']?'':'月'}}</text>
+  <view id="calendar" class="wd-calendar {{ !loading ? 'load' : '' }}" style="height: {{ view == 'week' ? minHeight : calendarHeight }}px;" catchtransitionend="handleCalendarTransEnd" mark:panel="{{ panelHeight }}" mark:calendar="{{ calendarHeight }}" mark:max="{{ maxHeight }}" mark:min="{{ minHeight }}" mark:view="{{ currView }}" data-panel="{{ panelHeight }}" data-calendar="{{ calendarHeight }}" data-min="{{ minHeight }}">
+    <view class="wd-calendar-bar">
+      
+      <view class="wd-calendar-title" data-info="{{ titleInfo }}" bindtap="{{ calendar_wxs.handleYearPanelShow }}">
+        <text>{{ months[currTab].year }}</text><text class="wd-calendar-title-cn">{{language['年']?',':'年'}}</text>
+        <text>{{ months[currTab].month }}</text>
+        <text class="wd-calendar-title-cn">{{language['月']?'':'月'}}</text>
+      </view>
+      <view class="wd-calendar-options">
+        <view class="wd-calendar-option">
+          <view class="wd-calendar-option-it ">
+            <view class="wd-calendar-option-views today {{ tdOpShow ? 'show' : '' }}" catchtap="toToday">
+              <view class="wd-calendar-option-view">{{language['现在']||'今'}}</view>
             </view>
-            <view class="wd-calendar-options">
-                <view class="wd-calendar-option">
-                    <view class="wd-calendar-option-it ">
-                        <view class="wd-calendar-option-views today {{ tdOpShow ? 'show' : '' }}" catchtap="toToday">
-                            <view class="wd-calendar-option-view">{{language['现在']||'今'}}</view>
-                        </view>
-                    </view>
-                </view>
-                <view class="wd-calendar-option">
-                    <view class="wd-calendar-option-it">
-                        <view class="wd-calendar-option-views" catchtap="{{ calendar_wxs.toggleView }}">
-                            <view catchtransitionend="handleOpBarTransEnd" class="wd-calendar-option-view {{ (currView == 1 || currView == 3)? 'curr' : '' }}">{{language['月']||'月'}}</view>
-                            <view catchtransitionend="handleOpBarTransEnd" class="wd-calendar-option-view {{ currView == 2 ? 'curr' : '' }}">{{language['周']||'周'}}</view>
-                            <view class="wd-calendar-option-view-bar" style="transform: translateX({{ currView == 2 ? '70rpx' : 0 }}) translateZ(0px);"></view>
-                        </view>
-                    </view>
-                </view>
-            </view>
-        </view>
-        <view class="wd-calendar-week-bar">
-            <view class="wd-calendar-week-item" wx:for="{{ Weeks }}">{{language['周' + item] || item}}</view>
+          </view>
         </view>
-        <view 
-            class="wd-calendar-month-body {{ solidDay ? '' : 'solid' }}" 
-            change:weektabchange="{{ calendar_wxs.handleWeekSwiperChange }}" weektabchange="{{ weektabchange }}"
-            change:monthchange="{{ calendar_wxs.handleMonthChange }}" monthchange="{{ monthchange }}"
-            change:needInitTrans="{{ calendar_wxs.handleInitTrans }}" needInitTrans="{{ needInitTrans }}"
-            change:viewchange="{{ calendar_wxs.handleViewChange }}" viewchange="{{ viewchange }}"
-            bindtouchstart="{{ calendar_wxs.touchStart }}"
-            catchtouchmove="{{ calendar_wxs.touchMove }}" 
-            catchtouchend="{{ calendar_wxs.touchEnd }}">
-            <swiper circular duration="{{ 300 }}" current="{{ currTab }}" class="wd-calendar-swiper" bindanimationfinish="handleSwiperAniEnd">
-                <swiper-item
-                    wx:for="{{ months }}" 
-                    wx:for-item="month" 
-                    wx:for-index="mdx"
-                    skip-hidden-item-layout
-                    class="wd-calendar-swiper-item" >
-                    <view 
-                        class="wd-calendar-month-panel {{ currTab === mdx ? 'curr' : 'other' }}" 
-                        style="height: {{ panelHeight }}px;min-height: {{ panelHeight }}px;"
-                        data-trans="{{ month.trans }}">
-                        <view 
-                            wx:if="{{ month.bar.s && currTab === mdx && checkedShow }}"
-                            class="wd-calendar-day-sel {{ barAni ? '' : 'no-ani' }} {{ month.bar.t ? 'today' : '' }} " 
-                            style="top: {{ month.bar.y }};left: {{ month.bar.x }}px;" >
-                            <view class="wd-calendar-day-sel-bar {{ month.bar.a ? 'animation' : '' }}" bindanimationend="handleSelBarAniEnd"></view>
-                        </view>
-                        <view 
-                            class="wd-calendar-week-row l-{{ month.days.length }}" 
-                            wx:for="{{ month.days }}" 
-                            wx:for-item="w" 
-                            wx:for-index="wdx" >
-                            <view 
-                                wx:for="{{ w.days }}" 
-                                wx:for-item="d" 
-                                wx:for-index="ddx"
-                                class="wd-calendar-day {{ d.type }} {{ d.isToday ? 'today' : ''  }} {{ ((wdx * 7 + ddx) == month.bar.i && currTab === mdx) ? 'curr' : '' }}" 
-                                catchtap="selDate"
-                                data-wdx="{{ wdx }}"
-                                data-ddx="{{ ddx }}">
-                                <view class="wd-calendar-gregorian {{ (currView != 3 && d.marker && d.marker.schedule.length > 0) ? 'dot' : '' }}">
-                                    <text>{{ d.day }}</text>
-                                    <view 
-                                        class="wd-calendar-gregorian-corner" 
-                                        wx:if="{{ d.marker && d.marker.corner.length > 0 }}"
-                                        style="{{ d.marker.corner[0].color ? 'color:' + d.marker.corner[0].color + ';' : '' }}"
-                                        >{{ d.marker.corner[0].mark }}</view>
-                                </view>
-                                <view class="wd-calendar-solar {{ d.lunar_type }}">
-                                    <text 
-                                        wx:if="{{ d.marker && d.marker.holiday.length > 0 }}"
-                                        style="color: {{ d.marker.corner[0].color ? d.marker.corner[0].color : '#2a97ff' }};">{{ d.marker.holiday[0].mark }}</text>
-                                    <text wx:elif="{{languagecode == 'ZH'}}">{{d.lunar_day}}</text>
-                                    <view class="wd-calendar-schedules" wx:if="{{ d.marker && d.marker.schedule.length > 0 }}">
-                                        <view 
-                                            class="wd-calendar-schedule"
-                                            style="{{ d.marker.schedule[0].color ? 'color:' + d.marker.schedule[0].color + ';' : '' }}{{ d.marker.schedule[0].bgColor ? 'background-color:' + d.marker.schedule[0].bgColor + ';' : '' }}">{{ d.marker.schedule[0].mark }}</view>
-                                        <view class="wd-calendar-schedule-more" wx:if="{{ d.marker.schedule.length - 1 > 0 }}">+{{ d.marker.schedule.length - 1 }}</view>
-                                    </view>
-                                </view>
-                            </view>
-                        </view>
-                    </view>
-                </swiper-item>
-            </swiper>
+        <view class="wd-calendar-option">
+          <view class="wd-calendar-option-it">
+            <view class="wd-calendar-option-views" catchtap="{{ calendar_wxs.toggleView }}">
+              <view catchtransitionend="handleOpBarTransEnd" class="wd-calendar-option-view {{ (currView == 1 || currView == 3)? 'curr' : '' }}">{{language['月']||'月'}}</view>
+              <view catchtransitionend="handleOpBarTransEnd" class="wd-calendar-option-view {{ currView == 2 ? 'curr' : '' }}">{{language['周']||'周'}}</view>
+              <view class="wd-calendar-option-view-bar" style="transform: translateX({{ currView == 2 ? '70rpx' : 0 }}) translateZ(0px);"></view>
+            </view>
+          </view>
         </view>
-        <view 
-            class="wd-calendar-bt-bar"
-            bindtouchstart="{{ calendar_wxs.touchStart }}"
-            catchtouchmove="{{ calendar_wxs.touchMove }}" 
-            catchtouchend="{{ calendar_wxs.touchEnd }}">
-            <view class="wd-calendar-bt-control">
-                <view class="wd-calendar-bt-control-item" >
-                    <view class="wd-calendar-bt-control-bar" id="control_1"></view>
+      </view>
+    </view>
+    <view class="wd-calendar-week-bar">
+      <view class="wd-calendar-week-item" wx:for="{{ Weeks }}">{{language['周' + item] || item}}</view>
+    </view>
+    <view class="wd-calendar-month-body {{ solidDay ? '' : 'solid' }}" change:weektabchange="{{ calendar_wxs.handleWeekSwiperChange }}" weektabchange="{{ weektabchange }}" change:monthchange="{{ calendar_wxs.handleMonthChange }}" monthchange="{{ monthchange }}" change:needInitTrans="{{ calendar_wxs.handleInitTrans }}" needInitTrans="{{ needInitTrans }}" change:viewchange="{{ calendar_wxs.handleViewChange }}" viewchange="{{ viewchange }}" bindtouchstart="{{ calendar_wxs.touchStart }}" catchtouchmove="{{ calendar_wxs.touchMove }}" catchtouchend="{{ calendar_wxs.touchEnd }}">
+      <swiper circular duration="{{ 300 }}" current="{{ currTab }}" class="wd-calendar-swiper" bindanimationfinish="handleSwiperAniEnd">
+        <swiper-item wx:for="{{ months }}" wx:for-item="month" wx:for-index="mdx" skip-hidden-item-layout class="wd-calendar-swiper-item">
+          <view class="wd-calendar-month-panel {{ currTab === mdx ? 'curr' : 'other' }}" style="height: {{ panelHeight }}px;min-height: {{ panelHeight }}px;" data-trans="{{ month.trans }}">
+            <view wx:if="{{ month.bar.s && currTab === mdx && checkedShow }}" class="wd-calendar-day-sel {{ barAni ? '' : 'no-ani' }} {{ month.bar.t ? 'today' : '' }} " style="top: {{ month.bar.y }};left: {{ month.bar.x }}px;">
+              <view class="wd-calendar-day-sel-bar {{ month.bar.a ? 'animation' : '' }}" bindanimationend="handleSelBarAniEnd"></view>
+            </view>
+            <view class="wd-calendar-week-row l-{{ month.days.length }}" wx:for="{{ month.days }}" wx:for-item="w" wx:for-index="wdx">
+              <view wx:for="{{ w.days }}" wx:for-item="d" wx:for-index="ddx" class="wd-calendar-day {{ d.type }} {{ d.isToday ? 'today' : ''  }} {{ ((wdx * 7 + ddx) == month.bar.i && currTab === mdx) ? 'curr' : '' }}" catchtap="selDate" data-wdx="{{ wdx }}" data-ddx="{{ ddx }}">
+                <view class="wd-calendar-gregorian {{ (currView != 3 && d.marker && d.marker.schedule.length > 0) ? 'dot' : '' }}">
+                  <text>{{ d.day }}</text>
+                  <view class="wd-calendar-gregorian-corner" wx:if="{{ d.marker && d.marker.corner.length > 0 }}" style="{{ d.marker.corner[0].color ? 'color:' + d.marker.corner[0].color + ';' : '' }}">{{ d.marker.corner[0].mark }}</view>
                 </view>
-                <view class="wd-calendar-bt-control-item" >
-                    <view class="wd-calendar-bt-control-bar" id="control_2"></view>
+                <view class="wd-calendar-solar {{ d.lunar_type }}">
+                  <text wx:if="{{ d.marker && d.marker.holiday.length > 0 }}" style="color: {{ d.marker.corner[0].color ? d.marker.corner[0].color : '#2a97ff' }};">{{ d.marker.holiday[0].mark }}</text>
+                  <text wx:elif="{{languagecode == 'ZH'}}">{{d.lunar_day}}</text>
+                  <view class="wd-calendar-schedules" wx:if="{{ d.marker && d.marker.schedule.length > 0 }}">
+                    <view class="wd-calendar-schedule" style="{{ d.marker.schedule[0].color ? 'color:' + d.marker.schedule[0].color + ';' : '' }}{{ d.marker.schedule[0].bgColor ? 'background-color:' + d.marker.schedule[0].bgColor + ';' : '' }}">{{ d.marker.schedule[0].mark }}</view>
+                    <view class="wd-calendar-schedule-more" wx:if="{{ d.marker.schedule.length - 1 > 0 }}">+{{ d.marker.schedule.length - 1 }}</view>
+                  </view>
                 </view>
+              </view>
             </view>
+          </view>
+        </swiper-item>
+      </swiper>
+    </view>
+    <view class="wd-calendar-bt-bar" bindtouchstart="{{ calendar_wxs.touchStart }}" catchtouchmove="{{ calendar_wxs.touchMove }}" catchtouchend="{{ calendar_wxs.touchEnd }}">
+      <view class="wd-calendar-bt-control">
+        <view class="wd-calendar-bt-control-item">
+          <view class="wd-calendar-bt-control-bar" id="control_1"></view>
+        </view>
+        <view class="wd-calendar-bt-control-item">
+          <view class="wd-calendar-bt-control-bar" id="control_2"></view>
         </view>
+      </view>
+    </view>
 
-        <view class="wd-calendar-years-panel {{ yearPanelShow ? 'show' : '' }}">
-            <view class="wd-calendar-bar">
-                <view class="wd-calendar-title show ym" data-info="{{languagecode=='ZH' ? yearMs[currYmTab].lunar_year : '' }}">
-                    <text >{{ yearMs[currYmTab].year }}</text><text wx:if="{{languagecode=='ZH'}}" class="wd-calendar-title-cn margin-left">年</text>
+    <view class="wd-calendar-years-panel {{ yearPanelShow ? 'show' : '' }}">
+      <view class="wd-calendar-bar">
+        <view class="wd-calendar-title show ym" data-info="{{languagecode=='ZH' ? yearMs[currYmTab].lunar_year : '' }}">
+          <text>{{ yearMs[currYmTab].year }}</text><text wx:if="{{languagecode=='ZH'}}" class="wd-calendar-title-cn margin-left">年</text>
+        </view>
+      </view>
+      <view class="wd-calendar-years-panel-body">
+        <swiper circular duration="{{ 300 }}" current="{{ currYmTab }}" class="wd-calendar-ym-swiper" bindanimationfinish="handleYmSwiperAniEnd">
+          <swiper-item wx:for="{{ yearMs }}" wx:for-item="year" wx:for-index="ydx" skip-hidden-item-layout class="wd-calendar-ym-swiper-item">
+            <view class="wd-calendar-ym-months">
+              <view class="wd-calendar-ym-row" wx:for="{{ 3 }}" wx:for-item="mr" wx:for-index="mrdx">
+                <view wx:for="{{ 4 }}" wx:for-item="m" wx:for-index="mdx" class="wd-calendar-ym-month {{ year.months[mrdx * 4 + mdx].curr ? 'curr' : '' }}" bindtap="handleYearPanelDayClick" data-year="{{ year.year }}" data-month="{{ year.months[mrdx * 4 + mdx].month }}">
+                  <view class="wd-calendar-ym-month-contaner">
+                    <view class="wd-calendar-ym-m-r">
+                      <view class="wd-calendar-ym-m {{languagecode=='ZH'?'':'wd-calendar-ym-m-EN'}}">{{ year.months[mrdx * 4 + mdx].month }}</view>
+                    </view>
+                    <view wx:for="{{ year.months[mrdx * 4 + mdx].lunar }}" wx:for-item="l" wx:for-index="idx" class="wd-calendar-ym-l">
+                      <view class="wd-calendar-ym-l-i"><text data-order="{{ l.order }}">{{ l.day }}</text></view>
+                      <view class="wd-calendar-ym-l-i"><text>{{ l.lunar }}</text></view>
+                    </view>
+                  </view>
                 </view>
+              </view>
             </view>
-            <view class="wd-calendar-years-panel-body">
-                <swiper 
-                    circular
-                    duration="{{ 300 }}"
-                    current="{{ currYmTab }}" 
-                    class="wd-calendar-ym-swiper" 
-                    bindanimationfinish="handleYmSwiperAniEnd">
-                    <swiper-item
-                        wx:for="{{ yearMs }}" 
-                        wx:for-item="year" 
-                        wx:for-index="ydx"
-                        skip-hidden-item-layout
-                        class="wd-calendar-ym-swiper-item" >
-                        <view class="wd-calendar-ym-months">
-                            <view class="wd-calendar-ym-row" wx:for="{{ 3 }}" wx:for-item="mr" wx:for-index="mrdx" >
-                                <view 
-                                    wx:for="{{ 4 }}" 
-                                    wx:for-item="m" 
-                                    wx:for-index="mdx"
-                                    class="wd-calendar-ym-month {{ year.months[mrdx * 4 + mdx].curr ? 'curr' : '' }}"
-                                    bindtap="handleYearPanelDayClick"
-                                    data-year="{{ year.year }}"
-                                    data-month="{{ year.months[mrdx * 4 + mdx].month }}">
-                                    <view class="wd-calendar-ym-month-contaner">
-                                        <view class="wd-calendar-ym-m-r">
-                                            <view class="wd-calendar-ym-m {{languagecode=='ZH'?'':'wd-calendar-ym-m-EN'}}">{{ year.months[mrdx * 4 + mdx].month }}</view>
-                                        </view> 
-                                        <view wx:for="{{ year.months[mrdx * 4 + mdx].lunar }}" wx:for-item="l" wx:for-index="idx" class="wd-calendar-ym-l" >
-                                            <view class="wd-calendar-ym-l-i"><text data-order="{{ l.order }}">{{ l.day }}</text></view>
-                                            <view class="wd-calendar-ym-l-i"><text >{{ l.lunar }}</text></view>
-                                        </view>
-                                    </view>
-                                </view>
-                            </view>
-                        </view>
-                    </swiper-item>
-                </swiper>
-            </view>
-        </view>
+          </swiper-item>
+        </swiper>
+      </view>
     </view>
-    <view class="wd-calendar-content">
-        <slot></slot>
-    </view>
-</view>
-
+  </view>
+  <view class="wd-calendar-content">
+    <slot></slot>
+  </view>
+</view>

+ 12 - 0
node_modules/.package-lock.json

@@ -0,0 +1,12 @@
+{
+  "name": "prsx-crm",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {
+    "node_modules/@vant/weapp": {
+      "version": "1.10.3",
+      "resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.10.3.tgz",
+      "integrity": "sha512-CcG5umI+zlJRN6hQXPeknOenPkVm6WBEgBaB6Y94kOmKLx9NHtHBdURwxuJEA4q4mxhUdOuf6sV7I8tZBnCVxw=="
+    }
+  }
+}

+ 9 - 3
package-lock.json

@@ -1,8 +1,14 @@
 {
+  "name": "prsx-crm",
+  "lockfileVersion": 3,
   "requires": true,
-  "lockfileVersion": 1,
-  "dependencies": {
-    "@vant/weapp": {
+  "packages": {
+    "": {
+      "dependencies": {
+        "@vant/weapp": "^1.10.3"
+      }
+    },
+    "node_modules/@vant/weapp": {
       "version": "1.10.3",
       "resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.10.3.tgz",
       "integrity": "sha512-CcG5umI+zlJRN6hQXPeknOenPkVm6WBEgBaB6Y94kOmKLx9NHtHBdURwxuJEA4q4mxhUdOuf6sV7I8tZBnCVxw=="

+ 239 - 130
prsx/calendar/index.js

@@ -1,49 +1,127 @@
+const _Http = getApp().globalData.http
 Page({
   data: {
-    currentMonth: '2025-12',
-    selectedDate: '2025-12-15',
     viewMode: 'month', // month / week
-    
-    tasks: [
-      { id: 1, title: '参加扬州大学附属医院产品推介会', date: '2025-12-15' },
-      { id: 2, title: '跟台上海天伦医院手术3场', date: '2025-12-15' }
-    ],
-    records: [
-      { id: 1, title: '参加扬州大学附属医院产品推介会', date: '2025-12-15' },
-      { id: 2, title: '跟台上海天伦医院手术3场', date: '2025-12-15' }
-    ],
     currentDate: '', // 当前选择的日期
     currentYear: '', // 当前显示的年份
     currentMonth: '', // 当前显示的月份
     weekdays: ['日', '一', '二', '三', '四', '五', '六'],
     days: [], // 当前月份的日期数组
     selectedDate: '', // 格式:'2025-04-05'
-
+    prevList: [],
+    currentList: [],
+    nextList: [],
+    userid: '',
+    prev_year: '',
+    prev_month: '',
+    next_year: '',
+    next_month: '',
+    taskData: [],
+    followData: [],
+    nowday: '',
+    types: [{
+      value: '新建任务',
+      name: '新建任务',
+    }, {
+      value: '新建跟进',
+      name: '新建跟进',
+    }],
+    actionShow: false,
+    canlendar_name:'我',
+    showFiltrate:false
   },
 
   onLoad() {
-    // this.generateCalendar();
-    // this.updateCalendar(new Date());
     const now = new Date();
     const year = now.getFullYear();
     const month = now.getMonth() + 1; // 月份从 0 开始
     const today = this.formatDate(now);
+    const prev_year = month == 1 ? year - 1 : year
+    const prev_month = month == 1 ? 12 : month - 1
+    const next_year = month == 12 ? year + 1 : year
+    const next_month = month == 12 ? 1 : month + 1
+
+    const userid = wx.getStorageSync('userMsg').userid
 
     this.setData({
-      selectedDate: today
+      selectedDate: today,
+      userid: userid,
+      currentYear: year,
+      currentMonth: month,
+      prev_year,
+      prev_month,
+      next_year,
+      next_month,
+      nowday: today
     });
+    // this.prevData()
 
-    this.renderCalendar(year, month);
   },
-   // 格式化日期为 YYYY-MM-DD
-   formatDate(date) {
+  async prevData() {
+    console.log('prevData')
+    let prevList = []
+    _Http.basic({
+      "id": 2025122210193402,
+      "content": {
+        "year": this.data.prev_year,
+        "month": this.data.prev_month,
+        "taskUserid": this.data.userid,
+      },
+    }).then(res => {
+      prevList = res.data
+      console.log(prevList)
+      this.currentData()
+      this.setData({
+        prevList
+      })
+    })
+  },
+  async currentData() {
+    let currentList = []
+    _Http.basic({
+      "id": 2025122210193402,
+      "content": {
+        "year": this.data.currentYear,
+        "month": this.data.currentMonth,
+        "taskUserid": this.data.userid,
+      },
+    }).then(res => {
+      currentList = res.data
+      console.log(currentList)
+      this.nextData()
+      this.setData({
+        currentList
+      })
+    })
+  },
+  async nextData() {
+    let nextList = []
+    _Http.basic({
+      "id": 2025122210193402,
+      "content": {
+        "year": this.data.next_year,
+        "month": this.data.next_month,
+        "taskUserid": this.data.userid,
+      },
+    }).then(res => {
+      nextList = res.data
+      console.log(nextList)
+      this.setData({
+        nextList
+      })
+      this.renderCalendar(this.data.currentYear, this.data.currentMonth);
+    })
+  },
+  // 格式化日期为 YYYY-MM-DD
+  formatDate(date) {
     const y = date.getFullYear();
     const m = String(date.getMonth() + 1).padStart(2, '0');
     const d = String(date.getDate()).padStart(2, '0');
     return `${y}-${m}-${d}`;
   },
   // 渲染日历
-  renderCalendar(year, month) {
+  async renderCalendar(year, month) {
+    console.log(this.data.selectedDate, '选择日期2025')
     const today = this.formatDate(new Date());
     const selected = this.data.selectedDate;
 
@@ -57,43 +135,49 @@ Page({
     for (let i = firstDay - 1; i >= 0; i--) {
       const day = prevMonthDays - i;
       const fullDate = this.formatDate(new Date(year, month - 2, day));
+      // 默认值
+      let hasTask = false;
+      let hasFollow = false;
+
+      // 如果 daysData 包含当前日期,则更新 hasTask 和 hasFollow
+      if (this.data.prevList[fullDate]) {
+        hasTask = Array.isArray(this.data.prevList[fullDate].task) && this.data.prevList[fullDate].task.length > 0;
+        hasFollow = Array.isArray(this.data.prevList[fullDate].follow) && this.data.prevList[fullDate].follow.length > 0;
+      }
+      if (this.data.prevList[this.data.selectedDate]) {
+        this.setData({
+          taskData: this.data.prevList[this.data.selectedDate].task,
+          followData: this.data.prevList[this.data.selectedDate].follow
+        })
+      }
       days.push({
         day,
-        type: 'other',
+        type: 'current',
         fullDate,
-        isToday: false,
-        isSelected: false
+        isSelected: fullDate === selected,
+        hasTask,
+        hasFollow
       });
     }
 
     // 本月
     for (let i = 1; i <= daysInMonth; i++) {
       const fullDate = this.formatDate(new Date(year, month - 1, i));
-      const daysData = {
-        '2026-01-06':{
-          follow:[
-            {followobj:'经销商'},
-            {followobj:'临床'}
-          ],
-          task:[]
-        },
-        '2026-01-08':{
-          follow:[
-            {followobj:'经销商'},
-            {followobj:'临床'}
-          ],
-          task:[]
-        },
-      }
       // 默认值
-    let hasTask = false;
-    let hasFollow = false;
+      let hasTask = false;
+      let hasFollow = false;
 
-    // 如果 daysData 包含当前日期,则更新 hasTask 和 hasFollow
-    if (daysData[fullDate]) {
-      hasTask = Array.isArray(daysData[fullDate].task) && daysData[fullDate].task.length > 0;
-      hasFollow = Array.isArray(daysData[fullDate].follow) && daysData[fullDate].follow.length > 0;
-    }
+      // 如果 daysData 包含当前日期,则更新 hasTask 和 hasFollow
+      if (this.data.currentList[fullDate]) {
+        hasTask = Array.isArray(this.data.currentList[fullDate].task) && this.data.currentList[fullDate].task.length > 0;
+        hasFollow = Array.isArray(this.data.currentList[fullDate].follow) && this.data.currentList[fullDate].follow.length > 0;
+      }
+      if (this.data.currentList[this.data.selectedDate]) {
+        this.setData({
+          taskData: this.data.currentList[this.data.selectedDate].task,
+          followData: this.data.currentList[this.data.selectedDate].follow
+        })
+      }
       days.push({
         day: i,
         type: 'current',
@@ -110,121 +194,146 @@ Page({
     const remaining = totalCells - days.length;
     for (let i = 1; i <= remaining; i++) {
       const fullDate = this.formatDate(new Date(year, month, i));
+      // 默认值
+      let hasTask = false;
+      let hasFollow = false;
+
+      // 如果 daysData 包含当前日期,则更新 hasTask 和 hasFollow
+      if (this.data.nextList[fullDate]) {
+        hasTask = Array.isArray(this.data.nextList[fullDate].task) && this.data.nextList[fullDate].task.length > 0;
+        hasFollow = Array.isArray(this.data.nextList[fullDate].follow) && this.data.nextList[fullDate].follow.length > 0;
+      }
+      if (this.data.nextList[this.data.selectedDate]) {
+        this.setData({
+          taskData: this.data.nextList[this.data.selectedDate].task,
+          followData: this.data.nextList[this.data.selectedDate].follow
+        })
+      }
       days.push({
         day: i,
-        type: 'other',
+        type: 'current',
         fullDate,
-        isToday: false,
-        isSelected: false
+        isSelected: fullDate === selected,
+        hasTask,
+        hasFollow
       });
     }
-
+    if (!this.data.selectedDate) {
+      this.setData({
+        taskData: [],
+        followData: []
+      })
+    }
     this.setData({
       currentYear: year,
       currentMonth: month,
-      days
+      days,
+      today
     });
   },
   // 切换月份
   onMonthChange(e) {
     const [year, month] = e.detail.value.split('-').map(Number);
-    this.renderCalendar(year, month);
+    const prev_year = month == 1 ? year - 1 : year
+    const prev_month = month == 1 ? 12 : month - 1
+    const next_year = month == 12 ? year + 1 : year
+    const next_month = month == 12 ? 1 : month + 1
+    console.log(prev_year, prev_month, next_year, next_month)
+    this.setData({
+      selectedDate: '',
+      currentYear: year,
+      currentMonth: month,
+      prev_year,
+      prev_month,
+      next_year,
+      next_month
+    });
+    this.prevData()
+    // this.renderCalendar(year, month);
   },
 
   // 点击日期
   onDayTap(e) {
-    const fullDate = e.currentTarget.dataset.date;
-    this.setData({ selectedDate: fullDate });
+    const fullDate =  e.currentTarget.dataset.date;
+    this.setData({
+      selectedDate: fullDate
+    });
     // 重新渲染以更新 isSelected
     this.renderCalendar(this.data.currentYear, this.data.currentMonth);
   },
-  
-  updateCalendar(date) {
-    const year = date.getFullYear();
-    const month = date.getMonth() + 1; // 获取月份(从0开始)
-    const firstDayOfMonth = new Date(year, month - 1, 1).getDay(); // 当月第一天是星期几
-    const totalDaysInMonth = new Date(year, month, 0).getDate(); // 当月总天数
-
-    let days = [];
-    // 添加上个月末尾的空白天数
-    for (let i = 0; i < firstDayOfMonth; i++) {
-      days.push({ day: '', type: 'empty' });
-    }
-    // 添加当月的天数
-    for (let i = 1; i <= totalDaysInMonth; i++) {
-      days.push({ day: i, type: 'day' });
-    }
-
+  onShow(){
+    this.prevData()
+  },
+  goToday() {
+    // const today = new Date().toISOString().split('T')[0];
+    const now = new Date();
+    const year = now.getFullYear();
+    const month = now.getMonth() + 1; // 月份从 0 开始
+    const today = this.formatDate(now);
+    const prev_year = month == 1 ? year - 1 : year
+    const prev_month = month == 1 ? 12 : month - 1
+    const next_year = month == 12 ? year + 1 : year
+    const next_month = month == 12 ? 1 : month + 1
     this.setData({
-      currentDate: `${year}-${String(month).padStart(2, '0')}`,
+      selectedDate: today,
       currentYear: year,
       currentMonth: month,
-      days: days
+      prev_year,
+      prev_month,
+      next_year,
+      next_month,
+      nowday: today
     });
+    this.prevData()
   },
-
-  generateCalendar() {
-    const { currentMonth } = this.data;
-    const year = parseInt(currentMonth.split('-')[0]);
-    const month = parseInt(currentMonth.split('-')[1]) - 1;
-
-    const date = new Date(year, month, 1);
-    const firstDay = date.getDay(); // 0=Sun, 1=Mon...
-    const daysInMonth = new Date(year, month + 1, 0).getDate();
-
-    let days = [];
-    // 填充前面空格
-    for (let i = 0; i < firstDay; i++) {
-      days.push({ day: '', date: '', isCurrent: false, hasTask: false });
-    }
-
-    // 填充当月日期
-    for (let i = 1; i <= daysInMonth; i++) {
-      const currentDate = `${year}-${String(month + 1).padStart(2, '0')}-${String(i).padStart(2, '0')}`;
-      const hasTask = this.data.tasks.some(t => t.date === currentDate);
-      const isCurrent = currentDate === this.data.selectedDate;
-
-      days.push({
-        day: i,
-        date: currentDate,
-        isCurrent,
-        hasTask,
-        taskCount: this.data.tasks.filter(t => t.date === currentDate).length
-      });
-    }
-
-    this.setData({ days });
+  onSelect() {
+    this.setData({
+      actionShow: true
+    })
   },
-
-  bindDateChange(e) {
-    // const value = e.detail.value;
-    // this.setData({ currentMonth: value });
-    // this.generateCalendar();
-    const selectedDate = e.detail.value.split('-');
-    const year = parseInt(selectedDate[0], 10);
-    const month = parseInt(selectedDate[1], 10);
-    this.updateCalendar(new Date(year, month - 1));
+  /* 选择合作协议类型 */
+  selectType({
+    detail
+  }) {
+    console.log(detail.value,'选择')
+    if (detail.value) {
+      wx.navigateTo({
+      url: '/prsx/calendar/task/index?select=' + this.data.selectedDate,
+    })
+    }
+    this.onCancel();
   },
-
-  goToday() {
-    const today = new Date().toISOString().split('T')[0];
-    this.setData({ currentMonth: today.substring(0, 7), selectedDate: today });
-    this.generateCalendar();
+  /* 取消选择合作协议类型 */
+  onCancel() {
+    this.setData({
+      actionShow: false
+    })
   },
-
-  switchView(e) {
-    const mode = e.currentTarget.dataset.view;
-    this.setData({ viewMode: mode });
+  filtrateShow() { 
+    this.setData({
+      showFiltrate:true
+    })
+    let page = this.selectComponent("#personnel")
+    page.userList()
   },
-
-  onDayClick(e) {
-    const date = e.currentTarget.dataset.date;
-    this.setData({ selectedDate: date });
+  handleFilter({
+    detail
+  }){
+    console.log('shuchu',detail)
+    let page = this.selectComponent("#personnel")
+    console.log(page.data.result,'555')
+    console.log(page.data.users.active,'输出active')
+    this.setData({
+      canlendar_name:page.data.result.name,
+      userid:page.data.result.userid
+    })
+    this.prevData()
   },
-
-  addNew() {
+  taskSelect(item){
+    console.log('选中',item)
+    let data = item.currentTarget.dataset.data
     wx.navigateTo({
-      url: '../add/add'
-    });
+      url: '/prsx/calendar/task/detail?id=' + data.sys_taskid
+  })
   }
 });

+ 66 - 17
prsx/calendar/index.scss

@@ -43,7 +43,7 @@
   padding: 20rpx;
   background-color: white;
   border-bottom: 1rpx solid #e5e5e5;
-  margin: 0 20rpx 0 20rpx;
+  margin: 0 ;
 }
 
 .select-date {
@@ -57,7 +57,6 @@
 }
 
 .btn-today, .btn-month, .btn-week {
-  padding: 10rpx 20rpx;
   border-radius: 20rpx;
   font-size: 28rpx;
   background-color: #007AFF;
@@ -121,11 +120,11 @@
 }
 
 .section {
-  margin: 20rpx;
   background-color: white;
   border-radius: 10rpx;
   padding: 20rpx;
   box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.1);
+  margin: 20rpx 10rpx 20rpx 10rpx;
 }
 
 .section-title {
@@ -175,13 +174,14 @@
 }
 
 .calendar-container {
-  padding: 20rpx;
+  padding: 0rpx;
   background-color: #f5f5f5;
+  margin-bottom: 50rpx;
 }
 
 .calendar-header {
   text-align: center;
-  font-size: 36rpx;
+  font-size: 32rpx;
   margin-bottom: 20rpx;
   color: #333;
 }
@@ -203,7 +203,7 @@
 
 .calendar-grid view {
   text-align: center;
-  padding: 8px;
+  padding: 5rpx;
 }
 
 .calendar-grid .empty {
@@ -224,23 +224,26 @@
   justify-content: center;
   align-items: center;
   margin-top: 4rpx;
-  height: 5rpx;
+  height: 4rpx;
 }
 
-.dot {
-  font-size: 20rpx;
-  line-height: 1;
-  margin: 0 2rpx;
+.dots-container {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-top: 2rpx;
+  height: 2rpx; /* 可选:减小容器高度 */
 }
 
-
-.task-dot {
-  color: #ff3b30; /* 红色 - 任务 */
+.circle {
+  width: 2rpx;        /* 原来是 8rpx,现在更小 */
+  height: 2rpx;       /* 同步缩小 */
+  border-radius: 100%;
+  margin: 0 2rpx;     /* 左右间距也稍微缩小 */
 }
 
-.followup-dot {
-  color: #007AFF; /* 蓝色 - 跟进 */
-}
+.task-circle { background-color: #ff3b30; }
+.followup-circle { background-color: #007AFF; }
 
 /* 当前月日期 */
 .day.current {
@@ -264,4 +267,50 @@
   background-color: #E7E9F0 !important;
   
   font-weight: bold;
+}
+
+.today.active {
+  background:#007AFF
+}
+.today.unactive {
+  background:gray
+}
+.display-style{
+  display: flex;
+  justify-content: left;
+}
+.display-style-between{
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 10rpx;
+}
+
+
+.footer {
+  display: flex;
+  justify-content: space-around;
+  width: 100%;
+  box-sizing: border-box;
+  padding: 10rpx;
+  box-shadow: rgba(0, 0, 0, 0.1) 0px -2px 8rpx;
+
+  .v-but {
+      width: 190rpx;
+      height: 90rpx;
+      background: #FFFFFF;
+      border-radius: 8rpx;
+      border: 1px solid #CCCCCC;
+      font-size: 28rpx;
+      font-family: PingFang SC-Regular, PingFang SC;
+      color: #666666;
+  }
+
+  .confirm {
+      border: none;
+      background: #3874F6;
+      font-size: 28rpx;
+      font-family: PingFang SC-Bold, PingFang SC;
+      font-weight: bold;
+      color: #FFFFFF;
+  }
 }

+ 40 - 26
prsx/calendar/index.wxml

@@ -1,14 +1,19 @@
 <view class="container">
   <!-- 日历头部 -->
   <view class="calendar-header">
-    <picker mode="date" fields="month" value="{{currentDate}}" bindchange="onMonthChange">
-      <view>{{currentYear}}年{{currentMonth}}月</view>
-    </picker>
-    <!-- <view class="calendar-controls">
-      <button class="btn-today" bindtap="goToday">今</button>
-      <button class="btn-month" bindtap="switchView" data-view="month">月</button>
-      <button class="btn-week" bindtap="switchView" data-view="week">周</button>
-    </view> -->
+    <view class="display-style">
+      <view class="iconfont  icon-webxialaxuanxiangjiantou" />
+      <view bind:tap="filtrateShow">{{canlendar_name}}的日历</view>
+    </view>
+    <view class="display-style">
+      <view class="iconfont  icon-webxialaxuanxiangjiantou" />
+      <picker mode="date" fields="month" value="{{currentDate}}" bindchange="onMonthChange">
+        <view>{{currentYear}}-{{currentMonth}}</view>
+      </picker>
+    </view>
+    <view>
+      <button class="btn-today today {{selectedDate == nowday ? 'active' : 'unactive'}}" bindtap="goToday">今</button>
+    </view>
   </view>
 
   <view class="calendar-container">
@@ -24,11 +29,10 @@
       <block wx:for="{{days}}" wx:key="index">
         <view class="day {{item.type}} {{item.isSelected ? 'selected' : ''}} {{item.isToday ? 'today' : ''}}" data-date="{{item.fullDate}}" bindtap="{{item.type === 'current' ? 'onDayTap' : ''}}">
           <text>{{ item.day }}</text>
-          <!-- <text>{{'数据'}}</text> -->
           <!-- 任务和跟进标记容器 -->
-          <view class="dots-container" >
-            <!-- <text  class="dot task-dot">•</text> -->
-            <text  class="dot followup-dot" style="line-height: 1;margin-top: 1rpx;">•</text>
+          <view class="dots-container">
+            <view wx:if="{{item.hasTask}}" class="circle task-circle"></view>
+            <view wx:if="{{item.hasFollow}}" class="circle followup-circle"></view>
           </view>
         </view>
       </block>
@@ -36,25 +40,35 @@
   </view>
 
   <!-- 任务列表 -->
-  <view class="section">
-    <view class="section-title">任务</view>
-    <view class="section-date">{{ selectedDate }}</view>
-    <view wx:for="{{ tasks }}" wx:key="id" class="task-item">
+  <view class="section" wx:if="{{taskData && taskData.length > 0}}">
+    <view class="display-style-between">
+      <view class="section-title">任务</view>
+      <view class="section-date">{{ selectedDate }}</view>
+    </view>
+    <view wx:for="{{ taskData }}" wx:key="id" class="task-item" data-data="{{ item }}" bindtap="taskSelect">
       <text class="task-text">{{ item.title }}</text>
     </view>
   </view>
 
   <!-- 跟进记录 -->
-  <view class="section">
-    <view class="section-title">跟进记录</view>
-    <view class="section-date">{{ selectedDate }}</view>
-    <view wx:for="{{ records }}" wx:key="id" class="record-item">
-      <text class="record-text">{{ item.title }}</text>
+  <view class="section" wx:if="{{followData && followData.length > 0}}">
+    <view class="display-style-between">
+      <view class="section-title">跟进记录</view>
+      <view class="section-date">{{ selectedDate }}</view>
+    </view>
+    <view wx:for="{{ followData }}" wx:key="id" class="record-item">
+      <text class="record-text">{{ item.followobj == '临床' ? item.hospitalname : item.agentsname }}</text>
     </view>
   </view>
+  <My_empty wx:if="{{followData.length == 0  && taskData.length == 0 }}" />
+</view>
+<!-- 浮动按钮 -->
+<Yl_FloatingButton bindtap="onSelect" />
+<van-action-sheet show="{{ actionShow }}" actions="{{ types }}" cancel-text="{{language['取消']||'取消'}}" bind:select='selectType' bind:cancel='onCancel' bind:click-overlay='onCancel' />
 
-  <!-- 添加按钮 -->
-  <view class="add-btn" bindtap="addNew">
-    <text>+</text>
-  </view>
-</view>
+
+
+<!-- <organization slot='head' defaultIsleave='1' dimissionF id='organization' /> -->
+<Yl_Filtrate1 id="Yl_Filtrate1" show='{{showFiltrate}}' list="{{[]}}" bindhandle="handleFilter" isReset="{{false}}">
+  <personnel id="personnel"  />
+</Yl_Filtrate1>

+ 239 - 0
prsx/calendar/task/detail.js

@@ -0,0 +1,239 @@
+const _Http = getApp().globalData.http
+Page({
+    data: {
+        loading: true,
+        isLeader: false, //是否为负责人
+        tabsActive: 0, //tabs 选中项
+        sys_taskid: 0,
+        sColors: getApp().globalData.sColors
+    },
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').wdoctors;
+
+        let tabsList = [{
+            label: "附件",
+            icon: "icon-tabfujian1",
+            model: "#Files"
+        }, {
+            label: "操作",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Record"
+        }];
+        if (appAuth.isdatafollowup) {
+            tabsList.unshift({
+                label: "跟进动态",
+                icon: "icon-tabgenjinjilu",
+                model: "#Trace"
+            })
+        }
+        console.log("appAuth", appAuth)
+        this.setData({
+          sys_taskid: options.id,
+            tabsList,
+            appAuth
+        })
+        this.getDetail();
+        getApp().globalData.Language.getLanguagePackage(this);
+    },
+
+    /* 获取详情 */
+    getDetail() {
+        /* 基本信息 */
+        _Http.basic({
+            "id": 2025122210022002,
+            "content": {
+              sys_taskid: this.data.sys_taskid
+            },
+        }).then(res => {
+            console.log("详情", res)
+            if (res.code != '1') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            this.setPreview(res);
+            this.setData({
+                loading: false,
+                detail: res.data,
+            })
+            let page = this.selectComponent("#Trace")
+            page.getList("", true)
+            //获取标签
+            // this.setTabbar();
+            // this.partialRenewal();
+        });
+    },
+
+    setPreview(res) {
+        /* 摘要信息 */
+        let briefs = [];
+
+        this.setData({
+            briefs,
+        });
+    },
+    //详情按钮回调
+    tabbarOnClick({
+        detail
+    }) {
+        let data = JSON.parse(JSON.stringify(this.data.detail)),
+            that = this;
+        switch (detail.label) {
+            case "编辑":
+                data.sa_customersid = data.enterprisename ? [data.enterprisename, [data.sa_customersid]] : "";
+                wx.navigateTo({
+                    url: `/prsx/doctors/insert?data=${JSON.stringify(data)}`,
+                })
+                break;
+            case "跟进":
+                that.selectComponent("#Trace").toAdd()
+                break;
+            case "删除":
+                wx.showModal({
+                    content: `是否确定删除'${data.hospitaldepname}'?`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "content": {
+                                "sys_taskid": data.sys_taskid
+                            },
+                            "id": 2025102116480402
+                        }).then(res => {
+                            console.log("删除医生", res)
+                            wx.showToast({
+                                title: res.code != '1' ? res.msg : '删除成功',
+                                icon: "none",
+                                mask: res.code == '1'
+                            })
+                            if (res.code != '1') return;
+                            setTimeout(() => {
+                                wx.navigateBack()
+                            }, 300)
+                        })
+                    }
+                })
+                break;
+            case "更换负责人":
+                wx.navigateTo({
+                    url: `/pages/group/select?data=${JSON.stringify({
+                         ownertable:"sa_doctor",
+                         ownerid:this.data.sys_taskid,
+                    })}&radio=true&principal=true`,
+                })
+                break;
+            default:
+                console.log(detail)
+                break;
+        }
+    },
+    /* 更换负责人 */
+    handelSubmit(arr) {
+        const that = this;
+        wx.showModal({
+            title: getApp().globalData.Language.getMapText('提示'),
+            content: getApp().globalData.Language.getMapText('是否确认更换负责人'),
+            complete: ({
+                confirm
+            }) => {
+                if (confirm) wx.showModal({
+                    title: getApp().globalData.Language.getMapText('提示'),
+                    content: getApp().globalData.Language.getMapText('是否参与该数据的后续工作'),
+                    cancelText: getApp().globalData.Language.getMapText('不参与'),
+                    confirmText: getApp().globalData.Language.getMapText('参与'),
+                    complete: (s) => {
+                        _Http.basic({
+                            "id": 20220930103701,
+                            "content": {
+                                ownertable: "sa_doctor",
+                                ownerid: that.data.sys_taskid,
+                                userid: arr[0],
+                                isaddoldleader: s.confirm ? 1 : 0
+                            }
+                        }).then(res => {
+                            console.log("更换负责人", res)
+                            if (res.code != '1') return wx.showToast({
+                                title: res.data,
+                                icon: "none"
+                            });
+                            wx.showToast({
+                                title: getApp().globalData.Language.getMapText('更换成功'),
+                                icon: "none",
+                                mask: true
+                            });
+                            getCurrentPages().forEach(v => {
+                                if (['packageA/setclient/index'].includes(v.__route__)) v.getList(true)
+                            })
+                            setTimeout(() => {
+                                wx.navigateBack({
+                                    delta: 2
+                                });
+                            }, 300)
+                        })
+                    }
+                })
+            }
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        let model = this.data.tabsList[this.data.tabsActive].model;
+        if (model) {
+            let Component = this.selectComponent(model),
+                {
+                    total,
+                    pageNumber,
+                    pageTotal
+                } = Component.data.content,
+                id = model == "#Clue" ? this.data.detail.sys_taskid : this.data.detail.sys_enterpriseid;
+            if (model == "#Files") init = true;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                Component.getList(id, false);
+            }
+        }
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags()
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList().then(this.setTabbarList)
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    onUnload() {
+        getCurrentPages().forEach(page => {
+            if (page.__route__ == 'prsx/doctors/index') {
+                let content = JSON.parse(JSON.stringify(page.data.content));
+                content.pageSize = (content.pageNumber - 1) * content.pageSize;
+                content.pageNumber = 1;
+                _Http.basic({
+                    id: '2025102208523002',
+                    content
+                }).then(res => {
+                    console.log("更新医生列表", res);
+                    if (res.code == '1') {
+                        page.setData({
+                            list: res.data,
+                            "content.total": res.total
+                        })
+                    }
+                })
+            } else if (page.__route__ == 'prsx/department/detail') {
+                page.selectComponent("#Doctors").getList(page.data.detail.sa_hospitaldepid, true)
+            } else if (page.__route__ == 'prsx/hospital/detail') {
+                page.selectComponent("#Doctors").getList('', true)
+            }
+        })
+    }
+})

+ 6 - 0
prsx/calendar/task/detail.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+      "Trace": "/prsx/trace/index"
+  },
+  "navigationBarTitleText": "任务详情"
+}

+ 66 - 0
prsx/calendar/task/detail.scss

@@ -0,0 +1,66 @@
+.setclient-list-item {
+	width: 100vw;
+	background-color: #fff;
+	box-sizing: border-box;
+
+	.con {
+		padding-left: 30rpx;
+		display: flex;
+		width: 100%;
+		box-sizing: border-box;
+		padding-top: 20rpx;
+
+		.mian {
+			flex: 1;
+			width: 0;
+			padding-right: 20rpx;
+			box-sizing: border-box;
+
+			.label {
+				font-size: 28rpx;
+				font-family: PingFang SC-Bold, PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				height: 40rpx;
+				line-height: 40rpx;
+			}
+
+			.tag-box {
+				margin-top: 10rpx;
+
+				.tag {
+					height: 40rpx;
+					font-size: 20rpx;
+					font-family: PingFang SC-Regular, PingFang SC;
+					padding: 0 12rpx;
+					margin-right: 8rpx;
+				}
+			}
+		}
+
+		.icon {
+			display: flex;
+			height: 136rpx;
+			align-items: center;
+			margin-top: -20rpx;
+			color: #CFCFCF;
+			width: 28rpx;
+			margin-right: 30rpx;
+			flex-shrink: 0;
+		}
+
+		.extend {
+			display: flex;
+			height: 116rpx;
+			width: 48rpx;
+			margin-right: 30rpx;
+			flex-shrink: 0;
+		}
+	}
+}
+
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}

+ 26 - 0
prsx/calendar/task/detail.wxml

@@ -0,0 +1,26 @@
+<view class="setclient-list-item" url="#">
+    <view class="con">
+        <view class="mian">
+            <view class="label line-1" style="font-size: 35rpx;">{{detail.title}}</view>
+            <view style="margin-top: 20rpx;color: rgb(194, 188, 188);font-size: 26rpx;">{{detail.taskdate}}</view>
+            <view style="margin-top: 20rpx;">{{detail.contenttext}}</view>
+        </view>
+    </view>
+</view>
+<view style="margin-top: -16rpx;">
+    <Yl_Detail list="{{briefs}}">
+      <view>{{detail.taskdate}}</view>
+    </Yl_Detail>
+</view>
+<view style="height: 20rpx;" />
+<!-- 功能 -->
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+    <!-- <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' /> -->
+    <Trace resource="行事历" slot='跟进动态' id='Trace' ownertable='sys_task' ownerid='{{sys_taskid}}' disabled="{{false}}"  />
+    <Record slot="操作" id="Record" ownertable='sys_task' ownerid='{{sys_taskid}}' />
+    <Files slot="附件" id="Files" ownertable='sys_task' ownerid='{{sys_taskid}}' disabled="{{detail.status != '已终止'}}" />
+</Yl_FunTabs>
+<view style="height: 80rpx;" />
+<!-- 底部 -->
+<!-- <Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" /> -->
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 126 - 0
prsx/calendar/task/index.js

@@ -0,0 +1,126 @@
+let _Http = getApp().globalData.http,
+    count = null;
+
+Page({
+    data: {
+        loading: false,
+        showAll: false,
+        repetitionShow: false,
+        repetitionList: [],
+        content: {
+          "begindate": "",
+          "enddate": "",
+        },
+        disabled: true,
+    },
+    onLoad(options) {
+        console.log(options)
+        let form = [{
+            label: "标题",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "标题名称",
+            valueName: "title",
+            checking: "base",
+            slot: "info",
+            required: true
+        }, {
+            label: "内容",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "内容",
+            valueName: "contenttext",
+            checking: "base",
+            required: false
+        }]
+        if (options.data) {
+            let data = JSON.parse(options.data);
+            form = form.map(v => {
+                v.value = data[v.valueName] || "";
+                return v
+            })
+            this.setData({
+                disabled: false,
+                content: {
+                    sa_hospitaldepid: data.sa_hospitaldepid,
+                },
+                form
+            })
+        } else if (options.sa_customersid) {
+            let item = form.find(v => v.label == '所属医院')
+            item.value = [options.name, [options.sa_customersid]];
+            item.disabled = true;
+        }
+        this.setData({
+            form,
+            content:{
+              begindate:options.select,
+              enddate:options.select
+            }
+        })
+        getApp().globalData.Language.getLanguagePackage(this, options.data ? '编辑任务' : '新建 '+ options.select + ' 的任务');
+
+    },
+    /* 表单必填项是否完成 */
+    onConfirm({
+        detail
+    }) {
+        this.setData({
+            disabled: detail
+        })
+    },
+    // 是否显示全部
+    onChange({
+        detail
+    }) {
+        this.setData({
+            showAll: detail
+        })
+    },
+    async submit() {
+        this.setData({
+            loading: true
+        })
+        let data = this.selectComponent("#Form").submit(),
+            content = this.data.content
+        _Http.basic({
+            "id": 2025122209075802,
+            "content": {
+                ...content,
+                ...data,
+            }
+        }).then(res => {
+            this.setData({
+                loading: false
+            })
+            wx.showToast({
+                title: res.code != '1' ? res.msg : '保存成功',
+                icon: "none",
+                mask: res.code == '1'
+            })
+            if (res.code != '1') return;
+            getCurrentPages().forEach(v => {
+              console.log(v,'v的数据')
+                switch (v.route) {
+                    case 'prsx/calendar/task/index':
+                        v.onChange(this.data.content.begindate)
+                        break;
+                }
+            })
+            setTimeout(() => {
+                // if (content.sa_hospitaldepid == 0) {
+                //     wx.redirectTo({
+                //         url: '/prsx/department/detail?id=' + res.data.sa_hospitaldepid,
+                //     })
+                // } else {
+                //     wx.navigateBack()
+                // }
+                wx.navigateBack()
+            }, 300)
+        })
+    },
+})

+ 3 - 0
prsx/calendar/task/index.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 32 - 0
prsx/calendar/task/index.scss

@@ -0,0 +1,32 @@
+.new-footer {
+	display: flex;
+	align-items: center;
+	justify-content: flex-end;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	z-index: 999;
+
+	.new-submit {
+		width: 156rpx;
+		height: 90rpx;
+		border-radius: 8rpx;
+		font-size: 28rpx;
+		font-family: PingFang SC-Bold, PingFang SC;
+		font-weight: bold;
+		color: #FFFFFF;
+		margin-right: 30rpx;
+	}
+
+	.blue {
+		background: #3874F6;
+	}
+
+	.orange {
+		background: #F29C37;
+	}
+
+}

+ 8 - 0
prsx/calendar/task/index.wxml

@@ -0,0 +1,8 @@
+<Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
+<Yl_field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm' bind:interrupt='interrupt' />
+<view style="height: 160rpx;" />
+<view class="new-footer" style="padding-bottom:12rpx;">
+	<van-button custom-class="new-submit {{content.sa_hospitaldepid ? 'orange' : 'blue' }}" disabled='{{disabled ||loading}}' loading='{{loading}}' bindclick='submit'>
+		{{content.sa_hospitaldepid ? '保存' : '确定'}}
+	</van-button>
+</view>

+ 75 - 0
prsx/calendarN/index.js

@@ -0,0 +1,75 @@
+const _Http = getApp().globalData.http
+Component({
+  properties: {
+
+  },
+  data: {
+    nowDate: '',
+    markers: [],
+  },
+  methods: {
+    handleCalendarLoad(e) {
+      // 1. 拿到今日日期 把年月记录到data中
+      // 2. 获取当月数据给日期打标记
+      // 3. 获取当日数据
+      let page = this.selectComponent("#calendar")
+      console.log("加载", e)
+      let date = e.detail.date
+      let nowDate = this.formatDate(date.year, date.month, date.day)
+      this.setData({
+        nowDate
+      })
+      console.log(this.data.nowDate)
+    },
+    handleCalendarDateChange(e) {
+      console.log("切换日期", e)
+      let date = e.detail.date
+      _Http.basic({
+        "id": "2025122210193402",
+        content: {
+          "year": date.year,
+          "month": date.month,
+          "taskUserid": 2800,
+        }
+      }).then(res => {
+        console.log('获取日期', res.data)
+        let obj = res.data
+        let arry = []
+        for (let key in obj) {
+          if (obj.hasOwnProperty(key)) {
+            console.log(key);
+            console.log(obj[key])
+            const item = obj[key];
+            const hasFollow = Array.isArray(item.follow) && item.follow.length > 0;
+            const hasTask = Array.isArray(item.task) && item.task.length > 0;
+            if (hasFollow || hasTask) {
+              const date = new Date(key);
+              // 优先任务颜色
+              const isTask = hasTask;
+              arry.push({
+                year: date.getFullYear(),
+                month: date.getMonth() + 1, // number
+                day: date.getDate(), // number
+                type: 'corner', // 或 'schedule'
+                text: '●',
+                style: {
+                  color: isTask ? '#f5222d' : '#1890ff',
+                  fontSize: '10px'
+                }
+              })
+            }
+          }
+        }
+        // console.log(arry, 'arry888')
+        this.setData({
+          markers: arry
+        })
+      })
+      // 1. 获取当日数据  
+      // 2. 判断选中日的年月是否与data中的相同;不相同获取当月数据打标记
+    },
+    formatDate(y, m, d) {
+      return `${y}-${String(m).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
+    }
+  }
+})

+ 6 - 0
prsx/calendarN/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+      "calendar": "/components/wx-calendar/index"
+  }
+}

+ 33 - 0
prsx/calendarN/index.scss

@@ -0,0 +1,33 @@
+.section {
+	margin: 20rpx;
+	background-color: white;
+	border-radius: 10rpx;
+	padding: 20rpx;
+	box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
+
+	.section-title {
+		font-size: 32rpx;
+		color: #333;
+		margin-bottom: 10rpx;
+	}
+
+	.section-date {
+		font-size: 28rpx;
+		color: #999;
+		margin-bottom: 10rpx;
+	}
+}
+
+.task-item,
+.record-item {
+	margin-bottom: 15rpx;
+	padding: 15rpx;
+	border-left: 5rpx solid #ff3b30;
+	background-color: #fff8f8;
+	border-radius: 6rpx;
+}
+
+.record-item {
+	border-left-color: #007AFF;
+	background-color: #f0f8ff;
+}

+ 23 - 0
prsx/calendarN/index.wxml

@@ -0,0 +1,23 @@
+<view class="">
+	<calendar id="calendar" _vibrate='{{false}}' view='month' user_show='{{true}}' bindload="handleCalendarLoad" binddatechange="handleCalendarDateChange"  marks="{{markers}}">
+
+		<!-- 任务列表 -->
+		<view class="section">
+			<view class="section-title">任务</view>
+			<view class="section-date">{{ selectedDate }}</view>
+			<view wx:for="{{ tasks }}" wx:key="id" class="task-item">
+				<text class="task-text">{{ item.title }}</text>
+			</view>
+		</view>
+
+		<!-- 跟进记录 -->
+		<view class="section">
+			<view class="section-title">跟进记录</view>
+			<view class="section-date">{{ selectedDate }}</view>
+			<view wx:for="{{ records }}" wx:key="id" class="record-item">
+				<text class="record-text">{{ item.title }}</text>
+			</view>
+		</view>
+
+	</calendar>
+</view>

+ 1 - 1
prsx/dealer/detail.wxml

@@ -17,7 +17,7 @@
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Trace resource='经销商管理' slot='跟进动态' id='Trace' ownertable='sa_agents' ownerid='{{sys_enterpriseid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sa_agentsid}}' />
+    <Trace resource='经销商管理' slot='跟进动态' id='Trace' ownertable='sa_agents' ownerid='{{detail.sa_agentsid}}' disabled="{{false}}" ownerid1='{{detail.sa_agentsid}}' />
     <Salesperson slot='授权业务员' id="Salesperson" disabled="{{per.query(appAuth.options,'salesAuth')}}"></Salesperson>
     <Department slot='科室' id='Department'></Department>
     <Hospital slot='医院' id='Hospital'></Hospital>

+ 1 - 1
prsx/department/detail.wxml

@@ -17,7 +17,7 @@
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Trace resource='科室管理' slot='跟进动态' id='Trace' ownertable='sa_hospitaldep' ownerid='{{sa_hospitaldepid}}' ownerid1='{{detail.sys_enterpriseid}}' />
+    <Trace resource='科室管理' slot='跟进动态' id='Trace' disabled="{{false}}"  ownertable='sa_hospitaldep' ownerid='{{sa_hospitaldepid}}' ownerid1='{{detail.sys_enterpriseid}}' />
     <Doctors slot="医生" id='Doctors' disabled="{{isLeader && isAdmin}}"/>
     <Product slot="推荐产品" id='Product' disabled="{{isLeader && isAdmin}}" />
     <Dealer slot="关联经销商" id='Dealer' disabled="{{isLeader && isAdmin}}" />

+ 1 - 1
prsx/doctors/detail.wxml

@@ -18,7 +18,7 @@
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Trace resource='医生管理' slot='跟进动态' id='Trace' ownertable='sa_doctor' ownerid='{{sa_doctorid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sys_enterpriseid}}' />
+    <Trace resource='医生管理' slot='跟进动态' id='Trace' ownertable='sa_doctor' ownerid='{{sa_doctorid}}' disabled="{{false}}" ownerid1='{{detail.sys_enterpriseid}}' />
     <Record slot="操作" id="Record" ownertable='sa_doctor' ownerid='{{sa_doctorid}}' />
     <Files slot="附件" id="Files" ownertable='sa_doctor' ownerid='{{sa_doctorid}}' disabled="{{detail.status != '已终止'}}" />
 </Yl_FunTabs>

+ 1 - 1
prsx/hospital/detail.wxml

@@ -16,7 +16,7 @@
 <view style="height: 20rpx;" />
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
-  <Trace resource='医院管理' slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{sa_customersid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sys_enterpriseid}}' />
+  <Trace resource='医院管理' slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{sa_customersid}}' disabled="{{false}}" ownerid1='{{detail.sys_enterpriseid}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Department slot='科室' id='Department' disabled="{{isLeader}}" />
     <Doctors slot='医生' id='Doctors' disabled="{{isLeader}}" />

+ 1 - 1
prsx/select/task/index.wxml

@@ -11,7 +11,7 @@
 				<text>{{item.contenttext}}</text>
 			</view>
 			<view class="replenish1">
-				<text>{{item.begindate + '至' + item.enddate}}</text>
+				<text>{{item.begindate}}</text>
 			</view>
 		</view>
 	</navigator>

+ 185 - 102
prsx/trace/add/index.js

@@ -22,14 +22,12 @@ Page({
         ...options
       })
     };
-    console.log(options.resource, 'resource')
-    // this.formSet(options.resource)
-    if (options.resource == '医院管理' || options.resource == '科室管理' || options.resource == '医生管理' || options.resource == '经销商管理' || options.resource == '行事历') {
+    if (options.ownertable == 'sys_task') {
       this.setData({
         special: true
       })
+      this.formSet()
     }
-
     //编辑获取原信息,新建初始化模板
     if (options.sys_datafollowupid) {
       _Http.basic({
@@ -48,18 +46,42 @@ Page({
             wx.navigateBack()
           }, 300)
         };
-        // this.formSet(res.data.resource, res.data.type, '编辑', res.data)
-        // if (res.data.resource == '医院管理' || res.data.resource == '科室管理' || res.data.resource == '医生管理' || res.data.resource == '经销商管理' || res.data.resource == '行事历') {
-        //   this.setData({
-        //     special: true
-        //   })
-        // } else {
-          
-        // }
-        this.setData({
-          [`list[0].value`]: res.data.content,
-          resource: res.data.resource
-        })
+        if (options.ownertable == 'sys_task') {
+          let data = res.data;
+          data.sys_taskid = [data.tasktitle, [data.sys_taskid]]
+          if (res.data.followobj == '临床') {
+            data.sa_customersid = [data.hospitalname,[data.sa_customersid]]
+            data.sa_doctorid = [data.doctorname,[data.sa_doctorid]]
+            data.sa_hospitaldepid = [data.hospitaldepname,[data.sa_hospitaldepid]]
+            this.formSetNew(res.data.followobj)
+          }else {
+            data.sa_agentsid = [data.agentsname,[data.sa_agentsid]]
+            this.formSetNew(res.data.followobj)
+          }
+          let form = this.data.form.map(v => {
+            v.value = data[v.valueName];
+            if (v.label == '医生') {
+              v.disabled = false
+            }
+            return v
+          })
+          let list = this.data.list.map(k => {
+            k.value = data[k.key]
+            return k
+          })
+          console.log(form, 'form的数据')
+          this.setData({
+            form,
+            list,
+            resource: res.data.resource,
+            disabled: false
+          })
+        } else {
+          this.setData({
+            [`list[0].value`]: res.data.content,
+            resource: res.data.resource
+          })
+        }
         if (res.data.attinfos.length) this.selectComponent("#Yl_files").handleFiles(res.data.attinfos);
         this.data.content = Object.assign(res.data, options);
 
@@ -69,47 +91,8 @@ Page({
       this.data.content = options;
     }
   },
-  formSet(val, type_select, btn_type, datas) {
+  formSet() {
     let form = [{
-      label: "跟进类型",
-      error: false,
-      errMsg: "",
-      type: "option",
-      optionNmae: "hosfollowtype",
-      optionType: "radio", //复选   radio 单选
-      value: "",
-      placeholder: "跟进类型",
-      valueName: "type",
-      checking: "base",
-      required: true
-    }, {
-      label: "关联任务",
-      error: false,
-      errMsg: "",
-      type: "route",
-      url: "/prsx/select/task/index",
-      value: "",
-      placeholder: "任务",
-      valueName: "sys_taskid",
-      checking: "base",
-      required: false,
-      params: {
-        "content": {
-          "pageNumber": 1,
-          "pageSize": 20,
-          "where": {
-            "condition": ""
-          }
-        },
-        "id": 2025122309161202,
-      },
-      query: "&radio=true",
-    }, {
-      label: "推荐产品",
-      key: "products",
-      value: "",
-    }]
-    if (val == '医院管理' || val == '科室管理' || val == '医生管理') form.unshift({
       label: "跟进对象",
       error: false,
       errMsg: "",
@@ -127,36 +110,26 @@ Page({
       required: true, //必填
       direction: "horizontal",
       interrupt: true,
-      disabled: false
-    })
-
-    if(val == '经销商管理') form.unshift({
-      label: "跟进对象",
+    }, {
+      label: "跟进类型",
       error: false,
       errMsg: "",
-      hint: "",
-      type: "radio",
-      value: '',
-      radioList: [{
-        id: '临床',
-        name: '临床'
-      }, {
-        id: '经销商',
-        name: '经销商'
-      }],
-      valueName: "followobj", //绑定的字段名称
-      required: true, //必填
-      direction: "horizontal",
-      interrupt: true,
-      disabled: false
-    },{
-      label: "经销商",
+      type: "option",
+      optionNmae: "hosfollowtype",
+      optionType: "radio", //复选   radio 单选
+      value: "",
+      placeholder: "跟进类型",
+      valueName: "type",
+      checking: "base",
+      required: true
+    }, {
+      label: "关联任务",
       error: false,
       errMsg: "",
       type: "route",
-      url: "/prsx/select/dealer/index",
+      url: "/prsx/select/task/index",
       value: "",
-      placeholder: "经销商",
+      placeholder: "任务",
       valueName: "sys_taskid",
       checking: "base",
       required: false,
@@ -171,7 +144,11 @@ Page({
         "id": 2025122309161202,
       },
       query: "&radio=true",
-    })
+    }, {
+      label: "推荐产品",
+      valueName: "products",
+      value: "",
+    }]
 
     let list = [{
       label: "目的",
@@ -190,33 +167,139 @@ Page({
       key: "nextplan",
       value: "",
     }]
-    if (btn_type == '编辑') {
-      let data = datas;
-      form = form.map(v => {
-        v.value = data[v.valueName] || "";
-        return v
-      })
-      list = list.map(k => {
-        k.value = data[k.valueName] || "";
-        return k
-      })
-      form.find(v => v.label == '跟进对象').value = type_select
+    this.setData({
+      form,
+      list
+    })
+  },
+
+  formSetNew(followobj) {
+    console.log(followobj,'新的对象')
+    if (followobj == '临床') {
+      const existingJxsIndex = this.data.form.findIndex(item => item.label === "经销商");
+      if (existingJxsIndex !== -1) {
+        this.data.form.splice(existingJxsIndex, 1);
+      }
+      let lcForm = [{
+        label: "医院",
+        error: false,
+        errMsg: "",
+        type: "route",
+        url: "/prsx/select/hospital/index",
+        value: "",
+        placeholder: "医院",
+        valueName: "sa_customersid",
+        checking: "base",
+        required: true,
+        params: {
+          "content": {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+              "condition": ""
+            }
+          },
+          "id": 2025101409411402,
+        },
+        query: "&radio=true",
+      }, {
+        label: "医生",
+        error: false,
+        errMsg: "",
+        type: "route",
+        url: "/prsx/select/docter/index",
+        value: "",
+        placeholder: "医生",
+        valueName: "sa_doctorid",
+        checking: "base",
+        required: false,
+        params: {
+          "content": {
+            sa_customersid: 0,
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+              "condition": ""
+            }
+          },
+          "id": 2025102310134602,
+        },
+        query: "&radio=true",
+        disabled: true
+      }, {
+        label: "科室",
+        error: false,
+        errMsg: "",
+        type: "route",
+        value: "",
+        placeholder: "科室",
+        valueName: "sa_hospitaldepid",
+        checking: "base",
+        required: false,
+        query: "&radio=true",
+        disabled: true
+      }]
+      const followObjectIndex = this.data.form.findIndex(item => item.label === "跟进对象");
+      if (followObjectIndex !== -1) {
+        this.data.form.splice(followObjectIndex + 1, 0, ...lcForm);
+      }
     } else {
-      if (val == '医院管理' || val == '科室管理' || val == '医生管理') {
-        form.find(v => v.label == '跟进对象').value = '临床'
-        form.find(v => v.label == '跟进对象').disabled = true
-      }else if(val == '经销商'){
-        form.find(v => v.label == '跟进对象').value = '经销商'
-        form.find(v => v.label == '跟进对象').disabled = true
+      const existingJxsIndex = this.data.form.findIndex(item => item.label === "医院");
+      if (existingJxsIndex !== -1) {
+        this.data.form.splice(existingJxsIndex, 1);
+      }
+      existingJxsIndex = this.data.form.findIndex(item => item.label === "医生");
+      if (existingJxsIndex !== -1) {
+        this.data.form.splice(existingJxsIndex, 1);
+      }
+      existingJxsIndex = this.data.form.findIndex(item => item.label === "科室");
+      if (existingJxsIndex !== -1) {
+        this.data.form.splice(existingJxsIndex, 1);
+      }
+      let jxsForm = [{
+        label: "经销商",
+        error: false,
+        errMsg: "",
+        type: "route",
+        url: "/prsx/select/firm/index",
+        value: "",
+        placeholder: "经销商",
+        valueName: "sa_agentsid",
+        checking: "base",
+        required: true,
+        params: {
+          "content": {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+              "condition": ""
+            }
+          },
+          "id": 2025123116453802,
+        },
+        query: "&radio=true",
+      }]
+      const followObjectIndex = this.data.form.findIndex(item => item.label === "跟进对象");
+      if (followObjectIndex !== -1) {
+        this.data.form.splice(followObjectIndex + 1, 0, ...jxsForm);
       }
     }
-
-
     this.setData({
-      form,
-      list
+      form: this.data.form
     })
   },
+  interrupt(e) {
+    console.log(e, 'e的数据初始')
+    const {
+      data,
+      form,
+      temporary
+    } = e.detail;
+    console.log(data, form, temporary)
+    if (temporary.item.label == '跟进对象') {
+      this.formSetNew()
+    }
+  },
   /* 表单必填项是否完成 */
   onConfirm({
     detail

+ 6 - 5
prsx/trace/add/index.wxml

@@ -1,7 +1,8 @@
-<!-- <Yl_Headline title='跟进记录' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
-<Yl_field wx:if="{{special}}" id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm' />
+<Yl_Headline wx:if="{{special}}" title='跟进记录' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
+<Yl_field wx:if="{{special}}" id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm' 
+bind:interrupt='interrupt' />
 
-<view style="height: 20rpx;" /> -->
+<view style="height: 20rpx;" />
 <view>
   <view class="inputs" wx:for="{{list}}" wx:key="key" >
     <view class="label">
@@ -32,6 +33,6 @@
 </view>
 <view style="height: 130rpx;" />
 <view class="footer">
-    <van-button wx:if="{{special}}" custom-class='but' disabled='{{disabled || loading}}' loading='{{loading}}' bindclick="submit">{{language['确定']||'确定'}}</van-button>
-    <van-button wx:else="" custom-class='but' disabled='{{list[0].value.length==0 || loading}}' loading='{{loading}}' bindclick="submit">{{language['确定']||'确定'}}</van-button>
+    <van-button wx:if="{{special}}" custom-class='but' disabled='{{disabled}}' loading='{{loading}}' bindclick="submit">{{language['确定']||'确定'}}</van-button>
+    <van-button wx:else custom-class='but' disabled='{{list[0].value.length==0 || loading}}' loading='{{loading}}' bindclick="submit">{{language['确定']||'确定'}}</van-button>
 </view>

+ 132 - 67
prsx/trace/detail/index.js

@@ -1,73 +1,138 @@
 const _Http = getApp().globalData.http;
 
 Page({
-    data: {
-        ownertable: null,
-        ownerid: null,
-        sys_datafollowupid: null,
-        detail: {},
-        tabbarList: [{
-            icon: "color-bianji",
-            label: "编辑"
-        }, {
-            icon: "icon-shanchu",
-            label: "删除"
-        }],
-    },
-    onLoad(options) {
-        if (options.data) {
-            this.setData({
-                ...JSON.parse(options.data),
-                userid: wx.getStorageSync('userMsg').userid
-            })
-            this.getDetail();
-            getApp().globalData.Language.getLanguagePackage(this, '跟进动态详情');
-        }
-    },
-    getDetail() {
-        _Http.basic({
-            "id": 20221026085601,
-            "content": {
-                "sys_datafollowupid": this.data.sys_datafollowupid
-            }
-        }).then(res => {
-            console.log("跟进详情", res)
-            if (res.code != '1') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            })
-            this.selectComponent("#Yl_files").initData()
-            this.selectComponent("#Yl_files").handleFiles(res.data.attinfos)
-            this.setData({
-                detail: res.data,
-                briefs: [{
-                    label: "跟进类型",
-                    value: res.data.type
-                }, {
-                    label: "跟进内容",
-                    value: res.data.content
-                }]
-            })
+  data: {
+    ownertable: null,
+    ownerid: null,
+    sys_datafollowupid: null,
+    detail: {},
+    tabbarList: [{
+      icon: "color-bianji",
+      label: "编辑"
+    }, {
+      icon: "icon-shanchu",
+      label: "删除"
+    }],
+  },
+  onLoad(options) {
+    if (options.data) {
+      this.setData({
+        ...JSON.parse(options.data),
+        userid: wx.getStorageSync('userMsg').userid
+      })
+      this.getDetail();
+      getApp().globalData.Language.getLanguagePackage(this, '跟进动态详情');
+    }
+  },
+  getDetail() {
+    _Http.basic({
+      "id": 20221026085601,
+      "content": {
+        "sys_datafollowupid": this.data.sys_datafollowupid
+      }
+    }).then(res => {
+      console.log("跟进详情", res)
+      if (res.code != '1') return wx.showToast({
+        title: res.data,
+        icon: "none"
+      })
+      let briefs
+      if (res.data.resource == '经销商管理') {
+        briefs = [{
+          label: "跟进对象",
+          value: res.data.followobj
+        },{
+          label: "经销商",
+          value: res.data.agentsname
+        },{
+          label: "跟进类型",
+          value: res.data.type
+        },{
+          label: "关联任务",
+          value: res.data.tasktitle
+        },{
+          label: "推荐产品",
+          value: res.data.products
+        },{
+          label: "目的",
+          value: res.data.target
+        },{
+          label: "过程",
+          value: res.data.content
+        },{
+          label: "结果",
+          value: res.data.results
+        },{
+          label: "下次跟进计划",
+          value: res.data.nextplan
+        }]
+      }else if(res.data.resource == '医院管理' || res.data.resource == '医生管理' || res.data.resource == '科室管理'){
+        briefs = [{
+          label: "跟进对象",
+          value: res.data.followobj
+        },{
+          label: "医院",
+          value: res.data.hospitalname
+        },{
+          label: "科室",
+          value: res.data.hospitaldepname
+        },{
+          label: "医生",
+          value: res.data.doctorname
+        },{
+          label: "跟进类型",
+          value: res.data.type
+        },{
+          label: "关联任务",
+          value: res.data.tasktitle
+        },{
+          label: "推荐产品",
+          value: res.data.products
+        },{
+          label: "目的",
+          value: res.data.target
+        },{
+          label: "过程",
+          value: res.data.content
+        },{
+          label: "结果",
+          value: res.data.results
+        },{
+          label: "下次跟进计划",
+          value: res.data.nextplan
+        }]
+      }else{
+        briefs = [{
+          label: "跟进内容",
+          value: res.data.content
+        }]
+      }
+      this.selectComponent("#Yl_files").initData()
+      this.selectComponent("#Yl_files").handleFiles(res.data.attinfos)
+      this.setData({
+        detail: res.data,
+        briefs
+      })
+    })
+  },
+  /* tab 切换回调 */
+  tabbarOnClick({
+    detail
+  }) {
+    const item = this.data.detail;
+    switch (detail.label) {
+      case "编辑":
+        wx.navigateTo({
+          url: `/prsx/trace/add/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&sys_datafollowupid=${item.sys_datafollowupid}`
+        });
+        break;
+      case "删除":
+        _Http.traceHandleDelete(item).then(res => {
+          if (res) setTimeout(() => {
+            wx.navigateBack()
+          }, 300)
         })
-    },
-    /* tab 切换回调 */
-    tabbarOnClick({
-        detail
-    }) {
-        const item = this.data.detail;
-        switch (detail.label) {
-            case "编辑":
-                wx.navigateTo({
-                    url: `/prsx/trace/add/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&sys_datafollowupid=${item.sys_datafollowupid}`
-                });
-                break;
-            case "删除":
-                _Http.traceHandleDelete(item).then(res => {
-                    if (res) setTimeout(() => {
-                        wx.navigateBack()
-                    }, 300)
-                })
-                break;
-        }
+        break;
     }
+  }
 })

+ 3 - 0
prsx/trace/list/index.js

@@ -19,6 +19,9 @@ Component({
         },
         disabled: {
             type: Boolean
+        },
+        resource: {
+          type:String
         }
     },
     lifetimes: {

+ 41 - 8
prsx/trace/list/index.wxml

@@ -19,26 +19,59 @@
                 </view>
             </view>
         </view>
-        <view class="text">
+        <view class="text" wx:if="{{ownertable != 'sa_customers' && ownertable != 'sa_doctor' && ownertable != 'sa_hospitaldep' && ownertable != 'sa_agents' && ownertable != 'sys_task'}}">
             <text class="text-label">{{language['跟进内容']||'跟进内容'}}:</text>{{language[item.content]||item.content}}
         </view>
-        <view class="type" wx:if="{{item.type}}">
+        <view class="type" wx:if="{{ownertable == 'sa_customers' || ownertable == 'sa_doctor' || ownertable == 'sa_hospitaldep' || ownertable == 'sa_agents' || ownertable == 'sys_task'}}">
+            <text class="text-label">{{language['跟进对象']||'跟进对象'}}:</text><text>{{language[item.followobj]||item.followobj}}</text>
+        </view>
+        <view class="type" wx:if="{{item.hospitalname}}">
+            <text class="text-label">{{language['医院']||'医院'}}:</text><text>{{language[item.hospitalname]||item.hospitalname}}</text>
+        </view>
+        <view class="type" wx:if="{{item.hospitaldepname}}">
+            <text class="text-label">{{language['科室']||'科室'}}:</text><text>{{language[item.hospitaldepname]||item.hospitaldepname}}</text>
+        </view>
+        <view class="type" wx:if="{{item.doctorname}}">
+            <text class="text-label">{{language['医生']||'医生'}}:</text><text>{{language[item.doctorname]||item.doctorname}}</text>
+        </view>
+        <view class="type" wx:if="{{item.agentsname}}">
+            <text class="text-label">{{language['经销商']||'经销商'}}:</text><text>{{language[item.agentsname]||item.agentsname}}</text>
+        </view>
+        <view class="type" wx:if="{{ownertable == 'sa_customers' || ownertable == 'sa_doctor' || ownertable == 'sa_hospitaldep' || ownertable == 'sa_agents' || ownertable == 'sys_task'}}">
             <text class="text-label">{{language['跟进类型']||'跟进类型'}}:</text><text>{{language[item.type]||item.type}}</text>
         </view>
+        <view class="type" wx:if="{{item.products}}">
+            <text class="text-label">{{language['关联任务']||'关联任务'}}:</text><text>{{language[item.tasktitle]||item.tasktitle}}</text>
+        </view>
+        <view class="type" wx:if="{{item.products}}">
+            <text class="text-label">{{language['推荐产品']||'推荐产品'}}:</text><text>{{language[item.products]||item.products}}</text>
+        </view>
+        <view class="type" wx:if="{{ownertable == 'sa_customers' || ownertable == 'sa_doctor' || ownertable == 'sa_hospitaldep' || ownertable == 'sa_agents' || ownertable == 'sys_task'}}">
+            <text class="text-label">{{language['目的']||'目的'}}:</text><text>{{language[item.target]||item.target||'--'}}</text>
+        </view>
+        <view class="type" wx:if="{{ownertable == 'sa_customers' || ownertable == 'sa_doctor' || ownertable == 'sa_hospitaldep' || ownertable == 'sa_agents' || ownertable == 'sys_task'}}">
+            <text class="text-label">{{language['过程']||'过程'}}:</text><text>{{language[item.content]||item.content||'--'}}</text>
+        </view>
+        <view class="type" wx:if="{{ownertable == 'sa_customers' || ownertable == 'sa_doctor' || ownertable == 'sa_hospitaldep' || ownertable == 'sa_agents' || ownertable == 'sys_task'}}">
+            <text class="text-label">{{language['结果']||'结果'}}:</text><text>{{language[item.results]||item.results||'--'}}</text>
+        </view>
+        <view class="type" wx:if="{{ownertable == 'sa_customers' || ownertable == 'sa_doctor' || ownertable == 'sa_hospitaldep' || ownertable == 'sa_agents' || ownertable == 'sys_task'}}">
+            <text class="text-label">{{language['下次跟进计划']||'下次跟进计划'}}:</text><text>{{language[item.nextplan]||item.nextplan||'--'}}</text>
+        </view>
     </navigator>
     <Yl_Files wx:if="{{item.attinfos.length}}" attinfos='{{item.attinfos}}' />
     <commentList id="Comment{{item.sys_datafollowupid}}" comments='{{item.comment}}' quantity="{{item.commentqty}}" ownerid='{{item.sys_datafollowupid}}' bind:updateCommentList='updateCommentList' />
     <view class="bottom">
-        <navigator url="#" class="comment" bind:tap="comment" id="Comment{{item.sys_datafollowupid}}">
+        <!-- <navigator url="#" class="comment" bind:tap="comment" id="Comment{{item.sys_datafollowupid}}">
             <text class="iconfont icon-huifu" /><text style="color: #3874F6;">{{language['评论']||'评论'}}({{item.commentqty}})</text>
-        </navigator>
+        </navigator> -->
         <view style="flex: 1;" />
-        <block wx:if="{{disabled  && userid == item.createuserid}}">
-            <navigator url="#" bindtap="editItem" data-item="{{item}}">
+        <block wx:if="{{(disabled  && userid == item.createuserid) || ownertable == 'sa_customers' || ownertable == 'sa_doctor' || ownertable == 'sa_hospitaldep' || ownertable == 'sa_agents' || ownertable == 'sys_task'}}">
+            <navigator url="#" bindtap="editItem" data-item="{{item}}" wx:if="{{ownertable != 'sa_customers' && ownertable != 'sa_doctor' && ownertable != 'sa_hospitaldep' && ownertable != 'sa_agents'}}">
                 <text class="iconfont icon-bianji" />{{language['编辑']||'编辑'}}
             </navigator>
-            <navigator url="#" bindtap="deleteItem" data-item="{{item}}">
-                <text class="iconfont icon-qunzu" />{{language['删除']||'删除'}}
+            <navigator url="#" bindtap="deleteItem" data-item="{{item}}" wx:if="{{userid == item.createuserid}}">
+                <text class="iconfont icon-shanchu2" />{{language['删除']||'删除'}}
             </navigator>
         </block>
     </view>

+ 1 - 1
prsx/tryOut/detail.wxml

@@ -32,7 +32,7 @@
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
   <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-  <tryDetail slot='试用明细' id='tryDetail' disabled="{{isLeader}}" />
+  <tryDetail slot='试用明细' id='tryDetail' disabled="{{isLeader && detail.status == '新建'}}" />
   <Trace resource='安装管理' slot='跟进动态' id='Trace' ownertable='sa_trial' ownerid='{{sys_enterpriseid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sa_trialid}}' />
   <Record slot="操作" id="Record" ownertable='sa_trial' ownerid='{{sa_trialid}}' />
   <Files slot="附件" id="Files" ownertable='sa_trial' ownerid='{{sa_trialid}}' disabled="{{detail.status != '已终止'}}" />

+ 309 - 293
prsx/tryOut/insert.js

@@ -1,305 +1,321 @@
 let _Http = getApp().globalData.http,
-    getTime = require("../../utils/getTime");
+  getTime = require("../../utils/getTime");
 
 Page({
-    data: {
-        loading: false,
-        showAll: false,
-        content: {
-            sa_trialid: 0,
-            sa_hospitaldepid:0
-        },
-        disabled: true,
+  data: {
+    loading: false,
+    showAll: false,
+    content: {
+      sa_trialid: 0,
+      sa_hospitaldepid: 0
     },
-    onLoad(options) {
-        let form = [{
-          label: "申请日期",
-          error: false,
-          errMsg: "",
-          type: "date",
-          start: '',
-          value: new Date().toISOString().split('T')[0],
-          placeholder: "申请日期",
-          valueName: "applydate",
-          checking: "base",
-          required: true,
-          interrupt:true
-      },{
-        label: "试用类型",
-        error: false,
-        errMsg: "",
-        type: "option",
-        optionNmae: "testtype",
-        optionType: "radio", //复选   radio 单选
-        value: "",
-        placeholder: "试用类型",
-        valueName: "type",
-        checking: "base",
-        required: true
-    },{
-            label: "医院",
-            error: false,
-            errMsg: "",
-            type: "route",
-            url: "/prsx/select/hospital/index",
-            value: "",
-            placeholder: "医院",
-            valueName: "sa_customersid",
-            checking: "base",
-            required: true,
-            params: {
-                "content": {
-                    "isExport": 0,
-                    "pageNumber": 1,
-                    "pageSize": 20,
-                    "where": {
-                        "condition": ""
-                    }
-                },
-                "id": 2025102814083902,
-            },
-            query: "&radio=true",
-            required: true,
-            interrupt: true,
-        },{
-          label: "医生",
-          error: false,
-          errMsg: "",
-          type: "route",
-          url: "/prsx/select/docter/index",
-          value: "",
-          placeholder: "医生",
-          valueName: "sa_doctorid",
-          checking: "base",
-          required: true,
-          params: {
-              "content": {
-                  "isExport": 0,
-                  "sa_customersid":0,
-                  "pageNumber": 1,
-                  "pageSize": 20,
-                  "where": {
-                      "condition": ""
-                  }
-              },
-              "id": 2025102310134602,
-          },
-          query: "&radio=true",
-          required: true,
-          interrupt: true,
-          disabled: true,
+    disabled: true,
+  },
+  onLoad(options) {
+    let form = [{
+      label: "申请日期",
+      error: false,
+      errMsg: "",
+      type: "date",
+      start: '',
+      value: new Date().toISOString().split('T')[0],
+      placeholder: "申请日期",
+      valueName: "applydate",
+      checking: "base",
+      required: true,
+      interrupt: true
+    }, {
+      label: "试用类型",
+      error: false,
+      errMsg: "",
+      type: "option",
+      optionNmae: "testtype",
+      optionType: "radio", //复选   radio 单选
+      value: "",
+      placeholder: "试用类型",
+      valueName: "type",
+      checking: "base",
+      required: true
+    }, {
+      label: "医院",
+      error: false,
+      errMsg: "",
+      type: "route",
+      url: "/prsx/select/hospital/index",
+      value: "",
+      placeholder: "医院",
+      valueName: "sa_customersid",
+      checking: "base",
+      required: true,
+      params: {
+        "content": {
+          "isExport": 0,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        },
+        "id": 2025102814083902,
+      },
+      query: "&radio=true",
+      required: true,
+      interrupt: true,
+    }, {
+      label: "医生",
+      error: false,
+      errMsg: "",
+      type: "route",
+      url: "/prsx/select/docter/index",
+      value: "",
+      placeholder: "医生",
+      valueName: "sa_doctorid",
+      checking: "base",
+      required: true,
+      params: {
+        "content": {
+          "isExport": 0,
+          "sa_customersid": 0,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        },
+        "id": 2025102310134602,
+      },
+      query: "&radio=true",
+      required: true,
+      interrupt: true,
+      disabled: true,
 
-      }, {
-        label: "科室",
-        error: false,
-        errMsg: "",
-        type: "route",
-        value: "",
-        placeholder: "科室",
-        valueName: "sa_hospitaldepid",
-        checking: "base",
-        required: false,
-        disabled: true,
     }, {
-            label: "经销商",
-            error: false,
-            errMsg: "",
-            type: "route",
-            url: "/prsx/select/firm/index",
-            value: "",
-            params: {
-                id: 2025111915343902,
-                "content": {
-                    "pageSize": 20,
-                    "pageNumber": 1,
-                    sa_hospitaldepid: 0
-                },
-            },
-            query: "&radio=true",
-            placeholder: "选择经销商",
-            valueName: "sa_agentsid",
-            checking: "base",
-            required: false,
-            interrupt: true,
-        }, {
-            label: "发货日期",
-            error: false,
-            errMsg: "",
-            type: "date",
-            start: '',
-            value: '',
-            placeholder: "发货日期",
-            valueName: "deliverydate",
-            checking: "base",
-            required: true,
-            interrupt:true
-        }, {
-          label: "领用人",
-          error: false,
-          errMsg: "",
-          type: "textarea",
-          value: "",
-          placeholder: "领用人",
-          valueName: "user",
-          checking: "base",
-          required: true
-      }, {
-        label: "试用结束日期",
-        error: false,
-        errMsg: "",
-        type: "date",
-        start: '',
-        value: '',
-        placeholder: "试用结束日期",
-        valueName: "enddate",
-        checking: "base",
-        required: true,
-        interrupt:true
+      label: "科室",
+      error: false,
+      errMsg: "",
+      type: "route",
+      value: "",
+      placeholder: "科室",
+      valueName: "sa_hospitaldepid",
+      checking: "base",
+      required: false,
+      disabled: true,
+    }, {
+      label: "经销商",
+      error: false,
+      errMsg: "",
+      type: "route",
+      url: "/prsx/select/firm/index",
+      value: "",
+      placeholder: "选择经销商",
+      valueName: "sa_agentsid",
+      checking: "base",
+      required: true,
+      params: {
+        id: 2025111915343902,
+        "content": {
+          "pageSize": 20,
+          "pageNumber": 1,
+          sa_hospitaldepid: 0
+        },
+      },
+      query: "&radio=true",
+      valueName: "sa_agentsid",
+      checking: "base",
+      required: false,
+      interrupt: true,
+      disabled: true,
+    }, {
+      label: "发货日期",
+      error: false,
+      errMsg: "",
+      type: "date",
+      start: '',
+      value: '',
+      placeholder: "发货日期",
+      valueName: "deliverydate",
+      checking: "base",
+      required: true,
+      interrupt: true
+    }, {
+      label: "领用人",
+      error: false,
+      errMsg: "",
+      type: "textarea",
+      value: "",
+      placeholder: "领用人",
+      valueName: "user",
+      checking: "base",
+      required: true
     }, {
-            label: "备注",
-            error: false,
-            errMsg: "",
-            type: "textarea",
-            value: "",
-            placeholder: "备注",
-            valueName: "remarks",
-            checking: "base",
-            required: false
-        }]
-        if (options.data) {
-            let data = JSON.parse(options.data);
-            data.sa_customersid = [data.hospitalname, [data.sa_customersid]]
-            data.sa_agentsid = [data.agentname, [data.sa_agentsid]]
-            data.sa_doctorid = [data.doctorname,[data.sa_doctorid]]
-            data.sa_hospitaldepid = [data.hospitaldepname,[data.sa_hospitaldepid]]
-            form = form.map(v => {
-                v.value = data[v.valueName];
-                if (v.label == '经销商') v.disabled = false
-                return v
-            })
-            this.setData({
-                disabled: false,
-                content: {
-                    sa_trialid: data.sa_trialid,
-                },
-                form
-            })
+      label: "试用结束日期",
+      error: false,
+      errMsg: "",
+      type: "date",
+      start: '',
+      value: '',
+      placeholder: "试用结束日期",
+      valueName: "enddate",
+      checking: "base",
+      required: true,
+      interrupt: true
+    }, {
+      label: "备注",
+      error: false,
+      errMsg: "",
+      type: "textarea",
+      value: "",
+      placeholder: "备注",
+      valueName: "remarks",
+      checking: "base",
+      required: false
+    }]
+    if (options.data) {
+      let data = JSON.parse(options.data);
+      console.log(data,'1111')
+      data.sa_customersid = [data.hospitalname, [data.sa_customersid]]
+      data.sa_agentsid = data.agentname?[data.agentname, [data.sa_agentsid]]:0
+      data.sa_doctorid = [data.doctorname, [data.sa_doctorid]]
+      data.sa_hospitaldepid = [data.hospitaldepname, [data.sa_hospitaldepid]]
+      form = form.map(v => {
+        v.value = data[v.valueName];
+        if (v.label == '经销商') {
+          v.disabled = false
+          v.params.content.sa_hospitaldepid = data.sa_hospitaldepid[1][0]
+        }
+        if (v.label == '医生') {
+          v.disabled = false
+          v.params.content.sa_customersid = data.sa_customersid[1][0]
         }
-        this.setData({
-            form
-        })
-        getApp().globalData.Language.getLanguagePackage(this, options.data ? '编辑试用申请' : '新建试用申请');
+        return v
+      })
+      this.setData({
+        disabled: false,
+        content: {
+          sa_trialid: data.sa_trialid,
+        },
+        form
+      })
+    }
+    this.setData({
+      form
+    })
+    getApp().globalData.Language.getLanguagePackage(this, options.data ? '编辑试用申请' : '新建试用申请');
 
-    },
-    interrupt(e) {
-      console.log(e,'输出222')
-        const {
-            data,
-            form,
-            temporary
-        } = e.detail;
-        console.log(data, form, temporary)
-        if (temporary.item.label == '医院') {
-            form.find(v => v.label == '医院').value = data.value;
-            let obj2 = form.find(v => v.label == '医生')
-            obj2.params.content.sa_customersid = data.id[0];
-            obj2.value = '';
-            obj2.disabled = false;
-            wx.navigateBack()
-        }else if(temporary.item.label == '医生'){
-          form.find(v => v.label == '医生').value = data.value;
-          let obj2 = form.find(v => v.label == '经销商')
-          obj2.params.content.sa_hospitaldepid = data.item.sa_hospitaldepid;
-          obj2.value = '';
-          obj2.disabled = false;
-          form.find(v => v.label == '科室').value = [data.item.hospitaldepname, [data.item.sa_hospitaldepid]];
-          wx.navigateBack()
-        }else if(temporary.item.label == '经销商'){
-          form.find(v => v.label == '经销商').value = data.value;
+  },
+  interrupt(e) {
+    console.log(e)
+    const {
+      data,
+      form,
+      temporary
+    } = e.detail;
+    console.log(data, form, temporary)
+    if (temporary.item.label == '医院') {
+      form.find(v => v.label == '医院').value = data.value;
+      let obj2 = form.find(v => v.label == '医生')
+      obj2.params.content.sa_customersid = data.id[0];
+      obj2.value = '';
+      obj2.disabled = false;
+      let obj3 = form.find(v => v.label == '科室')
+      obj3.value = '';
+      let obj4 = form.find(v => v.label == '经销商')
+      obj4.value = '';
+      wx.navigateBack()
+    } else if (temporary.item.label == '医生') {
+      form.find(v => v.label == '医生').value = data.value;
+      let obj2 = form.find(v => v.label == '经销商')
+      obj2.params.content.sa_hospitaldepid = data.item.sa_hospitaldepid;
+      obj2.value = '';
+      obj2.disabled = false;
+      form.find(v => v.label == '科室').value = [data.item.hospitaldepname, [data.item.sa_hospitaldepid]];
+      wx.navigateBack()
+    } else if (temporary.item.label == '经销商') {
+      form.find(v => v.label == '经销商').value = data.value;
+      wx.navigateBack()
+    } else if (temporary.item.label == '申请日期') {
+      let obj2 = form.find(v => v.label == '发货日期')
+      if (new Date(data.value).getTime() > new Date(obj2.value)) {
+        obj2.errMsg = '发货日期不可小于申请日期'
+      } else {
+        obj2.errMsg = ''
+      }
+    } else if (temporary.item.label == '发货日期') {
+      let obj2 = form.find(v => v.label == '发货日期')
+      let obj3 = form.find(v => v.label == '申请日期')
+      if (new Date(obj3.value).getTime() > new Date(obj2.value)) {
+        obj2.errMsg = '发货日期不可小于申请日期'
+      } else {
+        obj2.errMsg = ''
+      }
+    } else if (temporary.item.label == '试用结束日期') {
+      let obj2 = form.find(v => v.label == '试用结束日期')
+      let obj3 = form.find(v => v.label == '发货日期')
+      if (new Date(obj3.value).getTime() > new Date(obj2.value)) {
+        obj2.errMsg = '试用结束日期不可小于发货日期'
+      } else {
+        obj2.errMsg = ''
+      }
+    }
+    this.selectComponent("#Form").confirm();
+    this.setData({
+      form
+    })
+  },
+  /* 表单必填项是否完成 */
+  onConfirm({
+    detail
+  }) {
+    this.setData({
+      disabled: detail
+    })
+  },
+  // 是否显示全部
+  onChange({
+    detail
+  }) {
+    this.setData({
+      showAll: detail
+    })
+  },
+  async submit() {
+    this.setData({
+      loading: true
+    })
+    let data = this.selectComponent("#Form").submit(),
+      content = this.data.content;
+    data.sa_customersid = data.sa_customersid.length ? data.sa_customersid[1][0] : 0
+    data.sa_agentsid = data.sa_agentsid.length ? data.sa_agentsid[1][0] : 0
+    data.sa_doctorid = data.sa_doctorid.length ? data.sa_doctorid[1][0] : 0
+    data.sa_hospitaldepid = data.sa_hospitaldepid.length ? data.sa_hospitaldepid[1][0] : 0
+    _Http.basic({
+      "id": 2025110710322702,
+      "content": {
+        ...content,
+        ...data,
+      }
+    }).then(res => {
+      this.setData({
+        loading: false
+      })
+      wx.showToast({
+        title: res.code != '1' ? res.msg : '保存成功',
+        icon: "none",
+        mask: res.code == '1'
+      })
+      if (res.code != '1') return;
+      getCurrentPages().forEach(v => {
+        if (v.route == 'prsx/tryOut/detail') v.getDetail()
+      })
+      setTimeout(() => {
+        if (content.sa_trialid == 0) {
+          wx.redirectTo({
+            url: '/prsx/tryOut/detail?id=' + res.data.sa_trialid,
+          })
+        } else {
           wx.navigateBack()
-        }else if(temporary.item.label == '申请日期'){
-          let obj2 = form.find(v => v.label == '发货日期')
-          if(new Date(data.value).getTime() > new Date(obj2.value)){
-            obj2.errMsg = '发货日期不可小于申请日期'
-          }else {
-            obj2.errMsg = ''
-          }
-        }else if(temporary.item.label == '发货日期'){
-          let obj2 = form.find(v => v.label == '发货日期')
-          let obj3 = form.find(v => v.label == '申请日期')
-          if(new Date(obj3.value).getTime() > new Date(obj2.value)){
-            obj2.errMsg = '发货日期不可小于申请日期'
-          }else {
-            obj2.errMsg = ''
-          }
-        }else if(temporary.item.label == '试用结束日期'){
-          let obj2 = form.find(v => v.label == '试用结束日期')
-          let obj3 = form.find(v => v.label == '发货日期')
-          if(new Date(obj3.value).getTime() > new Date(obj2.value)){
-            obj2.errMsg = '试用结束日期不可小于发货日期'
-          }else {
-            obj2.errMsg = ''
-          }
         }
-        this.selectComponent("#Form").confirm();
-        this.setData({
-            form
-        })
-    },
-    /* 表单必填项是否完成 */
-    onConfirm({
-        detail
-    }) {
-        this.setData({
-            disabled: detail
-        })
-    },
-    // 是否显示全部
-    onChange({
-        detail
-    }) {
-        this.setData({
-            showAll: detail
-        })
-    },
-    async submit() {
-        this.setData({
-            loading: true
-        })
-        let data = this.selectComponent("#Form").submit(),
-            content = this.data.content;
-        data.sa_customersid = data.sa_customersid.length ? data.sa_customersid[1][0] : 0
-        data.sa_agentsid = data.sa_agentsid.length ? data.sa_agentsid[1][0] : 0
-        data.sa_doctorid = data.sa_doctorid.length ? data.sa_doctorid[1][0] : 0
-        data.sa_hospitaldepid = data.sa_hospitaldepid.length ? data.sa_hospitaldepid[1][0] : 0
-        _Http.basic({
-            "id": 2025110710322702,
-            "content": {
-                ...content,
-                ...data,
-            }
-        }).then(res => {
-            this.setData({
-                loading: false
-            })
-            wx.showToast({
-                title: res.code != '1' ? res.msg : '保存成功',
-                icon: "none",
-                mask: res.code == '1'
-            })
-            if (res.code != '1') return;
-            getCurrentPages().forEach(v => {
-                if (v.route == 'prsx/tryOut/detail') v.getDetail()
-            })
-            setTimeout(() => {
-                if (content.sa_trialid == 0) {
-                    wx.redirectTo({
-                        url: '/prsx/tryOut/detail?id=' + res.data.sa_trialid,
-                    })
-                } else {
-                    wx.navigateBack()
-                }
-            }, 300)
-        })
-    },
+      }, 300)
+    })
+  },
 })

+ 1 - 1
prsx/tryOut/tryDetail/index.wxml

@@ -43,7 +43,7 @@
         </view>
         <view class="bottom">
           <text style="color: #666;">试用数量:</text>
-          <input placeholder="填写试用数量" type="digit" value="{{item.qty ||''}}" bindblur="changeQty" data-index="{{index}}" />
+          <input disabled="{{!disabled}}" placeholder="填写试用数量" type="digit" value="{{item.qty ||''}}" bindblur="changeQty" data-index="{{index}}" />
         </view>
       </view>
       <navigator wx:if="{{disabled}}" url="#" class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">