Forráskód Böngészése

Merge branch 'master' of ssh://s1.nsloop.com:29418/web_TracerMethodology

“yst 4 éve
szülő
commit
c4ebdb4026

+ 25 - 0
App.vue

@@ -47,9 +47,34 @@
 		line-height: 18.75rpx;
 	}
 	
+	body,
+	uni-app,
+	uni-page {
+		background-color: #F5F6FA;
+	}
+	
 	view,
 	label,
 	scroll-view {
 		box-sizing: border-box;
 	}
+	
+	// 底部固定的按钮
+	.fixed-buttom-btn {
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin-top: 12.5rpx;
+		width: 100%;
+		height: 75rpx;
+		background-color: #3377FF;
+		
+		.btn-text {
+			font-size: 22.5rpx;
+			color: #fff;
+		}
+	}
 </style>

+ 1 - 0
README.md

@@ -7,6 +7,7 @@
 1. 步骤条:tm-steps,详细传参说明在组件内部。
 2. 树形控件:tm-trees。
 3. 底部tabBar:tm-tabbar。
+4. 单选列表组合:tm-radio-group。
 
 ### 公共组件的注册方式 
 ---

+ 21 - 11
components/tm-button/tm-button.vue

@@ -1,18 +1,28 @@
 <template>
-	<view :class="['tm-button-container', true ? 'pramary' : '']">
-		<text class="btn-text">确定</text>
+	<view
+    :class="['tm-button-container', type === 'pramary' ? 'pramary' : '']"
+     @click="btnClick" >
+		<text class="btn-text">{{ btnText }}</text>
 	</view>
 </template>
 
 <script>
 	export default {
-		data() {
-			return {
-				
-			}
-		},
+    props: {
+      //按钮类型 default:蓝色背景按钮;pramary:线条按钮
+      type: {
+        type: String,
+        default: 'default'
+      },
+      btnText: {
+        type: String,
+        default: '确定'
+      }
+    },
 		methods: {
-			
+			btnClick() {
+				this.$emit('btnClick')
+			}
 		}
 	}
 </script>
@@ -27,17 +37,17 @@
 		background: #3377FF;
 		border-radius: 37.5rpx;
 		border: 1.25rpx solid #3377FF;
-		
+
 		.btn-text {
 			font-size: 22.5rpx;
 			letter-spacing: 2.5rpx;
 			color: #fff;
 		}
 	}
