1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408 |
- <template>
- <view class="mainPointsDetailPage">
- <tm-modal v-if="showSelectModal" @click="clickModalhandle">
- <view class="checkItemResultModal">
- <view class="modalContent">
- <view class="modalBar">请选择查核结果</view>
- <scroll-view v-if="data.checkModelName != '访谈'" class="scroll" scroll-y="true" >
- <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/check-checkbox.png" mode=""></image>
- {{item.resultName}}
- </view>
- </scroll-view>
-
- <scroll-view v-if="data.checkModelName == '访谈'" class="scroll" scroll-y="true" >
- <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/check-checkbox.png" mode=""></image>
- {{item.resultName}}
- </view>
- </scroll-view>
- <view class="comfirmBtn" @click="commitSelectResult">确定</view>
- </view>
- </view>
- </tm-modal>
- <scroll-view scroll-y="true" class="scroll-y">
- <view class="checkItem">
- <view class="chBg">
- <image
- src="../../static/chahexiang-bg.png"
- mode=""
- class="img"
- ></image>
- <text class="title">查核项</text>
- </view>
- <image
- src="../../static/tuli.png"
- mode=""
- class="tlImg"
- @click="toTuLi"
- ></image>
- <view class="chContent">
- <view class="checkItemName">{{ data.checkItemName ? data.checkItemName : "" }}</view>
- <view class="checkPointName">{{ data.checkPointName ? data.checkPointName : "" }}</view>
- <view class="cont">
- <view class="floatLeft other">
- <view class="letterTitle2">{{ data.deptName ? data.deptName : "" }}</view>
- <view class="letterTitle">查核单位</view>
- </view>
- <view class="floatLeft borderLine"></view>
- <view class="floatLeft other">
- <view class="letterTitle2">{{ data.checkModelName ? data.checkModelName : "" }}</view>
- <view class="letterTitle">查核方式</view>
- </view>
- <view class="floatLeft borderLine"></view>
- <view class="floatLeft other">
- <view class="letterTitle2">{{ data.lastResult ? data.lastResult : "" }}</view>
- <view class="letterTitle">上次结果</view>
- </view>
- <view class="floatLeft borderLine"></view>
- <view class="floatLeft other">
- <view class="letterTitle2">{{ data.checkResult ? data.checkResult : "" }}</view>
- <view class="letterTitle">本次结果</view>
- </view>
- </view>
- <view class="checked">
- <view
- class="checked-checkItem"
- v-for="item in checkConfiglist"
- :key="item.attr"
- @click="checkedOne(item)"
- :style="
- Index == item.attr
- ? { backgroundColor: '#3377FF', color: '#fff' }
- : { backgroundColor: '#EBEFF7' }
- "
- >{{item.attr}}
- <view v-if="lastIndex == item.attr"
- ><image
- src="../../static/shangci.png"
- mode=""
- class="img"
- ></image>
- <text class="lastName">上次</text></view
- >
- </view>
-
- </view>
- <view class="more" @click="toHistory">
- <text>查看改善历史</text>
- <view class="moreImg">
- <image
- src="../../static/blue-arrow.png"
- mode=""
- class="moreImg2"
- ></image>
- </view>
- </view>
- <view class="multipleResponsible">
- <view class="inner" @click="toSelectResponsible">
- <text class="label">当事人</text>
- <input type="text" disabled v-model="checkedResponsibleList.join(',')" placeholder="请选择当事人(可多选)" class="value" placeholder-class="valuePlaceholder" />
- <image class="arrow" src="../../static/incon-more.png" mode=""></image>
- </view>
- </view>
- <view class="score">
- <view class="box">
- <text class="lable">总分</text>
- <text class="totalScore">{{totalScore}}</text>
- </view>
- <view class="box">
- <text class="lable">本次得分</text>
- <text class="currentScore">{{currentScore}}</text>
- </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" />
- </view>
- </view>
- </view>
- <view v-if="data.checkModelName == '访谈'" class="talk">
- <view v-for="(item, i) in talkList">
- <view class="talkTitle">
- <text
- >访谈内容{{ i + 1 }}{{ i == 0 ? "" : "(访谈人员:护士、医生)" }}</text
- >
- <text v-if="i != 0" class="del" @click="del(i)">删除</text>
- </view>
- <view>
- <view class="talkResult">
- <view class="seeResultFloorOne">
- <text class="seeName">查核结果</text>
- <view class="plusAction" v-if="checkItemResultList.length>0" @click="openSelectModal(i)">
- <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>
- </view>
- <view class="talkImg" @click="imgClick(i)">
- <tm-upload-img
- label="上传图片"
- :filePaths="item.filePath"
- :isMultiple="true"
- @changeFilePaths="changeFilePaths2"
- />
- </view>
- </view>
- </view>
- </view>
- <view v-else class="see">
- <view class="seeResult">
- <view class="seeResultFloorOne">
- <text class="seeName">查核结果</text>
- <view class="plusAction" v-if="checkItemResultList.length>0" @click="openSelectModal">
- <image class="plusIcon" src="../../static/icon-add.png" mode=""></image>
- <text class="threePoint" >缺陷</text>
- </view>
- <!-- <text class="threePoint" v-if="checkItemResultList" @click="openSelectModal">⋮</text> -->
- <!-- <dropdown :list="checkItemResultList" :current="currentSelect" @onClick="dropDownChange"></dropdown> -->
- </view>
- <text class="clear" @click="clearResult(false)">清空</text>
- <textarea
- maxlength="300"
- class="seeTextarea"
- placeholder="请输入"
- :value="recordList[0].seeResult"
- @blur="changeTextarea2"
- ></textarea>
- </view>
- <view class="seeImg">
- <tm-upload-img
- label="上传图片"
- :filePaths="filePath"
- :isMultiple="true"
- @changeFilePaths="changeFilePaths"
- />
- </view>
- </view>
- <button
- class="insert"
- @click="insert"
- v-if="data.checkModelName == '访谈'"
- >
- + 增加一条记录
- </button>
- </scroll-view>
- <!-- <button type="primary" class="sureDetail" @click="sureDetail" v-if="data.display?data.display:false">完成</button> -->
- <view class="bottomMenuGroup">
- <view class="menuBtn" @click="goToPrevPage">
- <image class="threeLineMenuIcon" src="/static/threeLineMenu.png" ></image>
- </view>
- <view class="prevBtn" @click="switchItem(1)">下一项</view>
- <view class="nextBtn" @click="sureDetail('back')" v-if="data.display?data.display:false">完成</view>
- </view>
- </view>
- </template>
- <script>
- import {_goBackFresh} from '../../utils/compatible.js';
- // import ldSelect from '@/components/ld-select/ld-select.vue'
- export default {
- // components:{ldSelect},
- data() {
- return {
- value:'',
- showSelectModal:false,
- data: {}, //详情数据
- lastIndex: null, //上次选中的结果
- Index: null, //点击修改本次选中样式
- filePath: [],
- recordList: [{ seeResult: "", filePath: [] }],
- talkLength: 1,
- talkList: [{ talkResult: "", filePath: [] }],
- editIndex: null,
- resultConfigList: [],
- id: "",
- checkPointId: "",
- itemBelongGroup:[],
- itemId:'',
- currentEditTextAreaIndex:'',
- checkItemResultList:[],//查核结果说明下拉列表
- checkedSelectResultList:[],//下拉结果选中集合
- checkedSelectResultListIds:[],
- currentSelect:'',
- checkItemScore:null,//查核选中的分数
- checkItemValue:null,//查核选中的分数占比
- checkConfiglist:[],//查核情况可配置列表
- totalScore:0,//总分
- // currentScore:0,//当前得分
- inputScore:null,//手动填写分值
- selectedScore:0,//缺失项分值
- checkedResponsibleList:[],
- deptId:'',//病区id
- checkedResponsibleData:[],
- checkedSelectResultListData:[],
- multiSelectScore:[],
- deductPointFromRes:0,
- };
- },
- onShow() {
- const {responsibleList} = this.$store.state;
- this.checkedResponsibleData = responsibleList.checkedResponsibleList;
- this.checkedResponsibleList = responsibleList.checkedResponsibleList.map(item=>item.main);
- },
- computed:{
- // currentScore:function(){
- // return (this.totalScore-this.selectedScore-this.checkItemScore).toFixed(2);
- // },
- currentScore:{
- get: function () {
- // console.log(this.inputScore);
- // console.log(this.totalScore,this.selectedScore,this.checkItemScore)
- if(this.inputScore>0){
- return this.totalScore - this.inputScore;
- }
- return (this.totalScore-this.selectedScore-this.checkItemScore-this.deductPointFromRes).toFixed(2);
- },
- set:function(newValue){
- // const everyCount = Math.abs((newValue)/2);
- // this.selectedScore = everyCount;
- // this.checkItemScore = everyCount;
- // this.inputScore = this.inputScore + newValue;
- },
-
- },
- //this.inputScore
- // score:function(){
- // return this.inputScore+Math.abs(this.currentScore)
- // },
- deductPoint:function(){
- console.log(Number(this.inputScore),Number(this.selectedScore),Number(this.checkItemScore));
- if(this.inputScore){
- return this.inputScore;
- }
- return (this.deductPointFromRes-Number(this.inputScore)+Number(this.selectedScore)+Number(this.checkItemScore)).toFixed(2)
- }
- },
- watch:{
- checkedResponsibleList:function(){
- const {responsibleList} = this.$store.state;
- console.log({responsibleList});
- return responsibleList.checkedResponsibleList.map(item=>item.main);
- }
- },
- mounted() {
- this.checkTaskDetail(this.id);
- this.getPeizhiList();
-
- },
- methods: {
- //查核结果清空操作
- clearResult(ifMulti,index){
- if(ifMulti){
- //多个查核结果组件时
- this.talkList[index].talkResult = '';
- this.multiSelectScore[index] = 0;
- this.selectedScore = this.multiSelectScore.reduce((prev,cur)=>(prev+cur),0);
-
- this.checkedSelectResultListIds.splice(index,1,[]);
- this.checkedSelectResultList.splice(index,1,[]);
- this.checkedSelectResultListData.splice(index,1,[]);
-
- }else {
- this.recordList[0].seeResult='';
- this.selectedScore = 0;
- this.checkedSelectResultListIds=[];
- this.checkedSelectResultList=[];
- this.checkedSelectResultListData=[];
- }
- },
- clickModalhandle(){
- this.showSelectModal = false;
- },
- openSelectModal(index){
- // console.log({index});
- if(index>=0){
- this.currentEditTextAreaIndex = index;
- }
- this.showSelectModal = true;
- },
- //跳转选择当事人
- toSelectResponsible(){
- // console.log(this.deptId);
- uni.navigateTo({
- url: `/pages/responsibleList/responsibleList?deptId=${this.deptId}&checkId=${this.id}`,
- });
- },
- onInputScore(e){
- this.inputScore = e.target.value;
- this.currentScore = e.target.value;
- },
- selectResultHandle(item){
-
- if(this.data.checkModelName == '访谈'){
- const currentIndex = this.currentEditTextAreaIndex;
- if(this.checkedSelectResultListIds[currentIndex]&&this.checkedSelectResultListIds[currentIndex].includes(item.id)){
- console.log('减去');
- const tempIdsArr = JSON.parse(JSON.stringify(this.checkedSelectResultListIds[currentIndex]));
- const tempArr = JSON.parse(JSON.stringify(this.checkedSelectResultList[currentIndex]));
- const tempArrData = JSON.parse(JSON.stringify(this.checkedSelectResultListData[currentIndex]));
-
- tempIdsArr.splice(tempIdsArr.indexOf(item.id),1);
- 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);
- }else {
- if(!Array.isArray(this.checkedSelectResultListIds[currentIndex]))this.checkedSelectResultListIds[currentIndex]=[];
- if(!Array.isArray(this.checkedSelectResultList[currentIndex]))this.checkedSelectResultList[currentIndex]=[];
- if(!Array.isArray(this.checkedSelectResultListData[currentIndex]))this.checkedSelectResultListData[currentIndex]=[];
-
- const tempIdsArr = this.checkedSelectResultListIds[currentIndex].concat([item.id]);
- const tempArr = this.checkedSelectResultList[currentIndex].concat([item.resultName]);
- const tempArrData = this.checkedSelectResultListData[currentIndex].concat([item]);
-
- 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.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));
- tempIdsArr.splice(tempIdsArr.indexOf(item.id),1);
- tempArr.splice(tempArr.indexOf(item.resultName),1);
- tempArrData.splice(tempArrData.indexOf(item.id),1);
- this.checkedSelectResultListIds = tempIdsArr;
- this.checkedSelectResultList = tempArr;
- this.checkedSelectResultListData = tempArrData;
- }else {
- this.checkedSelectResultListIds.push(item.id);
- this.checkedSelectResultList.push(item.resultName);
- this.checkedSelectResultListData.push(item);
- }
- }
- },
- commitSelectResult(){
-
-
- if(this.data.checkModelName == '访谈'){
- const tempArr = this.checkedSelectResultListData[this.currentEditTextAreaIndex].map(item=>item.percentScore);
- const tempScore = tempArr.reduce((prev,cur)=>{
- // return ((prev/100)*this.totalScore)+((cur/100)*this.totalScore)
- return prev + cur;
- },0);
-
- 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);
- // console.log(this.selectedScore,this.multiSelectScore[this.currentEditTextAreaIndex],tempScore,tempArr,this.checkedSelectResultListData);
- }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;
- }
- // const tempArr = this.checkedSelectResultListData.map(item=>item.percentScore);
- // const tempScore = tempArr.reduce((prev,cur)=>{
- // return (prev/100)+(cur/100)
- // },0);
-
-
- // console.log({tempScore});
- // console.log(this.selectedScore);
-
- this.showSelectModal = false;
- },
- checkTaskDetail(id) {
- this.$store.dispatch({
- type: "mainPointsDetail/commActions",
- payload: {
- key: "checkTaskDetail",
- data: {
- id: id,
- },
- },
- }).then((res) => {
- // console.log({res});
- this.id = id;
- this.deptId = res.deptId;
- //再次编辑回显
- this.totalScore = res.totalScore;
- this.deductPointFromRes = res.deductPoint;
-
- if(res.lastResult){
- const lastConfig = this.checkConfiglist.filter(item=>item.attr == res.lastResult);
- this.checkItemScore = lastConfig[0].score*lastConfig[0].value;
- }
-
- // this.deductPoint = res.deductPoint;
- if(res.checkResultRequestList&&res.checkResultRequestList.length>0){
- if(res.checkModelName == '访谈'){
- this.talkList = res.checkResultRequestList.map((item,currentIndex)=>{
- 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]=[];
- if(!Array.isArray(this.checkedSelectResultList[currentIndex]))this.checkedSelectResultList[currentIndex]=[];
- if(!Array.isArray(this.checkedSelectResultListData[currentIndex]))this.checkedSelectResultListData[currentIndex]=[];
-
- const tempIdsArr = this.checkedSelectResultListIds[currentIndex].concat(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);
- this.checkedSelectResultListData.splice(currentIndex,1,tempResult);
-
- const tempArrFull = this.checkedSelectResultListData[currentIndex].map(item=>item.percentScore);
- const tempScore = tempArrFull.reduce((prev,cur)=>{
- return prev + cur;
- },0);
- this.multiSelectScore[currentIndex] = tempScore;
- return {
- talkResult:item.checkResultDescribe,
- filePath:item.checkResultUrl !=''?item.checkResultUrl.split(','):[]
- }
- });
- //设置回显分数
- // 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);
- const scores = tempResult.map(item=>item.percentScore);
- const tempScore = scores.reduce((prev,cur)=>(prev+cur),0);
- this.recordList[0].seeResult = res.checkResultRequestList[0].checkResultDescribe;
- this.checkedSelectResultListIds=tempIds;
- this.checkedSelectResultList=res.checkResultRequestList[0].checkResultDescribe.split(',');
- this.checkedSelectResultListData=tempResult;
- this.selectedScore = tempScore;
- // console.log(this.checkedSelectResultListIds,tempResult,tempIds,tempScore,this.selectedScore);
-
- }
- }
-
- //用于当时人页面回显
- if(res.responsibleUserName){
- const tempResponsibleUserName = res.responsibleUserName.split(',');
- const tempResponsibleUserId = res.responsibleUserId.split(',');
- this.checkedResponsibleList = tempResponsibleUserName;
- const arr = tempResponsibleUserName.map((item,index)=>({
- main:item,
- id:parseInt(tempResponsibleUserId[index])
- }));
- console.log({arr});
- this.$store.commit('responsibleList/updateCheckedResponsibleList',arr);
- }else{
- this.checkedResponsibleList = [];
- this.$store.commit('responsibleList/updateCheckedResponsibleList',[]);
- }
-
- if (res) {
- console.log({res});
- this.data = res;
- if (res && res.lastResult == "不适用") {
- // this.lastIndex = 1;
- this.lastIndex = res.lastResult;
- } else if (res && res.lastResult == "无缺失") {
- this.lastIndex = res.lastResult;
- } else if (res && res.lastResult == "主要缺失") {
- this.lastIndex = res.lastResult;
- } else if (res && res.lastResult == "次要缺失") {
- this.lastIndex = res.lastResult;
- } else if (res && res.lastResult == "观察事项") {
- this.lastIndex = res.lastResult;
- } else {
- this.lastIndex = 0;
- }
- }
- });
- },
- getPeizhiList() {
- this.$store.dispatch({
- type: "configure/commActions",
- payload: {
- key: "getResultConfig",
- },
- }).then((res) => {
- this.resultConfigList = res ? res : [];
- });
- },
- //查核点击回调
- checkedOne(data) {
- const parsedData = JSON.parse(JSON.stringify(data));
- // console.log({parsedData})
- this.Index = parsedData.attr;
- this.data.checkResult = parsedData.attr;
- this.checkItemScore = parsedData.score*parsedData.value;
- console.log(this.checkItemScore,parsedData);
- this.checkItemValue = parsedData.value;
-
- // this.Index = data;
- // this.data.checkResult = data;
- // if (data == 1) {
- // this.data.checkResult = "不适用";
- // } else if (data == 2) {
- // this.data.checkResult = "无缺失";
- // } else if (data == 3) {
- // this.data.checkResult = "主要缺失";
- // } else if (data == 4) {
- // this.data.checkResult = "次要缺失";
- // } else if (data == 5) {
- // this.data.checkResult = "观察事项";
- // } else {
- // this.data.checkResult = "";
- // }
- },
- changeFilePaths(filePaths, index) {
- let _recordList = [...this.recordList];
- _recordList[index].filePath = filePaths;
- this.filePath = _recordList[0].filePath;
- },
- insert() {
- let list = [...this.talkList];
- if (list.length < 10) {
- list.push({ talkResult: "", filePath: [] });
- this.talkList = list;
- }
- },
- del(index) {
- let list = [...this.talkList];
- let list2 = [];
- for (let i = 0; i < list.length; i++) {
- if (i != index) {
- list2.push(list[i]);
- }
- }
- this.talkList = list2;
- },
- changeFilePaths2(filePaths, index) {
- for (let j = 0; j < this.talkList.length; j++) {
- this.talkList[this.editIndex].filePath = filePaths;
- }
- },
- changeTextarea(e, i) {
- for (let j = 0; j < this.talkList.length; j++) {
- this.talkList[i].talkResult = e.detail.value;
- }
- },
- changeTextarea2(e) {
- this.recordList[0].seeResult = e.target.value;
- },
- imgClick(i) {
- this.editIndex = i;
- },
- sureDetail(key) {
- if (this.Index) {
- let params = {
- id: this.data.id,
- checkResult: this.data.checkResult,
- checkResultRequestList: [],
- checkItemScore:this.checkItemScore,
- value:this.checkItemValue,
- // responsibleUserId:(this.checkedResponsibleData.map(item=>item.id)).join(','),
- // responsibleUserName:(this.checkedResponsibleData.map(item=>item.main)).join(','),
- score:Number(this.currentScore),
- deductPoint:Number(this.inputScore?this.inputScore: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 list = [];
- let path = "";
- for (let j = 0; j < this.recordList[0].filePath.length; j++) {
- if (j == 0) {
- path += `${this.recordList[0].filePath[j]}`;
- } else {
- path += `,${this.recordList[0].filePath[j]}`;
- }
- }
- let item = {
- checkResultId: 1,
- checkResultDescribe: this.recordList[0].seeResult,
- checkResultUrl: path,
- };
- list.push(item);
- params.checkResultRequestList = list;
- }
- const checkConfiglist = JSON.parse(JSON.stringify(this.checkConfiglist));
- // console.log({params});
- // return;
- this.$store.dispatch({
- type: "mainPointsDetail/commActions",
- payload: {
- key: "saveCheckTaskDetail",
- data: {
- ...params,
- },
- },
- }).then((res) => {
- // console.log({'res':res,'checkConfiglist':checkConfiglist});
- if (res) {
- 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');
- }
- }
- console.log('w');
- if(key=='back'){
- //点完成时返回
- console.log('开始返回');
- _goBackFresh('pages/checkMainPoints/checkMainPoints');
- }
- // _goBackFresh('pages/checkMainPoints/checkMainPoints');
- //去查核详情页
- // uni.navigateTo({
- // url: `/pages/auditItemDetails/auditItemDetails?id=${this.data.id}&checkPointId=${this.checkPointId}`,
- // });
- }else {
- console.log('res为false');
- }
- });
- } else {
- uni.showModal({
- title: "检查选项未选择",
- showCancel: false,
- });
- }
- },
- toTuLi() {
- uni.navigateTo({
- url: `/pages/legendDetails/legendDetails?checkItemId=${this.data.checkItemId}&checkPointId=${this.checkPointId}`,
- });
- },
- toHistory() {
- const situationId = this.data.situationId;
- this.$store.dispatch({
- type: 'mission/commActions',
- payload: {
- key: "getMissionList",
- data:{situationId}
- }
- }).then(data => {
- if(data) {
- if(data.improvingTaskResponses.length>0){
- uni.navigateTo({
- url: `/pages/improve-mission-list/improve-mission-list?situationId=${this.data.situationId}`,
- });
- }else {
- uni.showModal({
- content: '暂无改善历史',
- showCancel:false
- });
- }
- // this.improvingTaskList = data.improvingTaskResponses || [];
- // this.completeTaskList = data.improveCompleteResponses || [];
- }
- });
- /** 请求参数 data
- * situationId: 情境id 当管路员或者查核者通过情境进入任务列表时 必传
- * checkItemId 单位负责人通过 查核要点进入改善任务列表时 必传
- */
-
- },
- clearForm(index){
- this.Index = '';
- this.deductPoint = 0;
- this.currentScore = 0;
- this.inputScore = 0;
- if(this.data.checkModelName == '访谈'){
- if(index){
- this.talkList[index].talkResult = '';
- }else {
- for(let i=0;i<this.talkList.length;i++){
- this.talkList[i].talkResult = '';
- }
- }
-
- }else {
- this.recordList[0].talkResult ='';
- }
- this.checkedSelectResultListIds=[];
- this.checkedSelectResultList=[];
- this.checkedSelectResultListData=[];
- },
- goToPrevPage(){
- _goBackFresh('pages/checkMainPoints/checkMainPoints');
- },
- switchItem:async function(num){
- await this.sureDetail();
- 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;
- // console.log({needItemIndex,needItemId});
- this.clearForm();
- this.checkTaskDetail(needItemId);
- },
- // 获取查核项可配置列表
- getCheckConfigList(checkItemId) {
- this.$store.dispatch({
- type: 'mainPointsDetail/commActions',
- payload: {
- key:'getCheckItemAttr',
- data:checkItemId
- }
- }).then(data=>{
- // console.log({data});
- this.checkConfiglist = data
- })
- },
- // 获取查核项结果说明下拉列表
- getCheckItemResultList(checkItemId) {
- this.$store.dispatch({
- type: 'mainPointsDetail/commActions',
- payload: {
- key:'getCheckItemResultList',
- data:checkItemId
- }
- }).then(data=>{
- // console.log({data});
- // const temp = [
- // {resultName:'1',id:0},
- // {resultName:'2',id:1},
- // {resultName:'3',id:2},
- // {resultName:'4',id:3}
- // ]
- // this.checkItemResultList = temp;
- this.checkItemResultList = data;
- })
- },
- },
- onLoad({ id, checkPointId,checkItemId }) {
- this.id = id;
- this.checkPointId = checkPointId;
-
- this.getCheckConfigList(checkItemId);
- this.getCheckItemResultList(checkItemId);
-
- //接收来自上个页面所传过来的数据
- const eventChannel = this.getOpenerEventChannel();
- eventChannel.on('acceptDataFromOpenerPage', (data)=>{
- // console.log({data});
- this.itemBelongGroup =data.data[0].responseList.map((item,index)=>{
- return({
- index:index,
- id:item['id'],
- })
- });
- //重新导航进页面,删除缓存并设置最新数据
- uni.removeStorageSync('itemBelongGroup');
- uni.setStorageSync('itemBelongGroup',this.itemBelongGroup);
- });
- //手动刷新页面,获取本地缓存
- const itemBelongGroup = uni.getStorageSync('itemBelongGroup');
- this.itemBelongGroup = itemBelongGroup;
- },
- };
- </script>
- <style lang="less">
- .mainPointsDetailPage {
- position: relative;
- // min-height: 75rpx;
- // overflow-y: auto;
- height: 100%;
-
- .checkItemResultModal {
- display: flex;
- height: 100%;
- justify-content: center;
- align-items: center;
- .modalContent {
- width: 90%;
- height:600rpx;
- border-radius: 10rpx;
- overflow: hidden;
- background-color: #FFFFFF;
- .modalBar{
- display: flex;
- justify-content: center;
- align-items: center;
- height: 80rpx;
- color: #4E78FF;
- font-size: 22.5rpx;
- box-shadow: 0 6rpx 6rpx #E5E5E5;
- border-bottom: 0.1rpx solid #E5E5E5;
- }
- .comfirmBtn {
- font-size: 22rpx;
- color: #FFFFFF;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- background-color: #3377FF;
- }
- .scroll {
- height: calc(100% - 160rpx);
- .list {
- position: relative;
- display: flex;
- height: 80rpx;
- justify-content: center;
- align-items: center;
- border-bottom: 0.1rpx solid #E5E5E5;
- .checkIcon {
- display: none;
- position: absolute;
- left:5%;
- width: 25rpx;
- height:25rpx;
- }
-
- &.on {
- color: #3377FF;
- .checkIcon {
- display: block;
- }
- }
- }
- }
- }
- }
- .scroll-y {
- height: calc(100% - 75rpx);
- }
- .checkItem {
- padding-top: 47.5rpx;
- width: 100%;
- min-height: 450rpx;
- background-color: #fff;
- position: relative;
- .chBg {
- position: absolute;
- top: 0;
- left: 0;
- width: 125rpx;
- height: 37.5rpx;
- .img {
- width: 125rpx;
- height: 37.5rpx;
- }
- .title {
- position: absolute;
- top: 8.75rpx;
- left: 25rpx;
- font-size: 20rpx;
- color: #fff;
- font-weight: 500;
- line-height: 20rpx;
- }
- }
- .tlImg {
- width: 40rpx;
- height: 40rpx;
- position: absolute;
- right: 25rpx;
- top: 25rpx;
- }
- .chContent {
- width: 100%;
- .checkItemName {
- margin-left: 31.25rpx;
- font-size: 25rpx;
- line-height: 55rpx;
- color: #292c33;
- }
- .checkPointName {
- margin-left: 31.25rpx;
- font-size: 17.5rpx;
- line-height: 17.5rpx;
- color: #7a8599;
- }
- .cont {
- height: 135rpx;
- .floatLeft {
- float: left;
- }
- .borderLine {
- margin-top: 56.25rpx;
- width: 0.62rpx;
- height: 25rpx;
- background-color: #dadee6;
- }
- .other {
- padding: 40rpx 0rpx;
- height: 95rpx;
- width: 187.18rpx;
- text-align: center;
- .letterTitle {
- font-size: 17.5rpx;
- color: #7a8599;
- line-height: 17.5rpx;
- }
- .letterTitle2 {
- height: 22.5rpx;
- font-size: 22.5rpx;
- line-height: 22.5rpx;
- color: #292c33;
- margin-bottom: 15rpx;
- font-weight: 500;
- }
- }
- }
- .checked {
- margin-bottom: 40rpx;
- padding: 0rpx 15.62rpx;
- height: 75rpx;
- .checked-checkItem {
- margin: 0rpx 9.37rpx;
- padding: 0;
- width: 125rpx;
- height: 75rpx;
- background: #ebeff7;
- float: left;
- line-height: 75rpx;
- text-align: center;
- color: #292c33;
- border-radius: 20rpx;
- position: relative;
- .img {
- width: 51.25rpx;
- height: 25rpx;
- position: absolute;
- right: -6.25rpx;
- top: -6.25rpx;
- }
- .lastName {
- color: #fff;
- font-size: 13.75rpx;
- line-height: 13.75rpx;
- position: absolute;
- right: 5rpx;
- top: -1.87rpx;
- }
- }
- }
- .more {
- margin: 0rpx 25rpx 0rpx 25rpx;
- text-align: center;
- border-top: 0.62rpx solid #dadee6;
- text {
- padding: 29.37rpx 0rpx 27.5rpx;
- margin-right: 10rpx;
- line-height: 22.5rpx;
- font-size: 22.5rpx;
- color: #3377ff;
- display: inline-block;
- vertical-align: top;
- }
- .moreImg {
- margin-top: 28.75rpx;
- width: 12.37rpx;
- height: 21.21rpx;
- display: inline-block;
- }
- .moreImg2 {
- width: 12.37rpx;
- height: 21.21rpx;
- }
- }
- .multipleResponsible {
- padding-top:15rpx;
- background-color:#F5F6FA;
- .inner {
- position: relative;
- display: flex;
- height: 87.5rpx;
- z-index: 10;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- padding: 0 25rpx;
- background-color: #FFFFFF;
- .label {
- display: inline-block;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- margin-right: 105rpx;
- }
- .value {
- flex: 0.9;
- font-size: 22.5rpx;
- overflow:hidden; //超出的文本隐藏
- text-overflow:ellipsis; //溢出用省略号显示
- white-space:nowrap; //溢出不换行
- }
- .valuePlaceholder {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #B8BECC;
- }
- .arrow {
- position: absolute;
- right:25rpx;
- width: 12.5rpx;
- height: 20rpx;
- }
- }
- }
- .score {
- display: flex;
- height: 87.5rpx;
- flex-direction:row;
- justify-content: space-between;
- align-items: center;
- padding: 0 25rpx;
- background: #F5F6FA;
- .box {
- text-align: center;
- vertical-align: bottom;
- .lable {
- display: inline-block;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- margin-right: 10rpx;
- }
- .totalScore {
- font-size: 30rpx;
- font-family: SourceHanSansCN-Bold, SourceHanSansCN;
- font-weight: bold;
- color: #292C33;
- }
-
- .currentScore {
- font-size: 30rpx;
- font-family: SourceHanSansCN-Bold, SourceHanSansCN;
- font-weight: bold;
- color: #3377FF;
- }
- }
- }
- .inputScore {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items:center;
- height: 87.5rpx;
- padding: 0 25rpx;
- background-color: #FFFFFF;
- .label {
- display: inline-block;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- margin-right: 81.25rpx;
- }
- .value {
- font-size: 22.5rpx;
- }
- .placeholder {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- }
- }
- }
- }
- .see {
- margin-top: 15rpx;
- height: 287.5rpx;
- background-color: #fff;
- // padding-left: 25rpx;
- .seeResult {
- position: relative;
- margin-left: 25rpx;
- padding-top: 32.5rpx;
- // height: 200rpx;
- border-bottom: 1px solid #dadee6;
- .clear {
- position: absolute;
- z-index: 10;
- right: 25rpx;
- bottom: 25rpx;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FF3355;
- }
- .seeResultFloorOne {
- display: flex;
- flex-direction: row;
- justify-content:space-between;
- align-items: center;
- margin-bottom: 25rpx;
- padding-right: 25rpx;
- .plusAction {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- .plusIcon {
- width: 25rpx;
- height: 25rpx;
- margin-right: 10rpx;
- }
- .threePoint {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #7A8599;
- }
- }
-
- }
- .seeName {
- width: 175rpx;
- font-size: 22.5rpx;
- color: #525866;
- line-height: 22.5rpx;
- display: inline-block;
- }
- .seeTextarea {
- width: 97%;
- height: 155rpx;
- display: inline-block;
- font-size: 22.5rpx;
- line-height: 27.5rpx;
- }
- }
- .seeImg {
- min-height: 87.5rpx;
- .seeName2 {
- width: 175rpx;
- font-size: 22.5rpx;
- color: #525866;
- line-height: 87.5rpx;
- display: inline-block;
- }
- }
- }
- .talk {
- .talkTitle {
- padding: 25rpx 25rpx 15rpx;
- font-size: 22.5rpx;
- line-height: 22.5rpx;
- color: #666f80;
- .del {
- float: right;
- color: #3377ff;
- }
- }
- .talkResult {
- position: relative;
- padding-left: 25rpx;
- padding-top: 32.5rpx;
- border-bottom: 1px solid #dadee6;
- background-color: #fff;
- .clear {
- position: absolute;
- z-index: 10;
- right: 25rpx;
- bottom: 25rpx;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FF3355;
- }
- .seeResultFloorOne {
- display: flex;
- flex-direction: row;
- justify-content:space-between;
- align-items: center;
- margin-bottom: 25rpx;
- padding-right: 25rpx;
- .plusAction {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- .plusIcon {
- width: 25rpx;
- height: 25rpx;
- margin-right: 10rpx;
- }
- .threePoint {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #7A8599;
- }
- }
- }
- .seeName {
- width: 175rpx;
- font-size: 22.5rpx;
- color: #525866;
- line-height: 22.5rpx;
- display: inline-block;
- }
- .seeTextarea {
- width: 531.25rpx;
- height: 155rpx;
- display: inline-block;
- font-size: 22.5rpx;
- line-height: 27.5rpx;
- }
- }
- .talkImg {
- min-height: 87.5rpx;
- .seeName2 {
- width: 175rpx;
- font-size: 22.5rpx;
- color: #525866;
- line-height: 87.5rpx;
- display: inline-block;
- }
- }
- }
- .insert {
- background-color: #fff;
- font-size: 22.5rpx;
- line-height: 22.5rpx;
- color: #3377ff;
- padding: 26.25rpx;
- }
- .sureDetail {
- width: 100%;
- height: 75rpx;
- font-size: 22.5rpx;
- background-color: #3377ff;
- line-height: 75rpx;
- position: absolute;
- bottom: 0rpx;
- }
- .bottomMenuGroup {
- position: fixed;
- bottom: 0;
- width: 100%;
- height: 75rpx;
- display: flex;
- flex-direction: row;
- background: #FFFFFF;
- border-top:0.62rpx solid #DADEE6;
- .menuBtn {
- display: flex;
- width: 75rpx;
- height: 75rpx;
- justify-content: center;
- align-items: center;
- border-right: 0.62rpx solid #DADEE6;
- .threeLineMenuIcon {
- width: 26.25rpx;
- height: 21.25rpx;
- }
-
- }
- .prevBtn,.nextBtn {
- display: flex;
- flex: 1;
- justify-content: center;
- height:75rpx;
- line-height:75rpx;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #3377FF;
- }
- .prevBtn {
- border-right: 0.62rpx solid #DADEE6;
- }
- .nextBtn{
- color: #FFFFFF;
- background: #3377FF;
- }
- }
- }
- </style>
|