移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

799 行
28 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 统计填报
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. </div>
  7. <div class="template_main">
  8. <div class="title_wrap">
  9. <div class="icon"></div>
  10. <div class="title">模板</div>
  11. </div>
  12. <div class="search_wrap" @click="templateClick">
  13. <div class="title">{{templateValue}}</div>
  14. <div class="xs_icon"></div>
  15. </div>
  16. </div>
  17. <div class="choose_main">
  18. <div class="search_wrap">
  19. <div class="title">申报类型</div>
  20. <div class="content" @click="typeDeclarationClick">
  21. <div class="text">{{declarationTypeValue}}</div>
  22. <div class="xs_icon"></div>
  23. </div>
  24. </div>
  25. <div class="search_wrap">
  26. <div class="title">负责人</div>
  27. <div class="content">
  28. <div class="text">
  29. <input v-model="from.principalName" type="text" class="fzr" placeholder="请输入">
  30. </div>
  31. <div class="xs_icon"></div>
  32. </div>
  33. </div>
  34. </div>
  35. <!--div class="table_main">
  36. <div class="head_wrap">
  37. <div class="project_name">项目名称</div>
  38. <div class="unit_count">计数单位</div>
  39. <div class="numerical_value">数值</div>
  40. </div>
  41. <div class="thead_wrap">
  42. <div class="basic_info">
  43. <div class="basic_title">
  44. <div class="s_title">合作社发展基本情况</div>
  45. </div>
  46. <div class="type_wrap">
  47. <div class="industry_list">
  48. <div class="subdivision_list">
  49. <div class="subdivision_title">行业分布</div>
  50. <div class="subdivision_main">
  51. <div class="planting_flex">
  52. <div class="subclass">大豆种植</div>
  53. <div class="unit_munt">个</div>
  54. <div class="number_value">
  55. <van-stepper v-model="stepperValue" />
  56. </div>
  57. </div>
  58. <div class="planting_flex">
  59. <div class="subclass">大豆种植</div>
  60. <div class="unit_munt">个</div>
  61. <div class="number_value">
  62. <van-stepper v-model="stepperValue" />
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="industry_list">
  69. <div class="type_project">各类合作社总数各类合</div>
  70. <div class="unit_munt">个</div>
  71. <div class="number_value">
  72. <van-stepper v-model="stepperValue" />
  73. </div>
  74. </div>
  75. <div class="industry_list">
  76. <div class="type_project">牧业</div>
  77. <div class="unit_munt">个</div>
  78. <div class="number_value">
  79. <van-stepper v-model="stepperValue" />
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="basic_info">
  85. <div class="basic_title">
  86. <div class="s_title">合作社发展基本情况</div>
  87. </div>
  88. <div class="type_wrap">
  89. <div class="industry_list">
  90. <div class="subdivision_list">
  91. <div class="subdivision_title">行业分布</div>
  92. <div class="subdivision_main">
  93. <div class="planting_flex">
  94. <div class="subclass">大豆种植</div>
  95. <div class="unit_munt">个</div>
  96. <div class="number_value">
  97. <van-stepper v-model="stepperValue" />
  98. </div>
  99. </div>
  100. <div class="planting_flex">
  101. <div class="subclass">大豆种植</div>
  102. <div class="unit_munt">个</div>
  103. <div class="number_value">
  104. <van-stepper v-model="stepperValue" />
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="industry_list">
  111. <div class="type_project">各类合作社总数各类合</div>
  112. <div class="unit_munt">个</div>
  113. <div class="number_value">
  114. <van-stepper v-model="stepperValue" />
  115. </div>
  116. </div>
  117. <div class="industry_list">
  118. <div class="type_project">牧业</div>
  119. <div class="unit_munt">个</div>
  120. <div class="number_value">
  121. <van-stepper v-model="stepperValue" />
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div-->
  128. <div class="table_main">
  129. <div class="head_wrap">
  130. <div class="project_name">项目名称</div>
  131. <div class="unit_count">计数单位</div>
  132. <div class="numerical_value">数值</div>
  133. </div>
  134. <div class="thead_wrap">
  135. <!---1-->
  136. <div class="basic_info" v-for="(item,index) in tEntityStatisticsNumberList" :key="index" >
  137. <div class="basic_title">
  138. <div class="s_title">{{item.projectName}}</div>
  139. </div>
  140. <div class="type_wrap">
  141. <!---2--->
  142. <div class="industry_list" v-for="(data,idx) in item.children" :key="idx">
  143. <div v-if="data.children && data.children!=null" class="industry_block">
  144. <div class="subdivision_list">
  145. <div class="subdivision_title">{{data.projectName}}</div>
  146. <div class="subdivision_main">
  147. <!---3--->
  148. <div class="planting_flex" v-for="(val,num) in data.children" :key="num">
  149. <div class="subclass">{{val.projectName}}</div>
  150. <div class="unit_munt">{{val.measuringUnit}}</div>
  151. <div class="number_value">
  152. <van-stepper v-model="val.currentYearNumber" min="0"/>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <div v-else class="industry_block">
  159. <div class="type_project">{{data.projectName}}</div>
  160. <div class="unit_munt">{{data.measuringUnit}}</div>
  161. <div class="number_value">
  162. <van-stepper v-model="data.currentYearNumber" min="0" />
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="submit_btn">
  171. <van-button type="info" @click="submitFrom" size="normal">保存填报信息</van-button>
  172. </div>
  173. <van-action-sheet v-model="popObj.typeDeclarationVisibile" duration="0.2" >
  174. <van-picker
  175. title="申报类型"
  176. :columns="declarationTypeIdOptions"
  177. show-toolbar
  178. @confirm="declarationTypeIdConfirm"
  179. @cancel="declarationTypeIdCancel"
  180. >
  181. <template #option="option">
  182. <div style="display: flex; flex-direction: column; align-items: center;">
  183. <div>{{ option.dictLabel }}</div>
  184. <!-- <div>年龄:{{ option.age }}</div> -->
  185. </div>
  186. </template>
  187. </van-picker>
  188. </van-action-sheet>
  189. <van-action-sheet v-model="popObj.templateVisbile" duration="0.2" >
  190. <van-cascader
  191. v-model="cascaderValue"
  192. title="请选择所在地区"
  193. :options="statisticsProject"
  194. @close="popObj.templateVisbile = false"
  195. @finish="projectOnFinish"
  196. @change="projectOnChange"
  197. :field-names="fieldNames"
  198. />
  199. </van-action-sheet>
  200. </div>
  201. </template>
  202. <script>
  203. import {entityStatisticsTemplate ,entityStatisticsSave ,entityStatisticsDetail} from "@/api/sunVillage_info/fixedAssets";
  204. import {getInfo} from "../../api/login";
  205. export default {
  206. name: "statisticalReportEdit",
  207. data() {
  208. return {
  209. from:{
  210. applyTime:null,
  211. applyUserId:null,
  212. applyUserName:null,
  213. auditStatus:null,
  214. createBy:null,
  215. createTime:null,
  216. deptId:null,
  217. id:null,
  218. instanceId:null,
  219. processKey:null,
  220. remark:null,
  221. statisticsTypeId:null,
  222. templateId:null, //模板id
  223. updateBy:null,
  224. updateTime:null,
  225. templateName:null, //模板名称
  226. declarationTypeId:null, //申报类型 1
  227. principalName:null, //单位负责人 1
  228. preparer:null, //填表人 1
  229. preparerDeptName:'', //填报单位 1
  230. time:this.format(new Date(),'yyyy-MM-dd'), //填报时间
  231. tEntityStatisticsNumberList:[]
  232. },
  233. //当前选中模板列表
  234. tEntityStatisticsNumberList:[],
  235. //选择模板标题
  236. templateValue :'请选择模板',
  237. popObj:{
  238. typeDeclarationVisibile:false,
  239. templateVisbile:false
  240. },
  241. // 申报类型ID字典
  242. declarationTypeIdOptions: [],
  243. declarationTypeValue:'请选择',
  244. loading:true,
  245. //模板list
  246. //申报大项--列表
  247. statisticsProject:[],
  248. cascaderValue:null,
  249. fieldNames:{
  250. text: 'dictLabel',
  251. value: 'dictValue',
  252. children: 'children',
  253. }
  254. };
  255. },
  256. created() {
  257. this.getDicts("declaration_type_id").then(response => {
  258. this.declarationTypeIdOptions = response.data;
  259. });
  260. },
  261. mounted(){
  262. getInfo().then(response => {
  263. this.from.preparer = response.user.nickName
  264. this.from.preparerDeptName = response.user.dept.deptName
  265. });
  266. let query = this.$route.query;
  267. if(query&& query.id){
  268. this.loading =true;
  269. //編輯
  270. let oId = this.$route.query.id;
  271. entityStatisticsDetail(oId).then((res)=>{
  272. if(res.code == 200){
  273. let content = res.data;
  274. // let obj = {
  275. // applyTime:content.content,
  276. // applyTime:content.applyTime,
  277. // applyUserId:content.pplyUserId,
  278. // applyUserName:content.applyUserName,
  279. // auditStatus:content.auditStatus,
  280. // createBy:content.createBy,
  281. // createTime:content.createTime,
  282. // deptId:content.deptId,
  283. // id:content.id,
  284. // instanceId:content.instanceId,
  285. // processKey:content.processKey,
  286. // remark:content.remark,
  287. // statisticsTypeId:content.statisticsTypeId,
  288. // templateId:content.templateId, //模板id
  289. // updateBy:content.updateBy,
  290. // updateTime:content.updateTime,
  291. // templateName:content.templateName, //模板名称
  292. // declarationTypeId:content.declarationTypeId, //申报类型 1
  293. // principalName:content.principalName, //单位负责人 1
  294. // preparer:content.preparer, //填表人 1
  295. // preparerDeptName:content.preparerDeptName, //填报单位 1
  296. // time:content.time,
  297. // tEntityStatisticsNumberList:content.tEntityStatisticsNumberList
  298. // }
  299. //当前选择模板
  300. this.tEntityStatisticsNumberList = content.tEntityStatisticsNumberList;
  301. //申报类型
  302. let declarationTypeObj = this.declarationTypeIdOptions.find((account) => {
  303. //model就是上面的数据源
  304. return account.dictValue == content.declarationTypeId; //筛选出匹配数据
  305. });
  306. //请选择模板
  307. this.templateValue = content.templateName
  308. // this.loading =false;
  309. this.declarationTypeValue = declarationTypeObj.dictLabel;
  310. this.from = res.data;
  311. }
  312. })
  313. }
  314. this.getDicts("newBusinessEntity_statistics_project").then(res => {
  315. if(res.code == 200){
  316. let content = res.data;
  317. content.forEach((v)=>{
  318. v.children = [];
  319. })
  320. this.statisticsProject = content;
  321. }
  322. });
  323. },
  324. methods: {
  325. projectOnFinish(data){
  326. let content = data.selectedOptions[data.selectedOptions.length -1]
  327. console.log(content)
  328. this.tEntityStatisticsNumberList = content.templateForm.tEntityStatisticsNumberList;
  329. this.templateValue = content.dictLabel;
  330. // // this.from.templateName = data.label;
  331. this.from = content.templateForm;
  332. this.popObj.templateVisbile = false;
  333. },
  334. projectOnChange(value){
  335. if(value.tabIndex == 0){
  336. //查看
  337. entityStatisticsTemplate({statisticsTypeId:value.selectedOptions[0].dictValue}).then((response)=>{
  338. if(response.code == 200){
  339. let content = response.data;
  340. this.statisticsProject[Number(value.value)-1].children = content.map(item => {
  341. const recursionFileMap = obj => {
  342. obj.forEach((v,i)=>{
  343. if(v.currentYearNumber == null){
  344. v.currentYearNumber = 0;
  345. }
  346. if (v.children && v.children != null) {
  347. recursionFileMap(v.children)
  348. }
  349. })
  350. }
  351. recursionFileMap(item.tEntityStatisticsNumberList)
  352. return {
  353. dictLabel:item.templateName,
  354. dictValue: item.templateId,
  355. templateForm:item,
  356. // templateForm:{
  357. // templateId:item.id,
  358. // templateName:item.templateName,
  359. // declarationTypeId:item.declarationTypeId,
  360. // tEntityStatisticsNumberList:item.tEntityStatisticsNumberList
  361. // }
  362. };
  363. });
  364. this.loading =false;
  365. }
  366. })
  367. }
  368. },
  369. submitFrom(){
  370. this.from.tEntityStatisticsNumberList = this.tEntityStatisticsNumberList;
  371. this.from.tentityStatisticsNumberList = this.tEntityStatisticsNumberList;
  372. if(this.from.templateName == null){
  373. this.$notify({
  374. message:'请选择模板!',
  375. type: 'danger'
  376. });
  377. return false;
  378. }else if(this.from.declarationTypeId == null){
  379. this.$notify({
  380. message:'请选择申报类型!',
  381. type: 'danger'
  382. });
  383. return false;
  384. }else if(this.from.principalName == null){
  385. this.$notify({
  386. message:'请填写负责人!',
  387. type: 'danger'
  388. });
  389. return false;
  390. }
  391. entityStatisticsSave(this.from).then((res)=>{
  392. if(res.code == 200){
  393. this.$notify({
  394. message:'保存成功!',
  395. type: 'success'
  396. });
  397. setTimeout(()=>{
  398. this.$router.push('/sunVillage_info/statistical_report')
  399. },1500)
  400. }
  401. })
  402. },
  403. typeDeclarationClick(){
  404. this.popObj.typeDeclarationVisibile = true;
  405. },
  406. declarationTypeIdConfirm(value,index){
  407. this.from.declarationTypeId = value.dictValue;
  408. this.declarationTypeValue = value.dictLabel
  409. this.popObj.typeDeclarationVisibile = false;
  410. },
  411. declarationTypeIdCancel(){
  412. this.popObj.typeDeclarationVisibile = false;
  413. },
  414. templateClick(){
  415. this.popObj.templateVisbile = true;
  416. }
  417. },
  418. }
  419. </script>
  420. <style scoped lang="scss">
  421. .home_wrapper{
  422. background: #e9e9e9;
  423. min-height: 100vh;
  424. width: 100vw;
  425. .header_main {
  426. height: 116px;
  427. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  428. background-size: 100% 100%;
  429. position: fixed;
  430. top: 0;
  431. left: 0;
  432. width: 100%;
  433. font-size: 36px;
  434. line-height: 116px;
  435. text-align: center;
  436. color: #fff;
  437. position: relative;
  438. .return_btn {
  439. width: 24px;
  440. height: 43.2px;
  441. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  442. background-size: 20px 36px;
  443. position: absolute;
  444. left: 38px;
  445. top: 36px;
  446. }
  447. }
  448. .template_main{
  449. padding:30px 24px 0;
  450. display: flex;
  451. margin-bottom: 20px;
  452. align-items: center;
  453. .title_wrap{
  454. display: flex;
  455. align-items: center;
  456. padding-right: 15px;
  457. .icon{
  458. width: 50px;
  459. height: 50px;
  460. border-radius: 50%;
  461. box-shadow: 4px 0px 7px rgba(63, 68, 75, 0.1);
  462. background:#2facfe url('../../assets/images/sunVillage_info/list_icon_11.png') center center no-repeat;
  463. background-size: 27px 27px;
  464. margin-right: 12px;
  465. }
  466. .title{
  467. font-size: 30px;
  468. color: #2facfe;
  469. }
  470. }
  471. .search_wrap{
  472. flex: 1;
  473. height: 64px;
  474. border-radius: 8px;
  475. box-shadow: 4px 4px 7px rgba(63, 68, 75, 0.1);
  476. background: #fff;
  477. display: flex;
  478. padding:0 26px 0 22px;
  479. align-items: center;
  480. justify-content: space-between;
  481. .title{
  482. width: 465px;
  483. height: 64px;
  484. line-height: 64px;
  485. font-size: 30px;
  486. white-space: nowrap;
  487. overflow: hidden;
  488. text-overflow: ellipsis;
  489. color: #2b2b2b;
  490. }
  491. .xs_icon{
  492. width: 11px;
  493. height: 23px;
  494. background: url('../../assets/images/sunVillage_info/list_icon_12.png') center center no-repeat;
  495. background-size: 100% 100%;
  496. }
  497. }
  498. }
  499. .choose_main{
  500. padding:0 24px;
  501. display: flex;
  502. justify-content: space-between;
  503. margin-bottom: 26px;
  504. .search_wrap{
  505. height: 64px;
  506. width: 48.5%;
  507. border-radius: 8px;
  508. box-shadow: 4px 4px 7px rgba(63, 68, 75, 0.1);
  509. background: #fff;
  510. display: flex;
  511. .title{
  512. width: 145px;
  513. font-size: 30px;
  514. color: #fff;
  515. background: #2facfe;
  516. border-top-left-radius: 8px;
  517. border-bottom-left-radius: 8px;
  518. display: flex;
  519. justify-content: center;
  520. align-items: center;
  521. }
  522. .content{
  523. flex: 1;
  524. padding:0 20px 0 10px;
  525. display: flex;
  526. align-items: center;
  527. justify-content: space-between;
  528. .text{
  529. width: 150px;
  530. // line-height: 64px;
  531. font-size: 30px;
  532. white-space: nowrap;
  533. text-align: center;
  534. overflow: hidden;
  535. text-overflow: ellipsis;
  536. .fzr{
  537. width: 150px;
  538. }
  539. }
  540. .xs_icon{
  541. width: 11px;
  542. height: 23px;
  543. background: url('../../assets/images/sunVillage_info/list_icon_12.png') center center no-repeat;
  544. background-size: 100% 100%;
  545. }
  546. }
  547. }
  548. }
  549. .table_main{
  550. padding:20px 0 0 24px;
  551. div{
  552. box-sizing: border-box;
  553. }
  554. .head_wrap{
  555. height: 69px;
  556. display: flex;
  557. font-size: 30px;
  558. background: #fff;
  559. color: #2facfe;
  560. border-top-left-radius: 8px;
  561. border-bottom-left-radius: 8px;
  562. .project_name,
  563. .unit_count,
  564. .numerical_value{
  565. display: flex;
  566. align-items: center;
  567. justify-content: center;
  568. }
  569. .project_name{
  570. width: 314px;
  571. background: #2facfe;
  572. color: #fff;
  573. border-radius: 8px;
  574. }
  575. .unit_count{
  576. width: 173px;
  577. border-right: 1px solid #0469ab;
  578. }
  579. .numerical_value{
  580. width: 239px;
  581. }
  582. }
  583. .thead_wrap{
  584. .basic_info{
  585. display: flex;
  586. .basic_title{
  587. width: 63px;
  588. display: flex;
  589. align-items: center;
  590. justify-content: center;
  591. background: #6ac1fa;
  592. border-right: 1px solid #0469ab;
  593. border-bottom: 1px solid #0469ab;
  594. .s_title{
  595. width: 28px;
  596. font-size: 28px;
  597. padding:14px 0;
  598. }
  599. }
  600. .type_wrap{
  601. flex: 1;
  602. display: flex;
  603. flex-wrap: wrap;
  604. .industry_list{
  605. width: 100%;
  606. display: flex;
  607. border-bottom: 1px solid #0469ab;
  608. min-height: 75px;
  609. .industry_block{
  610. flex: 1;
  611. display: flex;
  612. }
  613. .type_project,
  614. .unit_munt,
  615. .number_value{
  616. display: flex;
  617. justify-content: center;
  618. align-items: center;
  619. }
  620. .type_project{
  621. width: 251px;
  622. font-size: 28px;
  623. background: #aad8f6;
  624. padding:0 14px;
  625. font-size: 28px;
  626. border-right: 1px solid #0469ab;
  627. }
  628. .unit_munt{
  629. width: 173px;
  630. font-size: 28px;
  631. border-right: 1px solid #0469ab;
  632. }
  633. .number_value{
  634. width: 239px;
  635. }
  636. .subdivision_list{
  637. flex: 1;
  638. display: flex;
  639. .subdivision_title{
  640. width: 76px;
  641. background: #aad8f6;
  642. font-size: 28px;
  643. display: flex;
  644. align-items: center;
  645. padding:0 8px;
  646. justify-content: center;
  647. border-right: 1px solid #0469ab;
  648. }
  649. .subdivision_main{
  650. flex: 1;
  651. display: flex;
  652. flex-wrap: wrap;
  653. .planting_flex{
  654. width: 100%;
  655. display: flex;
  656. min-height: 75px;
  657. border-bottom: 1px solid #0469ab;
  658. &:last-child{
  659. border-bottom: 0;
  660. }
  661. .subclass{
  662. width: 175px;
  663. display: flex;
  664. align-items: center;
  665. justify-content: center;
  666. font-size: 27px;
  667. background: #d7e8f3;
  668. border-right: 1px solid #0469ab;
  669. }
  670. }
  671. }
  672. }
  673. // <div class="subdivision_list">
  674. // <div class="subdivision_title">行业分布</div>
  675. // <div class="subdivision_main">
  676. // <!---3--->
  677. // <div class="planting_flex">
  678. // 大豆种植
  679. // </div>
  680. // <!---3--->
  681. // <div class="planting_flex">
  682. // 大豆种植
  683. // </div>
  684. // </div>
  685. // </div>
  686. }
  687. }
  688. }
  689. }
  690. }
  691. .submit_btn{
  692. display: flex;
  693. align-items: center;
  694. justify-content: center;
  695. height: 150px;
  696. }
  697. /deep/ {
  698. .van-stepper__minus,
  699. .van-stepper__plus{
  700. background: #2facfe;
  701. color: #fff;
  702. }
  703. .van-stepper__minus--disabled{
  704. color: #e9e9e9;
  705. }
  706. .van-stepper__input{
  707. margin:0;
  708. background: #e0f1fc;
  709. font-size: 30px;
  710. color: #2facfe;
  711. }
  712. }
  713. }
  714. </style>