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

resourceAdd.vue 19 KiB

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