|
@@ -95,10 +95,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="inputScore">
|
|
|
- <text class="label">本项扣分</text>
|
|
|
- <!-- <text class="label">{{deductPoint}}</text> -->
|
|
|
- <input class="value" @input="onInputScore" type="number" v-model="inputScore"
|
|
|
- :placeholder="deductPoint+''" placeholder-class="placeholder" />
|
|
|
+ <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" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -117,14 +117,14 @@
|
|
|
<image class="plusIcon" src="../../static/icon-add.png" mode=""></image>
|
|
|
<text class="threePoint">缺陷</text>
|
|
|
</view>
|
|
|
- <!-- <text v-if="checkItemResultList.length>0" class="threePoint" @click="openSelectModal(i)">⋮</text> -->
|
|
|
</view>
|
|
|
<text class="clear" @click="clearResult(true,i)">清空</text>
|
|
|
<textarea maxlength="300" class="seeTextarea" value="" placeholder="请输入"
|
|
|
- :value="item.talkResult" @blur="changeTextarea($event, i)"></textarea>
|
|
|
+ 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"
|
|
|
+ <tm-upload-img label="上传图片" :filePaths="item.filePath" :isMultiple="true"
|
|
|
+ :pickIndex = "i"
|
|
|
@changeFilePaths="changeFilePaths2" />
|
|
|
</view>
|
|
|
</view>
|
|
@@ -140,7 +140,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<text class="clear" @click="clearResult(false)">清空</text>
|
|
|
- <textarea maxlength="300" class="seeTextarea" placeholder="请输入" :value="recordList[0].seeResult"
|
|
|
+ <textarea maxlength="300" class="seeTextarea" placeholder="请输入" v-model="recordList[0].seeResult"
|
|
|
@blur="changeTextarea2"></textarea>
|
|
|
</view>
|
|
|
<view class="seeImg">
|
|
@@ -168,9 +168,8 @@
|
|
|
import {
|
|
|
_goBackFresh
|
|
|
} from '../../utils/compatible.js';
|
|
|
- // import ldSelect from '@/components/ld-select/ld-select.vue'
|
|
|
+
|
|
|
export default {
|
|
|
- // components:{ldSelect},
|
|
|
data() {
|
|
|
return {
|
|
|
value: '',
|
|
@@ -194,12 +193,12 @@
|
|
|
checkPointId: "",
|
|
|
itemBelongGroup: [],
|
|
|
itemId: '',
|
|
|
- currentEditTextAreaIndex: '',
|
|
|
+ currentEditTextAreaIndex:-1, //当前编辑的查核结果下标
|
|
|
checkItemResultList: [], //查核结果说明下拉列表
|
|
|
checkedSelectResultList: [], //下拉结果选中集合
|
|
|
checkedSelectResultListIds: [],
|
|
|
currentSelect: '',
|
|
|
- checkItemScore: null, //查核选中的分数
|
|
|
+ checkItemScore:0, //查核选中的分数
|
|
|
checkItemValue: null, //查核选中的分数占比
|
|
|
checkConfiglist: [], //查核情况可配置列表
|
|
|
totalScore: 0, //总分
|
|
@@ -213,7 +212,8 @@
|
|
|
multiSelectScore: [],
|
|
|
deductPoint: 0, //本次扣分
|
|
|
currentCheckedTab: null, //当前选中的查核tab
|
|
|
- moreDeduction:false,
|
|
|
+ moreDeduction:false, //缺陷项是否多选
|
|
|
+ ifInputScore:false, //是否手动干预分值
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
@@ -223,14 +223,23 @@
|
|
|
this.checkedResponsibleData = responsibleList.checkedResponsibleList;
|
|
|
this.checkedResponsibleList = responsibleList.checkedResponsibleList.map(item => item.main);
|
|
|
},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ },
|
|
|
watch: {
|
|
|
checkedResponsibleList: function() {
|
|
|
const {
|
|
|
responsibleList
|
|
|
} = this.$store.state;
|
|
|
- // console.log({responsibleList});
|
|
|
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
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -244,29 +253,52 @@
|
|
|
data: true
|
|
|
});
|
|
|
},
|
|
|
- methods: {
|
|
|
+ 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;
|
|
|
+ },
|
|
|
//查核结果清空操作
|
|
|
clearResult(ifMulti, index) {
|
|
|
if (ifMulti) {
|
|
|
- //多个查核结果组件时
|
|
|
- this.talkList[index].talkResult = '';
|
|
|
- this.multiSelectScore[index] = 0;
|
|
|
- this.selectedScore = this.multiSelectScore.reduce((prev, cur) => (prev + cur), 0);
|
|
|
-
|
|
|
+ //多个查核结果组件时
|
|
|
+ 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, []);
|
|
|
-
|
|
|
- } else {
|
|
|
+ this.checkedSelectResultListData.splice(index, 1, []);
|
|
|
+ this.multiSelectScore[index] = 0;
|
|
|
+ this.currentEditTextAreaIndex = -1;
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
this.recordList[0].seeResult = '';
|
|
|
- this.selectedScore = 0;
|
|
|
this.checkedSelectResultListIds = [];
|
|
|
this.checkedSelectResultList = [];
|
|
|
- this.checkedSelectResultListData = [];
|
|
|
- }
|
|
|
+ this.checkedSelectResultListData = [];
|
|
|
+ this.selectedScore = 0;
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
clickModalhandle() {
|
|
|
- this.showSelectModal = false;
|
|
|
+ this.showSelectModal = false;
|
|
|
+ this.currentEditTextAreaIndex = -1;
|
|
|
},
|
|
|
openSelectModal(index) {
|
|
|
if (index >= 0) {
|
|
@@ -276,22 +308,14 @@
|
|
|
},
|
|
|
//跳转选择当事人
|
|
|
toSelectResponsible() {
|
|
|
- // console.log(this.deptId);
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/responsibleList/responsibleList?deptId=${this.deptId}&checkId=${this.id}`,
|
|
|
- // animationType: 'pop-in',
|
|
|
- // animationDuration: 200
|
|
|
});
|
|
|
},
|
|
|
- onInputScore(e) {
|
|
|
- this.inputScore = e.target.value;
|
|
|
- this.currentScore = this.totalScore - e.target.value;
|
|
|
- },
|
|
|
selectResultHandle(item) {
|
|
|
|
|
|
if (this.data.checkModelName == '访谈') {
|
|
|
const currentIndex = this.currentEditTextAreaIndex;
|
|
|
-
|
|
|
if(!this.moreDeduction){
|
|
|
//缺陷项单选
|
|
|
this.checkedSelectResultListIds.splice(currentIndex, 1,[item.id]);
|
|
@@ -312,8 +336,6 @@
|
|
|
tempArr.splice(tempArr.indexOf(item.resultName), 1);
|
|
|
tempArrData.splice(tempArrData.indexOf(item.id), 1);
|
|
|
|
|
|
- // console.log({tempIdsArr});
|
|
|
-
|
|
|
this.checkedSelectResultListIds.splice(currentIndex, 1, tempIdsArr);
|
|
|
this.checkedSelectResultList.splice(currentIndex, 1, tempArr);
|
|
|
this.checkedSelectResultListData.splice(currentIndex, 1, tempArrData);
|
|
@@ -332,7 +354,6 @@
|
|
|
this.checkedSelectResultListIds.splice(currentIndex, 1, tempIdsArr);
|
|
|
this.checkedSelectResultList.splice(currentIndex, 1, tempArr);
|
|
|
this.checkedSelectResultListData.splice(currentIndex, 1, tempArrData);
|
|
|
- // console.log(this.checkedSelectResultListIds[currentIndex],`index:${currentIndex}`);
|
|
|
}
|
|
|
} else {
|
|
|
if(!this.moreDeduction){
|
|
@@ -342,14 +363,14 @@
|
|
|
this.checkedSelectResultListData = [item];
|
|
|
return ;
|
|
|
}
|
|
|
- //缺陷项多选
|
|
|
+ // 缺陷项多选
|
|
|
if (this.checkedSelectResultListIds.includes(item.id)) {
|
|
|
- const tempIdsArr = JSON.parse(JSON.stringify(this.checkedSelectResultListIds));
|
|
|
- const tempArr = JSON.parse(JSON.stringify(this.checkedSelectResultList));
|
|
|
- const tempArrData = JSON.parse(JSON.stringify(this.checkedSelectResultListData));
|
|
|
+ const tempIdsArr = this.checkedSelectResultListIds;
|
|
|
+ const tempArr = this.checkedSelectResultList;
|
|
|
+ const tempArrData = this.checkedSelectResultListData;
|
|
|
tempIdsArr.splice(tempIdsArr.indexOf(item.id), 1);
|
|
|
tempArr.splice(tempArr.indexOf(item.resultName), 1);
|
|
|
- tempArrData.splice(tempArrData.indexOf(item.id), 1);
|
|
|
+ tempArrData.splice(tempArrData.findIndex(t=>t.id == item.id), 1);
|
|
|
this.checkedSelectResultListIds = tempIdsArr;
|
|
|
this.checkedSelectResultList = tempArr;
|
|
|
this.checkedSelectResultListData = tempArrData;
|
|
@@ -363,7 +384,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) => {
|
|
@@ -373,26 +395,16 @@
|
|
|
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);
|
|
|
-
|
|
|
- if (!this.inputScore) {
|
|
|
- this.deductPoint = this.checkItemScore + this.selectedScore;
|
|
|
- this.currentScore = this.totalScore - this.deductPoint;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- } 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;
|
|
|
}, 0);
|
|
|
this.recordList[0].seeResult = this.checkedSelectResultList.join(',');
|
|
|
this.selectedScore = tempScore;
|
|
|
-
|
|
|
- if (this.inputScore) {
|
|
|
- this.deductPoint = this.checkItemScore + this.selectedScore;
|
|
|
- this.currentScore = this.totalScore - this.deductPoint;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
_commitFunc();
|
|
@@ -407,7 +419,11 @@
|
|
|
id: id,
|
|
|
},
|
|
|
},
|
|
|
- }).then((res) => {
|
|
|
+ }).then((res) => {
|
|
|
+ uni.$once('未在查核规定时间内', function (data) {
|
|
|
+ uni.navigateBack();
|
|
|
+ });
|
|
|
+
|
|
|
this.id = id;
|
|
|
this.deptId = res.deptId;
|
|
|
//再次编辑回显
|
|
@@ -416,8 +432,8 @@
|
|
|
.split(',') : [];
|
|
|
this.Index = res.checkResult;
|
|
|
this.totalScore = res.totalScore;
|
|
|
- this.deductPoint = res.deductPoint;
|
|
|
this.currentScore = res.score;
|
|
|
+ this.deductPoint = res.deductPoint;
|
|
|
this.moreDeduction = res.moreDeduction;
|
|
|
if (res.checkResultRequestList && res.checkResultRequestList.length > 0) {
|
|
|
if (res.checkModelName == '访谈') {
|
|
@@ -425,7 +441,6 @@
|
|
|
const arr = item.checkResultDescribe.split(',');
|
|
|
const tempResult = this.checkItemResultList.filter(v => arr.includes(v
|
|
|
.resultName));
|
|
|
- // console.log({tempResult});
|
|
|
|
|
|
if (!Array.isArray(this.checkedSelectResultListIds[currentIndex])) this
|
|
|
.checkedSelectResultListIds[currentIndex] = [];
|
|
@@ -438,7 +453,7 @@
|
|
|
tempResult.map(item => item.id));
|
|
|
const tempArr = this.checkedSelectResultList[currentIndex].concat(
|
|
|
tempResult.map(item => item.resultName));
|
|
|
- // const tempArrData = this.checkedSelectResultListData[currentIndex].concat(tempResult.map(item=>item));
|
|
|
+
|
|
|
|
|
|
this.checkedSelectResultListIds.splice(currentIndex, 1, tempIdsArr);
|
|
|
this.checkedSelectResultList.splice(currentIndex, 1, tempArr);
|
|
@@ -457,11 +472,10 @@
|
|
|
}
|
|
|
});
|
|
|
//设置回显分数
|
|
|
- this.selectedScore = this.multiSelectScore.reduce((prev, cur) => (prev + cur), 0);
|
|
|
+ // this.selectedScore = this.multiSelectScore.reduce((prev, cur) => (prev + cur), 0);
|
|
|
|
|
|
} else {
|
|
|
- // console.log('非访谈');
|
|
|
- // console.log(res.checkResultRequestList[0]);
|
|
|
+
|
|
|
const arr = res.checkResultRequestList[0].checkResultDescribe.split(',');
|
|
|
const tempResult = this.checkItemResultList.filter(v => arr.includes(v.resultName));
|
|
|
const tempIds = tempResult.map(item => item.id);
|
|
@@ -472,7 +486,7 @@
|
|
|
this.checkedSelectResultList = res.checkResultRequestList[0].checkResultDescribe.split(
|
|
|
',');
|
|
|
this.checkedSelectResultListData = tempResult;
|
|
|
- this.selectedScore = tempScore;
|
|
|
+ // this.selectedScore = tempScore;
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -494,7 +508,6 @@
|
|
|
}
|
|
|
|
|
|
if (res) {
|
|
|
- // console.log({res});
|
|
|
this.data = res;
|
|
|
if (res && res.lastResult == "不适用") {
|
|
|
// this.lastIndex = 1;
|
|
@@ -532,15 +545,22 @@
|
|
|
this.checkItemScore = parsedData.itemGetScore;
|
|
|
this.checkItemValue = parsedData.value;
|
|
|
this.calScore = parsedData.calScore;
|
|
|
- if (!this.inputScore) {
|
|
|
- this.deductPoint = parsedData.itemGetScore;
|
|
|
- this.currentScore = this.totalScore - parsedData.itemGetScore;
|
|
|
+ if (!this.inputScore) { //没有手输调整过的才可以修改
|
|
|
+ this.checkItemScore = parsedData.itemGetScore;
|
|
|
}
|
|
|
|
|
|
- },
|
|
|
- changeFilePaths(filePaths, index) {
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @param {{
|
|
|
+ files
|
|
|
+ index,
|
|
|
+ }} fileInfo
|
|
|
+ files:文件集合
|
|
|
+ index:当前编辑的下标
|
|
|
+ */
|
|
|
+ changeFilePaths({files, index}) {
|
|
|
let _recordList = [...this.recordList];
|
|
|
- _recordList[index].filePath = filePaths;
|
|
|
+ _recordList[index].filePath = files;
|
|
|
this.filePath = _recordList[0].filePath;
|
|
|
},
|
|
|
insert() {
|
|
@@ -555,17 +575,29 @@
|
|
|
},
|
|
|
del(index) {
|
|
|
let list = [...this.talkList];
|
|
|
- let list2 = [];
|
|
|
+ let list2 = [];
|
|
|
+ //清空该项数据
|
|
|
+ this.clearResult(true,index);
|
|
|
+
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
if (i != index) {
|
|
|
list2.push(list[i]);
|
|
|
}
|
|
|
}
|
|
|
this.talkList = list2;
|
|
|
- },
|
|
|
- changeFilePaths2(filePaths, index) {
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @param {{
|
|
|
+ files
|
|
|
+ index,
|
|
|
+ }} fileInfo
|
|
|
+ files:文件集合
|
|
|
+ index:当前编辑的下标
|
|
|
+ */
|
|
|
+ changeFilePaths2(fileInfo) {
|
|
|
+ const {files,index} = fileInfo;
|
|
|
for (let j = 0; j < this.talkList.length; j++) {
|
|
|
- this.talkList[this.editIndex].filePath = filePaths;
|
|
|
+ this.talkList[index].filePath = files;
|
|
|
}
|
|
|
},
|
|
|
changeTextarea(e, i) {
|
|
@@ -593,8 +625,8 @@
|
|
|
value: this.checkItemValue,
|
|
|
situationType: this.situationType,
|
|
|
calScore: this.calScore,
|
|
|
- score: Number(this.currentScore),
|
|
|
- deductPoint: Number(this.inputScore ? this.inputScore : this.deductPoint),
|
|
|
+ score: this.currentScore,
|
|
|
+ deductPoint: this.deductPoint,
|
|
|
};
|
|
|
|
|
|
|
|
@@ -638,8 +670,7 @@
|
|
|
params.checkResultRequestList = list;
|
|
|
}
|
|
|
const checkConfiglist = JSON.parse(JSON.stringify(this.checkConfiglist));
|
|
|
- // console.log({params});
|
|
|
- // return;
|
|
|
+
|
|
|
this.$store.dispatch({
|
|
|
type: "mainPointsDetail/commActions",
|
|
|
payload: {
|
|
@@ -649,17 +680,19 @@
|
|
|
},
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
- // console.log({'res':res,'checkConfiglist':checkConfiglist});
|
|
|
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,
|
|
@@ -769,16 +802,15 @@
|
|
|
showCancel: false
|
|
|
});
|
|
|
}
|
|
|
- // this.improvingTaskList = data.improvingTaskResponses || [];
|
|
|
- // this.completeTaskList = data.improveCompleteResponses || [];
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
},
|
|
|
- clearForm(index) {
|
|
|
+ clearForm(index) {
|
|
|
+ //清除上一项的查核信息
|
|
|
this.Index = '';
|
|
|
- this.deductPoint = 0;
|
|
|
+ // this.deductPoint = 0;
|
|
|
this.currentScore = 0;
|
|
|
this.inputScore = 0;
|
|
|
if (this.data.checkModelName == '访谈') {
|
|
@@ -855,7 +887,6 @@
|
|
|
data: checkItemId
|
|
|
}
|
|
|
}).then(data => {
|
|
|
- // console.log({data});
|
|
|
this.checkConfiglist = data
|
|
|
})
|
|
|
},
|
|
@@ -1173,8 +1204,8 @@
|
|
|
font-weight: 400;
|
|
|
color: #525866;
|
|
|
margin-right: 105rpx;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
.value {
|
|
|
flex: 0.9;
|
|
|
font-size: 22.5rpx;
|
|
@@ -1235,6 +1266,15 @@
|
|
|
color: #3377FF;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ .textValue {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ width: 70%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
|
|
|
.inputScore {
|