| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- <template>
- <div>
- <!-- 顶部条-->
- <div class="navBarTOP">
- <van-nav-bar
- class="navBar"
- :title="info.summaryTaskName"
- left-arrow
- @click-left="onClickLeft" />
- <!-- <p style="text-align: right;margin-right: 16px;color: #1e5398;">{{title}}</p>-->
- </div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey" style="height: 6px"></div>
- <!-- 主体内容-->
- <div
- class="container linep"
- style="
- background-color: #fff;
- width: 94%;
- margin: 0px auto;
- border-radius: 6px;
- padding: 10px;
- ">
- <div style="padding: 4px 0">
- <van-icon :name="ry" size="16" style="float: left" />
- <span> {{ info.nickName }} - {{ info.postName }}</span>
- </div>
- <div style="padding: 4px 0">
- <van-icon :name="zw" size="16" style="float: left" />
- <span> 所属部门:{{ info.deptName }}</span>
- </div>
- <div style="padding: 4px 0">
- <van-icon :name="tm" size="16" style="float: left" />
- <span> 提交时间:{{ info.createTime }}</span>
- </div>
- </div>
- <div class="lineGrey"></div>
- <div
- class="container linep"
- style="background-color: #fff; width: 94%; margin: 0px auto; border-radius: 6px">
- <componVisitSummary
- :collectionItemLists="collectionItemLists"
- ref="componVisitSummary"></componVisitSummary>
- </div>
- <br />
- <div class="tc" style="padding: 0 16px" v-if="writeAgain">
- <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
- 补填保存
- </van-button>
- </div>
- <br />
- <br />
- <br />
- </div>
- </template>
- <script>
- import history from '@/assets/Icon/history.png';
- import tm from '@/assets/Icon/tm.png';
- import zw from '@/assets/Icon/zw.png';
- import ry from '@/assets/Icon/ry.png';
- import { getSummaryMobilo } from '@/api/index';
- import { ImagePreview } from 'vant';
- import deleteUploadImg from '@/components/deleteUploadImg';
- import componVisitSummary from '@/views/week/componVisitSummary';
- import { writeAgainCustomAnswer } from '@/api/week';
- export default {
- name: 'daily',
- components: { deleteUploadImg, componVisitSummary },
- data() {
- return {
- info: {},
- zw: zw,
- tm: tm,
- ry: ry,
- show: true,
- num: 0,
- todayGoal: {},
- progressWidth: 0,
- history: history,
- imgArr: [],
- activeNames: ['1', '2', '3', '4', '5', '6', '7', '8', '10', '16', '17'],
- value: '2',
- message: '',
- powerGrade: '',
- Content: '',
- Content2: '',
- reportTargetAll: {},
- reportContents: [{ dayContent: '' }],
- reportTarget: {},
- successContent: '',
- imgList: [],
- type: '-1',
- collectionItemLists: [],
- writeAgain: false,
- //
- };
- },
- created() {
- this.powerGrade = localStorage.getItem('powerGrade');
- this.getDetailById();
- },
- watch: {
- $route(to, from) {
- this.powerGrade = localStorage.getItem('powerGrade');
- if (to.path == '/dailyDetails') {
- this.getDetailById();
- }
- // &&from.path=="/dailyApprovalList"
- // if(to.path=="/dailyDetails"&&from.path=="/myHistoricalDaily"){
- // this.getDetailById()
- // }
- },
- },
- activated() {
- this.num = 0;
- this.userTodayPlanNum();
- },
- methods: {
- pviewFn(val, imgVal) {
- var imgList = [];
- var photos = this.reportTarget.photos[val].photos;
- for (let i = 0; i < photos.length; i++) {
- imgList.push(photos[i].fileUrl);
- }
- ImagePreview({ images: imgList, startPosition: imgVal });
- },
- submint() {
- this.$router.push({
- path: '/daily',
- query: { reportId: this.$route.query.reportId, temporaryShow: 'N' },
- });
- },
- getDetailById() {
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- getSummaryMobilo({ userSummaryId: this.$route.query.userSummaryId }).then((res) => {
- loading1.clear();
- this.reportTargetAll = res.data.reportTargetAll;
- this.info = res.data;
- this.type = res.data.userType;
- if (res.data.status == 3) {
- this.successContent = res.data.successContent;
- } else {
- this.successContent = res.data.failContent;
- }
- if (res.data.reportContents && res.data.reportContents.length > 0) {
- this.Content = res.data.reportContents[0].dayContent;
- if (res.data.reportContents.length > 1) {
- this.Content2 = res.data.reportContents[1].dayContent;
- } else {
- this.Content2 = '';
- }
- } else {
- this.Content = '';
- this.Content2 = '';
- }
- this.reportContents = res.data.reportContents;
- var imgList = [];
- if (res.data.photos != null) {
- for (var k = 0; k < res.data.photos.length; k++) {
- imgList.push(res.data.photos[k].fileUrl + '');
- }
- }
- this.imgList = imgList;
- this.writeAgain = res.data.customItemList.some((item) => {
- return item.writeAgain === '1';
- });
- this.collectionItemLists = res.data.customItemList;
- });
- },
- userTodayPlanNum() {
- // userTodayPlanNum().then((res) => {
- // if (res.code == 200) {
- // this.todayGoal = res.data;
- // this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + '%';
- // localStorage.setItem('nickName', res.data.user.nickName);
- // localStorage.setItem('storeType', res.data.user.type);
- // } else {
- // this.$toast.fail(res.msg);
- // }
- // });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- onSubmit() {
- let collectionAnswerlisd = this.$refs.componVisitSummary.collectionAnswerlisd;
- let collectionItemList = this.$refs.componVisitSummary.collectionItemList;
- for (var c = 0; c < collectionAnswerlisd.length; c++) {
- for (var b = 0; b < collectionItemList.length; b++) {
- if (collectionAnswerlisd[c].id == collectionItemList[b].customId) {
- collectionItemList[b].customOptionList = collectionAnswerlisd[c].value;
- }
- }
- }
- // 获取所有可以补填的题
- let customItemList = collectionItemList.filter((item) => item.writeAgain == '1');
- console.log(customItemList);
- // // 照片
- // let zpDataList = customItemList.find((item) => item.answerType == 'zp');
- // if (zpDataList) {
- // let fileIdList = [];
- // zpDataList.fileInfoList.forEach((item) => {
- // fileIdList.push(item.id);
- // });
- // zpDataList.fileIdList = fileIdList;
- // }
- writeAgainCustomAnswer({
- userSummaryId: this.$route.query.userSummaryId,
- customItemList: customItemList,
- }).then((res) => {
- if (res.code == 200) {
- this.$toast('操作成功!');
- this.$router.replace({
- path: '/VisitSummary',
- });
- }
- });
- },
- },
- };
- </script>
- <style scoped>
- .container {
- background-color: white;
- }
- .van-f-red {
- color: red;
- width: 8px;
- display: inline-block;
- line-height: 26px;
- }
- .formLabel {
- margin: 0 16px;
- border-bottom: 1px solid #f1f1f1;
- }
- .formLabel .van-cell {
- padding: 10px 0;
- }
- .formLabel .van-cell::after {
- border: 0;
- }
- .formLabel .van-field {
- border: 1px solid #f1f1f1;
- padding: 6px;
- width: 100%;
- border-radius: 4px;
- overflow: hidden;
- }
- .formLabel .van-field__control {
- padding: 0 10px;
- }
- .formLabel .formLabeltitle {
- position: absolute;
- top: 8px;
- }
- .z-checkbox .van-radio {
- padding: 6px 0;
- }
- .z-celly .van-cell__title {
- font-weight: initial;
- font-size: 14px;
- }
- </style>
- <style>
- .table-headermd {
- font-size: 1.2rem;
- text-align: center;
- position: initial;
- width: 94% !important;
- margin: 0 auto;
- border-right: 0;
- }
- .table-headermd .el-table__header,
- .table-headermd .el-table__body {
- width: 100% !important;
- }
- .table-headermd col {
- width: 5.8rem;
- }
- .table-headermd col:nth-child(2),
- .table-headermd col:nth-child(4),
- .table-headermd col:nth-child(3) {
- width: 5rem;
- }
- .table-headermd .van-cell {
- padding: 0 4px;
- height: 100%;
- }
- .table-headermd th.el-table__cell > .cell {
- padding: 0 4px;
- }
- .table-headermd th.el-table__cell {
- background-color: #1989fa;
- color: #fff;
- }
- .table-headermd .el-table__cell {
- padding: 4px 0;
- }
- .table-headermd .tipTitle {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- .table-headermd::before {
- height: 0;
- }
- .f-right {
- text-align: right;
- margin: 0;
- }
- .mg0 {
- margin: 6px 10px;
- color: #909090;
- font-size: 14px;
- }
- .selesetText {
- margin-bottom: 16px;
- }
- .z-cells .van-cell__title {
- font-weight: bold;
- color: #4a4a4a;
- }
- .z-cells .van-cell {
- padding-bottom: 0;
- }
- </style>
|