Browse Source

医院关联科室

xiaohaizhao 2 months ago
parent
commit
e440fe86ec

+ 9 - 2
project.private.config.json

@@ -10,12 +10,19 @@
     "condition": {
         "miniprogram": {
             "list": [
+                {
+                    "name": "医院详情",
+                    "pathName": "prsx/hospital/detail",
+                    "query": "id=6737",
+                    "scene": null,
+                    "launchMode": "default"
+                },
                 {
                     "name": "新建市场活动",
                     "pathName": "prsx/activity/insert",
                     "query": "",
-                    "scene": null,
-                    "launchMode": "default"
+                    "launchMode": "default",
+                    "scene": null
                 },
                 {
                     "name": "prsx/activity/detail",

+ 1 - 1
prsx/activity/Doctors/index.wxml

@@ -38,7 +38,7 @@
 			<input placeholder="费用(元)" type="digit" value="{{item.amount ||''}}" bindblur="changeAmount"
 				data-index="{{index}}" />
 		</view>
-		<view class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">
+		<view wx:if="{{disabled}}" class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">
 			<view class="iconfont icon-shanchu1" />
 		</view>
 	</view>

+ 1 - 1
prsx/activity/detail.wxml

@@ -17,7 +17,7 @@
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Doctors slot='参与医生' id="Doctors" />
+    <Doctors slot='参与医生' id="Doctors" disabled="{{isLeader}}" />
     <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}}' />

+ 32 - 21
prsx/department/detail.js

@@ -317,28 +317,39 @@ Page({
         this.partialRenewal();
     },
     onUnload() {
-        const page = getCurrentPages().find(v => v.__route__ == 'prsx/department/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: '2025101409402402',
-            content
-        }).then(res => {
-            console.log("更新科室列表", res);
-            if (res.code == '1') {
-                res.data = res.data.map(v => {
-                    v.totalstage = v.stages.length
-                    v.stage = v.stages.findIndex(s => s.stagename == v.stagename) + 1
-                    v.progress = v.stage / v.totalstage * 100;
-                    return v
-                })
-                page.setData({
-                    list: res.data,
-                    "content.total": res.total
-                })
+
+        getCurrentPages().forEach(page => {
+            switch (page.__route__) {
+                case 'prsx/department/index':
+                    let content = JSON.parse(JSON.stringify(page.data.content));
+                    content.pageSize = (content.pageNumber - 1) * content.pageSize;
+                    content.pageNumber = 1;
+                    _Http.basic({
+                        id: '2025101409402402',
+                        content
+                    }).then(res => {
+                        console.log("更新科室列表", res);
+                        if (res.code == '1') {
+                            res.data = res.data.map(v => {
+                                v.totalstage = v.stages.length
+                                v.stage = v.stages.findIndex(s => s.stagename == v.stagename) + 1
+                                v.progress = v.stage / v.totalstage * 100;
+                                return v
+                            })
+                            page.setData({
+                                list: res.data,
+                                "content.total": res.total
+                            })
+                        }
+                    })
+                    break;
+                case 'prsx/hospital/detail':
+                    let model = page.selectComponent("#Department");
+                    if (model) model.getList("", true);
+                    break;
+
             }
         })
+
     }
 })

+ 10 - 1
prsx/department/insert.js

@@ -13,6 +13,7 @@ Page({
         disabled: true,
     },
     onLoad(options) {
+        console.log(options)
         let form = [{
             label: "科室名称",
             error: false,
@@ -83,6 +84,10 @@ Page({
                 },
                 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
@@ -130,7 +135,11 @@ Page({
             })
             if (res.code != '1') return;
             getCurrentPages().forEach(v => {
-                if (v.route == 'prsx/department/detail') v.getDetail()
+                switch (v.route) {
+                    case 'prsx/department/detail':
+                        v.getDetail()
+                        break;
+                }
             })
             setTimeout(() => {
                 if (content.sa_hospitaldepid == 0) {

+ 109 - 0
prsx/hospital/Department/index.js

@@ -0,0 +1,109 @@
+const _Http = getApp().globalData.http;
+
+Component({
+    properties: {
+        disabled: {
+            type: Boolean,
+            value: true
+        }
+    },
+    options: {
+        addGlobalClass: true
+    },
+    data: {
+        sa_customersid: 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,
+                sa_customersid: id || this.data.sa_customersid
+            };
+            if (init) {
+                content.pageNumber = 1
+                content.pageTotal = 1
+            }
+            _Http.basic({
+                "id": 2025102310143002,
+                content
+            }).then(res => {
+                console.log("科室", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                let list = res.data.map(v => {
+                    v.totalstage = v.stages.length
+                    v.stage = v.stages.findIndex(s => s.stagename == v.stagename) + 1
+                    v.progress = v.stage / v.totalstage * 100;
+                    return v
+                })
+
+                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),
+                    sa_customersid: content.sa_customersid
+                })
+            })
+        },
+        insetr() {
+            const page = getCurrentPages().find(v => v.__route__ == 'prsx/hospital/detail'),
+                detail = page.data.detail;
+            wx.navigateTo({
+                url: `/prsx/department/insert?sa_customersid=${detail.sa_customersid}&name=${detail.name}`
+            })
+        },
+        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)
+        }
+    }
+})

+ 4 - 0
prsx/hospital/Department/index.json

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

+ 179 - 0
prsx/hospital/Department/index.scss

@@ -0,0 +1,179 @@
+.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;
+
+	.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;
+		}
+	}
+}
+
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}

+ 74 - 0
prsx/hospital/Department/index.wxml

@@ -0,0 +1,74 @@
+<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>
+<navigator url="/prsx/department/detail?id={{item.sa_hospitaldepid}}" class="project-item" wx:for="{{list}}" wx:key="sa_hospitaldepid">
+	<view class="chart">
+		<view class="circle">
+			<view class="circle_left ab" style="{{render.leftRate(item.progress)}}" />
+			<view class="circle_right ab" style="{{render.rightRate(item.progress)}}" />
+			<view class="circle_text">
+				<text class="value">{{item.stage+'/'+item.totalstage}}</text>
+				<text class="name">{{item.stagename}}</text>
+			</view>
+		</view>
+	</view>
+	<view class="main">
+		<view class="label">
+			<view class="title line-1">{{item.hospitaldepname}}</view>
+		</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.type}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">所属医院:</text>
+			<text>{{item.enterprisename || ' --'}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">科室负责人:</text>
+			<text>{{item.doctors || '--'}}</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>
+<My_empty wx:if="{{list.length==0}}" />
+
+
+<wxs module="render">
+	module.exports = {
+		rightRate: function (rate) {
+			if (rate - 0 < 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 0) + 'deg);';
+			} else {
+				return 'transform: rotate(0);border-color: var(--assist);';
+			}
+		},
+		leftRate: function (rate) {
+			if (rate - 0 >= 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 50) + 'deg);';
+			}
+		}
+	}
+</wxs>

