瀏覽代碼

拉取代码

jiangniuniu 4 年之前
父節點
當前提交
71dd3e7222

+ 3 - 2
components/tm-radio-group/radio-group.vue

@@ -23,7 +23,7 @@
 	 * props:属性说明看tm-radio-gruop.vue
 	 */
 	export default {
-	  props: ['list', 'defaultValue', 'label', 'setting'],
+	  props: ['list', 'defaultValue', 'label', 'setting', 'pIndex'],
 		methods: {
 			/**
 			 * 选中变化调用
@@ -40,7 +40,8 @@
 				  'change',
 				  selectData ? selectData[this.setting.value] : '',
 					selectData,
-					index
+          index,
+          this.pIndex
 				);
 			}
 		}

+ 4 - 3
components/tm-radio-group/radio-select-group.vue

@@ -10,6 +10,7 @@
         <template v-if="isOpen(i)">
 					<view class="child-radio-group">
 						<child-radio-group
+              :pIndex="i"
 						  :list="item[setting.child] || []"
 						  :defaultValue="defaultValue"
 						  :label="label"
@@ -42,8 +43,8 @@
 			 * @param {Object} selectData 当前选中的对象
 			 * @param {Object} index 当前选中下标
 			 */
-			toggleSelect(selectVal, selectData, index){
-		  	this.$emit('change', selectVal, selectData, index);
+			toggleSelect(selectVal, selectData, index, pIndex){
+		  	this.$emit('change', selectVal, selectData, index, ((pIndex || pIndex == 0) ? this.list[pIndex] : {}));
       },
       changeOpenKey(key) {
         let openKey = this.openkeys.find(openKey => openKey === key);
@@ -84,7 +85,7 @@
         }
       }
     }
-		
+
 		.child-radio-group {
 			padding-left: 62.5rpx;
 		}

+ 3 - 2
components/tm-radio-group/tm-radio-group.vue

@@ -94,9 +94,10 @@ import radioSelectGroup from './radio-select-group.vue'
 			 * selectData[this.setting.value]: 当前选中的值
 			 * selectData: 当前选中的整条数据
 			 * index:      当前选中的下标
+			 * pSelect:    选中的父级数据
 			 */
-			toggleSelect(selectVal, selectData, index){
-				this.$emit('change', selectVal, selectData, index);
+			toggleSelect(selectVal, selectData, index, pSelect){
+				this.$emit('change', selectVal, selectData, index, pSelect);
       },
       // 更改父级展开的下标
       changeOpenPKey(type, key) {

+ 8 - 2
pages/creatingSituations/creatingSituations.vue

@@ -42,6 +42,7 @@
 		data() {
 			return {
 				saveType: 'POST',
+				editID: '',
 				options: [
 					{id: 'theme', title: '主题', component: theme},
 					{id: 'condition', title: '条件', component: condition, hint: '追踪条件'},
@@ -82,6 +83,7 @@
 		onLoad:function({id,type}){
 			this.saveType = type ? type : 'POST';
 			if(id) {
+				this.editID = id;
 				this.dispatch('detialConfig',{id}).then((data)=>{
 					if(data) {
 						const {topic} = data;
@@ -131,7 +133,7 @@
 					});
 					return;
 				}
-				this.dispatch(`save${this.saveType}`, {
+				let data = {
 					name: sitName,
 					topic: this.theme.id,
 					checkPlanStartDate: dateObj.start,
@@ -156,7 +158,11 @@
 							endDate: i === checkList.length - 1 ? dateObj.end : checkList[i+1]
 						}
 					})
-				}).then((data)=>{
+				};
+				if(this.saveType === 'PUT') {
+					data.id = this.editID;
+				}
+				this.dispatch(`save${this.saveType}`, data).then((data)=>{
 					if(data) {
 						uni.navigateTo({
 							url: '/pages/situationsCenter/situationsCenter'

+ 7 - 7
pages/editCheckList/editCheckList.vue

@@ -107,8 +107,8 @@
               changePlanList.push({
                 index: i, // 第一次计划修改的下标
                 baseEmpListIndex: baseEmpList.length -1,
-                startDiffTimestamp: startDate ? this.dateToTimestamp(startDate) - planStartTimestamp : 0, // 开始时间差
-                endDifTimestamp: endDate ? this.dateToTimestamp(endDate) - planStartTimestamp : 0 // 结束时间差
+                startDiffTimestamp: (startDate && planStartTimestamp != -1) ? this.dateToTimestamp(startDate) - planStartTimestamp : -1, // 开始时间差
+                endDifTimestamp: (endDate && planStartTimestamp != -1) ? this.dateToTimestamp(endDate) - planStartTimestamp : -1 // 结束时间差
               });
             }
           }
@@ -124,9 +124,9 @@
             (planList || []).map(((planItem, planI) => {
                if(planI != 0){ // 过滤掉第一条
                  // 计划开始时间戳
-                 let planStartTimestamp = planItem.startDate ? this.dateToTimestamp(planItem.startDate + ' 00:00') : 0;
+                 let planStartTimestamp = planItem.startDate ? this.dateToTimestamp(planItem.startDate + ' 00:00') : -1;
                  // 计划结束时间戳
-                 let planEndTimestamp = planItem.endDate ? this.dateToTimestamp(planItem.endDate + ' 23:59') : 0;
+                 let planEndTimestamp = planItem.endDate ? this.dateToTimestamp(planItem.endDate + ' 23:59') : -1;
 
                  planItem.empList && planItem.empList.map((empItem, empI) => {
                    // 当前分配明细
@@ -139,10 +139,10 @@
                        empName,
                        checkId: empItem.checkId,
                        deptId: empItem.deptId,
-                       startDate: (planStartTimestamp && startDiffTimestamp)
+                       startDate: (planStartTimestamp > -1 && startDiffTimestamp > -1)
                          ? this.getDateStr(planStartTimestamp, planEndTimestamp, startDiffTimestamp, planItem.endDate)
                          : '',
-                       endDate: (planStartTimestamp && endDifTimestamp)
+                       endDate: (planStartTimestamp > -1 && endDifTimestamp > -1)
                          ? this.getDateStr(planStartTimestamp, planEndTimestamp, endDifTimestamp, planItem.endDate)
                          : ''
                      });
@@ -195,7 +195,7 @@
       },
       // 日期时间转换为时间戳
       dateToTimestamp(dataStr) {
-        return dataStr ? moment(dataStr).valueOf() : 0
+        return dataStr ? moment(dataStr).valueOf() : -1
       },
       checkEdit(data, index, title) {
         if(data.completeState){ // 计划已开始, 不能编辑查核人和计划时间

+ 1 - 1
pages/mission-action/components/pdca.vue

@@ -12,7 +12,7 @@
           v-if="current === 0"
           type="plan"
           :defaultValue="plan"
-          :disabled="disabled"
+          :disabled="disabled || btnInfo.pDisabled"
           @changeTextare="changeTextare"
         />
 				 <do-and-check

+ 11 - 2
pages/mission-action/components/personnel.vue

@@ -56,8 +56,11 @@
     },
     methods: {
       // 更改接收人
-      changeDesPersopn(selectVal, selectData, i) {
-        this.desPersopn = selectData;
+      changeDesPersopn(selectVal, selectData, i, pSelect) {
+        this.desPersopn = {
+          ...selectData,
+          ...pSelect
+        };
       },
       // 确定
       sure() {
@@ -80,6 +83,12 @@
               case 'receiveEmpName':
                 requestParams[item.paramsKey] = this.desPersopn.empName;
                 break;
+              case 'deptId':
+                requestParams[item.paramsKey] = this.desPersopn.deptId;
+                break;
+              case 'deptName':
+                requestParams[item.paramsKey] = this.desPersopn.deptName;
+                break;
               default:
                 requestParams[item.paramsKey] = '';
                 break;

+ 32 - 12
pages/mission-details/mission-details.vue

@@ -121,18 +121,38 @@
         if(btnInfo.componentName){ // 有组件名,则跳转页面
           if(btnInfo.componentName === 'pdca'){
             const { taskType, needApproveFlag } = this.missionDetails;
-            if(taskType === 13 || taskType === 15){ // 制定改善方案中(需要回显暂存过的数据)
-              if(needApproveFlag){// 需要审核(pdca)
-                btnInfo= { ...btnInfo, ...pdcaSetting['editPdcaBtnInfo'], isEdit: true };
-              }else {
-                btnInfo= { ...btnInfo, ...pdcaSetting['editPBtnInfo'], isEdit: true };
-              }
+            // needApproveFlag: true 需要审核(p)只显示p
+            if(taskType === 8){
+                btnInfo= {
+                ...btnInfo,
+                ...pdcaSetting['pdcaBtnInfo'],
+                pDisabled: true // plan内容禁用
+              };
+            } else if(taskType === 11){
+                btnInfo= {
+                ...btnInfo,
+                ...pdcaSetting['pdcaBtnInfo'],
+                pDisabled: needApproveFlag // plan内容是否禁用取决于needApproveFlag
+              };
+            }else if(taskType === 13){ // 制定改善方案p中(需要回显暂存过的数据)
+              btnInfo= {
+                ...btnInfo,
+                ...pdcaSetting['editPBtnInfo'],
+                isEdit: true
+              };
+            }else if(taskType === 15){ // 制定改善方案pdca中(需要回显暂存过的数据)
+              btnInfo= {
+                ...btnInfo,
+                ...pdcaSetting['editPdcaBtnInfo'],
+                isEdit: true,
+                pDisabled: needApproveFlag
+              };
             }else {
-              if(needApproveFlag){ // 需要审核(pdca)
-                btnInfo= { ...btnInfo, ...pdcaSetting['pdcaBtnInfo'] };
-              }else {
-                btnInfo= { ...btnInfo, ...pdcaSetting['pBtnInfo'] };
-              }
+              // taskType === 4 || taskType === 6 || taskType === 7 || taskType === 9
+              btnInfo= {
+                ...btnInfo,
+                ...pdcaSetting[needApproveFlag ? 'pBtnInfo' : 'pdcaBtnInfo']
+              };
             }
           }
           uni.navigateTo({
@@ -201,7 +221,7 @@
 						data
 					}
 				}).then(data1 => {
-          if(!data1){
+          if(data1){
            this.getMissionDetails();
           }
 				});

+ 5 - 3
pages/mission-details/setting.js

@@ -49,7 +49,7 @@ const taskTypeList = [
     selectDetails: {
       name: '查看查核结果详情', // 详情显示的名字
       hasAnyData: false, // 是否有多个数据需要回显 为true则使用dateKey, 否则使用key <key和datakey互斥)
-      key: 'checkItemId', //使用详情接口key
+      key: 'checkDetailId', //使用详情接口key
       navigateUrl: '/pages/auditItemDetails/auditItemDetails', // 跳转页面的url
       dataKey: [],
       isOutvalueKey: true,  // 是否详情接口一级key, 不是则在当前任务状态中找key(如pfmTaskCirculationList下面)
@@ -92,7 +92,7 @@ const taskTypeList = [
     selectDetails: {
       name: '查看查核结果详情', // 详情显示的名字
       hasAnyData: false, // 是否有多个数据需要回显 为true则使用dateKey, 否则使用key <key和datakey互斥)
-      key: 'checkItemId', //使用详情接口key
+      key: 'checkDetailId', //使用详情接口key
       navigateUrl: '/pages/auditItemDetails/auditItemDetails', // 跳转页面的url
       dataKey: [],
       isOutvalueKey: true,  // 是否详情接口一级key, 不是则在当前任务状态中找key(如pfmTaskCirculationList下面)
@@ -125,7 +125,9 @@ const taskTypeList = [
           { paramsKey: 'id', valueKey: 'id', isOutvalueKey: true }, // 任务id
           { paramsKey: 'taskType', value: 1 }, // 状态值
           { paramsKey: 'receiveEmpId', valueKey: null }, // 接收人id
-          { paramsKey: 'receiveEmpName', valueKey: null } // 接收人姓名
+          { paramsKey: 'receiveEmpName', valueKey: null }, // 接收人姓名
+          { paramsKey: 'deptId', valueKey: null }, // 更换部门id
+          { paramsKey: 'deptName', valueKey: null } // 更换部门名称
         ]
       }
     ],