Browse Source

市场活动

xiaohaizhao 6 months ago
parent
commit
3074db899a

+ 5 - 1
app.json

@@ -199,7 +199,11 @@
                 "doctors/detail",
                 "doctors/insert",
                 "select/department/index",
-                "select/product/index"
+                "select/product/index",
+                "activity/index",
+                "activity/insert",
+                "activity/detail",
+                "select/docter/index"
             ]
         },
         {

+ 23 - 2
project.private.config.json

@@ -10,12 +10,33 @@
     "condition": {
         "miniprogram": {
             "list": [
+                {
+                    "name": "新建市场活动",
+                    "pathName": "prsx/activity/insert",
+                    "query": "",
+                    "scene": null,
+                    "launchMode": "default"
+                },
+                {
+                    "name": "prsx/activity/detail",
+                    "pathName": "prsx/activity/detail",
+                    "query": "id=193",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "市场活动",
+                    "pathName": "prsx/activity/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
                 {
                     "name": "科室详情",
                     "pathName": "prsx/department/detail",
                     "query": "id=11",
-                    "scene": null,
-                    "launchMode": "default"
+                    "launchMode": "default",
+                    "scene": null
                 },
                 {
                     "name": "医院详情",

+ 197 - 0
prsx/activity/Doctors/index.js

@@ -0,0 +1,197 @@
+const _Http = getApp().globalData.http;
+
+Component({
+    properties: {
+        disabled: {
+            type: Boolean,
+            value: true
+        }
+    },
+    options: {
+        addGlobalClass: true
+    },
+    data: {
+        sat_campaignid: 0,
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 10,
+            pageTotal: 1,
+            total: null,
+            where: {
+                condition: ""
+            }
+        },
+        list: [],
+        showSearch: false,
+        focus: false,
+        condition: ""
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    methods: {
+        getList(id, init = false) {
+            let content = {
+                ...this.data.content,
+                sat_campaignid: id || this.data.sat_campaignid
+            };
+            if (init) {
+                content.pageNumber = 1
+                content.pageTotal = 1
+            }
+            _Http.basic({
+                "id": 2025103013521502,
+                content
+            }).then(res => {
+                console.log("科室医生", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                let list = res.data
+                this.setData({
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+                    sat_campaignid: content.sat_campaignid
+                })
+            })
+        },
+        insetr() {
+            let params = {
+                "id": 2025103013523102,
+                "content": {
+                    "sat_campaignid": this.data.sat_campaignid,
+                    pageNumber: 1,
+                    pageSize: 20,
+                    "where": {
+                        "condition": ""
+                    }
+                }
+            };
+            wx.navigateTo({
+                url: '/prsx/select/docter/index?params=' + JSON.stringify(params) + '&radio=true',
+            })
+            let that = this;
+            getApp().globalData.handleSelect = function ({
+                item
+            }) {
+                wx.showModal({
+                    content: `是否确定添加“${item.doctorname}”`,
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 2025103013511502,
+                            "content": {
+                                "sat_campaignid": that.data.sat_campaignid,
+                                "doctors": [{
+                                    "sat_campaign_doctorid": 0,
+                                    "sa_doctorid": item.sa_doctorid,
+                                    "amount": 0
+                                }]
+                            },
+                        }).then(res => {
+                            console.log("添加医生", res)
+                            wx.showToast({
+                                title: res.code == 1 ? '添加成功' : res.data,
+                                icon: 'none'
+                            })
+                            if (res.code == 1) {
+                                that.getList("", true)
+                                getCurrentPages().find(v => v.__route__ == 'prsx/select/docter/index').uploadList()
+                            }
+                        })
+
+                    }
+                })
+
+                console.log(item)
+            }.bind(this)
+        },
+        toSearch() {
+            if (this.data.showSearch && this.data.content.where.condition) {
+                this.data.content.where.condition = '';
+                this.getList("", true);
+            } else if (this.data.condition) {
+                this.data.content.where.condition = this.data.condition;
+                this.setData({
+                    condition: this.data.condition
+                })
+                this.getList("", true);
+            }
+            this.setData({
+                showSearch: !this.data.showSearch
+            })
+            setTimeout(() => {
+                this.setData({
+                    focus: this.data.showSearch
+                })
+            }, 300)
+        },
+        onChange({
+            detail
+        }) {
+            this.data.condition = detail;
+        },
+        onSearch({
+            detail
+        }) {
+            this.data.content.where.condition = detail;
+            this.getList("", true)
+        },
+        deleteItem(e) {
+            const {
+                item
+            } = e.currentTarget.dataset,
+                that = this;
+            wx.showModal({
+                content: `是否确定删除“${item.doctorname}”`,
+                complete: ({
+                    confirm
+                }) => {
+                    if (confirm) _Http.basic({
+                        "id": 2025103013514902,
+                        "content": {
+                            "sat_campaignid": that.data.sat_campaignid,
+                            "sa_doctorid": [item.sa_doctorid]
+                        },
+                    }).then(res => {
+                        console.log("添加医生", res)
+                        wx.showToast({
+                            title: res.code == 1 ? '删除成功' : res.data,
+                            icon: 'none'
+                        })
+                        if (res.code == 1) {
+                            that.getList("", true)
+                            getCurrentPages().find(v => v.__route__ == 'prsx/activity/detail').getDetail()
+                        }
+                    })
+                }
+            })
+        },
+        changeAmount(e) {
+            let value = e.detail.value,
+                index = e.currentTarget.dataset.index;
+            this.data.list[index].amount = value;
+            _Http.basic({
+                "id": 2025103013511502,
+                "content": {
+                    "sat_campaignid": this.data.sat_campaignid,
+                    doctors: this.data.list
+                }
+            }).then(res => {
+                console.log("修改金额", res)
+                wx.showToast({
+                    title: res.code == 1 ? '修改成功' : res.msg,
+                    icon: "none"
+                })
+                if (res.code == 1) getCurrentPages().find(v => v.__route__ == 'prsx/activity/detail').getDetail()
+            })
+        }
+    }
+})

+ 4 - 0
prsx/activity/Doctors/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 131 - 0
prsx/activity/Doctors/index.scss

@@ -0,0 +1,131 @@
+.head {
+	display: flex;
+	align-items: center;
+	width: 100vw;
+	height: 120rpx;
+	padding: 0 20rpx 0 30rpx;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.expand {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+
+		.but {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			background: #FFFFFF;
+			border-radius: 8rpx;
+			border: 2rpx solid #CCCCCC;
+			margin-left: 20rpx;
+			color: #666666;
+		}
+	}
+}
+
+.custom-class {
+	--search-background-color: #fff !important;
+	padding-right: 10rpx !important;
+}
+
+.project-item {
+	display: flex;
+	align-items: center;
+	background-color: #fff;
+	width: 690rpx;
+	border-radius: 8rpx;
+	margin: 0 auto 20rpx;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+
+	.main {
+		position: relative;
+		overflow: hidden;
+		width: 100%;
+
+		.iconfont-box {
+			position: absolute;
+			top: -20rpx;
+			right: -30rpx;
+			padding: 30rpx;
+			color: #B5B5B5;
+			border-radius: 8rpx;
+		}
+
+		.label {
+			font-size: 30rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+		}
+
+		.tag-box {
+			display: flex;
+			align-items: center;
+			width: 100%;
+
+			.datatag,
+			.systemtag {
+				flex-shrink: 0;
+				margin-top: 6rpx;
+				background: #3874f6;
+				color: #ffffff;
+				margin-right: 10rpx;
+				display: flex;
+				align-items: center;
+				height: 40rpx;
+				font-size: 20rpx;
+				padding: 0 10rpx;
+				border-radius: 20rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+			}
+
+			.datatag {
+				background: #FA8C16;
+			}
+		}
+
+		.replenish {
+			display: flex;
+			min-height: 34rpx;
+			font-size: 24rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+			margin-top: 8rpx;
+			word-break: break-all;
+			white-space: pre-wrap;
+		}
+
+		.bottom {
+			display: flex;
+			align-items: center;
+			height: 58rpx;
+			font-family: PingFang SC, PingFang SC;
+			font-size: 24rpx;
+			color: #333333;
+			width: 100%;
+			margin-top: 8rpx;
+			padding-bottom: 2rpx;
+
+			input {
+				width: 400rpx;
+				height: 58rpx;
+				background: #FFFFFF;
+				border-radius: 8rpx;
+				border: 1rpx solid #CCCCCC;
+				padding-left: 20rpx;
+			}
+
+		}
+	}
+}

+ 46 - 0
prsx/activity/Doctors/index.wxml

@@ -0,0 +1,46 @@
+<view class="head">
+	<view class="count">
+		参与医生
+	</view>
+	<view class="expand">
+		<van-search wx:if="{{showSearch}}" custom-class='custom-class' focus='{{focus}}' value="{{ condition }}"
+			shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索关键词"
+			background='#F4F5F7' />
+		<navigator url="#" class="but" bindtap="toSearch">
+			<van-icon name="search" />
+		</navigator>
+		<navigator wx:if="{{disabled}}" url="#" class="but" bindtap="insetr">
+			<van-icon name="plus" />
+		</navigator>
+	</view>
+</view>
+
+<view class="project-item" wx:for="{{list}}" wx:key="sa_doctorid">
+	<view class="main">
+		<view class="label">
+			{{item.doctorname}}
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">职称:</text>
+			<text>{{item.professional}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">科室:</text>
+			<text>{{item.hospitaldepname || '--'}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">医院:</text>
+			<text>{{item.hospitalname || '--'}}</text>
+		</view>
+
+		<view class="bottom">
+			<text style="color: #666;">产品培训费用:</text>
+			<input placeholder="费用(元)" type="digit" value="{{item.amount ||''}}" bindblur="changeAmount"
+				data-index="{{index}}" />
+		</view>
+		<view class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">
+			<view class="iconfont icon-shanchu1" />
+		</view>
+	</view>
+</view>
+<My_empty wx:if="{{list.length==0}}" />

+ 279 - 0
prsx/activity/detail.js

@@ -0,0 +1,279 @@
+const _Http = getApp().globalData.http;
+Page({
+    data: {
+        loading: true,
+        isLeader: false, //是否为负责人
+        tabsActive: 1, //tabs 选中项
+        sat_campaignid: 0
+    },
+    onLoad(options) {
+        const appAuth = wx.getStorageSync('auth').wmarketing_activity;
+        let tabsList = [{
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "参与医生",
+            icon: "icon-yisheng",
+            model: "#Doctors"
+        }];
+        this.setData({
+            sat_campaignid: options.id,
+            tabsList,
+            appAuth
+        })
+        this.getDetail();
+    },
+
+    /* 获取详情 */
+    getDetail() {
+        _Http.basic({
+            "classname": "webmanage.saletool.orderclue.ordercluecampaign",
+            "method": "queryCampaignMain",
+            "content": {
+                sat_campaignid: this.data.sat_campaignid
+            }
+        }).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,
+            })
+            //获取标签
+            if (this.data.appAuth.isdatatag) this.getTags();
+            if (this.data.appAuth.isdatateam) this.getGroup()
+            this.setTabbar();
+            this.partialRenewal();
+        });
+    },
+    setPreview(res) {
+        /* 摘要信息 */
+        let briefs = [{
+            label: "活动类型",
+            value: res.data.type
+        }, {
+            label: "承办医院",
+            value: res.data.hospitalname
+        }, {
+            label: "科室",
+            value: res.data.hospitaldepname
+        }, {
+            label: "申请金额",
+            value: _Http.formatMoney(res.data.amount),
+            style: `color:#FF3B30`
+        }, {
+            label: "实际发生金额",
+            value: _Http.formatMoney(res.data.actualAmount),
+            style: `color:#FF3B30`
+        }, {
+            label: "活动地址",
+            value: res.data.province + res.data.city + res.data.county + res.data.address
+        }, {
+            label: "创建人",
+            value: res.data.createby
+        }];
+
+        /* 基本信息 */
+        let list1 = [{
+            label: "活动名称",
+            value: res.data.name
+        }, {
+            label: "承办医院",
+            value: res.data.hospitalname
+        }, {
+            label: "科室",
+            value: res.data.hospitaldepname
+        }, {
+            label: "活动类型",
+            value: res.data.type
+        }, {
+            label: "活动性质",
+            value: res.data.activitytype
+        }, {
+            label: "活动地址",
+            value: res.data.province + res.data.city + res.data.county + res.data.address
+        }, {
+            label: "开始日期",
+            value: res.data.begdate
+        }, {
+            label: "结束日期",
+            value: res.data.enddate
+        }, {
+            label: "申请金额",
+            value: _Http.formatMoney(res.data.amount)
+        }, {
+            label: "实际发生金额",
+            value: _Http.formatMoney(res.data.actualAmount)
+        }, {
+            label: "产品总培训费",
+            value: _Http.formatMoney(res.data.doctorAmount)
+        }, {
+            label: "负责人",
+            value: res.data.leader ? res.data.leader[0].name : '--'
+        }];
+        /* 系统信息 */
+        let list2 = [{
+            label: "创建人",
+            value: res.data.createby
+        }, {
+            label: "创建时间",
+            value: res.data.createdate
+        }, {
+            label: "最近编辑人",
+            value: res.data.changeby
+        }, {
+            label: "最近编辑时间",
+            value: res.data.changedate
+        }, {
+            label: "转手次数",
+            value: res.data.leader ? res.data.leader[0].leadernum : 0
+        }];
+        this.setData({
+            briefs,
+            list1,
+            list2
+        });
+    },
+    //详情按钮回调
+    tabbarOnClick({
+        detail
+    }) {
+        let data = this.data.detail,
+            that = this;
+        switch (detail.label) {
+            case "编辑":
+                wx.navigateTo({
+                    url: `/prsx/activity/insert?data=${JSON.stringify(data)}`,
+                })
+                break;
+            case "跟进":
+                that.selectComponent("#Trace").toAdd()
+                break;
+            default:
+                console.log(detail)
+                break;
+        }
+    },
+    /* 底部功能 */
+    async setTabbar() {
+        let detail = this.data.detail,
+            isAdmin = this.data.isAdmin,
+            isLeader = detail.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
+            editdataleader = isLeader ? 1 : 0,
+            tabbarList = [],
+            appAuth = this.data.appAuth,
+            tabsList = this.data.tabsList;
+        if (!isLeader) {
+            let res = await getApp().agentOrNot("sat_campaign", this.data.sat_campaignid),
+                data = res.code == '1' ? res.data : {
+                    editable: 0,
+                    editdataleader: 0
+                }
+            if (appAuth.isdatateam) isLeader = this.selectComponent("#Group").data.editable == 1;
+            if (!isLeader) isLeader = data.editable == 1;
+            editdataleader = data.editdataleader;
+        }
+        if (appAuth.isdatafollowup) {
+            tabsList.push({
+                label: "跟进动态",
+                icon: "icon-tabgenjinjilu",
+                model: "#Trace"
+            })
+            if (detail.status != '已终止') tabbarList.push({
+                icon: "color-genjin",
+                label: "跟进"
+            });
+        }
+        tabsList = tabsList.concat([{
+            label: "附件",
+            icon: "icon-tabfujian1",
+            model: "#Files"
+        }, {
+            label: "操作",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Record"
+        }])
+        if (isLeader || isAdmin) {
+            tabbarList.push({
+                icon: "color-bianji",
+                label: "编辑"
+            })
+        }
+        this.setData({
+            tabbarList,
+            isLeader,
+            tabsList
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        try {
+            let model = this.data.tabsList[this.data.tabsActive].model;
+            if (model) {
+                let Component = this.selectComponent(model),
+                    {
+                        total,
+                        pageNumber,
+                        pageTotal
+                    } = Component.data.content,
+                    id = this.data.detail.sat_campaignid;
+                if (model == "#Files") init = true;
+                if (total == null || init) {
+                    Component.getList(id, init);
+                } else if (pageNumber <= pageTotal) {
+                    Component.getList(id, false);
+                }
+            }
+        } catch (error) {
+
+        }
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags()
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList().then(this.setTabbarList)
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    onUnload() {
+        const page = getCurrentPages().find(v => v.__route__ == 'prsx/activity/index');
+        if (!page) return;
+        let content = JSON.parse(JSON.stringify(page.data.content));
+        content.pageSize = (content.pageNumber - 1) * content.pageSize;
+        content.pageNumber = 1;
+        _Http.basic({
+            id: '20221101095102',
+            content
+        }).then(res => {
+            console.log("更新列表", res);
+            if (res.code == '1') {
+                res.data = res.data.map(v => {
+                    v.amount = _Http.formatMoney(v.amount)
+                    v.actualAmount = _Http.formatMoney(v.actualAmount)
+                    return v
+                })
+                page.setData({
+                    list: res.data,
+                    "content.total": res.total
+                })
+            }
+        })
+    }
+})

+ 7 - 0
prsx/activity/detail.json

@@ -0,0 +1,7 @@
+{
+    "usingComponents": {
+        "Trace": "/prsx/trace/index",
+        "Doctors": "/prsx/activity/Doctors/index"
+    },
+    "navigationBarTitleText": "市场活动详情"
+}

+ 77 - 0
prsx/activity/detail.scss

@@ -0,0 +1,77 @@
+.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;
+}
+
+.textarea {
+	width: 90%;
+	height: 200rpx;
+	box-sizing: border-box;
+	padding: 20rpx 30rpx;
+	background-color: #FDF9FC;
+	margin: 20rpx auto;
+	border: 1rpx solid #EEECEF;
+	border-radius: 8rpx;
+}

+ 28 - 0
prsx/activity/detail.wxml

@@ -0,0 +1,28 @@
+<view class="setclient-list-item" url="#">
+    <view class="con">
+        <view class="mian">
+            <view class="label line-1">{{detail.name}}</view>
+            <view class="tag-box" wx:if="{{appAuth.isdatatag}}">
+                <Yl-tags id="Tags" add ownertable='sat_campaign' bind:onGetList='onGetList' ownerid='{{sat_campaignid}}' />
+            </view>
+        </view>
+    </view>
+</view>
+<view style="margin-top: -16rpx;">
+    <Yl_Detail list="{{briefs}}">
+        <Yl-group id='Group' slot='bottom' ownertable='sat_campaign' ownerid='{{sat_campaignid}}' />
+    </Yl_Detail>
+</view>
+<view style="height: 20rpx;" />
+<!-- 功能 -->
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+    <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+    <Doctors slot='参与医生' id="Doctors" />
+    <Trace resource='市场活动' slot='跟进动态' id='Trace' ownertable='sat_campaign' ownerid='{{sat_campaignid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sys_enterpriseid}}' />
+  
+    <Record slot="操作" id="Record" ownertable='sat_campaign' ownerid='{{sat_campaignid}}' />
+    <Files slot="附件" id="Files" ownertable='sat_campaign' ownerid='{{sat_campaignid}}' disabled="{{detail.status != '已终止'}}" />
+</Yl_FunTabs>
+<!-- 底部 -->
+<Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 159 - 0
prsx/activity/index.js

@@ -0,0 +1,159 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        navList: [{
+            label: "我负责的",
+            icon: "icon-webxialaxuanxiangjiantou",
+            color: "",
+            width: "",
+            id: "1"
+        }, {
+            label: "排序",
+            icon: "icon-jiangxu1",
+            color: "",
+            width: "",
+            id: "sort"
+        }, {
+            label: "筛选",
+            icon: "icon-shaixuan",
+            color: "",
+            width: "",
+            id: "2"
+        }],
+        content: {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+                "condition": "",
+                "activityformat": "",
+                "begindate": "",
+                "enddate": ""
+            },
+            "type": 99,
+            "isAll": 0
+        },
+    },
+    async onLoad() {
+        getApp().globalData.Language.getLanguagePackage(this);
+        let templetList = wx.getStorageSync('templetList')
+        this.setData({
+            insert: wx.getStorageSync('auth').wdepartment.options.some(v => v == 'insert'), //查询新增权限
+            classActions: templetList.map((v, i) => {
+                return {
+                    name: v.templetname,
+                    index: v.templetid,
+                    color: i == 0 ? '#3874F6' : '',
+                    i: i,
+                }
+            }),
+            'navList[0].label': templetList[0].templetname,
+            "content.type": templetList[0].templetid,
+        });
+        this.getList(true)
+
+        let filtratelist = [{
+            label: "活动类型",
+            index: null,
+            showName: "value", //显示字段
+            valueKey: "activityformat", //返回Key
+            selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+            value: "", //选中值
+            list: await _Http.getTypes('activityformat', _Http)
+        }]
+        this.setData({
+            filtratelist
+        })
+    },
+    getList(init = false) {
+        _Http.init(this.data.content, init).then(content => {
+            _Http.basic({
+                "id": 20221101095102,
+                content
+            }).then(res => {
+                console.log("活动列表", res)
+                this.selectComponent('#ListBox').RefreshToComplete();
+                if (res.code != '1') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                })
+                res.data = res.data.map(v => {
+                    v.amount = _Http.formatMoney(v.amount)
+                    v.actualAmount = _Http.formatMoney(v.actualAmount)
+                    return v
+                })
+                this.setData({
+                    content: _Http.paging(content, res),
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+                })
+            })
+        })
+    },
+    toAdd() {
+        wx.navigateTo({
+            url: '/prsx/activity/insert'
+        })
+    },
+    /* 处理筛选 */
+    handleFilter({
+        detail
+    }) {
+        detail.condition = this.data.content.where.condition;
+        if (detail.startdate) {
+            detail.begindate = detail.startdate
+            delete detail.startdate
+        }
+        this.data.content.where = detail;
+        this.getList(true);
+    },
+    /* 顶部条件导航回调 */
+    navClick({
+        detail
+    }) {
+        switch (detail.id) {
+            case '1':
+                this.setData({
+                    classShow: true
+                })
+                break;
+            case '2':
+                this.setData({
+                    'filterShow': true
+                })
+                break;
+            case '3':
+                this.setData({
+                    'content.sort[0].reversed': this.data.content.sort[0].reversed == 0 ? 1 : 0
+                });
+                this.getList(true)
+                break;
+        }
+    },
+    /* 处理搜索 */
+    onSearch({
+        detail
+    }) {
+        this.data.content.where.condition = detail;
+        this.getList(true);
+    },
+    classClose() {
+        this.setData({
+            classShow: false
+        })
+    },
+    classSelect({
+        detail
+    }) {
+        if (this.data.content.type == detail.index) return this.classClose();
+        this.setData({
+            "content.type": detail.index,
+            'navList[0].label': detail.name,
+            classActions: this.data.classActions.map(v => {
+                v.color = detail.i == v.i ? '#3874F6' : ''
+                return v
+            })
+        })
+        this.classClose();
+        this.getList(true)
+    }
+})

