yuwenfen 4 vuotta sitten
vanhempi
commit
f19ce5860e

+ 1 - 3
components/date-time-picker/date-time-picker.vue

@@ -397,9 +397,7 @@ export default {
       // 传了默认日期,格式化默认日期为日期对象
       if (this.defaultValue) {
         dtDefault = utils.formatDate(this.defaultValue).dt;
-      }
-      // 如果没有传默认日期,将默认日期设置为当前日期
-      else {
+      } else {// 如果没有传默认日期,将默认日期设置为当前日期
         dtDefault = new Date();
       }
 

+ 6 - 44
components/tm-upload-img/tm-upload-img.vue

@@ -14,6 +14,7 @@
 				<image
 				  class="del-close"
 				  src="/static/del-close.png"
+          v-if="!disabled"
 					@click="delImg(i)" />
 			</view>
 		</view>
@@ -28,7 +29,7 @@
 	 * props:属性说明看tm-radio-gruop.vue
 	 */
 
-  import { URL } from "../../utils/requestUrl.js";
+  import uploadImage from "../../utils/uploadImg.js";
 	export default {
 	  props: {
 			// 上传的图片路径列表
@@ -52,7 +53,7 @@
         type: String,
         default: '上传图片'
       },
-      // 下标
+      // 下标(多个动态的图片上传组件, 遍历的下标)
       pickIndex: {
         type: Number,
         default: 0
@@ -67,47 +68,9 @@
 					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 					sourceType: ['album'], //从相册选择
 					success: res1 => {
-            console.log(filePathStr)
-            // res1.tempFilePaths.map(item => {
-            // })
-						uni.uploadFile({
-              // url: `${URL}/eduscreen/upload/picture`,
-              url: `${URL}/imed/pfm/file/uploadImg`,
-							fileType: 'image',
-							filePath: res1.tempFilePaths[0],
-              name: 'file',
-              onUploadProgress(progressEvent) {
-                var percentCompleted = Math.round(
-                  (progressEvent.loaded * 100) / progressEvent.total
-                );
-                console.log('进度条:', percentCompleted, progressEvent);
-              },
-							success: res2 => {
-								if (res2.statusCode == 200) {
-									let data = JSON.parse(res2.data || '{}');
-									if (parseInt(data.meta.code, 10) === 200) {
-										const { viewUrl, picture } = data.body;
-										this.$emit('changeFilePaths', [...this.filePaths, viewUrl], this.pickIndex)
-										this.picture = picture;
-									} else {
-										uni.showToast({
-											position: 'top',
-											icon: 'none',
-											title: '上传图片失败',
-											duration: 1000
-										});
-									}
-								}
-							},
-							error(e) {
-								uni.showToast({
-									position: 'top',
-									icon: 'none',
-									title: '上传图片失败',
-									duration: 1000
-								});
-							}
-						});
+            uploadImage(res1).then(fileList => {
+              this.$emit('changeFilePaths', fileList, this.pickIndex);
+				  	})
 					},
 					error: e => {
 						console.log('选择图片失败', e);
@@ -116,7 +79,6 @@
 			},
 			// 删除图片
 			delImg(i) {
-        if(this.disabled) return;
 				this.$emit('changeFilePaths', this.filePaths.filter((item, index) => index != i), this.pickIndex);
 			}
 		}

+ 9 - 2
pages.json

@@ -64,8 +64,15 @@
 				"navigationBarTitleText": "消息中心",
 				"enablePullDownRefresh": false
 			}
-		}
-	],
+    },
+    {
+      "path": "pages/improve-mission-list/improve-mission-list",
+      "style": {
+          "navigationBarTitleText": "改善列表",
+          "enablePullDownRefresh": false
+        }
+      }
+    ],
 	"globalStyle": {
 		"navigationStyle": "custom",
 		"navigationBarTextStyle": "black",

+ 66 - 0
pages/improve-mission-list/improve-mission-list.vue

@@ -0,0 +1,66 @@
+<template>
+	<view class="improve-mission-list-page">
+		<scroll-view class="scroll-y" scroll-y="true">
+			<list-item
+				v-for="(item, i) in improvingTaskList"
+				:key="item.id"
+				:task="item"
+			/>
+			<list-item
+        v-for="(item, i) in completeTaskList"
+        :key="item.id"
+        :task="item"
+        :isComplete="true"
+			/>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+  // 改善列表
+	export default {
+		data() {
+			return {
+      	// 改善中任务
+				improvingTaskList: [],
+				// 历史任务
+				completeTaskList: []
+			}
+    },
+    onLoad({ situationId }){ // situationId:情景id
+      this.getMissionList({situationId});
+    },
+		methods: {
+    	// 获取改善任务列表
+			getMissionList(data) {
+				this.$store.dispatch({
+					type: 'mission/commActions',
+					payload: {
+						key: "getMissionList",
+						data
+					}
+				}).then(data => {
+					if(data) {
+						this.improvingTaskList = data.improvingTaskResponses || [];
+						this.completeTaskList = data.improveCompleteResponses || [];
+					}
+				});
+				/** 请求参数 data
+				 * situationId: 情境id 当管路员或者查核者通过情境进入任务列表时 必传
+				 * checkItemId 单位负责人通过 查核要点进入改善任务列表时 必传
+				 */
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+  .improve-mission-list-page {
+    height: 100%;
+    padding-top: 15rpx;
+
+    .scroll-y {
+      height: 100%;
+    }
+  }
+</style>

+ 14 - 7
pages/mission-action/components/assign-mission.vue

@@ -92,9 +92,8 @@
       },
       // 确定
       sure() {
-        const { params } = this.btnInfo;
         let requestParams = {};
-        this.btnInfo.params.map(item => {
+        this.btnInfo.params && this.btnInfo.params.map(item => {
           if(item.valueKey){
             requestParams[item.paramsKey] = (
               item.isOutvalueKey
@@ -128,16 +127,24 @@
 				this.$store.dispatch({
 					type: 'mission/commActions',
 					payload: {
-						key: "getEmpDeptTree"
+            key: "getEmpDeptTree",
+            data: {
+              deptId: this.missionDetails.deptId // 单位id
+            }
 					}
 				}).then(data => {
 					if(data) {
             let _empDeptList = [];
-            data && data.map(item => {
-              if(item.responseList){
-                 _empDeptList = [..._empDeptList, ...item.responseList];
+            data && data[0] && data[0].responseList.map(item => {
+              if(item.deptManage == 1) { // 是否部门负责人 1是 0 否
+                _empDeptList.push({
+                  ...item,
+                  empName: '单位负责人' + item.empName
+                });
+              }else {
+                _empDeptList.push(item);
               }
-            });
+            })
             this.empDeptList = _empDeptList;
 					}
 				});

+ 0 - 2
pages/mission-action/components/pdca-components/do-and-check.vue

@@ -104,14 +104,12 @@
       changeDateTime(dateObj, pickType, index) {
         let _recordList = [...this.recordList];
         _recordList[index].date = dateObj.f4;
-        console.log('日期时间', dateObj.f4, index);
         this.$emit('changeRecordList', _recordList);
       },
       // 改善效果改变
       changeFilePaths(filePaths, index) {
         let _recordList = [...this.recordList];
         _recordList[index].filePath = filePaths;
-        console.log('改善效果', filePaths, index);
         this.$emit('changeRecordList', _recordList);
       },
       // 新增一条记录

+ 27 - 6
pages/mission-action/components/pdca.vue

@@ -41,7 +41,7 @@
          />
 			</scroll-view>
 			<view class="fixed-buttom-btn" v-if="!disabled">
-		   	<view class="fixed-buttom-btn">
+		   	<view class="btn-text cancle" @click="sure('')">
 					<text>暂存</text>
 				</view>
 				<view class="btn-text" @click="toggleModalVisibile">
@@ -123,10 +123,10 @@
       if(this.disabled) {
         this.plan = this.values['plan'] || '';
         this.doList = (this.values['do'] && this.values['do'].length > 0)
-          ? this.values['do']
+          ? this.getComList(this.values['do'], 'do')
           : [{record: '', date: ''}];
         this.checkList = (this.values['check'] && this.values['check'].length > 0)
-          ? this.values['check']
+          ? this.getComList(this.values['check'], 'check')
           : [{record: '', date: '', filePath: [] }];
         this.action = this.values['action'] || '';
       }
@@ -155,7 +155,6 @@
       },
       // 提交审核/ 暂存(暂存时improveScheme为空)
       sure(improveScheme) {
-        const { params } = this.btnInfo;
         let requestParams = {
           improveScheme // 改善方案名称
         };
@@ -199,9 +198,31 @@
             }
           }
         });
-        console.log(9, requestParams)
         this.$emit('comRequest', requestParams);
-        this.toggleModalVisibile();
+        improveScheme && this.toggleModalVisibile();
+      },
+       /**
+       * 获取相同key 的新数组
+       * @param {Array} list 原数组
+       * @param {String} type 类型(如 do、check)
+       */
+      getComList(list, type) {
+        let newList = [];
+        list.map(item => {
+          if(type === 'do') {
+            newList.push({
+              record: item.taskDoProcess || '', // 记录内容
+              date: item.taskDoPlan || '' // 计划日期
+            });
+          }else if(type === 'check'){
+            newList.push({
+              record: item.taskCheckProcess || '', // 记录过程
+              date: item.taskCheckPlan || '', // 计划日期
+              filePath: item.taskCheckEffect ? item.taskCheckEffect.split(',') : [] // 改善效果(图片)
+            });
+          }
+        });
+        return newList;
       }
 		},
 		components: {

+ 19 - 10
pages/mission-action/components/write-back.vue

@@ -64,7 +64,7 @@
 		data() {
 			return {
         value: '',
-				filePath: ['/static/img-icon.png', '/static/img-icon.png']
+				filePath: []
 			}
 		},
 		created() {
@@ -73,7 +73,7 @@
       });
       if(this.disabled) {
         this.value = this.values['textarea'];
-        this.filePath = this.values['filePath'] || [];
+        this.filePath = this.values['filePath'] ? this.values['filePath'].split(',') : [];
       }
 		},
 		methods: {
@@ -84,19 +84,28 @@
 				this.filePath = filePath;
       },
       sure() {
-        const { params } = this.btnInfo;
         let requestParams = {};
-        params.map(item => {
+        this.btnInfo.params.map(item => {
           if(item.valueKey){
-            requestParams[item.paramsKey] = (item.isOutvalueKey ? this.missionDetails : this.btnInfo)[item.valueKey];
+            requestParams[item.paramsKey] = (
+              item.isOutvalueKey
+              ? this.missionDetails
+              : this.btnInfo
+            )[item.valueKey];
           }else {
-            if(item.paramsKey === 'imgPath'){ // 上传图片
-              requestParams[item.paramsKey] = this.filePath.join(',');
-            }else {
-              requestParams[item.paramsKey] = this.value;
+             switch(item.paramsKey){
+              case 'imgPath': // 上传图片
+                requestParams[item.paramsKey] = this.filePath.join(',');
+                break;
+              case 'textarea': // 回复内容
+                requestParams[item.paramsKey] = this.value;
+                break;
+              default:
+                requestParams[item.paramsKey] = '';
+                break;
             }
           }
-        })
+        });
         this.$emit('comRequest', requestParams);
       }
 		}

+ 3 - 5
pages/mission-action/mission-action.vue

@@ -30,7 +30,7 @@
 		data() {
 			return {
 				// 当前显示的组件
-        currentComponet: 'assign-mission',
+        currentComponet: '',
         // 查看详情回显的数据
         values: {},
         // 按钮信息
@@ -40,7 +40,7 @@
 					{type: 2, name: '原因', component: 'disagree'},
 					{type: 3, name: '人员架构', component: 'personnel'},
 					{type: 4, name: '改善回复', component: 'write-back'},
-					{type: 5, name: 'PDCA', component: 'pdca'},
+					{type: 5, name: 'PDCA', component: 'pdca'}
         ],
         // pdca类型
         pdcaSetting: 'p'
@@ -52,7 +52,6 @@
 		methods: {
       // 获取组件信息
       getComponentInfo(details) {
-        console.log('组件数据', details)
         const {
           nextPermission,
           nextPermissionName,
@@ -77,11 +76,10 @@
             values[labelKey] = (isOutvalueKey ? this.missionDetails : details)[key]
           }
           this.values = values;
-          this.pdcaSetting = pdcaSetting;
-          this.btnInfo = details;
         }else { // 编辑流程
           this.btnInfo = details;
         }
+        this.pdcaSetting = pdcaSetting;
       },
       // 公共改善任务接口
       comTaskCirculation(data) {

+ 1 - 1
pages/mission-details/mission-details.vue

@@ -120,7 +120,7 @@
         if(btnInfo.componentName){ // 有组件名,则跳转页面
           uni.navigateTo({
             url: `/pages/mission-action/mission-action?details=${encodeURIComponent(JSON.stringify({...currentInfo, ...btnInfo}))}`
-				  })
+				  });
         }else { // 直接调接口
           let requestParams = {};
           btnInfo.params.map(item => {

+ 13 - 14
pages/mission-details/setting.js

@@ -1,11 +1,5 @@
 // 任务流程列表
-/**
- * 注意:
- 1. 所有imgPath要换成正式接口key;
- 2. taskType: 11的按钮需要重新来一遍plan吗,还是pdca都可修改
- 3. taskType: 12的驳回请求按钮好像不需要填写原因,(原因没画)
- 4. taskType: 15 制定改善方案,从p开始还是pdca都需要执行)
- */
+
 const taskTypeList = [
   {
     taskType: 1, // 任务当前状态
@@ -98,7 +92,7 @@ const taskTypeList = [
           { paramsKey: 'receiveEmpId', valueKey: 'receiveEmpId', isOutvalueKey: false }, // 接收人id
           { paramsKey: 'receiveEmpName', valueKey: 'adminName', isOutvalueKey: true }, // 接收人姓名
           { paramsKey: 'approveReason', valueKey: null }, // 不认可原因
-          { paramsKey: 'imgPath', valueKey: null } // 图片地址
+          { paramsKey: 'improveUrl', valueKey: null } // 图片地址
         ]
       }
     ],
@@ -264,7 +258,7 @@ const taskTypeList = [
       hasAnyData: true, // 是否有多个数据需要回显(多个数据对多个key)
       dataKey: [
         {key: 'approveReason', isOutvalueKey: false, labelKey: 'textarea'}, // 回复内容
-        {key: 'imgPath', isOutvalueKey: false, labelKey: 'filePath'} // 回复图片地址
+        {key: 'improveUrl', isOutvalueKey: false, labelKey: 'filePath'} // 回复图片地址(多个用逗号分隔)
       ],
       disabled: true
     },
@@ -669,9 +663,10 @@ const taskTypeList = [
           { paramsKey: 'receiveEmpId', valueKey: 'establishEmpId', isOutvalueKey: false }, // 指派人
           { paramsKey: 'receiveEmpName', valueKey: 'establishEmpName', isOutvalueKey: false }, // 指派人姓名
           { paramsKey: 'taskPlan', valueKey: 'taskPlan', isOutvalueKey: false }, // 改善plan
-          { paramsKey: 'taskAction', valueKey: null }, // action
-          { paramsKey: 'taskDoRequestList', valueKey: null }, // do
-          { paramsKey: 'taskCheckRequestList', valueKey: null } // check
+          { paramsKey: 'taskAction', valueKey: 'taskAction', isOutvalueKey: false }, // action
+          { paramsKey: 'taskDoRequestList', valueKey: 'taskDoRequestList', isOutvalueKey: false }, // do
+          { paramsKey: 'taskCheckRequestList', valueKey: 'taskCheckRequestList', isOutvalueKey: false }, // check
+          { paramsKey: 'approveReason', valueKey: null } // 不通过原因
         ]
       },
       {
@@ -684,11 +679,16 @@ const taskTypeList = [
           { paramsKey: 'taskType', valueKey: 'taskType', isOutvalueKey: false }, // 状态值
           { paramsKey: 'receiveEmpId', valueKey: 'adminId', isOutvalueKey: true }, // 接收人id
           { paramsKey: 'receiveEmpName', valueKey: 'adminName', isOutvalueKey: true }, // 接收人姓名
+          { paramsKey: 'taskPlan', valueKey: 'taskPlan', isOutvalueKey: false }, // 改善plan
+          { paramsKey: 'taskAction', valueKey: 'taskAction', isOutvalueKey: false }, // action
+          { paramsKey: 'taskDoRequestList', valueKey: 'taskDoRequestList', isOutvalueKey: false }, // do
+          { paramsKey: 'taskCheckRequestList', valueKey: 'taskCheckRequestList', isOutvalueKey: false }, // check
+          { paramsKey: 'improveScheme', valueKey: 'improveScheme', isOutvalueKey: false }, // 改善方案名称
         ]
       },
     ],
     row1: { hasJoin: true, name: '改善者x', key: 'establishEmpName' },
-    row2: {hasJoin: false, name: '提交了改善计划(PLAN)'},
+    row2: {hasJoin: false, name: '提交了改善方案(PDCA)'},
     selectDetails: {
       name: '查看改善方案详情',
       hasAnyData: true, // 是否有多个数据需要回显(多个数据对多个key)
@@ -725,7 +725,6 @@ const taskTypeList = [
       disabled: true
     }
   },
-
   {
     taskType: 18,
     checkResult: 1,

+ 1 - 1
pages/mission/mission.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="mission-page">
 		<view class="message-remind" @click="toMessagePage">
-			<image :src="messageType?'/static/mission/消息中心未读.png':'/static/mission/消息中心已读.png'" mode=""></image>
+			<image :src="messageType?'/static/message-unread.png':'/static/message-read.png'" mode=""></image>
 		</view>
 	 	<scroll-view class="scroll-y" scroll-y="true">
 			<list-item

+ 5 - 5
pages/mission/model.js

@@ -27,8 +27,8 @@ export default {
       recordTime: "2021-02-03 09:44:17", // 最终修改时间
       situationId: 1, // 情景id
       situationName: "测试情景", // 情景名称
-      taskType: 2, // 任务当前状态
-      updateTime: "2021-02-03T01:44:17.000+0000", // 修改时间 (发送时间)
+      taskType: 10, // 任务当前状态
+      updateTime: "2021-02-03T01:44:16.000+0000", // 修改时间 (发送时间)
       improveEmpName: '', //改善人
       improveEmpId: '', //改善人id
       buttonDisplayFlag: 1,  // 底部按钮显示隐藏 0 不展示 1展示
@@ -48,7 +48,7 @@ export default {
           taskAction: "", // 改善处置 action
           taskId: 1, // 任务id
           taskPlan: "噢噢噢噢",// plan整改计划
-          taskType: 13, // 流转状态
+          taskType: 8, // 流转状态
           improveScheme: '', // 改善方案名称
           approveReason: '审核意见', // 审核意见/原因
           taskDoRequestList: [ // do
@@ -78,14 +78,14 @@ export default {
           taskAction: "", // 改善处置 action
           taskId: 1, // 任务id
           taskPlan: "plan内容",// plan整改计划
-          taskType: 13, // 流转状态
+          taskType: 10, // 流转状态
           improveScheme: '', // 改善方案名称
           approveReason: '审核意见', // 审核意见
           taskDoRequestList: [ // do
             {
               taskDoId:"mock",  // 过程记录id
               taskDoProcess:"mock", // 过程记录内容
-              taskDoPlan:"mock" // 计划日期
+              taskDoPlan:"2020-12-12 00:01:50" // 计划日期
             }
           ],
           taskCheckRequestList: [// check

+ 0 - 0
static/mission/消息中心已读.png → static/message-read.png


+ 0 - 0
static/mission/消息中心未读.png → static/message-unread.png


BIN
static/mission/多选-已选状态.png


BIN
static/mission/导航栏返回.png


BIN
static/mission/蓝色更多.png


+ 53 - 0
utils/uploadImg.js

@@ -0,0 +1,53 @@
+import { URL } from "./requestUrl.js";
+
+// 上传图片方法(单张/多张上传)
+const uploadImage = (params) => {
+	return new Promise((presolve, preject) => {
+		uni.showLoading()
+		let uploads = [];
+		(params.tempFilePaths).forEach((item, i) => {
+			uploads[i] = new Promise((resolve) => {
+				uni.uploadFile({
+          url: `${URL}/imed/pfm/file/uploadImg`,
+          fileType: 'image',
+					filePath: item,
+					name: 'file',
+					formData: {
+						'Filedata': item
+					},
+					header:{
+						token: uni.getStorageSync('token')
+          },
+					success(res) {
+						// console.log('1122',JSON.parse(res.data));
+						let data = JSON.parse(res.data);
+						if(data.code == 'SUCCESS'){
+							resolve(data.data)
+						}else{
+							resolve('')
+						}
+					},
+					fail(err) {
+						console.log('上传图片失败:', err)
+						uni.hideLoading()
+					}
+				})
+			})
+		})
+
+    Promise.all(uploads).then(res => {
+			//图片上传完成
+			presolve(res)
+			uni.hideLoading()
+		}).catch(err => {
+			preject(err)
+			uni.hideLoading()
+			uni.showToast({
+				title: '上传失败请重试',
+        icon: 'none',
+        duration: 1000
+			})
+		})
+	})
+}
+export default uploadImage;