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

преди 2 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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="list_main">
  8. <div class="titBox">
  9. <img src="../../assets/images/sunVillage_info/add_icon_1.png" style="width:22PX;height:22PX;margin-right: 10px;"/>
  10. <p class="tit">基本信息</p>
  11. </div>
  12. <van-field readonly required :rules="[{ required: true, message: '请填写资产名称' }]" v-model="form.name" label="资产名称" placeholder="资产名称" input-align="right" :border="false" />
  13. <van-field readonly v-model="form.code" label="资产编码" placeholder="资产编码" input-align="right" :border="false" />
  14. <van-field
  15. readonly
  16. clickable
  17. label="资产类别"
  18. placeholder="请选择"
  19. v-model="assetType"
  20. input-align="right"
  21. right-icon="arrow-down"
  22. label-width="auto"
  23. required
  24. :border="false"
  25. :rules="[{ required: true , message:'请选择资产类别' }]"
  26. />
  27. <van-popup v-model="showAssetType" position="bottom">
  28. <van-picker
  29. show-toolbar
  30. :columns="assetTypeOptions"
  31. @confirm="onConfirmAssetType"
  32. @cancel="showAssetType = false"
  33. />
  34. </van-popup>
  35. <van-field
  36. readonly
  37. clickable
  38. label="经营属性"
  39. placeholder="请选择"
  40. v-model="operationType"
  41. input-align="right"
  42. right-icon="arrow-down"
  43. label-width="auto"
  44. required
  45. :border="false"
  46. :rules="[{ required: true , message:'请选择经营属性' }]"
  47. />
  48. <van-popup v-model="showOperationType" position="bottom">
  49. <van-picker
  50. show-toolbar
  51. :columns="operationTypeOptions"
  52. @confirm="onConfirmOperationType"
  53. @cancel="showOperationType = false"
  54. />
  55. </van-popup>
  56. <van-field
  57. readonly
  58. clickable
  59. label="增加方式"
  60. placeholder="请选择"
  61. v-model="addType"
  62. input-align="right"
  63. right-icon="arrow-down"
  64. label-width="auto"
  65. required
  66. :border="false"
  67. :rules="[{ required: true , message:'请选择增加方式' }]"
  68. />
  69. <van-popup v-model="showAddType" position="bottom">
  70. <van-picker
  71. show-toolbar
  72. :columns="addTypeOptions"
  73. @confirm="onConfirmAddType"
  74. @cancel="showAddType = false"
  75. />
  76. </van-popup>
  77. <van-field
  78. readonly
  79. clickable
  80. label="购建时间"
  81. placeholder="请选择"
  82. v-model="form.buildTime"
  83. input-align="right"
  84. right-icon="arrow-down"
  85. label-width="auto"
  86. required
  87. :border="false"
  88. :rules="[{ required: true , message:'请选择购建时间' }]"
  89. />
  90. <van-popup v-model="showBuildTime" position="bottom">
  91. <van-datetime-picker
  92. type="date"
  93. title="选择年月日"
  94. @confirm="onConfirmBuildTime"
  95. @cancel="showBuildTime = false"
  96. />
  97. </van-popup>
  98. <van-field readonly v-model="form.location" label="坐落位置" placeholder="坐落位置" input-align="right" :border="false" />
  99. <van-field readonly v-model="form.specification" label="规格型号" placeholder="规格型号" input-align="right" :border="false" />
  100. <van-field readonly v-model="form.supplier" label="供应商" placeholder="供应商" input-align="right" :border="false" />
  101. <van-field
  102. readonly
  103. clickable
  104. label="使用情况"
  105. placeholder="请选择"
  106. v-model="useType"
  107. input-align="right"
  108. right-icon="arrow-down"
  109. label-width="auto"
  110. required
  111. :border="false"
  112. :rules="[{ required: true , message:'请选择使用情况' }]"
  113. />
  114. <van-popup v-model="showUseType" position="bottom">
  115. <van-picker
  116. show-toolbar
  117. :columns="useTypeOptions"
  118. @confirm="onConfirmUseType"
  119. @cancel="showUseType = false"
  120. />
  121. </van-popup>
  122. <van-field
  123. readonly
  124. clickable
  125. label="资产状态"
  126. placeholder="请选择"
  127. v-model="assetStatus"
  128. input-align="right"
  129. right-icon="arrow-down"
  130. label-width="auto"
  131. required
  132. :border="false"
  133. :rules="[{ required: true , message:'请选择资产状态' }]"
  134. />
  135. <van-popup v-model="showAssetStatus" position="bottom">
  136. <van-picker
  137. show-toolbar
  138. :columns="assetStatusOptions"
  139. @confirm="onConfirmAssetStatus"
  140. @cancel="showAssetStatus = false"
  141. />
  142. </van-popup>
  143. <van-field name="radio" label="单元资产" input-align="right" :border="false">
  144. <template #input>
  145. <van-radio-group v-model="form.isMin" direction="horizontal">
  146. <van-radio name="Y" disabled>是</van-radio>
  147. <van-radio name="N" disabled>否</van-radio>
  148. </van-radio-group>
  149. </template>
  150. </van-field>
  151. <van-field name="radio" label="扶贫资产" input-align="right" :border="false">
  152. <template #input>
  153. <van-radio-group v-model="form.isFormAsset" direction="horizontal">
  154. <van-radio name="Y" disabled>是</van-radio>
  155. <van-radio name="N" disabled>否</van-radio>
  156. </van-radio-group>
  157. </template>
  158. </van-field>
  159. </div>
  160. <div class="list_main">
  161. <div class="titBox">
  162. <img src="../../assets/images/sunVillage_info/add_icon_1.png" style="width:22PX;height:22PX;margin-right: 10px;"/>
  163. <p class="tit">资产数据</p>
  164. </div>
  165. <van-field required label="数量/面积" input-align="right" :border="false">
  166. <template #input>
  167. <van-stepper disabled v-model="form.quantity" input-width="100" :decimal-length="2" />
  168. </template>
  169. </van-field>
  170. <van-field required :rules="[{ required: true, message: '请填写计量单位' }]" v-model="form.unit" label="计量单位" placeholder="计量单位" input-align="right" :border="false" />
  171. <van-field required label="原值(元)" input-align="right" :border="false">
  172. <template #input>
  173. <van-stepper disabled v-model="form.originalValue" input-width="100" min="0.00" :decimal-length="2" @change="changeOriginalValue"/>
  174. </template>
  175. </van-field>
  176. <van-field label="净值(元)" input-align="right" :border="false">
  177. <template #input>
  178. <van-stepper v-model="form.netValue" disabled input-width="100" min="0.00" :decimal-length="2" />
  179. </template>
  180. </van-field>
  181. <van-field label="残值率N%" input-align="right" :border="false">
  182. <template #input>
  183. <van-stepper disabled v-model="form.residualsRate" input-width="100" @change="changeResidualsRate"/>
  184. </template>
  185. </van-field>
  186. <van-field label="净残值(元)" input-align="right" :border="false">
  187. <template #input>
  188. <van-stepper disabled v-model="form.netSalvage" input-width="100" min="0.00" :decimal-length="2" @change="changeNetSalvage" />
  189. </template>
  190. </van-field>
  191. <van-field readonly v-model="form.fixedValue" label="资产清理(元)" placeholder="无需输入" input-align="right" :border="false" />
  192. <van-field readonly v-model="form.fixedSubject" label="资产清理科目" placeholder="资产清理科目" input-align="right" :border="false" />
  193. <van-field readonly v-model="form.depreciationSubject" label="折旧科目" placeholder="折旧科目" input-align="right" :border="false" />
  194. <van-field readonly v-model="form.depreciationFeeSubject" label="折旧费用科目" placeholder="折旧费用科目" input-align="right" :border="false" />
  195. <van-field readonly v-model="form.remark" label="备注" placeholder="备注" input-align="right" :border="false" />
  196. </div>
  197. <div class="list_main">
  198. <div class="titBox">
  199. <img src="../../assets/images/sunVillage_info/add_icon_1.png" style="width:22PX;height:22PX;margin-right: 10px;"/>
  200. <p class="tit">折旧方式</p>
  201. </div>
  202. <van-field
  203. readonly
  204. clickable
  205. label="折旧方式"
  206. placeholder="请选择"
  207. v-model="depreciationType"
  208. input-align="right"
  209. right-icon="arrow-down"
  210. label-width="auto"
  211. required
  212. :border="false"
  213. :rules="[{ required: true , message:'请选择折旧方式' }]"
  214. />
  215. <van-popup v-model="showDepreciationType" position="bottom">
  216. <van-picker
  217. show-toolbar
  218. :columns="depreciationTypeOptions"
  219. @confirm="onConfirmDepreciationType"
  220. @cancel="showDepreciationType = false"
  221. />
  222. </van-popup>
  223. <van-field label="预计使用期数" input-align="right" :border="false">
  224. <template #input>
  225. <van-stepper disabled v-model="form.expectedYears" input-width="100" @change="changeExpectedYears" />
  226. </template>
  227. </van-field>
  228. <van-field readonly v-model="form.perYearDepreciationValue" label="每期折旧额" placeholder="(原值-净残值)/预计使用期数" input-align="right" :border="false" />
  229. <van-field label="已折旧期数" input-align="right" :border="false">
  230. <template #input>
  231. <van-stepper disabled v-model="form.depreciationYears" input-width="100" min="0" @change="changeDepreciationYears" />
  232. </template>
  233. </van-field>
  234. <van-field readonly v-model="form.depreciationValue" label="累计折旧(元)" placeholder="0" input-align="right" :border="false" @change="changeDepreciationValue" />
  235. </div>
  236. </div>
  237. </template>
  238. <script>
  239. import { getPermanent } from "@/api/sunVillage_info/fixedAssets";
  240. export default {
  241. name: "certificateList",
  242. data() {
  243. return {
  244. applicationList:[],
  245. applicationListSecond:[],
  246. assetStatusOptions:[],
  247. form:{
  248. },
  249. //资产类别
  250. assetType:'房屋及建筑物',
  251. showAssetType:false,
  252. assetTypeOptions:[],
  253. //经营属性
  254. operationType:'经营性',
  255. showOperationType:false,
  256. operationTypeOptions:[],
  257. //增加方式
  258. addTypeOptions:[],
  259. showAddType:false,
  260. addType:'购入',
  261. //使用情况
  262. useTypeOptions:[],
  263. showUseType:false,
  264. useType:'自用',
  265. //资产状态
  266. assetStatusOptions:[],
  267. showAssetStatus:false,
  268. assetStatus:'正常',
  269. //资产状态
  270. depreciationTypeOptions:[],
  271. showDepreciationType:false,
  272. depreciationType:'不折旧',
  273. showBuildTime:false,
  274. auditStatus:[],
  275. loading: false,
  276. finished: false,
  277. listLength:'0',
  278. searchInput:'',
  279. queryParams:{
  280. pageNum:1,
  281. pageSize:10,
  282. orderByColumn:'createTime',
  283. isAsc:'desc',
  284. name:'',
  285. }
  286. };
  287. },
  288. created() {
  289. this.houseGetDicts("asset_type").then((response) => {
  290. this.assetTypeOptions = response.data;
  291. });
  292. this.houseGetDicts("operation_type").then((response) => {
  293. this.operationTypeOptions = response.data;
  294. });
  295. this.houseGetDicts("add_type").then((response) => {
  296. this.addTypeOptions = response.data;
  297. });
  298. this.houseGetDicts("use_type").then((response) => {
  299. this.useTypeOptions = response.data;
  300. });
  301. this.houseGetDicts("asset_status").then((response) => {
  302. this.assetStatusOptions = response.data;
  303. });
  304. this.houseGetDicts("depreciation_type").then((response) => {
  305. this.depreciationTypeOptions = response.data;
  306. });
  307. this.getDetail(this.$route.query.id)
  308. },
  309. methods: {
  310. getDetail(id){
  311. getPermanent(id).then((response) => {
  312. if (response.code == 200){
  313. this.form = response.data;
  314. this.assetType = this.selectDictLabel(this.assetTypeOptions, response.data.assetType);
  315. this.operationType = this.selectDictLabel(this.operationTypeOptions, response.data.operationType);
  316. this.addType = this.selectDictLabel(this.addTypeOptions, response.data.addType);
  317. this.useType = this.selectDictLabel(this.useTypeOptions, response.data.useType);
  318. this.assetStatus = this.selectDictLabel(this.assetStatusOptions, response.data.assetStatus);
  319. this.depreciationType = this.selectDictLabel(this.depreciationTypeOptions, response.data.depreciationType);
  320. }
  321. });
  322. },
  323. onConfirmAssetType(data){
  324. this.assetType = data.text;
  325. this.form.assetType = data.value;
  326. this.showAssetType = false;
  327. },
  328. onConfirmOperationType(data){
  329. this.operationType = data.text;
  330. this.form.operationType = data.value;
  331. this.showOperationType = false;
  332. },
  333. onConfirmAddType(data){
  334. this.addType = data.text;
  335. this.form.addType = data.value;
  336. this.showAddType = false;
  337. },
  338. onConfirmUseType(data){
  339. this.useType = data.text;
  340. this.form.useType = data.value;
  341. this.showUseType = false;
  342. },
  343. onConfirmAssetStatus(data){
  344. this.assetStatus = data.text;
  345. this.form.assetStatus = data.value;
  346. this.showAssetStatus = false;
  347. },
  348. onConfirmDepreciationType(data){
  349. this.depreciationType = data.text;
  350. this.form.depreciationType = data.value;
  351. this.showDepreciationType = false;
  352. },
  353. onConfirmBuildTime(data){
  354. this.form.buildTime = this.format(data,'yyyy-MM-dd');
  355. this.showBuildTime = false;
  356. },
  357. // 原值变动监听
  358. changeOriginalValue(val) {
  359. if (this.form.depreciationValue != null) {
  360. // 净值 = 原值-累计折旧
  361. this.form.netValue = val - this.form.depreciationValue;
  362. }
  363. if (this.form.residualsRate != null) {
  364. // 净残值 = 原值*残值率
  365. this.form.netSalvage = (val * this.form.residualsRate) / 100;
  366. }
  367. if (this.form.netSalvage != null && this.form.expectedYears != null) {
  368. // 每年折旧额 = (原值-净残值)/ 预计使用年数
  369. this.form.perYearDepreciationValue =
  370. (val - this.form.netSalvage) / this.form.expectedYears;
  371. }
  372. },
  373. // 累计折旧变动监听
  374. changeDepreciationValue(val) {
  375. if (this.form.originalValue != null) {
  376. // 净值 = 原值-累计折旧
  377. this.form.netValue = this.form.originalValue - val;
  378. }
  379. },
  380. // 残值率变动监听
  381. changeResidualsRate(val) {
  382. if (this.form.originalValue != null) {
  383. // 净残值 = 原值*残值率
  384. this.form.netSalvage = (this.form.originalValue * val) / 100;
  385. }
  386. },
  387. // 净残值变动监听
  388. changeNetSalvage(val) {
  389. if (this.form.originalValue != null && this.form.expectedYears != null) {
  390. // 每年折旧额 = (原值-净残值)/ 预计使用年数
  391. this.form.perYearDepreciationValue =
  392. (this.form.originalValue - val) / this.form.expectedYears;
  393. }
  394. },
  395. // 预计使用年数变动监听
  396. changeExpectedYears(val) {
  397. if (this.form.originalValue != null && this.form.netSalvage != null) {
  398. // 每年折旧额:(原值-净残值)/ 预计使用年数
  399. this.form.perYearDepreciationValue =
  400. (this.form.originalValue - this.form.netSalvage) / val;
  401. }
  402. },
  403. // 已折旧年数变动监听
  404. changeDepreciationYears(val) {
  405. if (this.form.perYearDepreciationValue != null) {
  406. this.form.depreciationValue = val * this.form.perYearDepreciationValue;
  407. }
  408. },
  409. },
  410. }
  411. </script>
  412. <style scoped lang="scss">
  413. .home_wrapper{
  414. background: #e9e9e9;
  415. min-height: 100vh;
  416. width: 100vw;
  417. .header_main {
  418. height: 116px;
  419. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  420. background-size: 100% 100%;
  421. position: fixed;
  422. top: 0;
  423. left: 0;
  424. width: 100%;
  425. font-size: 36px;
  426. line-height: 116px;
  427. text-align: center;
  428. color: #fff;
  429. position: relative;
  430. .return_btn {
  431. width: 24px;
  432. height: 43.2px;
  433. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  434. background-size: 20px 36px;
  435. position: absolute;
  436. left: 38px;
  437. top: 36px;
  438. }
  439. .add_btn {
  440. width: 56.4px;
  441. height: 40.8px;
  442. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  443. background-size: 47px 34px;
  444. position: absolute;
  445. right: 38px;
  446. top: 36px;
  447. }
  448. }
  449. .list_main{
  450. padding:25px;
  451. background: #ffffff;
  452. width: 94%;
  453. margin: 25px auto 0;
  454. border-radius: 15PX;
  455. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  456. }
  457. .titBox{
  458. display: flex;
  459. align-items: center;
  460. }
  461. .tit{
  462. font-size: 36px;
  463. font-weight: bold;
  464. }
  465. /deep/ .van-cell{
  466. padding-left: 0!important;
  467. padding-right: 0!important;
  468. padding-bottom: 0!important;
  469. }
  470. /deep/ .van-field__label{
  471. padding-left: 10PX;
  472. width: 8.2em;
  473. }
  474. /deep/ .van-cell--required::before{
  475. left: 0;
  476. }
  477. }
  478. </style>