+ 4 - 0
prsx/activity/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "市场活动"
+}

+ 28 - 0
prsx/activity/index.scss

@@ -0,0 +1,28 @@
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}
+
+.item {
+
+	.title {
+		line-height: 40rpx;
+		font-family: Microsoft YaHei, Microsoft YaHei;
+		font-weight: bold;
+		font-size: 30rpx;
+		color: #333333;
+	}
+
+	.row {
+		line-height: 32rpx;
+		font-family: Microsoft YaHei, Microsoft YaHei;
+		font-size: 24rpx;
+		color: #666666;
+		margin-top: 8rpx;
+
+		.red {
+			color: #FF3B30;
+		}
+	}
+}

+ 37 - 0
prsx/activity/index.wxml

@@ -0,0 +1,37 @@
+<Yl_nav search list='{{navList}}' sort='{{content.sort}}' bind:onClick='navClick' bind:onSearch='onSearch' />
+<view class="global-total">总共{{content.total}}个</view>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<navigator url="/prsx/activity/detail?id={{item.sat_campaignid}}" class="global-card item" wx:for="{{list}}" wx:key="sat_campaignid">
+		<view class="title">
+			{{item.name||' --'}}
+		</view>
+		<view class="row">
+			活动类型:{{item.type||' --'}}
+		</view>
+		<view class="row">
+			科室:{{item.hospitaldepname ||' --'}}
+		</view>
+		<view class="row">
+			申请金额:<text class="red">{{item.amount ||'0'}}</text>
+		</view>
+		<view class="row">
+			实际发生金额:<text class="red">{{item.actualAmount ||'0'}}</text>
+		</view>
+		<view class="row">
+			活动地址:{{item.province + item.city + item.county + item.address || ' --'}}
+		</view>
+		<view class="row">
+			创建人:{{item.createby ||' --'}}
+		</view>
+		<view class="row">
+			创建时间:{{item.createdate ||' --'}}
+		</view>
+	</navigator>
+	<My_empty wx:if="{{list.length==0}}" />
+</Yl_ListBox>
+<!-- 显示类型 -->
+<van-action-sheet show="{{ classShow }}" actions="{{ classActions }}" cancel-text="取消" bind:click-overlay='classClose' bind:cancel="classClose" bind:select="classSelect" />
+<!-- 筛选条件 -->
+<Yl_Filtrate1 show='{{filterShow}}' list="{{filtratelist}}" dateRange bindhandle="handleFilter" dateRangeName='创建日期' />
+<!-- 浮动按钮 -->
+<Yl_FloatingButton wx:if="{{insert}}" bindtap="toAdd" />