-	
+
 	.tm-button-container.pramary {
 		background-color: #FFFFFF;
-		 
+
 		 .btn-text {
 		 	color: #3377FF;
 		 }

+ 112 - 0
components/tm-radio-group/tm-radio-group.vue

@@ -0,0 +1,112 @@
+<template>
+	<view class="tm-radio-group">
+		<view v-if="label" class="label-view">
+			<text>{{ label }}</text>
+		</view>
+		<view class="radio-group">
+			<template v-for="(item, i) in list">
+				<view class="radio-item" :key="i" @click="toggleSelect(item, i)">
+					<text class="text">{{ item[setting.name] }}</text>
+					<image class="icon" 
+					  :src="`/static/${item[setting.value] === defaultValue ? 'check-radio' : 'check-no'}.png`"></image>
+				</view>
+			</template>
+		</view>
+	</view>
+</template>
+
+<script>
+	/**
+	 * 单选列表组合
+	 * 芦荟
+	 * 2021.2.2
+	 * props:看下面,有注释说明
+	 */
+	export default {
+		props: {
+			// 渲染的数据
+			list: {
+				type: Array,
+				default: []
+			},	
+			// 选中的数据 
+			defaultValue: {
+				type: Number | String,
+				default: ''
+			},
+			// 单选列表组合名字
+			label: {
+				type: String,
+				default: ''
+			},
+			// 单选组配置
+			setting: {
+				type: Object, 
+				default: {
+					value: 'value', // 设置当前选中的值(默认取value)
+					name: 'name' // 当前显示的文字(默认取name)
+				}
+			}
+		},
+		methods: {
+			/**
+			 * 选中变化调用
+			 * @param {Object} selectData 当前选中的对象
+			 * @param {Object} index 当前选中下标
+			 * 
+			 * 返回的参数
+			 * selectData[this.setting.value]: 当前选中的值
+			 * selectData: 当前选中的整条数据
+			 * index:      当前选中的下标
+			 */
+			toggleSelect(selectData, index){
+				this.$emit(
+				  'change', 
+				  selectData ? selectData[this.setting.value] : '', 
+					selectData, 
+					index
+				);
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.tm-radio-group {
+		
+		.label-view {
+			height: 47.5rpx;
+			line-height: 45rpx;
+			padding-left: 25rpx;
+			
+			>text {
+				font-size: 22.5rpx;
+				color: #666F80;
+			}
+		}
+		
+		.radio-group {
+			padding-left: 25rpx;
+			background-color: #fff;
+			
+			.radio-item {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				height: 87.5rpx;
+				border-bottom: 0.62rpx solid #DADEE6;
+				padding-right: 25rpx;
+				
+				.text {
+					font-size: 22.5rpx;
+					color: #292C33;
+				}
+				
+				.icon {
+					width: 25rpx;
+					height: 25rpx;
+				}
+			}
+		}
+	}
+</style>

+ 1 - 1
components/tm-tabbar/tm-tabbar.vue

@@ -54,7 +54,7 @@
 						text: '配置', 
 						iconPath: '/static/tabbar/setting-unselect.png', 
 						selectedIconPath: '/static/tabbar/setting-select.png', 
-						pagePath: 'pages/index/index'
+						pagePath: 'pages/configure/configure'
 					},{
 						text: '我的', 
 						iconPath: '/static/tabbar/my-unselect.png', 

+ 15 - 0
pages.json

@@ -23,12 +23,26 @@
 				"enablePullDownRefresh": false
 			}
 		},
+		{
+			"path": "pages/configure/configure",
+			"style": {
+				"navigationBarTitleText": "配置",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 			"path": "pages/mission-details/mission-details",
 			"style": {
 				"navigationBarTitleText": "改善任务",
 				"enablePullDownRefresh": false
 			}
+		},
+		{
+			"path": "pages/mission-action/mission-action",
+			"style": {
+				"navigationBarTitleText": "改善任务",
+				"enablePullDownRefresh": false
+			}
 		}
 	    ,{
             "path" : "pages/home/home",
@@ -41,6 +55,7 @@
         }
     ],
 	"globalStyle": {
+		"navigationStyle": "custom",
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "追踪方法学",
 		"navigationBarBackgroundColor": "#F8F8F8",

+ 143 - 0
pages/configure/configure.vue

@@ -0,0 +1,143 @@
+<template>
+	<view class="configure-page">
+		<view class="greyTitle">为结果选项配置后续操作</view>
+		<view v-for="(item,index) in resultConfigList" :key="index" class="configure-cont">
+			<text class="contTitle">{{item.name}}</text>
+			<text class="contCont" v-for="items in configList" v-if="item.resultType == items.key">{{items.name}}</text>
+			<image src="../../static/查看更多_.png" class="moreImg" @click="showConfig(item,index)"></image>
+		</view>
+		<view class="sure-button">
+			<button @click="sureList">保存</button>
+		</view>
+		<view class="recovery" @click="recoveryList">恢复初始配置</view>
+	  <tm-tabbar :permission="1" />
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				resultConfigList:[],
+				configList:[
+					{
+						key:'1',
+						name:'无需操作',
+					},{
+						key:'2',
+						name:'需改善回复',
+					},{
+						key:'3',
+						name:'需使用改善工具',
+					}
+				],
+				showPopup:false,
+				radioVal:null,
+				index:null,
+			}
+		},
+		created() {
+			this.getResultConfig()
+		},
+		methods: {
+			//获取最新配置
+			getResultConfig(){
+				this.$store.dispatch({
+					type:'configure/commActions',
+					payload:{
+						key:'getResultConfig'
+					}
+				}).then(res=>{
+					this.resultConfigList = res?res:[];
+				})
+			},
+			//恢复最初配置
+			recoveryList(){
+				this.$store.dispatch({
+					type:'configure/commActions',
+					payload:{
+						key:'getDefault'
+					}
+				}).then((res)=>{
+					// console.log(res)
+					// this.resultConfigList = res?res:[];
+				})
+			},
+			//保存配置
+			sureList(){
+				this.$store.dispatch({
+					type:'configure/commActions',
+					payload:{
+						key:'postResultConfig',
+						data:{
+							list:this.resultConfigList
+						}
+					}
+				}).then(res=>{
+					// console.log(res,'kkkk')
+					this.getResultConfig();
+					// this.resultConfigList = res?res:[];
+				})
+			}
+		},
+		components: {
+		}
+	}
+</script>
+
+<style lang="less">
+	.configure-page{
+		height: 100%;
+		background-color: #F5F6FA;
+		.greyTitle{
+			padding-left:25rpx;
+			height: 105rpx;
+			line-height: 105rpx;
+			font-size: 30rpx;
+			color: #292C33;
+		}
+		.configure-cont{
+			padding-left:25rpx;
+			font-size: 22.5rpx;
+			line-height: 87.5rpx;
+			border-bottom: 0.62rpx solid #DADEE6;
+			background-color: #fff;
+			.contTitle{
+				display: inline-block;
+				width: 175rpx;
+				color: #525866;
+			}
+			.contCont{
+				color: #292C33;
+			}
+			.moreImg{
+				margin-top: 31.23rpx;
+				margin-right: 18.68rpx;
+				padding: 1.89rpx 6.31rpx;
+				float: right;
+				width: 12.37rpx;
+				height: 21.21rpx;
+			}
+		}
+		.configure-cont:nth-child(6){
+			border-bottom: none;
+		}
+		.sure-button{
+			margin: 35rpx auto;
+			button{
+				width: 625rpx;
+				height: 62.5rpx;
+				line-height: 62.5rpx;
+				border-radius: 37.5rpx;
+				background-color: #3377FF;
+				color: #fff;
+				font-size: 22.5rpx;
+			}
+		}
+		.recovery{
+			text-align: center;
+			color: #7A8599;
+			font-size: 22.5rpx;
+		}
+	}
+</style>

