移动端
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.
 
 

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