代理记账中共新前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

todo.vue 9.9 KiB

1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <template>
  2. <div class="app-container">
  3. <div class="header_main">
  4. <el-dropdown trigger="click" placement="bottom-start">
  5. <div class="select_address el-dropdown-link">
  6. <span class="sanjiao-right"></span>
  7. <p>{{cityName}}</p>
  8. </div>
  9. <el-dropdown-menu slot="dropdown" style="width: 8vw;text-align: center;">
  10. <el-dropdown-item v-for="(item,index) in deptOptions">
  11. <div class="selected" @click="chooseCity(item.orgCode)">
  12. <p>{{item.deptName}}</p>
  13. </div>
  14. </el-dropdown-item>
  15. </el-dropdown-menu>
  16. </el-dropdown>
  17. <el-dropdown trigger="click" placement="bottom-start">
  18. <div class="el-dropdown-link select_main">
  19. <div class="select_address">
  20. <span class="sanjiao-right"></span>
  21. <p>{{townName}}</p>
  22. </div>
  23. <div class="select_address">
  24. <p class="select_time">2023.03.05</p>
  25. </div>
  26. </div>
  27. <el-dropdown-menu slot="dropdown" style="width: 16vw;text-align: center;">
  28. <el-dropdown-item v-for="(item,index) in townList">
  29. <div class="selected" @click="chooseTown(item.orgCode)">
  30. <p>{{item.deptName}}</p>
  31. <p>2023.03.05</p>
  32. </div>
  33. </el-dropdown-item>
  34. </el-dropdown-menu>
  35. </el-dropdown>
  36. <p class="todo_num">待处理合作社:<span>{{total}}</span>个</p>
  37. </div>
  38. <div class="main">
  39. <div class="left_main">
  40. <el-table :data="list" style="width: 100%;">
  41. <el-table-column prop="orgName" label="村" />
  42. <el-table-column prop="bookName" label="组织名称" show-overflow-tooltip />
  43. <el-table-column prop="voucherCount" label="记账笔数" >
  44. <template slot-scope="scope">
  45. {{scope.row.voucherCount}} <span class="num">7</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="contracCount" label="合同数量" />
  49. <el-table-column prop="otherCount" label="其他" />
  50. <el-table-column prop="allCount" label="任务总数" />
  51. <el-table-column prop="distriDate" label="下发日期" sortable />
  52. <el-table-column prop="endAt" label="截止日期" sortable />
  53. <el-table-column label="操作">
  54. <template slot-scope="scope">
  55. <el-button type="primary" size="mini" icon="el-icon-edit"></el-button>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. </div>
  60. <div class="right_main">
  61. <div class="title">
  62. <i></i>
  63. <p>任务日期</p>
  64. </div>
  65. <div class="time_main">
  66. <span class="sanjiao-top" @click="addDate"></span>
  67. <p @click = "selectionRange">{{year}}</p>
  68. <el-date-picker
  69. v-model="year"
  70. type="year"
  71. class="pickerTime"
  72. ref = "datePicker"
  73. value-format="yyyy"
  74. placeholder="选择年"
  75. @change="chooseMonth(1)">
  76. </el-date-picker>
  77. <span class="sanjiao-bottom" @click="reduceDate"></span>
  78. </div>
  79. <div class="month_main">
  80. <p v-for="(item,index) in 12" @click="chooseMonth(index + 1)" :class="{'active': isCurrentMonth(index + 1)}">{{index+1}}月<i v-if="isCurrentMonth(index + 1)"></i></p>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import {cityTree} from "@/api/misc/misc_dept";
  88. import {ENV} from "@/utils/env";
  89. import {taskList, todoTaskList} from "@/api/agentcenter/task";
  90. import {date_format} from "@/utils/date";
  91. export default {
  92. name: "todo",
  93. data() {
  94. return {
  95. deptOptions: [],
  96. cityCode: null,
  97. townCode: null,
  98. list: [],
  99. total: 0,
  100. year: date_format('%Y'),
  101. month: date_format('%m'),
  102. }
  103. },
  104. created() {
  105. this.getDeptTree();
  106. },
  107. methods:{
  108. addDate(){
  109. this.year = Number(this.year) + 1 ;
  110. this.chooseMonth(1);
  111. },
  112. reduceDate(){
  113. this.year = Number(this.year) - 1 ;
  114. this.chooseMonth(1);
  115. },
  116. selectionRange(){
  117. this.$refs.datePicker.focus();
  118. },
  119. getDeptTree() {
  120. cityTree({rootId: ENV.UserDeptId()}).then((resp) => {
  121. this.deptOptions = resp.data;
  122. if(this.deptOptions.length)
  123. this.cityCode = this.deptOptions[0].orgCode;
  124. });
  125. },
  126. chooseCity(cmd) {
  127. this.cityCode = cmd;
  128. this.townCode = null;
  129. },
  130. chooseTown(cmd) {
  131. this.townCode = cmd;
  132. this.getTaskList();
  133. },
  134. getTaskList() {
  135. if(!this.townCode || !this.year || !this.month)
  136. return;
  137. todoTaskList({
  138. townCode: this.townCode,
  139. orderYear: this.year,
  140. orderMonth: this.month,
  141. }).then((resp) => {
  142. this.list = resp.rows;
  143. this.total = resp.total;
  144. })
  145. },
  146. isCurrentMonth(m) {
  147. return parseInt(this.month) === m;
  148. },
  149. chooseMonth(month) {
  150. this.month = month >= 10 ? '' + month : ('0' + month);
  151. this.getTaskList();
  152. },
  153. },
  154. mounted(){
  155. },
  156. computed: {
  157. cityName() {
  158. if(!this.deptOptions.length)
  159. return '';
  160. let dept = this.deptOptions.find((x) => x.orgCode === this.cityCode);
  161. return dept ? dept.deptName : '';
  162. },
  163. townList() {
  164. if(!this.deptOptions.length)
  165. return [];
  166. let dept = this.deptOptions.find((x) => x.orgCode === this.cityCode);
  167. return dept ? dept.children || [] : [];
  168. },
  169. townName() {
  170. if(!this.townList.length)
  171. return '';
  172. let dept = this.townList.find((x) => x.orgCode === this.townCode);
  173. return dept ? dept.deptName : '';
  174. },
  175. },
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. p{margin: 0;line-height: 1;}
  180. .app-container{
  181. background-color: #f5f6f8;
  182. width: 100vw;
  183. height: 100vh;
  184. }
  185. .pickerTime{
  186. opacity: 0;
  187. position: absolute;
  188. left: 0px;
  189. top: 30px;
  190. width: 5px;
  191. height: 5px;
  192. z-index: -1;
  193. }
  194. .el-dropdown-link {
  195. cursor: pointer;
  196. }
  197. .title{
  198. display: flex;
  199. align-items: center;
  200. i{
  201. display: inline-block;
  202. width: 5px;
  203. height: 20px;
  204. background: #4d7cfe;
  205. border-radius: 5px;
  206. margin-right: 10px;
  207. }
  208. p{
  209. font-size: 18px;
  210. }
  211. }
  212. .num{
  213. color: #3976ff;
  214. display: inline-block;
  215. background-color: #e2ebff;
  216. width: 1.8vw;
  217. border-radius: 5px;
  218. margin-left: 5px;
  219. }
  220. ::v-deep .el-table .cell{
  221. text-align: center;
  222. }
  223. ::v-deep .el-table .el-table__cell{
  224. border: none!important;
  225. }
  226. ::v-deep .el-table::before{
  227. display: none;
  228. }
  229. ::v-deep .el-table .el-table__header-wrapper th{
  230. background-color: transparent;
  231. }
  232. ::v-deep .el-table tr{
  233. background-color: transparent;
  234. }
  235. .selected{
  236. display: flex;
  237. height: 4vh;
  238. p{
  239. width: 8vw;
  240. line-height: 4vh;
  241. text-align: center;
  242. }
  243. }
  244. .header_main{
  245. display: flex;
  246. align-items: center;
  247. position: relative;
  248. .select_main{
  249. display: flex;
  250. align-items: center;
  251. & .select_address:nth-child(1){
  252. margin-right: 0vw;
  253. border-top-right-radius: initial;
  254. border-bottom-right-radius: initial;
  255. }
  256. & .select_address:nth-child(2){
  257. margin-right: 0vw;
  258. border-top-left-radius: initial;
  259. border-bottom-left-radius: initial;
  260. }
  261. }
  262. .select_address{
  263. display: flex;
  264. align-items: center;
  265. justify-content: center;
  266. margin-right: 2vw;
  267. background-color: #ffffff;
  268. padding: 0px 0px;
  269. border-radius: 8px;
  270. box-shadow: 0 0 10px #dedfe1;
  271. width: 8vw;
  272. height: 4vh;
  273. overflow: hidden;
  274. .sanjiao-right {
  275. display: inline-block;
  276. border-left: 8px solid #000;
  277. border-left-color: initial;
  278. border-top: 5px solid transparent;
  279. border-bottom: 5px solid transparent;
  280. margin-right: 5px;
  281. }
  282. .select_time{
  283. text-align: center;
  284. width: 100%;
  285. height: 4vh;
  286. line-height: 4vh;
  287. background-color: #3976ff;
  288. color: #ffffff;
  289. }
  290. }
  291. .todo_num{
  292. margin-left: auto;
  293. span{
  294. font-size: 24px;
  295. color: #3976ff;
  296. }
  297. }
  298. }
  299. .main{
  300. display: flex;
  301. .left_main{
  302. width: 92%;
  303. margin-right: 0.57%;
  304. margin-top: 15px;
  305. border-radius: 8px;
  306. box-shadow: 4px 0px 10px rgba(0, 0, 0, 0.13);
  307. background: #fff;
  308. padding: 15px 20px;
  309. height: calc(100vh - 91px);
  310. }
  311. .right_main{
  312. width: 7.43%;
  313. margin-top: 15px;
  314. border-radius: 8px;
  315. box-shadow: 4px 0px 10px rgba(0, 0, 0, 0.13);
  316. background: #fff;
  317. padding: 15px 20px;
  318. height: calc(100vh - 91px);
  319. }
  320. }
  321. .sanjiao-top {
  322. display: inline-block;
  323. border-bottom: 8px solid #414141;
  324. border-bottom-color: initial;
  325. border-left: 5px solid transparent;
  326. border-right: 5px solid transparent;
  327. cursor: pointer;
  328. }
  329. .sanjiao-bottom {
  330. display: inline-block;
  331. border-top: 8px solid #414141;
  332. border-top-color: initial;
  333. border-left: 5px solid transparent;
  334. border-right: 5px solid transparent;
  335. cursor: pointer;
  336. }
  337. .time_main{
  338. display: flex;
  339. flex-direction: column;
  340. align-items: center;
  341. background-color: #f5f6f8;
  342. color: #414141;
  343. width: 75%;
  344. margin: 0 auto;
  345. margin-top: 15px;
  346. padding: 15px 0;
  347. border-radius: 8px;
  348. position: relative;
  349. cursor: pointer;
  350. p{
  351. margin: 10px 0;
  352. }
  353. }
  354. .month_main{
  355. display: flex;
  356. flex-direction: column;
  357. align-items: center;
  358. color: #414141;
  359. p{
  360. margin-top: 3vh;
  361. position: relative;
  362. &.active{
  363. color: #3976ff;
  364. }
  365. &:hover{
  366. color: #3976ff;
  367. cursor: pointer;
  368. }
  369. i{
  370. display: block;
  371. width: 5px;
  372. height: 5px;
  373. background-color: #fc5659;
  374. position: absolute;
  375. top: -5px;
  376. right: -5px;
  377. border-radius: 100%;
  378. }
  379. }
  380. }
  381. </style>