|
@@ -2,7 +2,7 @@
|
|
|
<view class="pdca-page">
|
|
|
<uni-segmented-control
|
|
|
:current="current"
|
|
|
- :values="items"
|
|
|
+ :values="tabItems"
|
|
|
@clickItem="onClickItem"
|
|
|
style-type="text"
|
|
|
active-color="#3377FF" />
|
|
@@ -10,33 +10,50 @@
|
|
|
<scroll-view class="scroll-y" scroll-y="true">
|
|
|
<one-textarea
|
|
|
v-if="current === 0"
|
|
|
- :defaultPlanValue="plan"
|
|
|
+ type="plan"
|
|
|
+ :defaultValue="plan"
|
|
|
:disabled="disabled"
|
|
|
- />
|
|
|
+ @changeTextare="changeTextare"
|
|
|
+ />
|
|
|
<do-and-check
|
|
|
v-if="current === 1"
|
|
|
+ type="do"
|
|
|
:disabled="disabled"
|
|
|
- />
|
|
|
- <view v-if="current === 2">
|
|
|
- 选项卡3的内容
|
|
|
- </view>
|
|
|
+ :recordList="doList"
|
|
|
+ @changeRecordList="changeDoList"
|
|
|
+ />
|
|
|
+ <do-and-check
|
|
|
+ v-if="current === 2"
|
|
|
+ type="check"
|
|
|
+ :disabled="disabled"
|
|
|
+ :recordList="checkList"
|
|
|
+ :showUploadImg="true"
|
|
|
+ @changeRecordList="changeCheckList"
|
|
|
+ />
|
|
|
<one-textarea
|
|
|
v-if="current === 3"
|
|
|
+ type="action"
|
|
|
title="对策处置(Action)"
|
|
|
label="对策处置"
|
|
|
- :defaultactionValue="'123'"
|
|
|
+ :defaultValue="action"
|
|
|
:disabled="disabled"
|
|
|
+ @changeTextare="changeTextare"
|
|
|
/>
|
|
|
</scroll-view>
|
|
|
<view class="fixed-buttom-btn" v-if="!disabled">
|
|
|
- <view class="btn-text cancle">
|
|
|
+ <view class="fixed-buttom-btn">
|
|
|
<text>暂存</text>
|
|
|
</view>
|
|
|
- <view class="btn-text">
|
|
|
- <text>完成</text>
|
|
|
+ <view class="btn-text" @click="toggleModalVisibile">
|
|
|
+ <text>提交</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- 方案名称modal -->
|
|
|
+ <modal
|
|
|
+ v-if="modalVisibile"
|
|
|
+ @close="toggleModalVisibile"
|
|
|
+ @sure="sure" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -44,7 +61,8 @@
|
|
|
// 改善任务PDCA
|
|
|
import uniSegmentedControl from "@/components/uni-segmented-control/uni-segmented-control.vue"
|
|
|
import oneTextarea from './pdca-components/one-textarea.vue'
|
|
|
- import doAndCheck from './pdca-components/do-and-check.vue'
|
|
|
+ import doAndCheck from './pdca-components/do-and-check.vue'
|
|
|
+ import modal from './modal.vue'
|
|
|
|
|
|
export default {
|
|
|
props: {
|
|
@@ -73,23 +91,44 @@
|
|
|
default: () => {
|
|
|
return {}
|
|
|
}
|
|
|
+ },
|
|
|
+ // pdca类型 p 和 pdca
|
|
|
+ pdcaSetting: {
|
|
|
+ type: String,
|
|
|
+ default: 'p'
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- items: ['改善计划(P)', '执行过程(D)', '改善确认(C)', '对策处置(A)'],
|
|
|
current: 0,
|
|
|
- // plan 改善计划
|
|
|
- plan: ''
|
|
|
+ plan: '', // 改善计划
|
|
|
+ doList: [{record: '', date: ''}], // 执行过程
|
|
|
+ checkList: [{record: '', date: '', filePath: [] }], // 改善确认
|
|
|
+ action: '', // 对策处置
|
|
|
+ // 方案名称显示隐藏
|
|
|
+ modalVisibile: false
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ tabItems(){
|
|
|
+ return this.pdcaSetting === 'p'
|
|
|
+ ? ['改善计划(P)']
|
|
|
+ : ['改善计划(P)', '执行过程(D)', '改善确认(C)', '对策处置(A)'];
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: '改善计划'
|
|
|
});
|
|
|
if(this.disabled) {
|
|
|
- this.plan = this.values['plan'];
|
|
|
- console.log(9, this.values)
|
|
|
+ this.plan = this.values['plan'] || '';
|
|
|
+ this.doList = (this.values['do'] && this.values['do'].length > 0)
|
|
|
+ ? this.values['do']
|
|
|
+ : [{record: '', date: ''}];
|
|
|
+ this.checkList = (this.values['check'] && this.values['check'].length > 0)
|
|
|
+ ? this.values['check']
|
|
|
+ : [{record: '', date: '', filePath: [] }];
|
|
|
+ this.action = this.values['action'] || '';
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -97,12 +136,79 @@
|
|
|
if (this.current !== e.currentIndex) {
|
|
|
this.current = e.currentIndex;
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 切换方案名称显示隐藏
|
|
|
+ toggleModalVisibile() {
|
|
|
+ this.modalVisibile = !this.modalVisibile;
|
|
|
+ },
|
|
|
+ // 改善计划/对策处置变化
|
|
|
+ changeTextare(type, text) {
|
|
|
+ this[type] = text;
|
|
|
+ },
|
|
|
+ // 执行过程变化
|
|
|
+ changeDoList(list) {
|
|
|
+ this.doList = list;
|
|
|
+ },
|
|
|
+ // 改善确认变化
|
|
|
+ changeCheckList(list) {
|
|
|
+ this.checkList = list;
|
|
|
+ },
|
|
|
+ // 提交审核/ 暂存(暂存时improveScheme为空)
|
|
|
+ sure(improveScheme) {
|
|
|
+ const { params } = this.btnInfo;
|
|
|
+ let requestParams = {
|
|
|
+ improveScheme // 改善方案名称
|
|
|
+ };
|
|
|
+ this.btnInfo.params && this.btnInfo.params.map(item => {
|
|
|
+ if(item.valueKey){
|
|
|
+ requestParams[item.paramsKey] = (
|
|
|
+ item.isOutvalueKey
|
|
|
+ ? this.missionDetails
|
|
|
+ : this.btnInfo
|
|
|
+ )[item.valueKey];
|
|
|
+ }else {
|
|
|
+ switch(item.paramsKey){
|
|
|
+ case 'taskPlan':
|
|
|
+ requestParams[item.paramsKey] = this.plan;
|
|
|
+ break;
|
|
|
+ case 'taskAction':
|
|
|
+ requestParams[item.paramsKey] = this.action;
|
|
|
+ break;
|
|
|
+ case 'taskDoRequestList':
|
|
|
+ requestParams[item.paramsKey] = this.doList.map((item, i) => {
|
|
|
+ return {
|
|
|
+ taskDoId: i + 1,
|
|
|
+ taskDoProcess: item.record,
|
|
|
+ taskDoPlan: item.date
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 'taskCheckRequestList':
|
|
|
+ requestParams[item.paramsKey] = this.checkList.map((item, i) => {
|
|
|
+ return {
|
|
|
+ taskCheckId: i + 1,
|
|
|
+ taskCheckProcess: item.record,
|
|
|
+ taskCheckPlan: item.date,
|
|
|
+ taskCheckEffect: item.filePath.join(',')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ requestParams[item.paramsKey] = '';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(9, requestParams)
|
|
|
+ this.$emit('comRequest', requestParams);
|
|
|
+ this.toggleModalVisibile();
|
|
|
+ }
|
|
|
},
|
|
|
components: {
|
|
|
uniSegmentedControl,
|
|
|
oneTextarea,
|
|
|
- doAndCheck
|
|
|
+ doAndCheck,
|
|
|
+ modal
|
|
|
}
|
|
|
}
|
|
|
</script>
|