mySignApproval.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <template>
  2. <div class="bgcolor">
  3. <!-- 顶部条-->
  4. <div class="navBarTOP">
  5. <van-nav-bar class="navBar" title="历史签约" left-arrow @click-left="onClickLeft"/>
  6. <div class="searchDiv">
  7. <van-row style="background-color: #fff;" type="flex">
  8. <div style="flex: 1;">
  9. <van-search v-model="fromValue.storeRequest" left-icon="search" placeholder="信息代码/店名/申请人" show-action>
  10. <template #action>
  11. <div @click="onSearch">搜索</div>
  12. </template>
  13. </van-search>
  14. </div>
  15. <div class="visitSearch">
  16. <van-dropdown-menu active-color="#0057ba">
  17. <van-dropdown-item ref="item" title="筛选">
  18. <van-form>
  19. <div style="padding:0 10px;">
  20. <h4 style="color:#444;text-align: left; margin: 10px 0;">组织架构</h4>
  21. <van-row class="contentpd16" gutter="20">
  22. <van-col span="12" style="padding-bottom: 10px;">
  23. <el-select v-model="fromValue.companyId" clearable placeholder="全部公司" @change="onCompanyConfirm">
  24. <el-option v-for="item in companyList" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>
  25. </el-select>
  26. </van-col>
  27. <van-col span="12" style=" padding-bottom: 10px;">
  28. <el-select v-model="fromValue.regionId" clearable placeholder="全部大区" @change="onRegionConfirm">
  29. <el-option v-for="item in regionList" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>
  30. </el-select>
  31. </van-col>
  32. <van-col span="12">
  33. <el-select v-model="fromValue.deptId" clearable placeholder="全部销售部" @change="onDeptConfirm">
  34. <el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>
  35. </el-select>
  36. </van-col>
  37. <van-col span="12" style=" padding-bottom: 10px;">
  38. <div style="height: 40px;"> &nbsp;</div>
  39. </van-col>
  40. <!-- <van-col span="12">-->
  41. <!-- <el-select v-model="fromValue.district" placeholder="全部业务员" @change="onDistrictConfirm">-->
  42. <!-- <el-option-->
  43. <!-- v-for="item in districtList"-->
  44. <!-- :key="item.countyCode"-->
  45. <!-- :label="item.text"-->
  46. <!-- :value="item.countyCode">-->
  47. <!-- </el-option>-->
  48. <!-- </el-select>-->
  49. <!-- </van-col>-->
  50. <van-col span="12">
  51. <div class="monthNowsin" @click="startTimeshow = true">
  52. <span class="month">{{ fromValue.startTime }}</span>
  53. <van-icon class="CalendarIcon" :name="timeico"/>
  54. </div>
  55. </van-col>
  56. <van-col span="12">
  57. <div class="monthNowsin" @click="endTimeshow = true">
  58. <span class="month">{{ fromValue.endTime }}</span>
  59. <van-icon class="CalendarIcon" :name="timeico"/>
  60. </div>
  61. </van-col>
  62. </van-row>
  63. </div>
  64. <div style="padding:0 10px;">
  65. <h4 style="color:#444;text-align: left; margin: 10px 0;">关键词</h4>
  66. <van-field
  67. v-model="fromValue.storeRequest"
  68. label=""
  69. placeholder="信息代码/店名/申请人"
  70. />
  71. </div>
  72. <div style="margin: 16px;">
  73. <van-row gutter="20">
  74. <van-col span="12">
  75. <van-button block size="normal" style="background-color: #f5f5f5;" type="default"
  76. @click="cancelSearch">清除筛选
  77. </van-button>
  78. </van-col>
  79. <van-col span="12">
  80. <van-button block size="normal" style="background-color: #0057ba;" type="info"
  81. @click="moreSearch">搜索
  82. </van-button>
  83. </van-col>
  84. </van-row>
  85. </div>
  86. </van-form>
  87. </van-dropdown-item>
  88. </van-dropdown-menu>
  89. </div>
  90. </van-row>
  91. </div>
  92. <van-tabs v-model="fromValue.status" color="#0057ba" @change="tabChange">
  93. <van-tab title="审批中" name="1" :disabled="disabled"></van-tab>
  94. <van-tab title="审批完成" name="2" :disabled="disabled"></van-tab>
  95. <van-tab title="拒绝" name="3" :disabled="disabled"></van-tab>
  96. </van-tabs>
  97. </div>
  98. <div class="container">
  99. <div class="lineGrey"></div>
  100. <div class="lineGrey"></div>
  101. <div class="lineGrey"></div>
  102. <div class="lineGrey"></div>
  103. <div class="lineGrey"></div>
  104. <div class="lineGrey"></div>
  105. <div class="lineGrey"></div>
  106. <div class="lineGrey"></div>
  107. <div class="lineGrey"></div>
  108. <div class="lineGrey"></div>
  109. <div class="lineGrey"></div>
  110. <div class="lineGrey"></div>
  111. <div class="lineGrey"></div>
  112. <div class="lineGrey"></div>
  113. <div class="lineGrey"></div>
  114. <van-list v-model="loading" :finished="finished" finished-text="--已经到底了--" @load="onLoad">
  115. <div class="cellcontent brud weekList" v-for="(item,index) in list" :key="index">
  116. <van-cell @click="approveFn(item)" is-link>
  117. <div class="cardContent">
  118. <div class="title" >
  119. <p class="textLeft" >{{item.storeName}}({{item.storeCode}})</p>
  120. <p class="textRight" v-if="item.status=='1'&&item.taskId==null">审批中</p>
  121. <p class="textRight" v-if="item.status=='1'&&item.taskId!=null" style="color:red;">退回修改</p>
  122. <span class="textRight" style="color: #07c160;" v-if="item.status==2">审批完成</span>
  123. <p class="textRight" v-if="item.status=='3'" style="color:red;">拒绝</p>
  124. </div>
  125. <div class="info">类型:{{selectDictLabel(storeTypeList, item.storeCategory)}}</div>
  126. <div class="info">地址:{{ item.addressLine }}</div>
  127. <div class="info">申请人:{{item.nickName}}</div>
  128. <div class="info">申请时间:{{item.createTime}}</div>
  129. <div class="info" v-if="fromValue.status=='2'">审批时间:{{item.updateTime}}</div>
  130. </div>
  131. </van-cell>
  132. </div>
  133. <van-empty description="" v-if="list.length==0"/>
  134. </van-list>
  135. </div>
  136. <van-overlay :show="startTimeshow" @click="startTimeshow = false" class="wrapperConent">
  137. <div class="wrapperTime" @click.stop>
  138. <div class="block" >
  139. <van-datetime-picker
  140. v-model="startcurrentDate"
  141. type="date"
  142. title="开始日期"
  143. @confirm="dateeconfirm"
  144. @cancel="startTimeshow=false"
  145. />
  146. </div>
  147. </div>
  148. </van-overlay>
  149. <van-overlay :show="endTimeshow" @click="endTimeshow = false" class="wrapperConent">
  150. <div class="wrapperTime" @click.stop>
  151. <div class="block" >
  152. <van-datetime-picker
  153. v-model="currentDate"
  154. type="date"
  155. title="结束日期"
  156. :min-date="endminDate"
  157. :max-date="maxDate"
  158. @confirm="endTimeconfirm"
  159. @cancel="endTimeshow=false"
  160. />
  161. </div>
  162. </div>
  163. </van-overlay>
  164. </div>
  165. </template>
  166. <script>
  167. import {getCWStoreTypeList, getvisitDeptInfo, storeCustomerSignList} from "@/api/index";
  168. import timeico from "@/assets/Icon/datatims.png";
  169. export default {
  170. name: "MyHistoricalWeekly",
  171. data() {
  172. return {
  173. disabled:false,
  174. startTimeshow:false,
  175. endTimeshow:false,
  176. startTime:"",
  177. loading: false,
  178. finished: false,
  179. timeico:timeico,
  180. minDate: new Date(2022, 0, 1),
  181. maxDate: new Date(),
  182. currentDate: new Date(),
  183. startcurrentDate: new Date(),
  184. endminDate: new Date(),
  185. startmaxDate: new Date(),
  186. storeTypeList:[],
  187. companyList:[],
  188. deptList:[],
  189. regionList:[],
  190. list:[],
  191. fromValue: {
  192. status:"1",
  193. storeRequest: "",
  194. companyId:"", // 公司id,必传 Long类型
  195. regionId:"", // 大区id,必传 Long类型
  196. deptId:"", // 部门id,如果为周报或日报为必传 Long类型
  197. userId:"", // 业务员id,如果为日报为必传 Long类型
  198. startTime:"", // 开始时间,必传 格式:yyyy-MM-dd String类型
  199. endTime:"", // 结束时间,必传 格式:yyyy-MM-dd String类型
  200. pageNum:1 , // 当前页码 int类型
  201. pageSize:10, // 当前每页条数 int类型
  202. }
  203. }
  204. },
  205. created() {
  206. getCWStoreTypeList({}).then(res => {
  207. this.storeTypeList = res.data
  208. })
  209. // this.approveList()
  210. },
  211. // watch: {
  212. // $route(to, from) {
  213. // this.powerGrade = localStorage.getItem("powerGrade")
  214. // this.fromValue.pageNum=1
  215. // if(to.path=="/mySignApproval"&&from.path=="/My/index"){
  216. // this.approveList()
  217. // }
  218. // if(to.path=="/signApprovalList"&&from.path=="/signApproval"){
  219. // this.fromValue.pageNum=1
  220. // this.approveList()
  221. // }
  222. // if(to.path=="/mySignApproval"&&from.path=="/signApproval"){
  223. // this.fromValue.pageNum=1
  224. // this.approveList()
  225. // }
  226. // }
  227. // },
  228. activated() {
  229. // watch: {
  230. // $route(to, from) {
  231. // if (from.path == "/My/index" && to.path == "/historAllVisit") {
  232. this.info();
  233. this.userList=[]
  234. this.pageNum=1;
  235. this.list=[];
  236. this.powerGrade = localStorage.getItem("powerGrade")
  237. this.getDeptInfo("dept")
  238. if(this.powerGrade==5){
  239. setTimeout(()=>{
  240. if(this.$route.query.userCode==undefined){
  241. this.companyName=this.companyList[0].deptName;
  242. this.companyCode=this.companyList[0].deptId;
  243. }
  244. this.getDeptInfo("dept",1)
  245. },1000)
  246. }
  247. if(this.powerGrade==4){
  248. setTimeout(()=>{
  249. this.getDeptInfo("dept",1)
  250. },1000)
  251. }
  252. if(this.powerGrade==3){
  253. setTimeout(()=>{
  254. this.getDeptInfo("dept",2)
  255. },1000)
  256. }
  257. if(this.powerGrade==2||this.powerGrade==1){
  258. setTimeout(()=>{
  259. this.getDeptInfo("user")
  260. },2000)
  261. }
  262. setTimeout(()=>{
  263. this.onSearch();
  264. },1000)
  265. // }
  266. // }
  267. // },
  268. },
  269. methods: {
  270. getDay(day) {
  271. var today = new Date();
  272. var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
  273. today.setTime(targetday_milliseconds); //注意,这行是关键代码
  274. var tYear = today.getFullYear();
  275. var tMonth = today.getMonth();
  276. var tDate = today.getDate();
  277. tMonth = this.doHandleMonth(tMonth + 1);
  278. tDate = this.doHandleMonth(tDate);
  279. return tYear + "-" + tMonth + "-" + tDate;
  280. },
  281. doHandleMonth(month) {
  282. var m = month;
  283. if (month.toString().length == 1) {
  284. m = "0" + month;
  285. }
  286. return m;
  287. },
  288. info(){
  289. this.query = this.$route.query;
  290. this.fromValue.startTime = this.getDay(-7)
  291. this.startcurrentDate = new Date(this.getDay(-7))
  292. this.fromValue.endTime = this.parseTime(new Date(), '{y}-{m}-{d}')
  293. this.endminDate = new Date(this.getDay(-7))
  294. },
  295. dateeconfirm() {
  296. this.startTimeshow = false
  297. this.fromValue.startTime = this.parseTime(this.startcurrentDate, '{yy}-{mm}-{dd}')
  298. this.fromValue.endminDate = new Date(this.startcurrentDate)
  299. this.onSearch()
  300. },
  301. endTimeconfirm() {
  302. this.endTimeshow = false
  303. this.fromValue.endTime = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}')
  304. this.startmaxDate = new Date(this.currentDate)
  305. this.onSearch()
  306. },
  307. onCompanyConfirm(){}, onRegionConfirm(){}, onDeptConfirm(){},
  308. getDeptInfo(type,grade){
  309. this.fromValue.type=type
  310. if(type=="dept"){
  311. if(grade=="1"){
  312. this.fromValue.parentId=this.companyCode
  313. }else if(grade=="2"){
  314. this.fromValue.parentId=this.regionCode
  315. }else{
  316. this.fromValue.type=""
  317. this.fromValue.parentId=""
  318. }
  319. }else if(type=="user"){
  320. this.fromValue.parentId=this.deptCode
  321. }
  322. getvisitDeptInfo(this.fromValue).then(res=>{
  323. if(type=="dept"){
  324. if(grade=="1"){
  325. if(res.data.region!=null){
  326. this.regionList=[{deptName:"全部大区",deptId:""}].concat(res.data.region)
  327. }
  328. }else if(grade=="2"){
  329. if(res.data.dept!=null){
  330. this.deptList=[{deptName:"全部销售部",deptId:""}].concat(res.data.dept)
  331. }
  332. }else{
  333. this.companyList=res.data.company
  334. if(this.$route.query.userCode==undefined){
  335. this.companyName=res.data.company[0].deptName
  336. this.companyCode=res.data.company[0].deptId
  337. }
  338. if(res.data.dept!=null){
  339. this.deptName=res.data.dept[0].deptName
  340. this.deptCode=res.data.dept[0].deptId
  341. this.deptList=res.data.dept
  342. }
  343. if(res.data.region!=null){
  344. this.regionName=res.data.region[0].deptName
  345. this.regionCode=res.data.region[0].deptId
  346. this.regionList=res.data.region
  347. }
  348. if(res.data.user!=null){
  349. this.userList=res.data.user
  350. this.userCode=""
  351. }
  352. }
  353. }else if(type=="user"){
  354. if(res.data.user!=null){
  355. this.userList=[{nickName:"全部业务员",userId:""}].concat(res.data.user)
  356. }
  357. }
  358. })
  359. },
  360. moreSearch() {
  361. this.onSearch();
  362. this.$refs.item.toggle();
  363. },
  364. onSearch() {
  365. window.scrollTo(0, 0)
  366. this.fromValue.pageNum = 1
  367. this.list = []
  368. this.finished = true;
  369. this.onLoad()
  370. },
  371. //取消搜索
  372. cancelSearch() {
  373. this.fromValue = {
  374. province: "",
  375. city: "",
  376. district: "",
  377. storeCategory: "",
  378. storeName: "",
  379. chainName: "",
  380. label1: ""
  381. }
  382. this.info()
  383. this.storeTypeVal = []
  384. // this.$refs.item.toggle();
  385. },
  386. onLoad(){
  387. this.approveList()
  388. },
  389. approveFn(row){
  390. this.list=[];
  391. var edit=true
  392. if(row.status=='1'&&row.taskId!=null&&row.taskId!=undefined){
  393. edit=true
  394. }else{
  395. edit=false
  396. }
  397. this.$router.push({
  398. path: "/signApproval",
  399. query: {signId: row.signId,type:"1",addressLine:row.addressLine,itemType:"dkhqy",edit:edit,taskId:row.taskId,instanceId:row.instanceId,visitsId:row.visitsId}
  400. })
  401. },
  402. tabChange() {
  403. this.disabled = true;
  404. this.list=[];
  405. this.fromValue.pageNum=1
  406. this.approveList()
  407. },
  408. approveList() {
  409. let loading1 = this.$toast.loading({
  410. duration: 0,
  411. message: '数据加载中...',
  412. forbidClick: true,
  413. });
  414. if (this.refreshing) {
  415. this.list = [];
  416. this.refreshing = false;
  417. }
  418. storeCustomerSignList(this.fromValue).then(res => {
  419. loading1.clear()
  420. this.disabled = false;
  421. this.loading = false;
  422. if(this.fromValue.pageNum==1){
  423. this.list=[];
  424. this.refreshing =false;
  425. }
  426. this.list = this.list.concat(res.rows)
  427. this.finished = true;
  428. if(this.list.length >=res.total) {
  429. this.finished = true;
  430. }else{
  431. this.finished = false;
  432. }
  433. this.fromValue.pageNum=this.fromValue.pageNum+1
  434. })
  435. },
  436. onClickLeft() {
  437. this.$router.push("/My")
  438. }
  439. }
  440. }
  441. </script>
  442. <style lang="scss">
  443. .monthNowsin {
  444. height:40px;
  445. line-height: 40px;
  446. text-align: left;
  447. font-weight: bold;
  448. padding: 0 16px;
  449. box-sizing: border-box;
  450. background-color: #fff;
  451. border-radius: 6px;
  452. margin:8px 0;
  453. border: 1px solid #ccc;
  454. position: relative;
  455. color: #333;
  456. font-size: 14px;
  457. .van-cell__left-icon, .van-cell__right-icon{
  458. line-height: 34px;
  459. }
  460. .CalendarIcon {
  461. float: right;
  462. font-size: 24px;
  463. color: #1989fa;
  464. margin-top: 6px;
  465. position: absolute;
  466. right: 12px;
  467. img {
  468. height: 0.8em;
  469. }
  470. }
  471. }
  472. .searchDiv {
  473. .van-search {
  474. background: #fff;
  475. }
  476. .van-search__action {
  477. font-size: 14px;
  478. color: #0057ba;
  479. font-weight: bold;
  480. background: #f1f1f1;
  481. border-bottom-right-radius: 60px;
  482. border-top-right-radius: 60px;
  483. border: 1px solid #ccc;
  484. padding: 0 20px;
  485. }
  486. .van-search--show-action {
  487. padding-right: 12px
  488. }
  489. .van-search__content {
  490. border: 1px solid #ccc;
  491. border-bottom-left-radius: 60px;
  492. border-top-left-radius: 60px;
  493. background: #f1f1f1;
  494. border-right: 0;
  495. }
  496. }
  497. .visitSearch {
  498. width: 68px;
  499. color: #0057ba;
  500. font-size: 14px;
  501. }
  502. .visitSearch .van-dropdown-menu__bar {
  503. box-shadow: 0 0 0 #fff;
  504. height: 52px;
  505. }
  506. .visitSearch .van-dropdown-menu__item {
  507. justify-content: normal;
  508. }
  509. .visitSearch .van-dropdown-menu__title {
  510. border-left: 1px solid #ccc;
  511. }
  512. .visitSearch .van-cell {
  513. border: 1px solid #ccc;
  514. border-radius: 5px;
  515. padding: 6px;
  516. }
  517. .visitSearch .el-select {
  518. margin: 0 !important;
  519. width: 100%;
  520. }
  521. .visitSearch .el-input__inner {
  522. padding: 0 26px 0 6px;
  523. }
  524. .visitSearch .van-dropdown-item {
  525. height: 98%;
  526. }
  527. .bgcolor {
  528. background-color: #f5f5f5;
  529. }
  530. .cardContent {
  531. box-sizing: border-box;
  532. }
  533. .cardContent .title {
  534. font-size: 14px;
  535. font-weight: bold;
  536. color: #333;
  537. line-height: 14px;
  538. }
  539. .cardContent .info {
  540. font-size: 14px;
  541. color: #999;
  542. line-height: 26px;
  543. }
  544. .cardContent .title p {
  545. padding: 0;
  546. margin: 0
  547. }
  548. .cardContent .title .textLeft {
  549. display: inline-block;
  550. padding-bottom: 10px;
  551. }
  552. .cardContent .title .textRight {
  553. float: right;
  554. color: #0057ba;
  555. }
  556. .van-tab--active {
  557. color: #0057ba;
  558. }
  559. .brud {
  560. margin: 16px;
  561. border-radius: 8px;
  562. overflow: hidden;
  563. }
  564. .weekList{border-radius:0;}
  565. .weekList .van-cell__right-icon{top:4px;}
  566. .weekList .van-cell{border-radius: 6px;overflow: hidden;}
  567. .weekList .cardContent .title{line-height: 32px}
  568. .wrapperConent{height: 40%;bottom: 0;z-index: 20;top: auto;}
  569. //.wrapperTime
  570. </style>