+ 397 - 0
prsx/activity/insert.js

@@ -0,0 +1,397 @@
+let _Http = getApp().globalData.http,
+    getTime = require("../../utils/getTime");
+Page({
+    data: {
+        loading: false,
+        showAll: false,
+        content: {
+            sat_campaignid: 0
+        },
+        disabled: true,
+        otheramount: 0,
+        otheramount1: '0.00',
+        trainingCost: '0.00',
+        allCost: '0.00',
+        list: []
+    },
+    onLoad(options) {
+        let form = [{
+            label: "活动名称",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "活动名称",
+            valueName: "name",
+            checking: "base",
+            required: true
+        }, {
+            label: "活动类型",
+            error: false,
+            errMsg: "",
+            type: "option",
+            optionNmae: "campaigntype",
+            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": {
+                    "pageNumber": 1,
+                    "pageSize": 20,
+                    "where": {
+                        "condition": ""
+                    }
+                },
+                "id": 2025102814083902,
+            },
+            query: "&radio=true",
+            required: false,
+            interrupt: true
+        }, {
+            label: "科室",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/prsx/select/department/index",
+            value: "",
+            placeholder: "请先选择承办医院",
+            valueName: "sa_hospitaldepid",
+            checking: "base",
+            disabled: true,
+            params: {
+                "content": {
+                    "pageNumber": 1,
+                    "pageSize": 20,
+                    "where": {
+                        "condition": ""
+                    }
+                },
+                "id": 2025102310143002,
+            },
+            query: "&radio=true",
+            required: false
+        }, {
+            label: "开始日期",
+            error: false,
+            errMsg: "",
+            type: "date",
+            start: '',
+            value: '',
+            placeholder: "报价日期",
+            valueName: "begdate",
+            checking: "base",
+            required: true,
+            interrupt: true
+        }, {
+            label: "结束日期",
+            error: false,
+            errMsg: "",
+            type: "date",
+            start: '',
+            value: "",
+            placeholder: "结束时间",
+            valueName: "enddate",
+            checking: "base",
+            required: false
+        }, {
+            label: "活动性质",
+            error: false,
+            errMsg: "",
+            type: "option",
+            optionNmae: "activitytype",
+            optionType: "radio", //复选   radio 单选
+            value: "",
+            placeholder: "活动性质",
+            valueName: "activitytype",
+            checking: "base",
+            required: false
+        }, {
+            label: "活动形式",
+            error: false,
+            errMsg: "",
+            type: "option",
+            optionNmae: "activityformat",
+            optionType: "radio", //复选   radio 单选
+            value: "",
+            placeholder: "活动形式",
+            valueName: "activityformat",
+            checking: "base",
+            required: true
+        }, {
+            label: "申请金额",
+            error: false,
+            errMsg: "",
+            type: "digit",
+            value: "",
+            placeholder: "申请金额",
+            valueName: "amount",
+            checking: "base",
+            required: false
+        }, {
+            label: "备注",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "remarks",
+            required: false,
+            checking: "base"
+        }, {
+            label: "其他费用",
+            error: false,
+            errMsg: "",
+            type: "digit",
+            value: "",
+            placeholder: "其他费用",
+            valueName: "otheramount",
+            checking: "base",
+            required: false,
+            interrupt: true
+        }]
+        if (options.data) {
+            let data = JSON.parse(options.data);
+            let sa_customersid = data.sa_customersid;
+            data.sa_hospitaldepid = data.sa_hospitaldepid ? [data.hospitaldepname, [data.sa_hospitaldepid]] : ''
+            data.sa_customersid = data.sa_hospitaldepid ? [data.hospitalname, [data.sa_customersid]] : ''
+            form = form.map(v => {
+                v.value = data[v.valueName] || "";
+                console.log("v.valueName", v.label)
+                if (v.label == '科室' && sa_customersid) {
+                    v.params.content.sa_customersid = sa_customersid;
+                    v.disabled = false;
+                    v.placeholder = '选择科室';
+                }
+                return v
+            })
+            this.setData({
+                disabled: false,
+                content: {
+                    sat_campaignid: data.sat_campaignid,
+                },
+                form
+            })
+        }
+        this.setData({
+            form
+        })
+        getApp().globalData.Language.getLanguagePackage(this, options.data ? '编辑市场活动' : '新建市场活动');
+    },
+    interrupt({
+        detail
+    }) {
+        let index = ''
+        switch (detail.temporary.item.label) {
+            case '承办医院':
+                index = detail.form.findIndex(v => v.label == '承办医院')
+                if (index != -1) {
+                    detail.form[index].value = detail.data.value;
+                    detail.form[index + 1].params.content.sa_customersid = detail.data.id[0];
+                    detail.form[index + 1].disabled = false;
+                    detail.form[index + 1].placeholder = '选择科室';
+                }
+                wx.navigateBack()
+                break;
+            case '开始日期':
+                index = detail.form.findIndex(v => v.label == '开始日期')
+                if (index != -1) {
+                    detail.form[index + 1].start = detail.data.value;
+                    if (new Date(detail.form[index + 1].value) < new Date(detail.data.value)) {
+                        detail.form[index + 1].value = '';
+                    }
+                }
+                break;
+            case '其他费用':
+                this.data.otheramount = detail.data.value;
+                this.calculatePrice()
+                break;
+        }
+
+        this.setData({
+            form: detail.form
+        })
+    },
+    calculatePrice() {
+        const otheramount = this.data.otheramount,
+            trainingCost = this.data.list.reduce((sum, item) => {
+                return sum + (parseFloat(item.amount) || 0);
+            }, 0);
+        this.setData({
+            otheramount1: _Http.formatMoney(otheramount, 2, '', false),
+            trainingCost: _Http.formatMoney(trainingCost, 2, '', false),
+            allCost: _Http.formatMoney(((trainingCost - 0) + (otheramount - 0)), 2, '', false)
+        });
+    },
+    /* 表单必填项是否完成 */
+    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_hospitaldepid = data.sa_hospitaldepid.length ? data.sa_hospitaldepid[1][0] : 0;
+        data.doctors = this.data.list.map(v => {
+            return {
+                "sat_campaign_doctorid": 0,
+                "sa_doctorid": v.sa_doctorid,
+                "amount": v.amount
+            }
+        });
+        _Http.basic({
+            "classname": "webmanage.saletool.orderclue.ordercluecampaign",
+            "method": "insertormodify_campaign",
+            "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/activity/detail') v.getDetail()
+            })
+            setTimeout(() => {
+                if (content.sat_campaignid == 0) {
+                    wx.redirectTo({
+                        url: '/prsx/activity/detail?id=' + res.data.sat_campaignid,
+                    })
+                } else {
+                    wx.navigateBack()
+                }
+            }, 300)
+        })
+    },
+    insetr() {
+        let params = {
+            "id": 2025103013523102,
+            "content": {
+                "sat_campaignid": 0,
+                pageNumber: 1,
+                pageSize: 20,
+                "where": {
+                    "condition": ""
+                }
+            }
+        };
+        wx.navigateTo({
+            url: '/prsx/select/docter/index?params=' + JSON.stringify(params) + '&radio=true',
+        })
+        let that = this;
+        getApp().globalData.handleSelect = function ({
+            item
+        }) {
+            wx.showModal({
+                content: `是否确定添加“${item.doctorname}”`,
+                complete: ({
+                    confirm
+                }) => {
+                    if (confirm) {
+                        if (!this.data.list.some(v => v.sa_doctorid == item.sa_doctorid)) {
+                            item.amount = 0
+                            that.setData({
+                                list: this.data.list.concat([item])
+                            })
+                        }
+                        wx.showToast({
+                            title: '添加成功',
+                            icon: "none"
+                        })
+                    }
+                }
+            })
+        }.bind(this)
+    },
+    deleteItem(e) {
+        const {
+            item
+        } = e.currentTarget.dataset,
+            that = this;
+        wx.showModal({
+            content: `是否确定删除“${item.doctorname}”`,
+            complete: ({
+                confirm
+            }) => {
+                if (confirm) {
+                    that.setData({
+                        list: that.data.list.filter(v => v.sa_doctorid != item.sa_doctorid)
+                    })
+                    this.calculatePrice();
+                }
+            }
+        })
+    },
+    toSearch() {
+        if (this.data.showSearch && this.data.content.where.condition) {
+            this.data.content.where.condition = '';
+            this.getList("", true);
+        } else if (this.data.condition) {
+            this.data.content.where.condition = this.data.condition;
+            this.setData({
+                condition: this.data.condition
+            })
+            this.getList("", true);
+        }
+        this.setData({
+            showSearch: !this.data.showSearch
+        })
+        setTimeout(() => {
+            this.setData({
+                focus: this.data.showSearch
+            })
+        }, 300)
+    },
+    onChange({
+        detail
+    }) {
+        this.data.condition = detail;
+    },
+    onSearch({
+        detail
+    }) {
+        this.data.content.where.condition = detail;
+        this.getList("", true)
+    },
+    changeAmount(e) {
+        let value = e.detail.value,
+            index = e.currentTarget.dataset.index;
+        this.data.list[index].amount = value;
+        this.calculatePrice();
+    }
+})