+ 5 - 1
prsx/hospital/detail.js

@@ -14,6 +14,10 @@ Page({
         let tabsList = [{
             label: "详细信息",
             icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "科室",
+            icon: "icon-keshi",
+            model: "#Department"
         }, {
             label: "推荐产品",
             icon: "icon-tuijianchanpin",
@@ -375,7 +379,7 @@ Page({
                         pageNumber,
                         pageTotal
                     } = Component.data.content,
-                    id = model == "#Product" ? this.data.detail.sa_customersid : this.data.detail.sys_enterpriseid;
+                    id = model == "#Address" ? this.data.detail.sys_enterpriseid : this.data.detail.sa_customersid;
                 if (model == "#Files") init = true;
                 if (total == null || init) {
                     Component.getList(id, init);

+ 2 - 1
prsx/hospital/detail.json

@@ -3,7 +3,8 @@
         "van-dialog": "@vant/weapp/dialog/index",
         "Trace": "/prsx/trace/index",
         "Address": "/prsx/hospital/address/index",
-        "Product": "/prsx/hospital/Product/index"
+        "Product": "/prsx/hospital/Product/index",
+        "Department": "/prsx/hospital/Department/index"
     },
     "navigationBarTitleText": "医院详情"
 }

+ 1 - 0
prsx/hospital/detail.wxml

@@ -20,6 +20,7 @@
     <Trace resource='医院管理' slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{sa_customersid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sys_enterpriseid}}' />
     <Address slot='地址管理' id='Address' disabled="{{(per.query(appAuth.options,'address')||isAdmin||isLeader)&& detail.status != '已终止'}}" />
     <Product slot='推荐产品' id='Product' />
+    <Department slot='科室' id='Department' />
     <Record slot="操作" id="Record" ownertable='sa_customers' ownerid='{{sa_customersid}}' />
     <Files slot="附件" id="Files" ownertable='sa_customers' ownerid='{{sa_customersid}}' disabled="{{detail.status != '已终止'}}" />
 </Yl_FunTabs>