+ 29 - 0
pages/configure/model.js

@@ -0,0 +1,29 @@
+import { commServer } from './server.js';
+
+export default {
+  namespaced: true,
+  state: {
+    // baseInfo: 'test',
+    // // 包含院区,病区, 床号
+    // patParams: {
+    //   hiId: '1',
+    //   wardDm: '-10022',
+    //   bedNo: '201'
+    // }
+  },
+  mutations: {
+  //   changeBaseInfo(state, { baseInfo }) {
+  //     state.baseInfo = baseInfo;
+  //   },
+  //   // 修改第三方应用传递的参数
+  //   changePatParams(state, { patParams }) {
+  //     state.patParams = patParams;
+  //   },
+  },
+  actions: {
+    commActions({ commit, state }, { payload }) {
+	  // payload = {key,data} // data是请求数据,key是请求接口id
+      return commServer(payload);
+	},
+  }
+}

+ 25 - 0
pages/configure/server.js

@@ -0,0 +1,25 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+	// 保存配置
+	postResultConfig: {
+		method: 'POST',
+		url: 'imed/pfm/resultConfig'
+	},
+	//最新配置
+	getResultConfig:{
+		method: 'GET',
+		url: 'imed/pfm/resultConfig'
+	},
+	//默认配置列表
+	getDefault:{
+		method: 'GET',
+		url: 'imed/pfm/resultConfig/default'
+	}
+	
+};
+
+export const commServer = ({ key, data }) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}

+ 84 - 0
pages/mission-action/components/assign-mission/assign-mission.vue

@@ -0,0 +1,84 @@
+<template>
+	<view class="assign-mission">
+		<scroll-view class="scroll-y" scroll-y="true">
+			<tm-radio-group 
+			  :list="list"
+				label="改善工具"
+				:defaultValue='defaultValue'
+				@change="changeSelect"
+				:setting="{
+				  value: 'value',
+				  name: 'label'
+			  }"
+		/>
+		<view class="switch-box">
+			<text class="label">需要审核改善方案</text>
+			<switch checked="true" style="transform:scale(1.5)" />
+		</view>
+		<tm-radio-group
+			  :list="list"
+				:defaultValue='defaultValue'
+				@change="changeSelect"
+				:setting="{
+				  value: 'value',
+				  name: 'label'
+			  }"
+		/>
+		</scroll-view>
+		<view class="fixed-buttom-btn">
+			<text class="btn-text">确定</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	// 指派改善任务
+	export default {
+		data() {
+			return {
+				defaultValue: 1,
+				list: [
+					{value: 1, label: 'PDCA1'},
+					{value: 2, label: 'PDCA2'},
+					{value: 3, label: 'PDCA3'},
+					{value: 4, label: 'PDCA4'}
+				]
+			}
+		},
+		created() {
+			uni.setNavigationBarTitle({
+				title: '指派改善任务'
+			});
+		},
+		methods: {
+			changeSelect(selectVal, selectData, i) {
+				this.defaultValue = selectVal;
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.assign-mission {
+		height: 100%;
+		
+		.scroll-y {
+			height: calc(100% - 87.5rpx);
+			
+			.switch-box {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				margin-bottom: 15rpx;
+				height: 87.5rpx;
+				background-color: #fff;
+				padding: 0 25rpx;
+				
+				.label {
+					font-size: 22.5rpx;
+					color: #292C33;
+				}
+			}
+		}
+	}
+</style>

+ 28 - 0
pages/mission-action/mission-action.vue

@@ -0,0 +1,28 @@
+<template>
+	<view class="mission-action-page">
+		<assign-mission />
+	</view>
+</template>
+
+<script>
+	import assignMission from './components/assign-mission/assign-mission.vue'
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		},
+		components: {
+			assignMission
+		}
+	}
+</script>
+
+<style lang="less">
+	.mission-action-page {
+		height: 100%;
+	}
+</style>

+ 16 - 5
pages/mission-details/mission-details.vue

@@ -30,10 +30,11 @@
 								</view>
 						  </view>
 						</view>
+						<view class="btn-group" v-if="i === list.length-1">
+							<tm-button type="pramary" btnText="重新发送" />
+							<tm-button btnText="指派改善任务" @btnClick="clickRightBtn" />
+						</view>
 					</template>
-					<view class="btn-group">
-						<tm-button />
-					</view>
 				</view>
 			</view>
 		</scroll-view>
@@ -53,7 +54,12 @@
 			}
 		},
 		methods: {
-			
+			// 点击右侧按钮
+			clickRightBtn() {
+				uni.navigateTo({
+					url: '/pages/mission-action/mission-action'
+				})
+			}
 		},
 		components: {
 			listItem, 
@@ -65,7 +71,6 @@
 	.mission-details-page {
 		height: 100%;
 		padding-top: 15rpx;
-		background-color: #F5F6FA;
 		
 		.scroll-y {
 			height: 100%;
@@ -148,6 +153,12 @@
 							}
 						}
 					}
