移动端
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

542 linhas
20 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. <van-form @submit="onSubmit">
  8. <div class="list_main">
  9. <div class="titBox">
  10. <img src="../../assets/images/sunVillage_info/add_icon_1.png" style="width:22PX;height:22PX;margin-right: 10px;"/>
  11. <p class="tit">基本信息</p>
  12. </div>
  13. <van-field v-model="form.code" label="资源编码" placeholder="不输入时系统自动分配" input-align="right" :border="false" />
  14. <van-field required :rules="[{ required: true }]" v-model="form.name" label="资源名称" placeholder="资源名称" input-align="right" :border="false" />
  15. <van-field
  16. readonly
  17. clickable
  18. label="资源分类"
  19. placeholder="请选择"
  20. v-model="resourceType"
  21. @click="showResourceType = true"
  22. input-align="right"
  23. right-icon="arrow-down"
  24. label-width="auto"
  25. required
  26. :border="false"
  27. :rules="[{ required: true }]"
  28. />
  29. <van-popup v-model="showResourceType" position="bottom">
  30. <van-picker
  31. show-toolbar
  32. :columns="resourceTypeOptions"
  33. @confirm="onConfirmResourceType"
  34. @cancel="showResourceType = false"
  35. />
  36. </van-popup>
  37. <van-field
  38. readonly
  39. clickable
  40. label="资源类型"
  41. placeholder="请选择"
  42. v-model="resourceSort"
  43. @click="showResourceSort = true"
  44. input-align="right"
  45. right-icon="arrow-down"
  46. label-width="auto"
  47. required
  48. :border="false"
  49. :rules="[{ required: true }]"
  50. />
  51. <van-popup v-model="showResourceSort" position="bottom">
  52. <van-picker
  53. show-toolbar
  54. :columns="farmingResourceTypeOptions"
  55. @confirm="onConfirmResourceSort"
  56. @cancel="showResourceSort = false"
  57. />
  58. </van-popup>
  59. <van-field v-model="form.location" label="坐落位置" placeholder="坐落位置" input-align="right" :border="false" />
  60. <van-field v-model="form.east" label="东至" placeholder="东至" input-align="right" :border="false" />
  61. <van-field v-model="form.west" label="西至" placeholder="西至" input-align="right" :border="false" />
  62. <van-field v-model="form.south" label="南至" placeholder="南至" input-align="right" :border="false" />
  63. <van-field v-model="form.north" label="北至" placeholder="北至" input-align="right" :border="false" />
  64. <van-field v-model="form.totalArea" label="总面积(亩)" placeholder="总面积(亩)" required :rules="[{ required: true }]" input-align="right" :border="false" />
  65. <field-select
  66. v-model="form.operationType"
  67. label="经营属性"
  68. value-key="dictLabel"
  69. data-key="dictValue"
  70. placeholder="请选择"
  71. :rulesx="[{ required: true }]"
  72. requiredx
  73. remote-url="/open/zdzh/list/operation_type"
  74. :on-remote-response="'data'"/>
  75. <van-field
  76. readonly
  77. clickable
  78. label="使用情况"
  79. placeholder="请选择"
  80. v-model="useType"
  81. @click="showUseType = true"
  82. input-align="right"
  83. right-icon="arrow-down"
  84. label-width="auto"
  85. required
  86. :border="false"
  87. :rules="[{ required: true }]"
  88. />
  89. <van-popup v-model="showUseType" position="bottom">
  90. <van-picker
  91. show-toolbar
  92. :columns="useTypeOptions"
  93. @confirm="onConfirmUseType"
  94. @cancel="showUseType = false"
  95. />
  96. </van-popup>
  97. <van-field
  98. readonly
  99. clickable
  100. label="资产状态"
  101. placeholder="请选择"
  102. v-model="assetStatus"
  103. @click="showAssetStatus = true"
  104. input-align="right"
  105. right-icon="arrow-down"
  106. label-width="auto"
  107. required
  108. :border="false"
  109. :rules="[{ required: true }]"
  110. />
  111. <van-popup v-model="showAssetStatus" position="bottom">
  112. <van-picker
  113. show-toolbar
  114. :columns="assetStatusOptions"
  115. @confirm="onConfirmAssetStatus"
  116. @cancel="showAssetStatus = false"
  117. />
  118. </van-popup>
  119. <van-field v-model="form.remark" label="备注" placeholder="备注" input-align="right" :border="false" />
  120. </div>
  121. <!-- <div class="list_main">-->
  122. <!-- <div class="titBox">-->
  123. <!-- <img src="../../assets/images/sunVillage_info/add_icon_1.png" style="width:22PX;height:22PX;margin-right: 10px;"/>-->
  124. <!-- <p class="tit">未承包到户</p>-->
  125. <!-- </div>-->
  126. <!-- <van-field v-model="form.sumArea" label="总面积(亩)" placeholder="总面积(亩)" input-align="right" :border="false" />-->
  127. <!-- <van-divider>集体经营</van-divider>-->
  128. <!-- <van-field v-model="form.groupArea" label="面积(亩)" placeholder="面积(亩)" input-align="right" :border="false" />-->
  129. <!-- <van-field v-model="form.groupValue" label="年收益(元)" placeholder="年收益(元)" input-align="right" :border="false" />-->
  130. <!-- <van-divider>出租经营</van-divider>-->
  131. <!-- <van-field v-model="form.rentArea" label="面积(亩)" placeholder="面积(亩)" input-align="right" :border="false" />-->
  132. <!-- <van-field v-model="form.rentValue" label="年租金(元)" placeholder="年租金(元)" input-align="right" :border="false" />-->
  133. <!-- <van-field v-model="form.rentLessee" label="承租人" placeholder="承租人" input-align="right" :border="false" />-->
  134. <!-- <van-field-->
  135. <!-- autocomplete="off"-->
  136. <!-- input-align="right"-->
  137. <!-- v-model="form.rentStartTime"-->
  138. <!-- name="开始时间"-->
  139. <!-- label="开始时间"-->
  140. <!-- placeholder="开始时间"-->
  141. <!-- readonly-->
  142. <!-- @click="showStartTime = true"-->
  143. <!-- :border="false"-->
  144. <!-- />-->
  145. <!-- <van-popup v-model:show="showStartTime" position="bottom">-->
  146. <!-- <van-datetime-picker-->
  147. <!-- type="date"-->
  148. <!-- v-model="buildTime"-->
  149. <!-- @confirm="onConfirStartTime"-->
  150. <!-- @cancel="showStartTime = false"-->
  151. <!-- :min-date="minDate"-->
  152. <!-- />-->
  153. <!-- </van-popup>-->
  154. <!-- <van-field-->
  155. <!-- autocomplete="off"-->
  156. <!-- input-align="right"-->
  157. <!-- v-model="form.rentEndTime"-->
  158. <!-- name="到期时间"-->
  159. <!-- label="到期时间"-->
  160. <!-- placeholder="到期时间"-->
  161. <!-- readonly-->
  162. <!-- @click="showEndTime = true"-->
  163. <!-- :border="false"-->
  164. <!-- />-->
  165. <!-- <van-popup v-model:show="showEndTime" position="bottom">-->
  166. <!-- <van-datetime-picker-->
  167. <!-- type="date"-->
  168. <!-- v-model="buildTime"-->
  169. <!-- @confirm="onConfirEndTime"-->
  170. <!-- @cancel="showEndTime = false"-->
  171. <!-- :min-date="minDate"-->
  172. <!-- />-->
  173. <!-- </van-popup>-->
  174. <!--&lt;!&ndash; <van-field v-model="form.rentStartTime" label="开始时间" placeholder="开始时间" input-align="right" :border="false" />&ndash;&gt;-->
  175. <!--&lt;!&ndash; <van-field v-model="form.rentEndTime" label="到期时间" placeholder="到期时间" input-align="right" :border="false" />&ndash;&gt;-->
  176. <!-- <van-divider>其他经营</van-divider>-->
  177. <!-- <van-field v-model="form.otherArea" label="面积(亩)" placeholder="面积(亩)" input-align="right" :border="false" />-->
  178. <!-- <van-field v-model="form.otherValue" label="年收益(元)" placeholder="年收益(元)" input-align="right" :border="false" />-->
  179. <!-- </div>-->
  180. <!-- <div class="list_main">-->
  181. <!-- <div class="titBox">-->
  182. <!-- <img src="../../assets/images/sunVillage_info/add_icon_1.png" style="width:22PX;height:22PX;margin-right: 10px;"/>-->
  183. <!-- <p class="tit">已承包到户</p>-->
  184. <!-- </div>-->
  185. <!-- <van-field v-model="form.farmerArea" label="总面积(亩)" placeholder="总面积(亩)" input-align="right" :border="false" />-->
  186. <!-- <van-divider>流转入集体统一经营</van-divider>-->
  187. <!-- <van-field v-model="form.circulationArea" label="面积(亩)" placeholder="面积(亩)" input-align="right" :border="false" />-->
  188. <!-- <van-field v-model="form.circulationValue" label="年收益(元)" placeholder="年收益(元)" input-align="right" :border="false" />-->
  189. <!-- </div>-->
  190. <div style="margin: 16px auto;width: 50%;">
  191. <van-button round block type="primary" native-type="submit">
  192. 保存
  193. </van-button>
  194. </div>
  195. </van-form>
  196. </div>
  197. </template>
  198. <script>
  199. import { updateResource,getResource } from "@/api/sunVillage_info/fixedAssets";
  200. import FieldSelect from "@/components/form/FieldSelect.vue";
  201. export default {
  202. name: "certificateList",
  203. components: {FieldSelect},
  204. data() {
  205. return {
  206. // 资源分类字典
  207. resourceTypeOptions: [],
  208. //农用地资源类型字典
  209. farmingResourceTypeOptions: [],
  210. //建设用地资源类型字典
  211. buildResourceTypeOptions: [],
  212. //未利用地、林木用地资源类型字典
  213. unusedResourceTypeOptions: [],
  214. showStartTime:false,
  215. showEndTime:false,
  216. showResourceType:false,
  217. resourceType:'',
  218. showResourceSort:false,
  219. resourceSort:'',
  220. minDate:new Date(1900,1,1),
  221. applicationList:[],
  222. applicationListSecond:[],
  223. form:{
  224. assetType:'151001',
  225. operationType: null,
  226. addType:'1',
  227. buildTime:this.format(new Date(),'yyyy-MM-dd'),
  228. useType:'1',
  229. assetStatus:'1',
  230. isMin:'Y',
  231. isFormAsset:'N',
  232. quantity:1.00,
  233. depreciationSubject:"152:累计折旧",
  234. fixedSubject:"153:固定资产清理",
  235. depreciationFeeSubject:"541005:管理费用-折旧及修理费",
  236. depreciationType:'3',
  237. expectedYears:1,
  238. depreciationYears:0,
  239. netValue:0.00,
  240. originalValue:0.00,
  241. residualsRate:1,
  242. netSalvage:0.00,
  243. fixedValue:null,
  244. perYearDepreciationValue:null,
  245. depreciationValue:0
  246. },
  247. //资产类别
  248. assetType:'房屋及建筑物',
  249. showAssetType:false,
  250. resourceSortOptions:[],
  251. //经营属性
  252. operationType:'经营性',
  253. showOperationType:false,
  254. operationTypeOptions:[],
  255. //增加方式
  256. addTypeOptions:[],
  257. showAddType:false,
  258. addType:'购入',
  259. //使用情况
  260. useTypeOptions:[],
  261. showUseType:false,
  262. useType:'自用',
  263. //资产状态
  264. assetStatusOptions:[],
  265. showAssetStatus:false,
  266. assetStatus:'正常',
  267. //资产状态
  268. depreciationTypeOptions:[],
  269. showDepreciationType:false,
  270. depreciationType:'不折旧',
  271. showBuildTime:false,
  272. auditStatus:[],
  273. loading: false,
  274. finished: false,
  275. listLength:'0',
  276. searchInput:'',
  277. queryParams:{
  278. pageNum:1,
  279. pageSize:10,
  280. orderByColumn:'createTime',
  281. isAsc:'desc',
  282. name:'',
  283. },
  284. buildTime:new Date()
  285. };
  286. },
  287. created() {
  288. this.houseGetDicts("resource_sort").then((response) => {
  289. for(var i = 0 ; i < response.data.length ; i++){
  290. this.resourceSortOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  291. }
  292. });
  293. this.houseGetDicts("operation_type").then((response) => {
  294. for(var i = 0 ; i < response.data.length ; i++){
  295. this.operationTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  296. }
  297. });
  298. this.houseGetDicts("add_type").then((response) => {
  299. for(var i = 0 ; i < response.data.length ; i++){
  300. this.addTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  301. }
  302. });
  303. this.houseGetDicts("use_type").then((response) => {
  304. for(var i = 0 ; i < response.data.length ; i++){
  305. this.useTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  306. }
  307. });
  308. this.houseGetDicts("sys_normal_disable").then((response) => {
  309. for(var i = 0 ; i < response.data.length ; i++){
  310. this.assetStatusOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  311. }
  312. });
  313. this.houseGetDicts("depreciation_type").then((response) => {
  314. for(var i = 0 ; i < response.data.length ; i++){
  315. this.depreciationTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  316. }
  317. });
  318. this.houseGetDicts("resource_type").then((response) => {
  319. this.resourceTypeOptionsSelect = response.data;
  320. for(var i = 0 ; i < response.data.length ; i++){
  321. this.resourceTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  322. }
  323. });
  324. this.houseGetDicts("resource_farming_type").then((response) => {
  325. this.farmingResourceTypeOptionsSelect = response.data;
  326. });
  327. this.houseGetDicts("resources_build_type").then((response) => {
  328. this.buildResourceTypeOptionsSelect = response.data;
  329. });
  330. this.houseGetDicts("resources_unused_type").then((response) => {
  331. this.unusedResourceTypeOptionsSelect = response.data;
  332. });
  333. this.getDetail();
  334. },
  335. methods: {
  336. getDetail(){
  337. getResource(this.$route.query.id).then(response => {
  338. this.form = response.data;
  339. this.resourceType = this.selectDictLabel(this.resourceTypeOptionsSelect, response.data.resourceType);
  340. if(response.data.resourceType == 1){
  341. this.resourceSort = this.selectDictLabel(this.farmingResourceTypeOptionsSelect, response.data.resourceSort);
  342. }
  343. if(response.data.resourceType == 2){
  344. this.resourceSort = this.selectDictLabel(this.buildResourceTypeOptionsSelect, response.data.resourceSort);
  345. }
  346. if(response.data.resourceType == 3){
  347. this.resourceSort = this.selectDictLabel(this.unusedResourceTypeOptionsSelect, response.data.resourceSort);
  348. }
  349. });
  350. },
  351. onConfirStartTime(val){
  352. let year = val.getFullYear()
  353. let month = val.getMonth() + 1
  354. let day = val.getDate()
  355. if (month >= 1 && month <= 9) { month = `0${month}` }
  356. if (day >= 1 && day <= 9) { day = `0${day}` }
  357. this.form.rentStartTime = year+"-"+month+"-"+day
  358. this.showStartTime= false
  359. },
  360. onConfirEndTime(val){
  361. let year = val.getFullYear()
  362. let month = val.getMonth() + 1
  363. let day = val.getDate()
  364. if (month >= 1 && month <= 9) { month = `0${month}` }
  365. if (day >= 1 && day <= 9) { day = `0${day}` }
  366. this.form.rentEndTime = year+"-"+month+"-"+day
  367. this.showEndTime= false
  368. },
  369. onConfirmResourceType(data){
  370. this.resourceType = data.text;
  371. this.form.resourceType = data.value;
  372. this.showResourceType = false;
  373. this.farmingResourceTypeOptions = [];
  374. this.resourceSort = '';
  375. this.form.resourceSort = '';
  376. if (data.value == '1'){//农用地
  377. this.houseGetDicts("resource_farming_type").then((response) => {
  378. for(var i = 0 ; i < response.data.length ; i++){
  379. this.farmingResourceTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  380. }
  381. });
  382. }
  383. if (data.value == '2'){//建设用地
  384. this.houseGetDicts("resources_build_type").then((response) => {
  385. for(var i = 0 ; i < response.data.length ; i++){
  386. this.farmingResourceTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  387. }
  388. });
  389. }
  390. if (data.value == '3'){//未利用地
  391. this.houseGetDicts("resources_unused_type").then((response) => {
  392. for(var i = 0 ; i < response.data.length ; i++){
  393. this.farmingResourceTypeOptions.push({text:response.data[i].dictLabel,value:response.data[i].dictValue});
  394. }
  395. });
  396. }
  397. },
  398. onConfirmResourceSort(data){
  399. this.resourceSort = data.text;
  400. this.form.resourceSort = data.value;
  401. this.showResourceSort = false;
  402. },
  403. onConfirmUseType(data){
  404. this.useType = data.text;
  405. this.form.useType = data.value;
  406. this.showUseType = false;
  407. },
  408. onConfirmAssetStatus(data){
  409. this.assetStatus = data.text;
  410. this.form.status = data.value;
  411. this.showAssetStatus = false;
  412. },
  413. onSubmit(){
  414. updateResource(this.form).then(response => {
  415. if (response.code == 200){
  416. this.$notify({ type: 'success', message: '修改成功' });
  417. setTimeout(function(){
  418. history.back(-1);
  419. },2000)
  420. }
  421. });
  422. }
  423. },
  424. }
  425. </script>
  426. <style scoped lang="scss">
  427. /deep/ .van-button--primary{
  428. background: url("../../assets/images/sunVillage_info/btn_bg.png") no-repeat;
  429. background-size: 100% 100%;
  430. border: none;
  431. }
  432. .home_wrapper{
  433. background: #e9e9e9;
  434. min-height: 100vh;
  435. width: 100vw;
  436. .header_main {
  437. height: 116px;
  438. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  439. background-size: 100% 100%;
  440. position: fixed;
  441. top: 0;
  442. left: 0;
  443. width: 100%;
  444. font-size: 36px;
  445. line-height: 116px;
  446. text-align: center;
  447. color: #fff;
  448. position: relative;
  449. .return_btn {
  450. width: 24px;
  451. height: 43.2px;
  452. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  453. background-size: 20px 36px;
  454. position: absolute;
  455. left: 38px;
  456. top: 36px;
  457. }
  458. .add_btn {
  459. width: 56.4px;
  460. height: 40.8px;
  461. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  462. background-size: 47px 34px;
  463. position: absolute;
  464. right: 38px;
  465. top: 36px;
  466. }
  467. }
  468. .list_main{
  469. padding:25px;
  470. background: #ffffff;
  471. width: 94%;
  472. margin: 25px auto 0;
  473. border-radius: 15PX;
  474. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  475. }
  476. .titBox{
  477. display: flex;
  478. align-items: center;
  479. }
  480. .tit{
  481. font-size: 36px;
  482. font-weight: bold;
  483. }
  484. /deep/ .van-cell{
  485. padding-left: 0!important;
  486. padding-right: 0!important;
  487. padding-bottom: 0!important;
  488. }
  489. /deep/ .van-field__label{
  490. padding-left: 10PX;
  491. width: 8.2em;
  492. }
  493. /deep/ .van-cell--required::before{
  494. left: 0;
  495. }
  496. }
  497. </style>