移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

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