+					
+					.btn-group {
+						display: flex;
+						justify-content: space-between;
+						padding: 0 25rpx;
+					}
 				}
 			}
 		}

+ 0 - 1
pages/mission/components/mission-list/list-item.vue

@@ -45,7 +45,6 @@
 		methods: {
 			// 跳转详情页面(改善任务)
 			gooDetails(){
-				console.log(9)
 				uni.navigateTo({
 				  url: '/pages/mission-details/mission-details'
 				});

+ 0 - 1
pages/mission/mission.vue

@@ -27,7 +27,6 @@
 <style lang="less">
  .mission-page {
 	 height: 100%;
-	 background-color: #F5F6FA;
 	 overflow: hidden;
  }
 </style>

+ 3 - 2
pages/model.js

@@ -1,5 +1,6 @@
 import login from './login/model.js';
-
+import configure from './configure/model.js';
 export default module = {
-  login
+  login,
+  configure,
 }

+ 2 - 1
utils/request.js

@@ -48,7 +48,8 @@ function request(url, options, additional) {
   // 模拟token,做登录的同学将这行代码移到登录成功函数中.
 
   // uni.setStorageSync('token', 'MjU2OzE2MTE2MjIxODYwNjM7OGJjMTA2ZjNhMzMyNGUxOTRhMmFlMGExOThjMzA5OGE=');
-  const token = uni.getStorageSync('token');
+  // const token = uni.getStorageSync('token');
+  const token = '/JY28U+aEf4jsMZoXx4jVKJl1iCZjBfMgEiS8wzU8Ts='
   return uni.request({
     url: `${BASE_URL}${url}`,
     ...options,

+ 23 - 0
yarn.lock

@@ -0,0 +1,23 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+crypto-js@^4.0.0:
+  version "4.0.0"
+  resolved "https://registry.npm.taobao.org/crypto-js/download/crypto-js-4.0.0.tgz#2904ab2677a9d042856a2ea2ef80de92e4a36dcc"
+  integrity sha1-KQSrJnep0EKFai6i74DekuSjbcw=
+
+moment@^2.29.1:
+  version "2.29.1"
+  resolved "https://registry.npm.taobao.org/moment/download/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
+  integrity sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=
+
+qs@^6.9.6:
+  version "6.9.6"
+  resolved "https://registry.npm.taobao.org/qs/download/qs-6.9.6.tgz?cache=0&sync_timestamp=1610598111557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee"
+  integrity sha1-Ju08gkOkMbKSSsqEzJBHHzXVoO4=
+
+vuex@^3.6.0:
+  version "3.6.2"
+  resolved "https://registry.npm.taobao.org/vuex/download/vuex-3.6.2.tgz?cache=0&sync_timestamp=1611672210051&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"
+  integrity sha1-I2vAhqhww655lG8QfxbeWdWJXnE=