+ 3 - 0
prsx/activity/insert.json

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

+ 201 - 0
prsx/activity/insert.scss

@@ -0,0 +1,201 @@
+.header {
+	position: sticky;
+	top: 0;
+	display: flex;
+	justify-content: space-between;
+	width: 100%;
+	height: 134rpx;
+	background: #FFFFFF;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+	padding-right: 0;
+	z-index: 999;
+
+	>view {
+		flex: 1;
+		flex-shrink: 0;
+
+		.label {
+			font-family: PingFang SC, PingFang SC;
+			font-weight: bold;
+			font-size: 28rpx;
+			color: #666666;
+			margin-bottom: 20rpx;
+		}
+
+		.value {
+			font-family: PingFang SC, PingFang SC;
+			font-weight: bold;
+			font-size: 28rpx;
+			color: #333333;
+		}
+	}
+
+}
+
+.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;
+	}
+
+}
+
+
+
+.head {
+	display: flex;
+	align-items: center;
+	width: 100vw;
+	height: 120rpx;
+	padding: 0 20rpx 0 30rpx;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.expand {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+
+		.but {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			background: #FFFFFF;
+			border-radius: 8rpx;
+			border: 2rpx solid #CCCCCC;
+			margin-left: 20rpx;
+			color: #666666;
+		}
+	}
+}
+
+.custom-class {
+	--search-background-color: #fff !important;
+	padding-right: 10rpx !important;
+}
+
+.project-item {
+	display: flex;
+	align-items: center;
+	background-color: #fff;
+	width: 690rpx;
+	border-radius: 8rpx;
+	margin: 0 auto 20rpx;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+
+	.main {
+		position: relative;
+		overflow: hidden;
+		width: 100%;
+
+		.iconfont-box {
+			position: absolute;
+			top: -20rpx;
+			right: -30rpx;
+			padding: 30rpx;
+			color: #B5B5B5;
+			border-radius: 8rpx;
+		}
+
+		.label {
+			font-size: 30rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+		}
+
+		.tag-box {
+			display: flex;
+			align-items: center;
+			width: 100%;
+
+			.datatag,
+			.systemtag {
+				flex-shrink: 0;
+				margin-top: 6rpx;
+				background: #3874f6;
+				color: #ffffff;
+				margin-right: 10rpx;
+				display: flex;
+				align-items: center;
+				height: 40rpx;
+				font-size: 20rpx;
+				padding: 0 10rpx;
+				border-radius: 20rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+			}
+
+			.datatag {
+				background: #FA8C16;
+			}
+		}
+
+		.replenish {
+			display: flex;
+			min-height: 34rpx;
+			font-size: 24rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+			margin-top: 8rpx;
+			word-break: break-all;
+			white-space: pre-wrap;
+		}
+
+		.bottom {
+			display: flex;
+			align-items: center;
+			height: 58rpx;
+			font-family: PingFang SC, PingFang SC;
+			font-size: 24rpx;
+			color: #333333;
+			width: 100%;
+			margin-top: 8rpx;
+			padding-bottom: 2rpx;
+
+			input {
+				width: 400rpx;
+				height: 58rpx;
+				background: #FFFFFF;
+				border-radius: 8rpx;
+				border: 1rpx solid #CCCCCC;
+				padding-left: 20rpx;
+			}
+
+		}
+	}
+}

