1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<template>
<div>
<van-form @submit="onSubmit">
<table>
<tr>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" type="number" format-trigger="reset" v-model="noManufacturingObject.GPM"
label="销售毛利率(%)" size="small" />
</td>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" format-trigger="reset" v-model="noManufacturingObject.ROE" type="number" label="净资产收益率(%)"
size="small" />
</td>
</tr>
<tr>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" type="number" format-trigger="reset" v-model="noManufacturingObject.ASSET"
label="资产负债率(%)" size="small" />
</td>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" format-trigger="reset"
v-model="noManufacturingObject.EARNED" label="已获利息倍数" type="number" size="small" />
</td>
</tr>
<tr>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" format-trigger="reset"
v-model="noManufacturingObject.InterBearing" type="number" label="有息负债率(%)" size="small" />
</td>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" format-trigger="reset"
v-model="noManufacturingObject.ACCRECETRUN" type="number" label="应收账款周转率(%)" size="small" />
</td>
</tr>
<tr>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" format-trigger="reset" v-model="noManufacturingObject.DEPTURN"
label="存款周转率(%)" type="number" size="small" />
</td>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" format-trigger="reset"
v-model="noManufacturingObject.FAT" type="number" label="固定资产周转率(%)" size="small" />
</td>
</tr>
<tr>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: '必须为正整数或者小数' }]" :required="true" format-trigger="reset" v-model="noManufacturingObject.ITR"
label="存货周转率(%)" type="number" size="small" />
</td>
<td>
<mobile-input :formatter="formatter" :required="true" type="number" format-trigger="reset" v-model="noManufacturingObject.SARE"
label="销售收入(元)" size="small" />
</td>
</tr>
<tr>
<td>
<mobile-input :formatter="formatter" :rules="[{ pattern, message: '年限为整数' }]" :required="true" format-trigger="reset" v-model="noManufacturingObject.ESYEAR"
label="成立年限" type="digit" size="small" />
</td>
<td>
<mobile-input :formatter="formatter" :rules="[{ validator: testFloat, message: floatMsg }]" :required="true" format-trigger="reset" v-model="noManufacturingObject.TASS"
label="总资产(元)" type="digit" size="small" />
</td>
</tr>
<tr>
<td colspan="2">
<mobile-input :required="true" :rules="[{ validator: testFloat, message: floatMsg }]" :formatter="formatter" format-trigger="reset" v-model="noManufacturingObject.NASS"
label="净资产(元)" type="number" size="small" />
</td>
</tr>
<tr>
<td colspan="2">
<div style="margin: 16px; display: flex; justify-content: space-around">
<van-button @click="reset" style="width: 25%" round color="#999999" native-type="button" plain>重置</van-button>
<van-button style="width: 25%" round type="info" native-type="submit">试算</van-button>
</div>
</td>
</tr>
</table>
</van-form>
<van-dialog
:show-cancel-button="false"
:show-confirm-button="false"
:close-on-click-overlay="true"
v-model="showDialogReject"
>
<div class="dialog-box" style="position: relative">
<div class="dialog-title">测算结果</div>
<div class="score-box">{{ totalScore }}</div>
<svg class="icon icon-img" aria-hidden="true">
<use xlink:href="#icon-a-cepingjieguo110x110ziyuan40"></use>
</svg>
<van-button class="submitstyle3" block native-type="button" @click="showDialogReject = false">
知道了
</van-button>
</div>
</van-dialog>
</div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import systemApi from "@/constants/api/ms-system/system.api.ts";
import IF from "@/public/factory/InterFaceFactory";
import { NativeUI } from "@/public/ts/NativeUI";
/**
* @Description 非制造业试算
* @Author 王航
* @Date 2022-2-23 下午 04:32
*/
@Component({
name: "NoManufacturingTrial"
})
export default class NoManufacturingTrial extends Vue {
noManufacturingObject:any = {
//非制造业对象
GPM: '', //销售毛利率
ROE: '', //净资产收益率
ASSET: '', //资产负债率
EARNED: '', //已获息倍数
InterBearing: '', //有息负债率
ACCRECETRUN: '', //应收账款周转率
DEPTURN: '', //存款周转率
FAT: '', //固定资产周转率
ITR: '', //存货周转率
SARE: '', //销售收入
ESYEAR: '', //成立年限
TASS: '', //总资产
NASS: '' //净资产
};
pattern = /^[1-9]\d*$/; //整数校验
totalScore:any= ''; //总分数
showDialogReject= false;
floatMsg= ''; //浮点数验证信息
formatter() {
}
onSubmit(values: any) {
// console.log("submit", values);
this.selectCompanyComputeInfo();
}
selectCompanyComputeInfo() {
let param = {
GPM: this.noManufacturingObject.GPM, //销售毛利率
ROE: this.noManufacturingObject.ROE, //净资产收益率
ASSET: this.noManufacturingObject.ASSET, //资产负债率
EARNED: this.noManufacturingObject.EARNED, //已获息倍数
InterBearing: this.noManufacturingObject.InterBearing, //有息负债率
ACCRECETRUN: this.noManufacturingObject.ACCRECETRUN, //应收账款周转率
DEPTURN: this.noManufacturingObject.DEPTURN, //存款周转率
FAT: this.noManufacturingObject.FAT, //固定资产周转率
ITR: this.noManufacturingObject.ITR, //存货周转率
SARE: this.noManufacturingObject.SARE, //销售收入
ESYEAR: this.noManufacturingObject.ESYEAR, //成立年限
TASS: this.noManufacturingObject.TASS, //总资产
NASS: this.noManufacturingObject.NASS, //净资产
COMTYPE: '1' //0表示制造业企业,1表示非制造业
};
NativeUI.showWaiting('正在查询...');
return IF.transferDataInter(systemApi.companyMoneyComputed, param).then((res:any) => {
NativeUI.closeWaiting();
if (res.code == 1) {
this.totalScore = res.data.totalAch; //总分
console.log(this.totalScore);
this.showDialogReject = true;
} else {
NativeUI.toast(res.message);
}
});
}
formatDate(date: any) {
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
}
reset() {
this.noManufacturingObject.GPM = '';
this.noManufacturingObject.ROE = '';
this.noManufacturingObject.ASSET = '';
this.noManufacturingObject.EARNED = '';
this.noManufacturingObject.InterBearing = '';
this.noManufacturingObject.ACCRECETRUN = '';
this.noManufacturingObject.DEPTURN = '';
this.noManufacturingObject.FAT = '';
this.noManufacturingObject.ITR = '';
this.noManufacturingObject.SARE = '';
this.noManufacturingObject.ESYEAR = '';
this.noManufacturingObject.TASS = '';
this.noManufacturingObject.NASS = '';
}
testFloat(val:any) {
if (parseFloat(val) < 0) {
// this.floatMsg = '必须为正数';
return false;
} else {
// this.floatMsg = '必须为整数或者小数';
return /^(-?\d+)(\.\d+)?$/.test(val);
}
}
}
</script>
<style scoped>
table {
width: 90%;
margin: 0 auto;
}
::v-deep .van-button--info {
background-color: #fd5065;
border: 1px solid #fd5065;
}
::v-deep .van-button__text {
font-size: 16px;
}
.dialog-box {
margin: 0 auto;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
width: 300px;
height: 306px;
}
.icon-img {
width: 120px;
height: 120px;
margin-top: 20px;
margin-bottom: 20px;
color: rgb(17, 167, 30);
}
.dialog-title {
font-weight: bold;
margin-top: 10%;
font-size: 16px;
color: #333;
}
.score-box {
position: absolute;
font-size: 36px;
font-weight: 400;
top: 105px;
z-index: 999;
color: #f59a23;
}
.submitstyle3 {
width: 268px;
height: 36px;
border-radius: 6px;
margin-top: 30px;
color: #fff;
background-color: #ff574c;
border-color: #ff574c;
font-size: 16px;
text-align: center;
font-weight: 400;
}
</style>