VisitSummaryAdd.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. <template>
  2. <div class="bgcolor">
  3. <!-- 顶部条-->
  4. <!-- 顶部条-->
  5. <div class="navBarTOP">
  6. <van-nav-bar
  7. class="navBar"
  8. left-arrow
  9. :title="title"
  10. @click-left="onClickLeft"
  11. />
  12. </div>
  13. <!-- 主体内容-->
  14. <div class="lineGrey"></div>
  15. <div class="lineGrey"></div>
  16. <div class="lineGrey"></div>
  17. <div class="lineGrey"></div>
  18. <div class="lineGrey"></div>
  19. <div class="lineGrey" style="height:6px;"></div>
  20. <div class="container" style="width: 94%; margin: 0px auto; border-radius: 6px;">
  21. <van-form ref="tabstoreVal">
  22. <div v-for="(item,index) in collectionItemList" :key="index">
  23. <div v-if="item.answerType=='sz'" class="formLabel z-cell">
  24. <van-cell>
  25. <template #title>
  26. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}<span style="font-size: 12px;color:#888;">{{ item.remark }}</span>
  27. </template>
  28. </van-cell>
  29. <!-- <p style=" margin-top: 0;"><span style="font-size: 12px;color:#888;">{{ item.remark }}</span></p>-->
  30. <van-field v-model="item.answerValue" :placeholder="item.customName" type="number" @input="numberFn(item,index)"></van-field>
  31. </div>
  32. <div v-if="item.answerType=='rq'" class="formLabel z-cell">
  33. <van-cell>
  34. <template #title>
  35. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}<span style="font-size: 14px;color:#ccc;">{{ item.remark }}</span>
  36. </template>
  37. </van-cell>
  38. <van-field v-model="item.answerValue" clickable
  39. name="calendar"
  40. placeholder="点击选择日期"
  41. readonly
  42. @click="showCalendarClick(index)"/>
  43. <p style="color: #444;
  44. font-size: 12px;
  45. margin: 0;
  46. padding:10px 0;text-align: right"></p>
  47. </div>
  48. <div v-if="item.answerType=='zp'" class="formLabel z-cell">
  49. <van-cell>
  50. <template #title>
  51. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}
  52. </template>
  53. </van-cell>
  54. <van-row gutter="10" style="margin-bottom: 10px;">
  55. <p style=" margin-top: 0;"><span style="font-size: 12px;color:#888;">{{ item.remark }}</span></p>
  56. <delete-upload-img :imgs="item.fileInfoList"></delete-upload-img>
  57. <upload-img :uploadid="uploadid2" @newimgarr="newimgarr1" imgText="上传照片" :indexImg="index"
  58. :customId="item.customId" :summaryId="item.summaryId"
  59. @click="imgClick(item,index)"></upload-img>
  60. </van-row>
  61. </div>
  62. <div v-if="item.answerType=='wb'" class="formLabel z-cell">
  63. <van-cell>
  64. <template #title>
  65. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}
  66. </template>
  67. </van-cell>
  68. <van-field v-model="item.answerValue" :formatter="formatter" :placeholder="item.customName"></van-field>
  69. <p style="color: #444;
  70. font-size: 12px;
  71. margin: 0;
  72. padding:10px 0;text-align: right">{{ item.remark }}</p>
  73. </div>
  74. <div v-if="item.answerType=='gs'" class="formLabel z-cell" @click="regionClick(index)">
  75. <van-cell>
  76. <template #title>
  77. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}
  78. </template>
  79. </van-cell>
  80. <van-field readonly v-model="item.answerName" :formatter="formatter" :placeholder="item.customName"></van-field>
  81. <p style="color: #444;
  82. font-size: 12px;
  83. margin: 0;
  84. padding:10px 0;text-align: right">{{ item.remark }}</p>
  85. </div>
  86. <div v-if="item.answerType=='dq'" class="formLabel z-cell" @click="SalesRegionClick(index)">
  87. <van-cell>
  88. <template #title>
  89. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}
  90. </template>
  91. </van-cell>
  92. <van-field readonly v-model="item.answerName" :formatter="formatter" :placeholder="item.customName"></van-field>
  93. <p style="color: #444;
  94. font-size: 12px;
  95. margin: 0;
  96. padding:10px 0;text-align: right">{{ item.remark }}</p>
  97. </div>
  98. <div v-if="item.answerType=='xsb'" class="formLabel z-cell" @click="SalesDepartmentClick(index)">
  99. <van-cell>
  100. <template #title>
  101. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}
  102. </template>
  103. </van-cell>
  104. <van-field readonly v-model="item.answerName" :formatter="formatter" :placeholder="item.customName"></van-field>
  105. <p style="color: #444;
  106. font-size: 12px;
  107. margin: 0;
  108. padding:10px 0;text-align: right">{{ item.remark }}</p>
  109. </div>
  110. <div v-if="item.answerType=='duox'" class="formLabel z-cell">
  111. <van-cell>
  112. <template #title>
  113. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}
  114. </template>
  115. </van-cell>
  116. <z-checkbox :answerType="item.answerType" :checkboxval="item.answerValue"
  117. :collectionType="item.customOptionList" :textc="item.customId"
  118. :zCheckboxcolumns="item.customOptionList" @zSelectVal="zSelectVal"></z-checkbox>
  119. </div>
  120. <div v-if="item.answerType=='dx'" class="formLabel z-cell">
  121. <van-cell>
  122. <template #title>
  123. <span v-if="item.isMust==0" class="van-f-red">*</span>{{ item.customName }}
  124. </template>
  125. </van-cell>
  126. <z-radio :answerType="item.answerType" :collectionType="item.collectionType" :radio="item.answerValue"
  127. :textc="item.customId"
  128. :zRadiocolumns="item.customOptionList"
  129. @zSelectVal="zSelectVal"></z-radio>
  130. </div>
  131. <br>
  132. </div>
  133. </van-form>
  134. </div>
  135. <br>
  136. <div class="tc" style="padding: 0 16px">
  137. <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">提交汇报</van-button>
  138. </div>
  139. <br>
  140. <van-calendar v-model="showCalendar" @confirm="onConfirm" color="#0057ba" :min-date="minDate" :max-date="maxDate" :show-confirm="false"/>
  141. <van-popup v-model="RegionShow" capture position="bottom">
  142. <van-picker
  143. :columns="companyList"
  144. show-toolbar
  145. value-key="deptName"
  146. @cancel="RegionShow = false"
  147. @confirm="onregionConfirm"
  148. />
  149. </van-popup>
  150. <van-popup v-model="SalesRegionShow" capture position="bottom">
  151. <van-picker
  152. :columns="regionList"
  153. show-toolbar
  154. value-key="deptName"
  155. @cancel="SalesRegionShow = false"
  156. @confirm="onSalesRegionConfirm"
  157. />
  158. </van-popup>
  159. <van-popup v-model="SalesDepartmentShow" capture position="bottom">
  160. <van-picker
  161. :columns="deptList"
  162. show-toolbar
  163. value-key="deptName"
  164. @cancel="SalesDepartmentShow = false"
  165. @confirm="onSalesDepartmentConfirm"
  166. />
  167. </van-popup>
  168. <van-popup v-model="StartTimeShow" capture position="bottom">
  169. <van-datetime-picker
  170. v-model="strtcurrentDate"
  171. :max-date="strtmaxDate"
  172. :min-date="strtminDate"
  173. title="选择查找开始时间"
  174. type="date"
  175. @cancel="StartTimeShow = false"
  176. @confirm="onStartTimeConfirm"
  177. />
  178. </van-popup>
  179. <van-popup v-model="EndTimeShow" capture position="bottom">
  180. <van-datetime-picker
  181. v-model="endcurrentDate"
  182. :max-date="endmaxDate"
  183. :min-date="endminDate"
  184. title="选择查找结束时间"
  185. type="date"
  186. @cancel="EndTimeShow = false"
  187. @confirm="onEndTimeConfirm"
  188. />
  189. </van-popup>
  190. </div>
  191. </template>
  192. <script>
  193. import timeico from "@/assets/Icon/datatims.png";
  194. import {insertCustomAnswer, getSummaryDetailById, getDeptInfo, getSummaryMobileDeptInfo} from "@/api/index";
  195. import zRadio from "@/components/zRadio2";
  196. import zCheckbox from "@/components/zCheckbox2";
  197. // import uploadImg from "@/components/uo";
  198. import uploadImg from "@/components/uploadVTask";
  199. import deleteUploadImg from "@/components/deleteUploadImg2";
  200. export default {
  201. name: "MyHistoricalWeekly",
  202. components: {zRadio, zCheckbox, uploadImg, deleteUploadImg},
  203. data() {
  204. return {
  205. timeico: timeico,
  206. RegionShow: false,
  207. SalesRegionShow: false,
  208. SalesDepartmentShow: false,
  209. StaffShow: false,
  210. StartTimeShow: false,
  211. dateIndex:"",
  212. EndTimeShow: false,
  213. uploadid2:'uploadid2',
  214. PhotoTypeList: [{text: "009", value: "09"}],
  215. strtminDate: new Date(2022, 0, 1),
  216. endminDate: new Date(2022, 0, 1),
  217. minDate: new Date(2020, 0, 1),
  218. maxDate: new Date(2090, 0, 31),
  219. strtmaxDate: new Date(),
  220. endmaxDate: new Date(),
  221. strtcurrentDate: new Date(),
  222. endcurrentDate: new Date(),
  223. companyName: "全部公司",
  224. deptName: "全部销售部",
  225. regionName: "全部大区",
  226. userName: "全部",
  227. companyCode: "",
  228. deptCode: "",
  229. regionCode: "",
  230. userCode: "",
  231. companyList: [],
  232. title:"",
  233. deptList: [],
  234. regionList: [],
  235. userList: [],
  236. deptForm: {type: "", parentId: ""},
  237. list: [],
  238. loading: false,
  239. finished: true,
  240. showCalendar: false,
  241. formData: {
  242. type: "2", // 汇报类型或入口 1-下属业务员日报 2-下属销售部主管周报 3-下属大区主管半月报
  243. companyId: "", // 公司id,必传 Long类型
  244. regionId: "", // 大区id,必传 Long类型
  245. deptId: "", // 部门id,如果为周报或日报为必传 Long类型
  246. userId: "", // 业务员id,如果为日报为必传 Long类型
  247. startTime: "", // 开始时间,必传 格式:yyyy-MM-dd String类型
  248. endTime: "", // 结束时间,必传 格式:yyyy-MM-dd String类型
  249. pageNum: 1, // 当前页码 int类型
  250. pageSize: 10, // 当前每页条数 int类型
  251. },
  252. tableList: [],
  253. collectionItemList: [],
  254. collectionAnswerlisd:[],
  255. flagclick:true,
  256. index:""
  257. }
  258. },
  259. created() {
  260. // this.formData.startTime = this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2)
  261. this.formData.startTime = this.getThreeDaysAgo()
  262. // this.strtcurrentDate=new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'),2))
  263. this.strtcurrentDate = new Date(this.getThreeDaysAgo())
  264. this.formData.endTime = this.parseTime(new Date(), '{y}-{m}-{d}') + ""
  265. this.endminDate = new Date(this.GetPreMonthDay(this.parseTime(new Date(), '{y}-{m}-{d}'), 2))
  266. this.powerGrade = localStorage.getItem("powerGrade")
  267. this.title=this.$route.query.title
  268. this.getReportInfo()
  269. this.regionCode=""
  270. },
  271. watch: {
  272. $route(to, from) {
  273. if (to.path == "/VisitSummaryAdd") {
  274. this.title=this.$route.query.title
  275. this.getReportInfo()
  276. this.regionCode=""
  277. }
  278. }
  279. },
  280. methods: {
  281. showCalendarClick(val){
  282. this.dateIndex=val
  283. this.showCalendar = true;
  284. },
  285. formatDate(date) {
  286. var Month=date.getMonth() + 1
  287. var Day=date.getDate()
  288. if(Month<10){
  289. Month="0"+Month
  290. }
  291. if(Day<10){
  292. Day="0"+Day
  293. }
  294. return `${date.getFullYear()}-${Month}-${Day}`;
  295. },
  296. onConfirm(date) {
  297. this.showCalendar = false;
  298. this.collectionItemList[this.dateIndex].answerValue = this.formatDate(date);
  299. },
  300. formatter(value) {
  301. 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, '');
  302. },
  303. numberFn(val, index) {
  304. if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
  305. this.collectionItemList[index].answerValue = this.collectionItemList[index].answerValue.replace(/\.\d{2,}$/, this.collectionItemList[index].answerValue.substr(this.collectionItemList[index].answerValue.indexOf('.'), 3));
  306. }
  307. },
  308. zSelectVal(value) {
  309. var collectionAnswerlisd=this.collectionAnswerlisd
  310. if(collectionAnswerlisd.length>0){
  311. var num=0
  312. for (var a = 0; a < collectionAnswerlisd.length; a++) {
  313. if(collectionAnswerlisd[a].id==value.id){
  314. collectionAnswerlisd[a]=value
  315. num=0
  316. }else{
  317. num=1
  318. }
  319. }
  320. if(num>0){
  321. collectionAnswerlisd.push(value)
  322. }
  323. }else{
  324. collectionAnswerlisd.push(value)
  325. }
  326. this.collectionAnswerlisd=collectionAnswerlisd
  327. },
  328. imgClick(val, index) {
  329. this.collectionId = val.collectionId + ""
  330. this.indeximg = index
  331. this.show = true
  332. },
  333. newimgarr1(val) {
  334. if (this.collectionItemList[val.index].fileInfoList == null || this.collectionItemList[val.index].fileInfoList == undefined) {
  335. this.collectionItemList[val.index].fileInfoList = []
  336. this.collectionItemList[val.index].fileIdList = []
  337. }
  338. this.collectionItemList[val.index].fileInfoList.push(val)
  339. this.collectionItemList[val.index].fileIdList.push(val.id)
  340. },
  341. dateFn(val) {
  342. return val.slice(0, 4) + "-" + val.slice(4, 6) + "-" + val.slice(6, 8)
  343. },
  344. onLoad() {
  345. },
  346. onSubmit() {
  347. // var formData = {
  348. // storeId: this.storeId,
  349. // storeCode: this.$route.query.storeCode,
  350. // storeGroupId: this.storeGroupId,
  351. // visitsId: this.visitId,
  352. // taskId: this.taskId,
  353. // collectionAnswers: [],
  354. // checkUnManage: checkUnManage
  355. // }
  356. // var collectionAnswers = []
  357. // for (var b = 0; b < this.collectionItemList.length; b++) {
  358. // if (this.collectionItemList[b].answerType == "sz" || this.collectionItemList[b].answerType == "wb") {
  359. // collectionAnswers.push({
  360. // "collectionId": this.collectionItemList[b].collectionId,
  361. // "itemName": this.collectionItemList[b].collectionName,
  362. // "collectionType": this.collectionItemList[b].collectionType,
  363. // "collectionOptionId": this.collectionItemList[b].collectionOptionList[0].collectionOptionId,
  364. // "answerType": this.collectionItemList[b].answerType,
  365. // "answerValue": this.collectionItemList[b].answerValue
  366. // })
  367. // }
  368. // }
  369. for (var c = 0; c < this.collectionAnswerlisd.length; c++) {
  370. for (var b = 0; b < this.collectionItemList.length; b++) {
  371. if(this.collectionAnswerlisd[c].id==this.collectionItemList[b].customId){
  372. this.collectionItemList[b].customOptionList=this.collectionAnswerlisd[c].value
  373. }
  374. }
  375. }
  376. if (this.flagclick) {
  377. this.flagclick = false
  378. this.timer = null;
  379. this.timer = setTimeout(() => {
  380. this.flagclick = true
  381. }, 2000)
  382. insertCustomAnswer(this.collectionItemList).then(res => {
  383. if (res.code == 200) {
  384. this.$router.go(-1)
  385. }
  386. })
  387. }
  388. },
  389. getReportInfo() {
  390. let loading1 = this.$toast.loading({
  391. duration: 0,
  392. message: '加载中...',
  393. forbidClick: true,
  394. });
  395. this.collectionItemList=[]
  396. this.collectionAnswerlisd=[]
  397. getSummaryDetailById({summaryId: this.$route.query.summaryId}).then(res => {
  398. loading1.clear()
  399. if (res.code == 200) {
  400. var collectionItemLists = res.data
  401. for (var q = 0; q < collectionItemLists.length; q++) {
  402. collectionItemLists[q].answerName=undefined
  403. // if (collectionItemLists[q].answerType == "sz" || collectionItemLists[q].answerType == "wb") {
  404. // collectionItemLists[q].answerValue = collectionItemLists[q].customOptionList[0].answerValue
  405. // }
  406. // if (collectionItemLists[q].answerType == "duox" || collectionItemLists[q].answerType == "dx") {
  407. // collectionItemLists[q].answerValue = []
  408. // for (var qq = 0; qq < collectionItemLists[q].customOptionList.length; qq++) {
  409. // if (collectionItemLists[q].customOptionList[qq].isCheck == 1) {
  410. // collectionItemLists[q].answerValue.push(collectionItemLists[q].customOptionList[qq].customId)
  411. // collectionItemLists[q].customOptionList[qq].code = collectionItemLists[q].collectionCode
  412. // collectionItemLists[q].customOptionList[qq].answerType = collectionItemLists[q].answerType
  413. // this.collectionAnswerlisd.push(collectionItemLists[q].customOptionList[qq])
  414. // }
  415. // }
  416. // collectionItemLists[q].answerValue = collectionItemLists[q].answerValue.join()
  417. // }
  418. }
  419. this.collectionItemList = collectionItemLists
  420. this.getDeptInfo("dept")
  421. }
  422. })
  423. },
  424. getThreeDaysAgo() {
  425. let myDate = new Date();
  426. let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 14); //最后一个数字30可改,30天的意思
  427. let lastY = lw.getFullYear();
  428. let lastM = lw.getMonth() + 1;
  429. let lastD = lw.getDate();
  430. let startData =
  431. lastY +
  432. "-" +
  433. (lastM < 10 ? "0" + lastM : lastM) +
  434. "-" +
  435. (lastD < 10 ? "0" + lastD : lastD); //三十天之前日期
  436. return startData;
  437. },
  438. GetPreMonthDay(date, monthNum, type) {
  439. var dateArr = date.split('-');
  440. var year = dateArr[0]; //获取当前日期的年份
  441. var month = dateArr[1]; //获取当前日期的月份
  442. var day = dateArr[2]; //获取当前日期的日
  443. var days = new Date(year, month, 0);
  444. days = days.getDate(); //获取当前日期中月的天数
  445. var year2 = year;
  446. var month2 = parseInt(month) - monthNum;
  447. if (month2 <= 0) {
  448. var absM = Math.abs(month2);
  449. year2 = parseInt(year2) - Math.ceil(absM / 12 == 0 ? 1 : parseInt(absM) / 12);
  450. month2 = 12 - (absM % 12);
  451. }
  452. var day2 = day;
  453. var days2 = new Date(year2, month2, 0);
  454. days2 = days2.getDate();
  455. if (day2 > days2) {
  456. day2 = days2;
  457. }
  458. if (month2 < 10) {
  459. month2 = '0' + month2;
  460. }
  461. var t2 = ""
  462. if (monthNum > 0) {
  463. t2 = year2 + '-' + month2 + '-01';
  464. } else {
  465. if (type == "end") {
  466. var Months = new Date().getMonth() + 1
  467. var days111 = new Date().getDate()
  468. if (Months < 10) {
  469. Months = '0' + Months;
  470. }
  471. if (days111 < 10) {
  472. days111 = '0' + days111;
  473. }
  474. if (parseInt(month2) >= new Date().getMonth() + 1) {
  475. t2 = year2 + '-' + Months + '-' + days111;
  476. } else {
  477. var daysd = this.getMonthDays(year2, month2)
  478. t2 = year2 + '-' + month2 + '-' + daysd;
  479. }
  480. } else {
  481. t2 = year2 + '-' + month2 + '-' + day2;
  482. }
  483. }
  484. return t2;
  485. },
  486. getMonthDays(year, month) {
  487. var stratDate = new Date(year, month - 1, 1),
  488. endData = new Date(year, month, 1);
  489. var days = (endData - stratDate) / (1000 * 60 * 60 * 24);
  490. return days;
  491. },
  492. getDeptInfo(type, grade) {
  493. this.deptForm.type = type
  494. if (grade == "1") {
  495. this.deptForm.parentId = this.companyCode
  496. } else if (grade == "2") {
  497. this.deptForm.parentId = this.regionCode
  498. } else {
  499. this.deptForm.type = ""
  500. this.deptForm.parentId = ""
  501. }
  502. getSummaryMobileDeptInfo(this.deptForm).then(res => {
  503. if (grade == "1") {
  504. if (res.data.region != null) {
  505. this.regionList = res.data.region
  506. }
  507. } else if (grade == "2") {
  508. if (res.data.dept != null) {
  509. this.deptList = res.data.dept
  510. }
  511. } else {
  512. this.companyList = res.data.company
  513. this.companyCode=res.data.company[0].deptId
  514. for(var k=0;k<this.collectionItemList.length;k++){
  515. if(this.collectionItemList[k].answerType == "gs"){
  516. this.collectionItemList[k].answerName=res.data.company[0].deptName
  517. this.collectionItemList[k].answerValue=res.data.company[0].deptCode
  518. }
  519. }
  520. this.getDeptInfo(1,"1")
  521. if(res.data.dept!=null){
  522. this.deptList=res.data.dept
  523. }
  524. if(res.data.region!=null){
  525. this.regionList=res.data.region
  526. }
  527. }
  528. })
  529. },
  530. dailyFn(row) {
  531. if (row.status != '0') {
  532. if (row.status == -1) {
  533. var dayTime = row.showDate;
  534. var times = new Date(dayTime.slice(0, 4) + "-" + dayTime.slice(4, 6) + "-" + dayTime.slice(6, 8)).getTime()
  535. var time = new Date("2022-08-25").getTime()
  536. if (times < time) {
  537. this.$dialog.alert({
  538. title: '系统提示',
  539. message: '非常抱歉,8月25日前历史报告数据不存在',
  540. })
  541. } else {
  542. this.$router.push({
  543. path: "/weeklyHistoricalDetils",
  544. query: {reportId: row.id,}
  545. })
  546. }
  547. } else {
  548. this.$router.push({
  549. path: "/weeklyHistoricalDetils",
  550. query: {reportId: row.id,}
  551. })
  552. }
  553. }
  554. },
  555. onClickLeft() {
  556. this.$router.go(-1)
  557. },
  558. regionClick(val) {
  559. // if(this.powerGrade>4){
  560. this.index=val
  561. this.RegionShow = true;
  562. // }
  563. },
  564. SalesRegionClick(val) {
  565. this.index=val
  566. this.SalesRegionShow = true;
  567. },
  568. SalesDepartmentClick(val) {
  569. this.index=val
  570. this.SalesDepartmentShow = true;
  571. },
  572. StaffClick() {
  573. this.StaffShow = true;
  574. },
  575. StartTimeClick() {
  576. this.StartTimeShow = true;
  577. },
  578. EndTimeClick() {
  579. this.EndTimeShow = true;
  580. },
  581. onSalesRegionConfirm(val) {
  582. this.SalesRegionShow = false;
  583. for(var k1=0;k1<this.collectionItemList.length;k1++){
  584. if(this.collectionItemList[k1].answerType == "xsb"){
  585. this.collectionItemList[k1].answerName=""
  586. this.collectionItemList[k1].answerValue=""
  587. }
  588. }
  589. this.collectionItemList[this.index].answerName=val.deptName
  590. this.collectionItemList[this.index].answerValue=val.deptCode
  591. this.regionCode =val.deptId;
  592. if (val.deptId != "") {
  593. this.getDeptInfo("dept", 2)
  594. }
  595. },
  596. onregionConfirm(val) {
  597. this.RegionShow = false;
  598. for(var k1=0;k1<this.collectionItemList.length;k1++){
  599. if(this.collectionItemList[k1].answerType == "xsb"||this.collectionItemList[k1].answerType == "dq"){
  600. this.collectionItemList[k1].answerName=""
  601. this.collectionItemList[k1].answerValue=""
  602. }
  603. }
  604. this.collectionItemList[this.index].answerName=val.deptName
  605. this.collectionItemList[this.index].answerValue=val.deptCode
  606. this.companyCode=val.deptId;
  607. this.getDeptInfo("dept",1)
  608. },
  609. onSalesDepartmentConfirm(val) {
  610. this.SalesDepartmentShow = false;
  611. this.collectionItemList[this.index].answerName=val.deptName
  612. this.collectionItemList[this.index].answerValue=val.deptCode
  613. },
  614. onStartTimeConfirm(val) {
  615. this.formData.startTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + ""
  616. this.StartTimeShow = false;
  617. this.endminDate = new Date(val)
  618. this.endmaxDate = new Date(this.GetPreMonthDay(this.formData.startTime, -2, "end"))
  619. if ((new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime()) || (new Date(this.endmaxDate).getTime() < new Date(this.formData.endTime).getTime())) {
  620. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}') + ""
  621. this.endcurrentDate = this.GetPreMonthDay(this.formData.startTime, -2)
  622. }
  623. this.list = [];
  624. this.formData.pageNum = 1;
  625. },
  626. onEndTimeConfirm(val) {
  627. this.formData.endTime = this.parseTime(new Date(val), '{y}-{m}-{d}')
  628. this.strtmaxDate = new Date(val)
  629. if (new Date(this.formData.startTime).getTime() > new Date(this.formData.endTime).getTime()) {
  630. this.formData.startTime = this.formData.endTime
  631. }
  632. this.list = [];
  633. this.formData.pageNum = 1;
  634. this.EndTimeShow = false;
  635. },
  636. }
  637. }
  638. </script>
  639. <style scoped>
  640. .container {
  641. background-color: white;
  642. }
  643. .van-f-red {
  644. color: red;
  645. width: 8px;
  646. display: inline-block;
  647. line-height: 26px;
  648. }
  649. .formLabel {
  650. margin: 0 16px;
  651. border-bottom: 1px solid #f1f1f1
  652. }
  653. .formLabel .van-cell {
  654. padding: 10px 0
  655. }
  656. .formLabel .van-cell::after {
  657. border: 0
  658. }
  659. .formLabel .van-field {
  660. border: 1px solid #f1f1f1;
  661. padding: 6px;
  662. width: 100%;
  663. border-radius: 4px;
  664. overflow: hidden
  665. }
  666. .formLabel .van-field__control {
  667. padding: 0 10px
  668. }
  669. .formLabel .formLabeltitle {
  670. position: absolute;
  671. top: 8px;
  672. }
  673. .lineGrey {
  674. height: 10px;
  675. width: 100%;
  676. background: #f1f1f1;
  677. }
  678. .z-checkbox .van-radio {
  679. padding: 6px 0;
  680. }
  681. .z-cell .van-cell__title {
  682. font-size: 16px;
  683. }
  684. </style>
  685. <style>
  686. .table-headermd {
  687. font-size: 12px;
  688. text-align: center;
  689. position: initial;
  690. width: 98% !important;
  691. margin: 0 auto;
  692. border-right: 0;
  693. }
  694. .table-headermd .el-table__header,
  695. .table-headermd .el-table__body {
  696. width: 100% !important;
  697. }
  698. /*.table-headermd col {width: 6.8rem;}*/
  699. .table-headermd col:nth-child(4) {
  700. width: 5.6rem;
  701. }
  702. .table-headermd col:nth-child(2),
  703. .table-headermd col:nth-child(3) {
  704. width: 4.6rem;
  705. }
  706. .table-headermd .van-cell {
  707. padding: 0 4px;
  708. height: 100%
  709. }
  710. .table-headermd th.el-table__cell > .cell {
  711. padding: 0 4px;
  712. text-align: center
  713. }
  714. .table-headermd th.el-table__cell:first-child > .cell {
  715. text-align: left;
  716. }
  717. .table-headermd th.el-table__cell {
  718. background-color: #1989fa;
  719. color: #fff;
  720. }
  721. .table-headermd .el-table__cell {
  722. padding: 4px 0;
  723. }
  724. .table-headermd.el-table .cell {
  725. padding: 0
  726. }
  727. .table-headermd .tipTitle {
  728. overflow: hidden;
  729. text-overflow: ellipsis;
  730. display: -webkit-box;
  731. -webkit-box-orient: vertical;
  732. -webkit-line-clamp: 2;
  733. }
  734. .table-headermd::before {
  735. height: 0
  736. }
  737. .xing {
  738. color: red;
  739. padding-left: 4px;
  740. }
  741. .formLabel .van-radio__label, .formLabel .van-checkbox__label {
  742. font-size: 1.4rem
  743. }
  744. .table-headermd .cell, .el-table--border .el-table__cell:first-child .cell {
  745. padding: 0 4px;
  746. }
  747. .van-dialog__confirm, .van-dialog__confirm:active {
  748. color: #1989fa;
  749. }
  750. .navBarTOP {
  751. position: fixed;
  752. width: 100%;
  753. z-index: 2;
  754. top: 0;
  755. }
  756. .isTableMust {
  757. padding: 4px;
  758. color: #999;
  759. margin: 0;
  760. margin-top: -10px;
  761. }
  762. </style>