+ 66 - 0
prsx/activity/insert.wxml

@@ -0,0 +1,66 @@
+<view>
+	<view wx:if="{{content.sat_campaignid == 0}}" class="header">
+		<view>
+			<view class="label">实际发生费用</view>
+			<view class="value">{{allCost}}元</view>
+		</view>
+		<view>
+			<view class="label">产品培训总费用</view>
+			<view class="value">{{trainingCost}}元</view>
+		</view>
+		<view>
+			<view class="label">其他费用</view>
+			<view class="value">{{otheramount1}}元</view>
+		</view>
+	</view>
+	<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>
+<block wx:if="{{content.sat_campaignid == 0}}">
+	<view class="head">
+		<view class="count">
+			参与活动医生
+		</view>
+		<view class="expand">
+			<navigator url="#" class="but" bindtap="insetr">
+				<van-icon name="plus" />
+			</navigator>
+		</view>
+	</view>
+	<view class="project-item" wx:for="{{list}}" wx:key="sa_doctorid">
+		<view class="main">
+			<view class="label">
+				{{item.doctorname}}
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">职称:</text>
+				<text>{{item.professional}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">科室:</text>
+				<text>{{item.hospitaldepname || '--'}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">医院:</text>
+				<text>{{item.hospitalname || item.enterprisename || '--'}}</text>
+			</view>
+
+			<view class="bottom">
+				<text style="color: #666;">产品培训费用:</text>
+				<input placeholder="费用(元)" type="digit" value="{{item.amount ||''}}" bindblur="changeAmount"
+					data-index="{{index}}" />
+			</view>
+			<view  class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">
+				<view class="iconfont icon-shanchu1" />
+			</view>
+		</view>
+	</view>
+</block>
+
+<view style="height: 160rpx;" />
+<view class="new-footer" style="padding-bottom:12rpx;">
+	<van-button custom-class="new-submit {{content.sa_doctorid ? 'orange' : 'blue' }}" disabled='{{disabled ||loading}}'
+		loading='{{loading}}' bindclick='submit'>
+		{{content.sa_doctorid ? '保存' : '确定'}}
+	</van-button>
+</view>

+ 0 - 164
prsx/department/index.scss

@@ -132,170 +132,6 @@
 	}
 }
 
