|
@@ -8,7 +8,9 @@
|
|
|
<view v-for="item in checkItemResultList"
|
|
|
:class="[checkedSelectResultListIds.includes(item.id)?'list on':'list']" :key="item.id"
|
|
|
@click.stop="selectResultHandle(item)">
|
|
|
- <image class="checkIcon" :src="`../../static/${!moreDeduction?'check-radio.png':'check-checkbox.png'}`" mode=""></image>
|
|
|
+ <image class="checkIcon"
|
|
|
+ :src="`../../static/${!moreDeduction?'check-radio.png':'check-checkbox.png'}`" mode="">
|
|
|
+ </image>
|
|
|
{{item.resultName}}
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -17,7 +19,9 @@
|
|
|
<view v-for="item in checkItemResultList"
|
|
|
:class="[checkedSelectResultListIds[currentEditTextAreaIndex]&&checkedSelectResultListIds[currentEditTextAreaIndex].includes(item.id)?'list on':'list']"
|
|
|
:key="item.id" @click.stop="selectResultHandle(item)">
|
|
|
- <image class="checkIcon" :src="`../../static/${!moreDeduction?'check-radio.png':'check-checkbox.png'}`" mode=""></image>
|
|
|
+ <image class="checkIcon"
|
|
|
+ :src="`../../static/${!moreDeduction?'check-radio.png':'check-checkbox.png'}`" mode="">
|
|
|
+ </image>
|
|
|
{{item.resultName}}
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -95,10 +99,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="inputScore">
|
|
|
- <text class="label">本项扣分</text>
|
|
|
+ <text class="label">本项扣分</text>
|
|
|
<view class="textValue" v-if="!ifInputScore" @click='changeToInputScore'>{{deductPoint}}</view>
|
|
|
- <input class="value" v-if="ifInputScore" @input="onInputScore" focus='true' auto-blur='true' @blur='inputOnBlur' type="number" v-model="inputScore"
|
|
|
- placeholder-class="placeholder" />
|
|
|
+ <input class="value" v-if="ifInputScore" @input="onInputScore" focus='true' auto-blur='true'
|
|
|
+ @blur='inputOnBlur' type="number" v-model="inputScore" placeholder-class="placeholder" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -123,8 +127,7 @@
|
|
|
v-model="item.talkResult" @blur="changeTextarea($event, i)"></textarea>
|
|
|
</view>
|
|
|
<view class="talkImg" @click="imgClick(i)">
|
|
|
- <tm-upload-img label="上传图片" :filePaths="item.filePath" :isMultiple="true"
|
|
|
- :pickIndex = "i"
|
|
|
+ <tm-upload-img label="上传图片" :filePaths="item.filePath" :isMultiple="true" :pickIndex="i"
|
|
|
@changeFilePaths="changeFilePaths2" />
|
|
|
</view>
|
|
|
</view>
|
|
@@ -193,12 +196,12 @@
|
|
|
checkPointId: "",
|
|
|
itemBelongGroup: [],
|
|
|
itemId: '',
|
|
|
- currentEditTextAreaIndex:-1, //当前编辑的查核结果下标
|
|
|
+ currentEditTextAreaIndex: -1, //当前编辑的查核结果下标
|
|
|
checkItemResultList: [], //查核结果说明下拉列表
|
|
|
checkedSelectResultList: [], //下拉结果选中集合
|
|
|
checkedSelectResultListIds: [],
|
|
|
currentSelect: '',
|
|
|
- checkItemScore:0, //查核选中的分数
|
|
|
+ checkItemScore: 0, //查核选中的分数
|
|
|
checkItemValue: null, //查核选中的分数占比
|
|
|
checkConfiglist: [], //查核情况可配置列表
|
|
|
totalScore: 0, //总分
|
|
@@ -211,9 +214,9 @@
|
|
|
checkedSelectResultListData: [],
|
|
|
multiSelectScore: [],
|
|
|
deductPoint: 0, //本次扣分
|
|
|
- currentCheckedTab: null, //当前选中的查核tab
|
|
|
- moreDeduction:false, //缺陷项是否多选
|
|
|
- ifInputScore:false, //是否手动干预分值
|
|
|
+ currentCheckedTab: null, //当前选中的查核tab
|
|
|
+ moreDeduction: false, //缺陷项是否多选
|
|
|
+ ifInputScore: false, //是否手动干预分值
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
@@ -223,81 +226,85 @@
|
|
|
this.checkedResponsibleData = responsibleList.checkedResponsibleList;
|
|
|
this.checkedResponsibleList = responsibleList.checkedResponsibleList.map(item => item.main);
|
|
|
},
|
|
|
- computed: {
|
|
|
- },
|
|
|
+ computed: {},
|
|
|
watch: {
|
|
|
checkedResponsibleList: function() {
|
|
|
const {
|
|
|
responsibleList
|
|
|
} = this.$store.state;
|
|
|
return responsibleList.checkedResponsibleList.map(item => item.main);
|
|
|
- },
|
|
|
- selectedScore:function(newVal,oldVal){
|
|
|
- this.scoreCounter()
|
|
|
- },
|
|
|
- checkItemScore:function(newVal){
|
|
|
- this.scoreCounter()
|
|
|
- },
|
|
|
- deductPoint:function(newVal,oldVal){
|
|
|
- this.currentScore = this.totalScore - newVal
|
|
|
+ },
|
|
|
+ selectedScore: function(newVal, oldVal) {
|
|
|
+ this.scoreCounter()
|
|
|
+ },
|
|
|
+ checkItemScore: function(newVal) {
|
|
|
+ this.scoreCounter()
|
|
|
+ },
|
|
|
+ deductPoint: function(newVal, oldVal) {
|
|
|
+ this.currentScore = this.totalScore - newVal
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.checkTaskDetail(this.id);
|
|
|
this.getPeizhiList();
|
|
|
|
|
|
- },
|
|
|
- onBackPress() {
|
|
|
- this.$store.commit('checkMainPoints/comChangeState', { //刷新前一页数据
|
|
|
- key: 'ifReloadPageData',
|
|
|
- data: true
|
|
|
- });
|
|
|
},
|
|
|
- methods: {
|
|
|
- scoreCounter(){
|
|
|
- if(this.inputScore){
|
|
|
- this.deductPoint = Number(this.inputScore) + this.selectedScore
|
|
|
- }else{
|
|
|
- this.deductPoint = this.selectedScore + this.checkItemScore
|
|
|
- }
|
|
|
- },
|
|
|
- changeToInputScore(){
|
|
|
- this.ifInputScore = true;
|
|
|
- },
|
|
|
- inputOnBlur(){
|
|
|
- this.ifInputScore = false;
|
|
|
- // this.inputScore = null;
|
|
|
- },
|
|
|
- onInputScore(e) {
|
|
|
- this.deductPoint = e.target.value;
|
|
|
+ onBackPress() {
|
|
|
+ this.$store.commit('checkMainPoints/comChangeState', { //刷新前一页数据
|
|
|
+ key: 'ifReloadPageData',
|
|
|
+ data: true
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ scoreCounter() {
|
|
|
+ if(this.checkItemValue == -1){
|
|
|
+ //清空分数
|
|
|
+ this.deductPoint = 0;
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.inputScore) {
|
|
|
+ this.deductPoint = Number(this.inputScore) + this.selectedScore
|
|
|
+ } else {
|
|
|
+ this.deductPoint = this.selectedScore + this.checkItemValue
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeToInputScore() {
|
|
|
+ this.ifInputScore = true;
|
|
|
+ },
|
|
|
+ inputOnBlur() {
|
|
|
+ this.ifInputScore = false;
|
|
|
+ // this.inputScore = null;
|
|
|
+ },
|
|
|
+ onInputScore(e) {
|
|
|
+ this.deductPoint = e.target.value;
|
|
|
},
|
|
|
//查核结果清空操作
|
|
|
clearResult(ifMulti, index) {
|
|
|
if (ifMulti) {
|
|
|
//多个查核结果组件时
|
|
|
- this.talkList[index].talkResult = '';
|
|
|
- if(this.multiSelectScore[index]){
|
|
|
- this.selectedScore = this.selectedScore - this.multiSelectScore[index];
|
|
|
+ this.talkList[index].talkResult = '';
|
|
|
+ if (this.multiSelectScore[index]) {
|
|
|
+ this.selectedScore = this.selectedScore - this.multiSelectScore[index];
|
|
|
}
|
|
|
this.checkedSelectResultListIds.splice(index, 1, []);
|
|
|
this.checkedSelectResultList.splice(index, 1, []);
|
|
|
- this.checkedSelectResultListData.splice(index, 1, []);
|
|
|
- this.multiSelectScore[index] = 0;
|
|
|
- this.currentEditTextAreaIndex = -1;
|
|
|
-
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
+ this.checkedSelectResultListData.splice(index, 1, []);
|
|
|
+ this.multiSelectScore[index] = 0;
|
|
|
+ this.currentEditTextAreaIndex = -1;
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
this.recordList[0].seeResult = '';
|
|
|
this.checkedSelectResultListIds = [];
|
|
|
this.checkedSelectResultList = [];
|
|
|
- this.checkedSelectResultListData = [];
|
|
|
+ this.checkedSelectResultListData = [];
|
|
|
this.selectedScore = 0;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
clickModalhandle() {
|
|
|
- this.showSelectModal = false;
|
|
|
+ this.showSelectModal = false;
|
|
|
this.currentEditTextAreaIndex = -1;
|
|
|
},
|
|
|
openSelectModal(index) {
|
|
@@ -315,16 +322,16 @@
|
|
|
selectResultHandle(item) {
|
|
|
|
|
|
if (this.data.checkModelName == '访谈') {
|
|
|
- const currentIndex = this.currentEditTextAreaIndex;
|
|
|
- if(!this.moreDeduction){
|
|
|
- //缺陷项单选
|
|
|
- this.checkedSelectResultListIds.splice(currentIndex, 1,[item.id]);
|
|
|
- this.checkedSelectResultList.splice(currentIndex, 1, [item.resultName]);
|
|
|
- this.checkedSelectResultListData.splice(currentIndex, 1, [item]);
|
|
|
-
|
|
|
- return ;
|
|
|
- }
|
|
|
-
|
|
|
+ const currentIndex = this.currentEditTextAreaIndex;
|
|
|
+ if (!this.moreDeduction) {
|
|
|
+ //缺陷项单选
|
|
|
+ this.checkedSelectResultListIds.splice(currentIndex, 1, [item.id]);
|
|
|
+ this.checkedSelectResultList.splice(currentIndex, 1, [item.resultName]);
|
|
|
+ this.checkedSelectResultListData.splice(currentIndex, 1, [item]);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (this.checkedSelectResultListIds[currentIndex] && this.checkedSelectResultListIds[currentIndex]
|
|
|
.includes(item.id)) {
|
|
|
|
|
@@ -355,14 +362,14 @@
|
|
|
this.checkedSelectResultList.splice(currentIndex, 1, tempArr);
|
|
|
this.checkedSelectResultListData.splice(currentIndex, 1, tempArrData);
|
|
|
}
|
|
|
- } else {
|
|
|
- if(!this.moreDeduction){
|
|
|
- //缺陷项单选
|
|
|
- this.checkedSelectResultListIds = [item.id];
|
|
|
- this.checkedSelectResultList = [item.resultName];
|
|
|
- this.checkedSelectResultListData = [item];
|
|
|
- return ;
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ if (!this.moreDeduction) {
|
|
|
+ //缺陷项单选
|
|
|
+ this.checkedSelectResultListIds = [item.id];
|
|
|
+ this.checkedSelectResultList = [item.resultName];
|
|
|
+ this.checkedSelectResultListData = [item];
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 缺陷项多选
|
|
|
if (this.checkedSelectResultListIds.includes(item.id)) {
|
|
|
const tempIdsArr = this.checkedSelectResultListIds;
|
|
@@ -370,7 +377,7 @@
|
|
|
const tempArrData = this.checkedSelectResultListData;
|
|
|
tempIdsArr.splice(tempIdsArr.indexOf(item.id), 1);
|
|
|
tempArr.splice(tempArr.indexOf(item.resultName), 1);
|
|
|
- tempArrData.splice(tempArrData.findIndex(t=>t.id == item.id), 1);
|
|
|
+ tempArrData.splice(tempArrData.findIndex(t => t.id == item.id), 1);
|
|
|
this.checkedSelectResultListIds = tempIdsArr;
|
|
|
this.checkedSelectResultList = tempArr;
|
|
|
this.checkedSelectResultListData = tempArrData;
|
|
@@ -384,8 +391,8 @@
|
|
|
commitSelectResult() {
|
|
|
|
|
|
const _commitFunc = () => {
|
|
|
- if (this.data.checkModelName == '访谈') {
|
|
|
-
|
|
|
+ if (this.data.checkModelName == '访谈') {
|
|
|
+
|
|
|
const tempArr = this.checkedSelectResultListData[this.currentEditTextAreaIndex].map(item =>
|
|
|
item.percentScore);
|
|
|
const tempScore = tempArr.reduce((prev, cur) => {
|
|
@@ -395,10 +402,10 @@
|
|
|
this.talkList[this.currentEditTextAreaIndex].talkResult = this.checkedSelectResultList[this
|
|
|
.currentEditTextAreaIndex].join(',');
|
|
|
this.multiSelectScore[this.currentEditTextAreaIndex] = tempScore;
|
|
|
- this.selectedScore = this.multiSelectScore.reduce((prev, cur) => (prev + cur), 0);
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
+ this.selectedScore = this.multiSelectScore.reduce((prev, cur) => (prev + cur), 0);
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
const tempArr = this.checkedSelectResultListData.map(item => item.percentScore);
|
|
|
const tempScore = tempArr.reduce((prev, cur) => {
|
|
|
return prev + cur;
|
|
@@ -419,11 +426,11 @@
|
|
|
id: id,
|
|
|
},
|
|
|
},
|
|
|
- }).then((res) => {
|
|
|
- uni.$once('未在查核规定时间内', function (data) {
|
|
|
- uni.navigateBack();
|
|
|
- });
|
|
|
-
|
|
|
+ }).then((res) => {
|
|
|
+ uni.$once('未在查核规定时间内', function(data) {
|
|
|
+ uni.navigateBack();
|
|
|
+ });
|
|
|
+
|
|
|
this.id = id;
|
|
|
this.deptId = res.deptId;
|
|
|
//再次编辑回显
|
|
@@ -432,8 +439,8 @@
|
|
|
.split(',') : [];
|
|
|
this.Index = res.checkResult;
|
|
|
this.totalScore = res.totalScore;
|
|
|
- this.currentScore = res.score;
|
|
|
- this.deductPoint = res.deductPoint;
|
|
|
+ this.currentScore = res.checkResult ? res.score : res.totalScore;
|
|
|
+ this.deductPoint = res.deductPoint;
|
|
|
this.moreDeduction = res.moreDeduction;
|
|
|
if (res.checkResultRequestList && res.checkResultRequestList.length > 0) {
|
|
|
if (res.checkModelName == '访谈') {
|
|
@@ -453,7 +460,7 @@
|
|
|
tempResult.map(item => item.id));
|
|
|
const tempArr = this.checkedSelectResultList[currentIndex].concat(
|
|
|
tempResult.map(item => item.resultName));
|
|
|
-
|
|
|
+
|
|
|
|
|
|
this.checkedSelectResultListIds.splice(currentIndex, 1, tempIdsArr);
|
|
|
this.checkedSelectResultList.splice(currentIndex, 1, tempArr);
|
|
@@ -484,11 +491,13 @@
|
|
|
this.recordList[0].seeResult = res.checkResultRequestList[0].checkResultDescribe;
|
|
|
this.checkedSelectResultListIds = tempIds;
|
|
|
this.checkedSelectResultList = res.checkResultRequestList[0].checkResultDescribe.split(
|
|
|
- ',');
|
|
|
-
|
|
|
- this.checkedSelectResultListData = tempResult;
|
|
|
-
|
|
|
- console.log({tempResult});
|
|
|
+ ',');
|
|
|
+
|
|
|
+ this.checkedSelectResultListData = tempResult;
|
|
|
+
|
|
|
+ console.log({
|
|
|
+ tempResult
|
|
|
+ });
|
|
|
// this.selectedScore = tempScore;
|
|
|
|
|
|
}
|
|
@@ -545,23 +554,30 @@
|
|
|
this.currentCheckedTab = data;
|
|
|
this.Index = parsedData.attr;
|
|
|
this.data.checkResult = parsedData.attr;
|
|
|
+
|
|
|
+
|
|
|
this.checkItemScore = parsedData.itemGetScore;
|
|
|
this.checkItemValue = parsedData.value;
|
|
|
- this.calScore = parsedData.calScore;
|
|
|
- if (!this.inputScore) { //没有手输调整过的才可以修改
|
|
|
- this.checkItemScore = parsedData.itemGetScore;
|
|
|
- }
|
|
|
+ this.calScore = parsedData.calScore;
|
|
|
+
|
|
|
+ if (!this.inputScore) { //没有手输调整过的才可以修改
|
|
|
+ this.checkItemScore = parsedData.itemGetScore;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- },
|
|
|
- /**
|
|
|
- * @param {{
|
|
|
- files
|
|
|
- index,
|
|
|
- }} fileInfo
|
|
|
- files:文件集合
|
|
|
- index:当前编辑的下标
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @param {{
|
|
|
+ files
|
|
|
+ index,
|
|
|
+ }} fileInfo
|
|
|
+ files:文件集合
|
|
|
+ index:当前编辑的下标
|
|
|
*/
|
|
|
- changeFilePaths({files, index}) {
|
|
|
+ changeFilePaths({
|
|
|
+ files,
|
|
|
+ index
|
|
|
+ }) {
|
|
|
let _recordList = [...this.recordList];
|
|
|
_recordList[index].filePath = files;
|
|
|
this.filePath = _recordList[0].filePath;
|
|
@@ -578,27 +594,30 @@
|
|
|
},
|
|
|
del(index) {
|
|
|
let list = [...this.talkList];
|
|
|
- let list2 = [];
|
|
|
- //清空该项数据
|
|
|
- this.clearResult(true,index);
|
|
|
-
|
|
|
+ let list2 = [];
|
|
|
+ //清空该项数据
|
|
|
+ this.clearResult(true, index);
|
|
|
+
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
if (i != index) {
|
|
|
list2.push(list[i]);
|
|
|
}
|
|
|
}
|
|
|
this.talkList = list2;
|
|
|
- },
|
|
|
- /**
|
|
|
- * @param {{
|
|
|
- files
|
|
|
- index,
|
|
|
- }} fileInfo
|
|
|
- files:文件集合
|
|
|
- index:当前编辑的下标
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @param {{
|
|
|
+ files
|
|
|
+ index,
|
|
|
+ }} fileInfo
|
|
|
+ files:文件集合
|
|
|
+ index:当前编辑的下标
|
|
|
*/
|
|
|
- changeFilePaths2(fileInfo) {
|
|
|
- const {files,index} = fileInfo;
|
|
|
+ changeFilePaths2(fileInfo) {
|
|
|
+ const {
|
|
|
+ files,
|
|
|
+ index
|
|
|
+ } = fileInfo;
|
|
|
for (let j = 0; j < this.talkList.length; j++) {
|
|
|
this.talkList[index].filePath = files;
|
|
|
}
|
|
@@ -614,160 +633,158 @@
|
|
|
imgClick(i) {
|
|
|
this.editIndex = i;
|
|
|
},
|
|
|
- sureDetail(key) {
|
|
|
- console.log('commit check');
|
|
|
- return new Promise((resolve)=>{
|
|
|
- const _commitCheck = () => {
|
|
|
- try{
|
|
|
- if (this.Index) {
|
|
|
- let params = {
|
|
|
- id: this.data.id,
|
|
|
- checkResult: this.data.checkResult,
|
|
|
- checkResultRequestList:[],
|
|
|
- checkItemScore: this.checkItemScore,
|
|
|
- value: this.checkItemValue,
|
|
|
- situationType: this.situationType,
|
|
|
- calScore: this.calScore,
|
|
|
- score: this.currentScore,
|
|
|
- deductPoint: this.deductPoint,
|
|
|
- };
|
|
|
-
|
|
|
- console.log({params});
|
|
|
-
|
|
|
- if (this.data.checkModelName == "访谈") {
|
|
|
- let list = [];
|
|
|
- for (let i = 0; i < this.talkList.length; i++) {
|
|
|
- let path = "";
|
|
|
- for (let j = 0; j < this.talkList[i].filePath.length; j++) {
|
|
|
- if (j == 0) {
|
|
|
- path += `${this.talkList[i].filePath[j]}`;
|
|
|
- } else {
|
|
|
- path += `,${this.talkList[i].filePath[j]}`;
|
|
|
- }
|
|
|
- }
|
|
|
- let item = {
|
|
|
- checkResultId: i,
|
|
|
- checkResultDescribe: this.talkList[i].talkResult,
|
|
|
- checkResultUrl: path,
|
|
|
- };
|
|
|
-
|
|
|
- list.push(item);
|
|
|
- }
|
|
|
- params.checkResultRequestList = list;
|
|
|
- } else {
|
|
|
-
|
|
|
- let item = {
|
|
|
- checkResultId: 1,
|
|
|
- checkResultDescribe: this.recordList[0].seeResult,
|
|
|
- checkResultUrl: this.filePath.join(','),
|
|
|
- };
|
|
|
-
|
|
|
- params.checkResultRequestList = [item];
|
|
|
- }
|
|
|
- const checkConfiglist = JSON.parse(JSON.stringify(this.checkConfiglist));
|
|
|
-
|
|
|
- this.$store.dispatch({
|
|
|
- type: "mainPointsDetail/commActions",
|
|
|
- payload: {
|
|
|
- key: "saveCheckTaskDetail",
|
|
|
- data: {
|
|
|
- ...params,
|
|
|
- },
|
|
|
- },
|
|
|
- }).then((res) => {
|
|
|
- if (res) {
|
|
|
- resolve(true);
|
|
|
- // console.log({checkConfiglist,params});
|
|
|
- for (let i = 0; i < checkConfiglist.length; i++) {
|
|
|
-
|
|
|
- if (
|
|
|
- checkConfiglist[i].attr == params.checkResult &&
|
|
|
- (checkConfiglist[i].resultType == 2 ||
|
|
|
- checkConfiglist[i].resultType == 3)
|
|
|
- ) {
|
|
|
- //当主要缺失和次要缺失时发起改善任务
|
|
|
- console.log('开始提交改善前准备');
|
|
|
-
|
|
|
- let param = {
|
|
|
- situationId: this.data.situationId,
|
|
|
- situationName: this.data.situationName,
|
|
|
- checkGroupId: this.data.checkGroupId,
|
|
|
- checkGroupName: this.data.checkGroupName,
|
|
|
- checkItemId: this.data.checkItemId,
|
|
|
- checkItemName: this.data.checkItemName,
|
|
|
- checkPointId: this.data.checkPointId,
|
|
|
- checkPointName: this.data.checkPointName,
|
|
|
- deptName: this.data.deptName,
|
|
|
- deptId: this.data.deptId,
|
|
|
- appointFlag: false,
|
|
|
- desicion: 0,
|
|
|
- taskType: "1",
|
|
|
- checkId: this.data.checkId,
|
|
|
- checkResult: 0,
|
|
|
- newResultType: checkConfiglist[i].resultType,
|
|
|
- // checkResult: this.resultConfigList[i].id,
|
|
|
- receiveEmpId: this.data.receiveEmpId,
|
|
|
- receiveEmpName: this.data.receiveEmpName,
|
|
|
- checkDetailId: this.data.id,
|
|
|
- };
|
|
|
-
|
|
|
- this.$store.dispatch({
|
|
|
- type: "mission/commActions",
|
|
|
- payload: {
|
|
|
- key: "comTaskCirculation",
|
|
|
- data: {
|
|
|
- ...param,
|
|
|
- },
|
|
|
- },
|
|
|
- });
|
|
|
- } else {
|
|
|
- console.log('改善条件为false');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (key == 'back') {
|
|
|
- //点完成时返回
|
|
|
- this.$store.commit('checkMainPoints/comChangeState', {
|
|
|
- 'key': 'ifUpdate',
|
|
|
- 'data': true
|
|
|
- });
|
|
|
- _goBackFresh('pages/checkMainPoints/checkMainPoints');
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log('res为false');
|
|
|
- resolve(false);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: '请先选择查核结果!',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- resolve(false);
|
|
|
- }
|
|
|
- }catch(err){
|
|
|
- resolve(err);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(this.data.checkResult == '无缺失'&&this.deductPoint != 0){
|
|
|
- //查核结果为‘无缺失’且扣分为非0
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: `当前选择无缺失结果,但扣分数为${this.deductPoint},确认继续提交么?`,
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- _commitCheck();
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消操作');
|
|
|
- resolve(false);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- _commitCheck();
|
|
|
- }
|
|
|
+ sureDetail(key) {
|
|
|
+ console.log('commit check');
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ const _commitCheck = () => {
|
|
|
+ try {
|
|
|
+ if (this.Index) {
|
|
|
+ let params = {
|
|
|
+ id: this.data.id,
|
|
|
+ checkResult: this.data.checkResult,
|
|
|
+ checkResultRequestList: [],
|
|
|
+ checkItemScore: this.checkItemScore,
|
|
|
+ value: this.checkItemValue,
|
|
|
+ situationType: this.situationType,
|
|
|
+ calScore: this.calScore,
|
|
|
+ score: this.currentScore,
|
|
|
+ deductPoint: this.deductPoint,
|
|
|
+ };
|
|
|
+
|
|
|
+ if (this.data.checkModelName == "访谈") {
|
|
|
+ let list = [];
|
|
|
+ for (let i = 0; i < this.talkList.length; i++) {
|
|
|
+ let path = "";
|
|
|
+ for (let j = 0; j < this.talkList[i].filePath.length; j++) {
|
|
|
+ if (j == 0) {
|
|
|
+ path += `${this.talkList[i].filePath[j]}`;
|
|
|
+ } else {
|
|
|
+ path += `,${this.talkList[i].filePath[j]}`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let item = {
|
|
|
+ checkResultId: i,
|
|
|
+ checkResultDescribe: this.talkList[i].talkResult,
|
|
|
+ checkResultUrl: path,
|
|
|
+ };
|
|
|
+
|
|
|
+ list.push(item);
|
|
|
+ }
|
|
|
+ params.checkResultRequestList = list;
|
|
|
+ } else {
|
|
|
+
|
|
|
+ let item = {
|
|
|
+ checkResultId: 1,
|
|
|
+ checkResultDescribe: this.recordList[0].seeResult,
|
|
|
+ checkResultUrl: this.filePath.join(','),
|
|
|
+ };
|
|
|
+
|
|
|
+ params.checkResultRequestList = [item];
|
|
|
+ }
|
|
|
+ const checkConfiglist = JSON.parse(JSON.stringify(this.checkConfiglist));
|
|
|
+
|
|
|
+ this.$store.dispatch({
|
|
|
+ type: "mainPointsDetail/commActions",
|
|
|
+ payload: {
|
|
|
+ key: "saveCheckTaskDetail",
|
|
|
+ data: {
|
|
|
+ ...params,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ if (res) {
|
|
|
+ resolve(true);
|
|
|
+ // console.log({checkConfiglist,params});
|
|
|
+ for (let i = 0; i < checkConfiglist.length; i++) {
|
|
|
+
|
|
|
+ if (
|
|
|
+ checkConfiglist[i].attr == params.checkResult &&
|
|
|
+ (checkConfiglist[i].resultType == 2 ||
|
|
|
+ checkConfiglist[i].resultType == 3)
|
|
|
+ ) {
|
|
|
+ //当主要缺失和次要缺失时发起改善任务
|
|
|
+ console.log('开始提交改善前准备');
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ situationId: this.data.situationId,
|
|
|
+ situationName: this.data.situationName,
|
|
|
+ checkGroupId: this.data.checkGroupId,
|
|
|
+ checkGroupName: this.data.checkGroupName,
|
|
|
+ checkItemId: this.data.checkItemId,
|
|
|
+ checkItemName: this.data.checkItemName,
|
|
|
+ checkPointId: this.data.checkPointId,
|
|
|
+ checkPointName: this.data.checkPointName,
|
|
|
+ deptName: this.data.deptName,
|
|
|
+ deptId: this.data.deptId,
|
|
|
+ appointFlag: false,
|
|
|
+ desicion: 0,
|
|
|
+ taskType: "1",
|
|
|
+ checkId: this.data.checkId,
|
|
|
+ checkResult: 0,
|
|
|
+ newResultType: checkConfiglist[i].resultType,
|
|
|
+ // checkResult: this.resultConfigList[i].id,
|
|
|
+ receiveEmpId: this.data.receiveEmpId,
|
|
|
+ receiveEmpName: this.data.receiveEmpName,
|
|
|
+ checkDetailId: this.data.id,
|
|
|
+ };
|
|
|
+
|
|
|
+ this.$store.dispatch({
|
|
|
+ type: "mission/commActions",
|
|
|
+ payload: {
|
|
|
+ key: "comTaskCirculation",
|
|
|
+ data: {
|
|
|
+ ...param,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.log('改善条件为false');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (key == 'back') {
|
|
|
+ //点完成时返回
|
|
|
+ this.$store.commit('checkMainPoints/comChangeState', {
|
|
|
+ 'key': 'ifUpdate',
|
|
|
+ 'data': true
|
|
|
+ });
|
|
|
+ _goBackFresh('pages/checkMainPoints/checkMainPoints');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('res为false');
|
|
|
+ resolve(false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请先选择查核结果!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ resolve(false);
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ resolve(err);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.data.checkResult == '无缺失' && this.deductPoint != 0) {
|
|
|
+ //查核结果为‘无缺失’且扣分为非0
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: `当前选择无缺失结果,但扣分数为${this.deductPoint},确认继续提交么?`,
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ _commitCheck();
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消操作');
|
|
|
+ resolve(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ _commitCheck();
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
toTuLi() {
|
|
@@ -799,10 +816,10 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
|
|
|
},
|
|
|
- clearForm(index) {
|
|
|
+ clearForm(index) {
|
|
|
//清除上一项的查核信息
|
|
|
this.Index = '';
|
|
|
// this.deductPoint = 0;
|
|
@@ -818,8 +835,8 @@
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- this.recordList[0].talkResult = '';
|
|
|
-
|
|
|
+ this.recordList[0].talkResult = '';
|
|
|
+
|
|
|
}
|
|
|
this.checkedSelectResultListIds = [];
|
|
|
this.checkedSelectResultList = [];
|
|
@@ -837,40 +854,40 @@
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- const result = await this.sureDetail();
|
|
|
-
|
|
|
- if(result){
|
|
|
- let current = this.itemBelongGroup.filter(item => {
|
|
|
- return item.id == this.id;
|
|
|
- });
|
|
|
- if (num < 0) {
|
|
|
- if (current[0].index == 0) {
|
|
|
- uni.showToast({
|
|
|
- title: '已经没有上一项',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- if (num > 0) {
|
|
|
- if (current[0].index == this.itemBelongGroup.length - 1) {
|
|
|
- uni.showToast({
|
|
|
- title: '已经没有下一项',
|
|
|
- duration: 2000,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- let needItemIndex = num > 0 ? current[0].index + 1 : current[0].index - 1;
|
|
|
- let needItemId = this.itemBelongGroup[needItemIndex].id;
|
|
|
- let needItemCheckId = this.itemBelongGroup[needItemIndex].checkItemId;
|
|
|
-
|
|
|
- this.clearForm();
|
|
|
- this.clearResult();
|
|
|
- this.checkTaskDetail(needItemId);
|
|
|
- this.getCheckItemResultList(needItemCheckId); //获取缺陷项列表数据
|
|
|
+ const result = await this.sureDetail();
|
|
|
+
|
|
|
+ if (result) {
|
|
|
+ let current = this.itemBelongGroup.filter(item => {
|
|
|
+ return item.id == this.id;
|
|
|
+ });
|
|
|
+ if (num < 0) {
|
|
|
+ if (current[0].index == 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '已经没有上一项',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (num > 0) {
|
|
|
+ if (current[0].index == this.itemBelongGroup.length - 1) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '已经没有下一项',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let needItemIndex = num > 0 ? current[0].index + 1 : current[0].index - 1;
|
|
|
+ let needItemId = this.itemBelongGroup[needItemIndex].id;
|
|
|
+ let needItemCheckId = this.itemBelongGroup[needItemIndex].checkItemId;
|
|
|
+
|
|
|
+ this.clearForm();
|
|
|
+ this.clearResult();
|
|
|
+ this.checkTaskDetail(needItemId);
|
|
|
+ this.getCheckItemResultList(needItemCheckId); //获取缺陷项列表数据
|
|
|
};
|
|
|
},
|
|
|
// 获取查核项可配置列表
|
|
@@ -906,7 +923,7 @@
|
|
|
}) {
|
|
|
this.id = id;
|
|
|
this.checkPointId = checkPointId;
|
|
|
- this.situationType = situationType;
|
|
|
+ this.situationType = situationType;
|
|
|
this.checkItemId = checkItemId;
|
|
|
this.getCheckConfigList(checkItemId);
|
|
|
this.getCheckItemResultList(checkItemId);
|
|
@@ -915,12 +932,12 @@
|
|
|
const eventChannel = this.getOpenerEventChannel();
|
|
|
eventChannel.on('acceptDataFromOpenerPage', (data) => {
|
|
|
// console.log({data});
|
|
|
- this.itemBelongGroup = data.data[0].responseList.map((item, index) => {
|
|
|
-
|
|
|
+ this.itemBelongGroup = data.data[0].responseList.map((item, index) => {
|
|
|
+
|
|
|
return ({
|
|
|
index: index,
|
|
|
- id: item['id'],
|
|
|
- checkItemId:item['checkItemId']
|
|
|
+ id: item['id'],
|
|
|
+ checkItemId: item['checkItemId']
|
|
|
})
|
|
|
});
|
|
|
//重新导航进页面,删除缓存并设置最新数据
|
|
@@ -1199,8 +1216,8 @@
|
|
|
font-weight: 400;
|
|
|
color: #525866;
|
|
|
margin-right: 105rpx;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
.value {
|
|
|
flex: 0.9;
|
|
|
font-size: 22.5rpx;
|
|
@@ -1261,15 +1278,15 @@
|
|
|
color: #3377FF;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- .textValue {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- justify-content: flex-start;
|
|
|
- align-items: center;
|
|
|
- width: 70%;
|
|
|
- height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .textValue {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ width: 70%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
|
|
|
.inputScore {
|