|
|
@@ -215,10 +215,7 @@
|
|
|
</van-collapse-item>
|
|
|
<van-collapse-item title="客户开拓" name="6">
|
|
|
<van-row>
|
|
|
- <!-- <van-col span="12" v-if="powerGrade>=3"><span class="leftTitle">非片区经销商</span></van-col>-->
|
|
|
- <!-- v-if="powerGrade==2"-->
|
|
|
<van-col span="24"><span class="leftTitle">非片客户开发</span></van-col>
|
|
|
- <!-- <van-col span="12" v-if="powerGrade>=3"><span class="rightTitle" >TOP70直营家装</span></van-col>-->
|
|
|
<van-col span="24"
|
|
|
><p>
|
|
|
全年开发数:<span class="colorbalck">{{
|
|
|
@@ -226,80 +223,76 @@
|
|
|
}}</span>
|
|
|
</p></van-col
|
|
|
>
|
|
|
- <!-- <van-col span="12" v-if="powerGrade>=3"><p>全年目标:<span class="colorbalck">{{reportTargetAll.directCustomerYearTarget}}</span></p></van-col>-->
|
|
|
- <!-- <van-col span="24"><p>实际:<span class="colorbalck">{{ Micrometer(reportTargetAll.customerAct) }}</span></p></van-col>-->
|
|
|
- <!-- <van-col span="12" v-if="powerGrade>=3"><p>实际:<span class="colorbalck">{{reportTargetAll.directCustomerAct}}</span></p></van-col>-->
|
|
|
<van-col span="24"
|
|
|
><p>
|
|
|
全年进度率:<span class="colorbalck">{{ reportTargetAll.customerYearRate }}%</span>
|
|
|
</p></van-col
|
|
|
>
|
|
|
- <!-- <van-col span="12" v-if="powerGrade>=3"><p>全年进度率:<span class="colorbalck">{{reportTargetAll.directCustomerYearRate}}%</span></p></van-col>-->
|
|
|
</van-row>
|
|
|
</van-collapse-item>
|
|
|
-
|
|
|
- <van-collapse-item title="上期工作成果" name="7" class="collapsettitle">
|
|
|
- <template #title>
|
|
|
- <div>上期工作成果 <span class="colorRed">(必填)</span></div>
|
|
|
- </template>
|
|
|
- <div style="margin-top: -10px">
|
|
|
- <div class="weekContent" v-for="(item2, index2) in reportContentsList2" :key="index2">
|
|
|
- <!-- <p class="texttitle"><span class="opint"></span><span>{{ item2.title }}</span><span-->
|
|
|
- <!-- class="colorRed">(必填)</span></p>-->
|
|
|
- <p class="texttitle texttitle2">计划工作进度</p>
|
|
|
- <p class="contentContainerp1">
|
|
|
- <van-field
|
|
|
- v-model="reportContentsList3[index2].doubleWeekContent"
|
|
|
- rows="4"
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- :formatter="formatter"
|
|
|
- type="textarea" />
|
|
|
- </p>
|
|
|
- <!-- <p style="min-height: 32px;">{{ reportContentsList3[index2].doubleWeekContent }}</p>-->
|
|
|
- <p class="texttitle texttitle2">实际工作进度</p>
|
|
|
- <p class="contentContainerp">
|
|
|
- <van-field
|
|
|
- v-model="item2.doubleWeekContent"
|
|
|
- rows="4"
|
|
|
- autosize
|
|
|
- maxlength="800"
|
|
|
- :formatter="formatter"
|
|
|
- type="textarea"
|
|
|
- show-word-limit />
|
|
|
- </p>
|
|
|
+ <!-- isHistory 是否为历史汇报:0-新汇报 1-历史汇报 -->
|
|
|
+ <div class="contentContainer" v-if="reportTargetAll.isHistory == '0'">
|
|
|
+ <reportCustom
|
|
|
+ ref="reportCustom"
|
|
|
+ :reportCustomData="reportTargetAll.customTaskList"></reportCustom>
|
|
|
+ </div>
|
|
|
+ <template v-else>
|
|
|
+ <van-collapse-item title="上期工作成果" name="7" class="collapsettitle">
|
|
|
+ <template #title>
|
|
|
+ <div>上期工作成果 <span class="colorRed">(必填)</span></div>
|
|
|
+ </template>
|
|
|
+ <div style="margin-top: -10px">
|
|
|
+ <div class="weekContent" v-for="(item2, index2) in reportContentsList2" :key="index2">
|
|
|
+ <p class="texttitle texttitle2">计划工作进度</p>
|
|
|
+ <p class="contentContainerp1">
|
|
|
+ <van-field
|
|
|
+ v-model="reportContentsList3[index2].doubleWeekContent"
|
|
|
+ rows="4"
|
|
|
+ autosize
|
|
|
+ readonly
|
|
|
+ :formatter="formatter"
|
|
|
+ type="textarea" />
|
|
|
+ </p>
|
|
|
+ <p class="texttitle texttitle2">实际工作进度</p>
|
|
|
+ <p class="contentContainerp">
|
|
|
+ <van-field
|
|
|
+ v-model="item2.doubleWeekContent"
|
|
|
+ rows="4"
|
|
|
+ autosize
|
|
|
+ maxlength="800"
|
|
|
+ :formatter="formatter"
|
|
|
+ type="textarea"
|
|
|
+ show-word-limit />
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </van-collapse-item>
|
|
|
- <van-collapse-item title="本期工作规划" name="8" class="collapsettitle">
|
|
|
- <template #title>
|
|
|
- <div>本期工作规划 <span class="colorRed">(必填)</span></div>
|
|
|
- </template>
|
|
|
- <div style="margin-top: -10px">
|
|
|
- <div class="weekContent" v-for="(item, index) in reportContentsList1" :key="index">
|
|
|
- <!-- <p class="texttitle"><span class="opint"></span><span>{{ item.title }}</span><span-->
|
|
|
- <!-- class="colorRed">(必填)</span></p>-->
|
|
|
- <p class="contentContainerp">
|
|
|
- <van-field
|
|
|
- v-model="item.doubleWeekContent"
|
|
|
- rows="4"
|
|
|
- autosize
|
|
|
- maxlength="800"
|
|
|
- type="textarea"
|
|
|
- show-word-limit
|
|
|
- :formatter="formatter" />
|
|
|
- </p>
|
|
|
+ </van-collapse-item>
|
|
|
+ <van-collapse-item title="本期工作规划" name="8" class="collapsettitle">
|
|
|
+ <template #title>
|
|
|
+ <div>本期工作规划 <span class="colorRed">(必填)</span></div>
|
|
|
+ </template>
|
|
|
+ <div style="margin-top: -10px">
|
|
|
+ <div class="weekContent" v-for="(item, index) in reportContentsList1" :key="index">
|
|
|
+ <p class="contentContainerp">
|
|
|
+ <van-field
|
|
|
+ v-model="item.doubleWeekContent"
|
|
|
+ rows="4"
|
|
|
+ autosize
|
|
|
+ maxlength="800"
|
|
|
+ type="textarea"
|
|
|
+ show-word-limit
|
|
|
+ :formatter="formatter" />
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </van-collapse-item>
|
|
|
+ </van-collapse-item>
|
|
|
+ </template>
|
|
|
</van-collapse>
|
|
|
<br />
|
|
|
<br />
|
|
|
- <!-- <div class="contentborder">-->
|
|
|
<van-button type="info" size="small" plain class="Btn100" @click="submint"
|
|
|
>提交半月报</van-button
|
|
|
>
|
|
|
- <!-- </div>-->
|
|
|
</div>
|
|
|
<br />
|
|
|
<br />
|
|
|
@@ -321,6 +314,7 @@ import ZYSAP from '@/views/componentsTarget/ZYSAP';
|
|
|
import veryGoodPlaceOrder from '@/views/componentsTarget/veryGoodPlaceOrder';
|
|
|
import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
|
|
|
import zhiganwaiqiangSAP from '@/views/componentsTarget/zhiganwaiqiangSAP';
|
|
|
+import reportCustom from './reportCustom';
|
|
|
|
|
|
export default {
|
|
|
name: 'home',
|
|
|
@@ -332,6 +326,7 @@ export default {
|
|
|
veryGoodPlaceOrder,
|
|
|
neiwaiqiangpingtu,
|
|
|
zhiganwaiqiangSAP,
|
|
|
+ reportCustom,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -403,7 +398,7 @@ export default {
|
|
|
formatter(value) {
|
|
|
return value.replace(
|
|
|
/[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
|
|
|
- ''
|
|
|
+ '',
|
|
|
);
|
|
|
},
|
|
|
getDetailById() {
|
|
|
@@ -436,7 +431,7 @@ export default {
|
|
|
for (var i = 0; i < res.data.reportContents.length; i++) {
|
|
|
reportContentsdata[i].title = this.selectDictLabel(
|
|
|
this.weekType,
|
|
|
- res.data.reportContents[i].doubleWeekType
|
|
|
+ res.data.reportContents[i].doubleWeekType,
|
|
|
);
|
|
|
if (res.data.reportContents[i].type == '2') {
|
|
|
reportContentsList1.push(reportContentsdata[i]);
|
|
|
@@ -550,97 +545,181 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
tsContentsFn() {
|
|
|
+ if (this.isclick) {
|
|
|
+ if (this.reportTarget.isHistory == '1') {
|
|
|
+ this.reportTarget.reportContents = [];
|
|
|
+ this.reportTarget.reportContents = this.reportContentsList2
|
|
|
+ .concat(this.reportContentsList1)
|
|
|
+ .concat(this.reportContentsList3);
|
|
|
+ this.tsContentsFun(null);
|
|
|
+ } else {
|
|
|
+ // 新的
|
|
|
+ if (this.reportTarget.customTaskList && this.reportTarget.customTaskList.length) {
|
|
|
+ // 配置任务
|
|
|
+ this.filterReportCustomData((reportCustomAnswers) => {
|
|
|
+ this.tsContentsFun(reportCustomAnswers);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 没有配置任务
|
|
|
+ this.tsContentsFun(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tsContentsFun(reportCustomAnswers) {
|
|
|
let loading1 = this.$toast.loading({
|
|
|
duration: 0,
|
|
|
message: '数据提交中...',
|
|
|
forbidClick: true,
|
|
|
});
|
|
|
- if (this.isclick) {
|
|
|
- this.reportTarget.reportContents = [];
|
|
|
- this.reportTarget.reportContents = this.reportContentsList2
|
|
|
- .concat(this.reportContentsList1)
|
|
|
- .concat(this.reportContentsList3);
|
|
|
- this.reportTarget.status = '1';
|
|
|
- this.isclick = false;
|
|
|
- tsContents(this.reportTarget).then((res) => {
|
|
|
- loading1.clear();
|
|
|
- this.isclick = true;
|
|
|
- if (res.code == 200) {
|
|
|
- this.$dialog
|
|
|
- .alert({
|
|
|
- title: '系统提示',
|
|
|
- message: '暂存成功',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- // if(this.$route.query.reportId!=undefined){
|
|
|
- // window.location.replace(window.location.origin+"/mobile/myHistoricalDaily")
|
|
|
- // }else{
|
|
|
- // window.location.replace(window.location.origin+"/mobile/home")
|
|
|
- // }
|
|
|
- });
|
|
|
+ if (reportCustomAnswers) this.reportTarget.reportCustomAnswers = reportCustomAnswers;
|
|
|
+ this.reportTarget.status = '1';
|
|
|
+ this.isclick = false;
|
|
|
+ tsContents(this.reportTarget).then((res) => {
|
|
|
+ loading1.clear();
|
|
|
+ this.isclick = true;
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$dialog
|
|
|
+ .alert({
|
|
|
+ title: '系统提示',
|
|
|
+ message: '暂存成功',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // if(this.$route.query.reportId!=undefined){
|
|
|
+ // window.location.replace(window.location.origin+"/mobile/myHistoricalDaily")
|
|
|
+ // }else{
|
|
|
+ // window.location.replace(window.location.origin+"/mobile/home")
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$toast.fail(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ reportCustomTabstoreVal(callback) {
|
|
|
+ // 必填校验
|
|
|
+ this.$refs.reportCustom.$refs.tabstoreVal
|
|
|
+ .validate()
|
|
|
+ .then(() => {
|
|
|
+ // 验证通过
|
|
|
+ this.filterReportCustomData(callback);
|
|
|
+ })
|
|
|
+ .catch((errors) => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ filterReportCustomData(callback) {
|
|
|
+ let reportCustomData = this.$refs.reportCustom ? this.$refs.reportCustom.fromData : {} || {};
|
|
|
+ let reportCustomAnswers = [];
|
|
|
+ for (let i = 0; i < reportCustomData.length; i++) {
|
|
|
+ let customData = reportCustomData[i].sfaReportCustomCollections
|
|
|
+ ? reportCustomData[i].sfaReportCustomCollections
|
|
|
+ : [];
|
|
|
+ for (let x = 0; x < customData.length; x++) {
|
|
|
+ if (
|
|
|
+ customData[x].reportCustomCollectionType == 'dx' ||
|
|
|
+ customData[x].reportCustomCollectionType == 'duox'
|
|
|
+ ) {
|
|
|
+ let optionData = customData[x].sfaReportCustomOptions;
|
|
|
+ for (let y = 0; y < optionData.length; y++) {
|
|
|
+ if (optionData[y].answerValue == 'Y') {
|
|
|
+ reportCustomAnswers.push({
|
|
|
+ reportCustomTaskId: customData[x].reportCustomTaskId,
|
|
|
+ reportCustomCollectionId: optionData[y].reportCustomCollectionId,
|
|
|
+ reportCustomOptionId: optionData[y].reportCustomOptionId,
|
|
|
+ answerValue: 'Y',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.$toast.fail(res.msg);
|
|
|
+ if (customData[x].answerValue)
|
|
|
+ reportCustomAnswers.push({
|
|
|
+ reportCustomTaskId: customData[x].reportCustomTaskId,
|
|
|
+ reportCustomCollectionId: customData[x].reportCustomCollectionId,
|
|
|
+ answerValue: customData[x].answerValue,
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log(reportCustomAnswers);
|
|
|
+ callback && callback(reportCustomAnswers);
|
|
|
},
|
|
|
// 提交日报
|
|
|
submint() {
|
|
|
- let loading1 = this.$toast.loading({
|
|
|
- duration: 0,
|
|
|
- message: '数据提交中...',
|
|
|
- forbidClick: true,
|
|
|
- });
|
|
|
if (this.isclick) {
|
|
|
- this.reportTarget.reportContents = [];
|
|
|
- for (var x = 0; x < this.reportContentsList2.length; x++) {
|
|
|
- if (this.reportContentsList2[x].doubleWeekContent.trim() == '') {
|
|
|
- this.$toast('请完善上期半月报内容!');
|
|
|
+ // 旧的
|
|
|
+ if (this.reportTarget.isHistory == '1') {
|
|
|
+ this.reportTarget.reportContents = [];
|
|
|
+ for (var x = 0; x < this.reportContentsList2.length; x++) {
|
|
|
+ if (this.reportContentsList2[x].doubleWeekContent.trim() == '') {
|
|
|
+ this.$toast('请完善上期半月报内容!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (var j = 0; j < this.reportContentsList1.length; j++) {
|
|
|
+ if (this.reportContentsList1[j].doubleWeekContent.trim() == '') {
|
|
|
+ this.$toast('请完善本期半月报内容!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.reportContentsList2[0].doubleWeekContent.length > 800) {
|
|
|
+ this.$toast('上期半月报内容超过800字!');
|
|
|
return false;
|
|
|
}
|
|
|
- }
|
|
|
- for (var j = 0; j < this.reportContentsList1.length; j++) {
|
|
|
- if (this.reportContentsList1[j].doubleWeekContent.trim() == '') {
|
|
|
- this.$toast('请完善本期半月报内容!');
|
|
|
+ if (this.reportContentsList1[0].doubleWeekContent.length > 800) {
|
|
|
+ this.$toast('本期半月报内容超过800字!');
|
|
|
return false;
|
|
|
}
|
|
|
- }
|
|
|
- if (this.reportContentsList2[0].doubleWeekContent.length > 800) {
|
|
|
- this.$toast('上期半月报内容超过800字!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (this.reportContentsList1[0].doubleWeekContent.length > 800) {
|
|
|
- this.$toast('本期半月报内容超过800字!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- this.reportTarget.reportContents = this.reportContentsList2
|
|
|
- .concat(this.reportContentsList1)
|
|
|
- .concat(this.reportContentsList3);
|
|
|
- this.reportTarget.status = '1';
|
|
|
- this.isclick = false;
|
|
|
- updateReport(this.reportTarget).then((res) => {
|
|
|
- loading1.clear();
|
|
|
- this.isclick = true;
|
|
|
- if (res.code == 200) {
|
|
|
- this.$dialog
|
|
|
- .alert({
|
|
|
- title: '系统提示',
|
|
|
- message: '提交成功',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- if (this.$route.query.reportId != undefined) {
|
|
|
- window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
|
|
|
- } else {
|
|
|
- this.onClickLeft();
|
|
|
- // window.location.replace(window.location.origin + '/mobile/home');
|
|
|
- }
|
|
|
- });
|
|
|
+ this.reportTarget.reportContents = this.reportContentsList2
|
|
|
+ .concat(this.reportContentsList1)
|
|
|
+ .concat(this.reportContentsList3);
|
|
|
+ this.submintFun();
|
|
|
+ } else {
|
|
|
+ // 新的
|
|
|
+ if (this.reportTarget.customTaskList && this.reportTarget.customTaskList.length) {
|
|
|
+ // 配置任务
|
|
|
+ this.reportCustomTabstoreVal((reportCustomAnswers) => {
|
|
|
+ this.submintFun(reportCustomAnswers);
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.$toast.fail(res.msg);
|
|
|
+ // 没有配置任务
|
|
|
+ this.submintFun(null);
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ submintFun(reportCustomAnswers) {
|
|
|
+ let loading1 = this.$toast.loading({
|
|
|
+ duration: 0,
|
|
|
+ message: '数据提交中...',
|
|
|
+ forbidClick: true,
|
|
|
+ });
|
|
|
+ if (reportCustomAnswers) this.reportTarget.reportCustomAnswers = reportCustomAnswers;
|
|
|
+ this.reportTarget.status = '1';
|
|
|
+ this.isclick = false;
|
|
|
+ updateReport(this.reportTarget).then((res) => {
|
|
|
+ loading1.clear();
|
|
|
+ this.isclick = true;
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$dialog
|
|
|
+ .alert({
|
|
|
+ title: '系统提示',
|
|
|
+ message: '提交成功',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (this.$route.query.reportId != undefined) {
|
|
|
+ window.location.replace(window.location.origin + '/mobile/myHistoricalDaily');
|
|
|
+ } else {
|
|
|
+ this.onClickLeft();
|
|
|
+ // window.location.replace(window.location.origin + '/mobile/home');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$toast.fail(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getReportInfo() {
|
|
|
let loading1 = this.$toast.loading({
|
|
|
duration: 0,
|