-.line-1 {
-	overflow: hidden;
-	white-space: nowrap;
-	text-overflow: ellipsis;
-}
-
-.project-item {
-	display: flex;
-	align-items: center;
-	background-color: #fff;
-	width: 690rpx;
-	border-radius: 8rpx;
-	margin: 0 auto 20rpx;
-
-	.chart {
-		margin: 0 30rpx;
-		width: 100rpx;
-		flex-shrink: 0;
-
-		.circle {
-			width: 100rpx;
-			height: 100rpx;
-			position: relative;
-			border-radius: 50%;
-			box-shadow: inset 0 0 0 8rpx var(--assist);
-
-			.ab {
-				position: absolute;
-				left: 0;
-				right: 0;
-				top: 0;
-				bottom: 0;
-				margin: auto;
-			}
-
-			&_left {
-				border: 8rpx solid #ccc;
-				border-radius: 50%;
-				clip: rect(0, 50rpx, 100rpx, 0);
-			}
-
-			&_right {
-				border: 8rpx solid #ccc;
-				border-radius: 50%;
-				clip: rect(0, 100rpx, 100rpx, 50rpx);
-			}
-
-			&_text {
-				height: 100%;
-				display: flex;
-				flex-direction: column;
-				justify-content: center;
-				align-items: center;
-				font-size: 16rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #666666;
-
-				.value {
-					margin-top: -6rpx;
-				}
-
-				.name {
-					margin-top: 6rpx;
-				}
-			}
-		}
-	}
-
-	.main {
-		position: relative;
-		box-sizing: border-box;
-		padding: 20rpx 0;
-		overflow: hidden;
-
-		.label {
-			display: flex;
-			height: 42rpx;
-
-			.title {
-				flex: 1;
-				width: 0;
-				font-size: 30rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #333333;
-				margin-right: 20rpx;
-			}
-
-			.state {
-				flex-shrink: 0;
-				width: 132rpx;
-				height: 40rpx;
-				line-height: 40rpx;
-				border-radius: 20rpx 0px 0px 20rpx;
-				font-size: 24rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #FFFFFF;
-				text-align: center;
-			}
-
-		}
-
-		.tag-box {
-			display: flex;
-			align-items: center;
-			width: 100%;
-
-			.datatag,
-			.systemtag {
-				flex-shrink: 0;
-				margin-top: 6rpx;
-				background: #3874f6;
-				color: #ffffff;
-				margin-right: 10rpx;
-				display: flex;
-				align-items: center;
-				height: 40rpx;
-				font-size: 20rpx;
-				padding: 0 10rpx;
-				border-radius: 20rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-			}
-
-			.datatag {
-				background: #FA8C16;
-			}
-		}
-
-		.replenish {
-			display: flex;
-			min-height: 34rpx;
-			font-size: 24rpx;
-			font-family: PingFang SC-Regular, PingFang SC;
-			color: #333333;
-			margin-top: 8rpx;
-			word-break: break-all;
-			white-space: pre-wrap;
-		}
-
-		.leader {
-			position: absolute;
-			width: 60rpx;
-			height: 60rpx;
-			border-radius: 50%;
-			right: 30rpx;
-			bottom: 10rpx;
-			overflow: hidden;
-
-			image {
-				width: 100%;
-				height: 100%;
-			}
-
-			>view {
-				font-size: 28rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #FFFFFF;
-				background-color: #3874F6;
-				line-height: 60rpx;
-				text-align: center;
-			}
-		}
-	}
-}
-
 .line-1 {
 	overflow: hidden;
 	white-space: nowrap;

+ 0 - 163
prsx/doctors/index.scss

@@ -62,166 +62,3 @@
 	white-space: nowrap;
 	text-overflow: ellipsis;
 }
-
-.project-item {
-	display: flex;
-	align-items: center;
-	background-color: #fff;
-	width: 690rpx;
-	border-radius: 8rpx;
-	margin: 0 auto 20rpx;
-
-	.chart {
-		margin: 0 30rpx;
-		width: 100rpx;
-		flex-shrink: 0;
-
-		.circle {
-			width: 100rpx;
-			height: 100rpx;
-			position: relative;
-			border-radius: 50%;
-			box-shadow: inset 0 0 0 8rpx var(--assist);
-
-			.ab {
-				position: absolute;
-				left: 0;
-				right: 0;
-				top: 0;
-				bottom: 0;
-				margin: auto;
-			}
-
-			&_left {
-				border: 8rpx solid #ccc;
-				border-radius: 50%;
-				clip: rect(0, 50rpx, 100rpx, 0);
-			}
-
-			&_right {
-				border: 8rpx solid #ccc;
-				border-radius: 50%;
-				clip: rect(0, 100rpx, 100rpx, 50rpx);
-			}
-
-			&_text {
-				height: 100%;
-				display: flex;
-				flex-direction: column;
-				justify-content: center;
-				align-items: center;
-				font-size: 16rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #666666;
-
-				.value {
-					margin-top: -6rpx;
-				}
-
-				.name {
-					margin-top: 6rpx;
-				}
-			}
-		}
-	}
-
-	.main {
-		position: relative;
-		box-sizing: border-box;
-		overflow: hidden;
-
-		.label {
-			display: flex;
-			height: 42rpx;
-
-			.title {
-				flex: 1;
-				width: 0;
-				font-size: 30rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #333333;
-				margin-right: 20rpx;
-			}
-
-			.state {
-				flex-shrink: 0;
-				width: 132rpx;
-				height: 40rpx;
-				line-height: 40rpx;
-				border-radius: 20rpx 0px 0px 20rpx;
-				font-size: 24rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #FFFFFF;
-				text-align: center;
-			}
-
-		}
-
-		.tag-box {
-			display: flex;
-			align-items: center;
-			width: 100%;
-
-			.datatag,
-			.systemtag {
-				flex-shrink: 0;
-				margin-top: 6rpx;
-				background: #3874f6;
-				color: #ffffff;
-				margin-right: 10rpx;
-				display: flex;
-				align-items: center;
-				height: 40rpx;
-				font-size: 20rpx;
-				padding: 0 10rpx;
-				border-radius: 20rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-			}
-
-			.datatag {
-				background: #FA8C16;
-			}
-		}
-
-		.replenish {
-			display: flex;
-			min-height: 34rpx;
-			font-size: 24rpx;
-			font-family: PingFang SC-Regular, PingFang SC;
-			color: #333333;
-			margin-top: 8rpx;
-			word-break: break-all;
-			white-space: pre-wrap;
-		}
-
-		.leader {
-			position: absolute;
-			width: 60rpx;
-			height: 60rpx;
-			border-radius: 50%;
-			right: 30rpx;
-			bottom: 10rpx;
-			overflow: hidden;
-
-			image {
-				width: 100%;
-				height: 100%;
-			}
-
-			>view {
-				font-size: 28rpx;
-				font-family: PingFang SC-Regular, PingFang SC;
-				color: #FFFFFF;
-				background-color: #3874F6;
-				line-height: 60rpx;
-				text-align: center;
-			}
-		}
-	}
-}
-
-.line-1 {
-	overflow: hidden;
-	white-space: nowrap;
-	text-overflow: ellipsis;
-}

+ 1 - 22
prsx/hospital/detail.js

@@ -144,7 +144,7 @@ Page({
             value: res.data.host
         }, {
             label: "负责人",
-            value: res.data.leader[0] ? res.data.leader[0].name : ""
+            value: res.data.leader.length ? res.data.leader[0].name : ""
         }, {
             label: "营销区域",
             value: res.data.areaname
@@ -398,27 +398,6 @@ Page({
     onReachBottom() {
         this.partialRenewal();
     },
-    onUnload() {
-        _Http.updateList && _Http.updateList()
-        const page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
-        if (!page) return;
-        let content = JSON.parse(JSON.stringify(page.data.content));
-        content.pageSize = (content.pageNumber - 1) * content.pageSize;
-        content.pageNumber = 1;
-        _Http.basic({
-            id: '20221012164402',
-            content
-        }).then(res => {
-            console.log("更新客户列表", res);
-            if (res.code == '1') {
-                page.setData({
-                    list: res.data,
-                    "content.total": res.total
-                })
-                page.getTags()
-            }
-        })
-    },
     onUnload() {
         const page = getCurrentPages().find(v => v.__route__ == 'prsx/hospital/index');
         if (!page) return;

+ 124 - 0
prsx/select/docter/index.js

@@ -0,0 +1,124 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        params: {}, //请求体
+        result: [], //返回结果
+        radio: false, //是否为单选
+        idname: "sa_doctorid", //idkey
+        showName: "doctorname", //表单用 显示名称
+    },
+    onLoad(options) {
+        console.log("options", options)
+        if (options.params) {
+            let params = JSON.parse(options.params);
+            if (!params.content.pageNumber || !params.content.pageTotal) {
+                params.content.pageNumber = 1;
+                params.content.pageTotal = 1;
+            }
+            this.setData({
+                params
+            });
+        }
+        this.setData({
+            radio: options.radio ? true : false,
+            idname: options.idname || this.data.idname,
+            showName: options.showName || this.data.showName
+        });
+        this.getList()
+    },
+    getList(init = false) {
+        //init 用于初始化分页
+        if (init.detail != undefined) init = init.detail;
+        let params = this.data.params;
+        if (init) params.content.pageNumber = 1;
+        if (params.content.pageNumber > params.content.pageTotal) return;
+        //init 用于初始化分页
+        _Http.basic(params).then(res => {
+            console.log("选择医生列表", res)
+            this.selectComponent('#ListBox').RefreshToComplete();
+            if (res.code != '1') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            this.setData({
+                'params.content.pageNumber': res.pageNumber + 1,
+                'params.content.pageTotal': res.pageTotal,
+                'params.content.total': res.total,
+                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+            })
+        })
+    },
+    uploadList() {
+        let params = JSON.parse(JSON.stringify(this.data.params));
+        params.content.pageSize = (params.content.pageNumber - 1) * params.content.pageSize;
+        params.content.pageNumber = 1;
+        _Http.basic(params).then(res => {
+            console.log("更新列表", res);
+            if (res.code != '1') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            this.setData({
+                'params.content.total': res.total,
+                list: res.data
+            })
+        })
+    },
+    /* 选中 */
+    changeResult(e) {
+        let {
+            id
+        } = e.currentTarget.dataset, result = this.data.result;
+        if (this.data.radio) {
+            result = [id];
+        } else {
+            result.some(v => v == id) ? result = result.filter(v => v != id) : result.push(id)
+        }
+        this.setData({
+            result
+        });
+        if (this.data.radio) this.submit();
+    },
+    /* 提交 */
+    submit() {
+        let result = this.data.result,
+            obj = this.data.radio ? {
+                id: result,
+                item: this.data.list.find(value => value[this.data.idname] == result),
+                value: [this.data.list.find(value => value[this.data.idname] == result)[this.data.showName], result]
+            } : {
+                result,
+                list: result.map(v => this.data.list.find(value => value[this.data.idname] == v)),
+                value: [result.map(v => {
+                    let data = this.data.list.find(value => value[this.data.idname] == v);
+                    return data ? data[this.data.showName] : ""
+                }), result]
+            }
+        getApp().globalData.handleSelect && getApp().globalData.handleSelect(obj)
+    },
+    /* 开始搜索 */
+    startSearch({
+        detail
+    }) {
+        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
+        if (detail == condition) return;
+        this.setData({
+            'content.where.condition': detail,
+            'params.content.where.condition': detail
+        });
+        this.getList(true);
+    },
+    /* 取消搜索 */
+    onClear() {
+        this.setData({
+            'content.where.condition': "",
+            'params.content.where.condition': ""
+        });
+        this.getList(true);
+    },
+    onUnload() {
+        //回收数据
+        getApp().globalData.handleSelect = null;
+    },
+})

+ 4 - 0
prsx/select/docter/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "选择医生"
+}

+ 103 - 0
prsx/select/docter/index.scss

@@ -0,0 +1,103 @@
+.project-item {
+	display: flex;
+	align-items: center;
+	background-color: #fff;
+	width: 690rpx;
+	border-radius: 8rpx;
+	margin: 0 auto 20rpx;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+
+	.main {
+		position: relative;
+		overflow: hidden;
+
+		.label {
+			font-size: 30rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+		}
+
+		.tag-box {
+			display: flex;
+			align-items: center;
+			width: 100%;
+
+			.datatag,
+			.systemtag {
+				flex-shrink: 0;
+				margin-top: 6rpx;
+				background: #3874f6;
+				color: #ffffff;
+				margin-right: 10rpx;
+				display: flex;
+				align-items: center;
+				height: 40rpx;
+				font-size: 20rpx;
+				padding: 0 10rpx;
+				border-radius: 20rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+			}
+
+			.datatag {
+				background: #FA8C16;
+			}
+		}
+
+		.replenish {
+			display: flex;
+			min-height: 34rpx;
+			font-size: 24rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+			margin-top: 8rpx;
+			word-break: break-all;
+			white-space: pre-wrap;
+		}
+	}
+}
+
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}
+
+
+.footer {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	padding: 0 30rpx;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.but {
+		width: 156rpx;
+		height: 90rpx;
+		background: #3874F6;
+		border-radius: 8rpx;
+		font-size: 28rpx;
+		font-family: PingFang SC-Bold, PingFang SC;
+		font-weight: bold;
+		color: #FFFFFF;
+	}
+}
+
+.iconfont {
+	font-size: 28rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	color: #666666;
+	padding: 0 10rpx;
+}

+ 63 - 0
prsx/select/docter/index.wxml

@@ -0,0 +1,63 @@
+<van-search value="{{ params.content.where.condition }}" shape='round' placeholder="请输入搜索关键词" use-action-slot bind:clear='onClear' bind:search="startSearch">
+</van-search>
+<view class="global-total">总共{{params.content.total}}个</view>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<navigator url="#" class="project-item" wx:for="{{list}}" wx:key="sa_doctorid" data-id="{{item.sa_doctorid}}" bind:tap="changeResult">
+		<view class="main">
+			<view class="label">
+				{{item.doctorname}}
+			</view>
+			<view class="tag-box">
+				<view class="systemtag" wx:for="{{item.tag_sys}}" wx:key="item">{{item}}</view>
+				<view class="datatag" wx:for="{{item.tag}}" wx:key="item">{{item}}</view>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">联系方式:</text>
+				<text>{{item.phonenumber}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">职称:</text>
+				<text>{{item.professional}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">所属科室:</text>
+				<text>{{item.hospitaldepname || '--'}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">是否科室负责人:</text>
+				<text>{{item.isleader==0?'否':'是'}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">所属医院:</text>
+				<text>{{item.hospitalname || item.enterprisename || '--'}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">负责人:</text>
+				<text>{{item.leader[0].name}}</text>
+			</view>
+			<view class="replenish">
+				<text style="color: #666;">备注:</text>
+				<text>{{item.remarks || '--'}}</text>
+			</view>
+		</view>
+	</navigator>
+	<view wx:if="{{!radio}}" style="height: 70rpx;" />
+	<My_empty wx:if="{{!list.length}}" />
+</Yl_ListBox>
+<block wx:if="{{!radio}}">
+	<view class="footer">
+		<view class="count">
+			已选:{{result.length}}
+		</view>
+		<van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">确定</van-button>
+	</view>
+	<wxs module="handle">
+		module.exports = {
+			isCheck: function (id, list) {
+				return list.some(function (v) {
+					return v == id
+				});
+			},
+		}
+	</wxs>
+</block>

+ 12 - 0
utils/Http.js

@@ -110,6 +110,18 @@ class HTTP {
             return res.code == '1' ? res.data : [];
         }
 
+        // 千位符格式化金额
+        this.formatMoney = (num, decimalPlaces = 2, prefix = '', removeTrailingZeros = true) => {
+            if (isNaN(num)) return '';
+            let fixedNum = Number(num).toFixed(decimalPlaces);
+            if (removeTrailingZeros) {
+                fixedNum = parseFloat(fixedNum).toString();
+            }
+            let parts = fixedNum.split('.');
+            parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
+            return prefix + parts.join('.');
+        }
+
     }
     request({
         url,

+ 1 - 1
utils/work/apps.js

@@ -52,7 +52,7 @@ function getapps() {
 function getcrm() {
 	const paths = [{
 		name: "市场活动",
-		path: "/packageA/activity/index",
+		path: "/prsx/activity/index",
 		icon: "work-shichanghuodong",
 		objectname: "sat_campaign"
 	}, {