keepAccountForm.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. <template>
  2. <el-dialog title="记账信息" v-model="visible" width="90%" append-to-body draggable @close="close" class="dialog-form" :close-on-click-modal = "false">
  3. <!-- <div slot="title" class="dialog-title-container">
  4. <span class="title-label"><i class="el-icon-document" /> 工资信息</span>
  5. <i class="el-icon-close" @click="close" />
  6. </div> -->
  7. <!-- 功能按钮 -->
  8. <div style="padding: 8px 24px 16px 24px">
  9. <el-form size="small" label-width="140px" v-model="form">
  10. <el-row :gutter="30">
  11. <el-col :span="12">
  12. <el-form-item label="客户名称">
  13. <div>{{ form.companyName }}</div>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="12">
  17. <el-form-item label="所属月份">
  18. <div>{{ form.year }}-{{ form.month }}</div>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="12">
  22. <el-form-item label="服务状态">
  23. <el-select v-model="form.status" placeholder="请选择">
  24. <el-option v-for="item in selectStatus" :key="item.value" :value="item.value" :label="item.label" />
  25. </el-select>
  26. </el-form-item>
  27. </el-col>
  28. <el-divider content-position="left">工资</el-divider>
  29. <el-col :span="24" class="details-container">
  30. <!--操作按钮 开始-->
  31. <div class="details-head" style="margin-bottom: 15px; " >
  32. <div class="title">
  33. <i class="fa fa-th-list" aria-hidden="true" /> 工资人员信息
  34. </div>
  35. <el-button type="primary" style="margin-top: 15px;" size="small" icon="plus" @click="handleEmployeeCreate">新增</el-button>
  36. <el-button v-if="selections.length > 0" type="danger" size="small" icon="delete" style="margin-top: 15px;"
  37. @click="handleEmployeeBatchDelete">
  38. 删除</el-button>
  39. </div>
  40. <div class="details-body">
  41. <div>
  42. <el-table ref="sourceTable" :data="form.salary.details" size="small" max-height="490px" border
  43. show-summary :summary-method="getSummaries" highlight-current-row
  44. header-row-class-name="list-header-row" row-class-name="list-row" class="salary-table"
  45. @selection-change="handleCheckChange" @current-change="handleCurrentChange">
  46. <el-table-column type="selection" width="50" align="center" />
  47. <el-table-column type="index" label="序号" width="50" align="center" />
  48. <el-table-column label="员工姓名" width="80" align="center">
  49. <template #default="scope">
  50. <div>
  51. <el-input v-model="scope.row.employeeName" size="small" placeholder="员工姓名"
  52. style="width: 100%" />
  53. </div>
  54. <span style="
  55. color: red;
  56. position: absolute;
  57. z-index: 10;
  58. top: 4px;
  59. right: 12px;
  60. ">*</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="身份证号" width="150" align="center">
  64. <template #default="scope">
  65. <div>
  66. <el-input v-model="scope.row.idCode" size="small" placeholder="身份证号" style="width: 100%" />
  67. </div>
  68. <span style="
  69. color: red;
  70. position: absolute;
  71. z-index: 10;
  72. top: 4px;
  73. right: 12px;
  74. ">*</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="应发工资" width="140" align="center" prop="planSalary">
  78. <template #default="scope">
  79. <div>
  80. <el-input-number v-model="scope.row.planSalary" size="small" placeholder="应发工资" :precision="2"
  81. :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="实发工资" width="140" align="center" prop="actuallySalary">
  86. <template #default="scope">
  87. <div>
  88. <!-- <el-input-number
  89. v-model="scope.row.actuallySalary"
  90. size="small"
  91. placeholder="实发工资"
  92. :precision="2"
  93. :controls="false"
  94. style="width: 100%"
  95. /> -->
  96. {{ rowNum(scope.row.actuallySalary) }}
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="奖金及其他" width="120" align="center" prop="bonusAmount">
  101. <template #default="scope">
  102. <div>
  103. <el-input-number v-model="scope.row.bonusAmount" size="small" placeholder="奖金及其他" :precision="2"
  104. :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  105. </div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="社保" align="center">
  109. <el-table-column label="养老保险" width="120" align="center" prop="endowmentInsurance">
  110. <template #default="scope">
  111. <div>
  112. <el-input-number v-model="scope.row.endowmentInsurance" size="small" placeholder="养老保险"
  113. :precision="2" :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  114. </div>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="医疗保险" width="120" align="center" prop="medicalInsurance">
  118. <template #default="scope">
  119. <div>
  120. <el-input-number v-model="scope.row.medicalInsurance" size="small" placeholder="医疗保险"
  121. :precision="2" :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  122. </div>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="失业险" width="120" align="center" prop="unemploymentBenefit">
  126. <template #default="scope">
  127. <div>
  128. <el-input-number v-model="scope.row.unemploymentBenefit" size="small" placeholder="失业险"
  129. :precision="2" :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  130. </div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="大病险" width="120" align="center" prop="seriousIllnessInsurance">
  134. <template #default="scope">
  135. <div>
  136. <el-input-number v-model="scope.row.seriousIllnessInsurance" size="small" placeholder="大病险"
  137. :precision="2" :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  138. </div>
  139. </template>
  140. </el-table-column>
  141. </el-table-column>
  142. <el-table-column label="公积金" width="120" align="center" prop="housingFund">
  143. <template #default="scope">
  144. <div>
  145. <el-input-number v-model="scope.row.housingFund" size="small" placeholder="住房公积金" :precision="2"
  146. :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  147. </div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="个税" align="center" width="90" prop="currentIndividualIncomeTax">
  151. <template #default="scope">
  152. <div>
  153. <el-input-number v-model="scope.row.currentIndividualIncomeTax" size="small" placeholder="个税"
  154. :precision="2" :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  155. </div>
  156. </template></el-table-column>
  157. <el-table-column label="其他扣款" width="120" align="center" prop="otherCut">
  158. <template #default="scope">
  159. <div>
  160. <el-input-number v-model="scope.row.otherCut" size="small" placeholder="其他扣款" :precision="2"
  161. :controls="false" style="width: 100%" @change="rowChangeSum(scope.row)" />
  162. </div>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="备注" width="85" header-align="center">
  166. <template #default="scope">
  167. <div>
  168. <el-input v-model="scope.row.remark" size="small" placeholder="备注" />
  169. </div>
  170. </template>
  171. </el-table-column>
  172. </el-table>
  173. </div>
  174. </div>
  175. </el-col>
  176. <el-col :span="24">
  177. <el-divider />
  178. </el-col>
  179. <el-col :span="24">
  180. <el-form-item label="合计工资">
  181. {{ form.salary.amount }}
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="24">
  185. <el-form-item label="工资备注">
  186. <el-input v-model.trim="form.salary.content" maxlength="200" show-word-limit type="textarea" rows="2" />
  187. </el-form-item>
  188. </el-col>
  189. <el-divider content-position="left">收票</el-divider>
  190. <el-col :span="12">
  191. <el-form-item label="收入票">
  192. <el-input-number v-model="form.ticket.incomeTicket" size="small" placeholder="收入票" :step="1" step-strictly
  193. :controls="false" style="width: 100%" @change="ticketNumberChange" />
  194. </el-form-item>
  195. </el-col>
  196. <el-col :span="12">
  197. <el-form-item label="成本票">
  198. <el-input-number v-model="form.ticket.costTicket" size="small" placeholder="成本票" :step="1" step-strictly
  199. :controls="false" style="width: 100%" @change="ticketNumberChange" />
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="12">
  203. <el-form-item label="费用票">
  204. <el-input-number v-model="form.ticket.feeTicketNumber" size="small" placeholder="费用票" :step="1"
  205. step-strictly :controls="false" style="width: 100%" @change="ticketNumberChange" />
  206. </el-form-item>
  207. </el-col>
  208. <el-col :span="12">
  209. <el-form-item label="银行对账">
  210. <el-input-number v-model="form.ticket.bankCopyNumber" size="small" placeholder="银行回单" :step="1"
  211. step-strictly :controls="false" style="width: 100%" @change="ticketNumberChange" />
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="12">
  215. <el-form-item label="银行回单">
  216. <el-input-number v-model="form.ticket.bankSlipsNumber" size="small" placeholder="银行回单" :step="1"
  217. step-strictly :controls="false" style="width: 100%" @change="ticketNumberChange" />
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="12">
  221. <el-form-item label="工资单">
  222. <el-input-number v-model="form.ticket.salaryTicket" size="small" placeholder="工资单" :step="1" step-strictly
  223. :controls="false" style="width: 100%" @change="ticketNumberChange" />
  224. </el-form-item>
  225. </el-col>
  226. <el-col :span="12">
  227. <el-form-item label="社保公积金">
  228. <el-input-number v-model="form.ticket.ssafTicket" size="small" placeholder="社保公积金" :step="1" step-strictly
  229. :controls="false" style="width: 100%" @change="ticketNumberChange" />
  230. </el-form-item>
  231. </el-col>
  232. <el-col :span="12">
  233. <el-form-item label="其他票">
  234. <el-input-number v-model="form.ticket.otherTicket" size="small" placeholder="其他票" :step="1" step-strictly
  235. :controls="false" style="width: 100%" @change="ticketNumberChange" />
  236. </el-form-item>
  237. </el-col>
  238. <el-col :span="12">
  239. <el-form-item label="合计">
  240. <div>{{ form.ticket.sumNumber }}</div>
  241. <!-- <el-input-number
  242. v-model="form.ticket.sumNumber"
  243. size="small"
  244. placeholder="合计"
  245. :step="1"
  246. step-strictly
  247. :controls="false"
  248. style="width: 100%"
  249. /> -->
  250. </el-form-item>
  251. </el-col>
  252. <el-col :span="24">
  253. <el-form-item label="备注">
  254. <el-input v-model.trim="form.ticket.content" maxlength="200" show-word-limit type="textarea" rows="2" />
  255. </el-form-item>
  256. </el-col>
  257. <el-divider content-position="left">记账</el-divider>
  258. <el-col :span="12">
  259. <el-form-item label="本期收入">
  260. <el-input-number v-model="form.keepAccount.currentIncome" size="small" placeholder="本期收入" :precision="2"
  261. :controls="false" style="width: 100%" />
  262. </el-form-item>
  263. </el-col>
  264. <el-col :span="12">
  265. <el-form-item label="本年收入">
  266. <el-input-number v-model="form.keepAccount.currentYearIncome" size="small" placeholder="本年收入"
  267. :precision="2" :controls="false" style="width: 100%" />
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="12">
  271. <el-form-item label="本年累计成本">
  272. <el-input-number v-model="form.keepAccount.cumulativeCost" size="small" placeholder="本年累计成本"
  273. :precision="2" :controls="false" style="width: 100%" />
  274. </el-form-item>
  275. </el-col>
  276. <el-col :span="12">
  277. <el-form-item label="本年利润总额">
  278. <el-input-number v-model="form.keepAccount.currentYearProfit" size="small" placeholder="本年利润总额"
  279. :precision="2" :controls="false" style="width: 100%" />
  280. </el-form-item>
  281. </el-col>
  282. <el-col :span="12">
  283. <el-form-item label="是否暂估">
  284. <el-checkbox v-model="form.keepAccount.isProvisionalEstimate" :true-label="1" :false-label="0" />
  285. </el-form-item>
  286. </el-col>
  287. <el-col v-if="form.keepAccount.isProvisionalEstimate === 1" :span="12">
  288. <el-form-item label="暂估金额">
  289. <el-input-number v-model="form.keepAccount.provisionalEstimateAmount" size="small" placeholder="暂估金额"
  290. :precision="2" :controls="false" style="width: 100%" />
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="24">
  294. <el-form-item label="备注">
  295. <el-input v-model.trim="form.keepAccount.content" maxlength="200" show-word-limit type="textarea"
  296. rows="2" />
  297. </el-form-item>
  298. </el-col>
  299. <el-divider content-position="left">报税</el-divider>
  300. <el-col :span="12">
  301. <el-form-item label="可弥补之前年度亏损">
  302. <el-input-number size="small" placeholder="可弥补之前年度亏损" v-model="form.reportTax.previousAnnualLosses"
  303. :precision="2" :controls="false" style="align: right; text-align: right; width: 100%" />
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="12">
  307. <el-form-item label="增值税">
  308. <el-input-number placeholder="增值税" v-model="form.reportTax.valueAddedTax" style="
  309. display: flex;
  310. align-items: center;
  311. justify-content: center;
  312. width: 100%;
  313. " @change="taxChangeHandler" :controls="false" :precision="2" />
  314. </el-form-item>
  315. </el-col>
  316. <el-col :span="12">
  317. <el-form-item label="城建税">
  318. <el-input-number placeholder="城建税" v-model="form.reportTax.cityConstructTax" :precision="2" style="
  319. display: flex;
  320. align-items: center;
  321. justify-content: center;
  322. width: 100%;
  323. " @change="taxChangeHandler" :controls="false" />
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="12">
  327. <el-form-item label="教育费附加">
  328. <el-input-number placeholder="教育费附加" v-model="form.reportTax.additionsTaxOfEducation" style="
  329. display: flex;
  330. align-items: center;
  331. justify-content: center;
  332. width: 100%;
  333. " @change="taxChangeHandler" :precision="2" :controls="false" />
  334. </el-form-item>
  335. </el-col>
  336. <el-col :span="12">
  337. <el-form-item label="地方教育费附加">
  338. <el-input-number placeholder="地方教育费附加" v-model="form.reportTax.ladditionsTaxOfEducation" style="
  339. display: flex;
  340. align-items: center;
  341. justify-content: center;
  342. width: 100%;
  343. " @change="taxChangeHandler" :precision="2" :controls="false" />
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="12">
  347. <el-form-item label="企业所得税">
  348. <el-input-number placeholder="企业所得税" v-model="form.reportTax.businessIncomeTax" style="
  349. display: flex;
  350. align-items: center;
  351. justify-content: center;
  352. width: 100%;
  353. " @change="taxChangeHandler" :precision="2" :controls="false" />
  354. </el-form-item>
  355. </el-col>
  356. <el-col :span="12">
  357. <el-form-item label="印花税">
  358. <el-input-number placeholder="印花税" v-model="form.reportTax.stampTax" style="
  359. display: flex;
  360. align-items: center;
  361. width: 100%;
  362. justify-content: center;
  363. " @change="taxChangeHandler" :precision="2" :controls="false" />
  364. </el-form-item>
  365. </el-col>
  366. <el-col :span="12">
  367. <el-form-item label="文化事业建设税">
  368. <el-input-number placeholder="文化事业建设税" v-model="form.reportTax.culturalConstructTax" style="
  369. display: flex;
  370. align-items: center;
  371. justify-content: center;
  372. width: 100%;
  373. " @change="taxChangeHandler" :precision="2" :controls="false" />
  374. </el-form-item>
  375. </el-col>
  376. <el-col :span="12">
  377. <el-form-item label="消费税">
  378. <el-input-number placeholder="消费税" v-model="form.reportTax.excise" style="
  379. display: flex;
  380. align-items: center;
  381. justify-content: center;
  382. width: 100%;
  383. " @change="taxChangeHandler" :precision="2" :controls="false" />
  384. </el-form-item>
  385. </el-col>
  386. <el-col :span="12">
  387. <el-form-item label="合计">
  388. <span>{{ rowNum(form.reportTax.sumTax) }}</span>
  389. </el-form-item>
  390. </el-col>
  391. <el-divider content-position="left">个税</el-divider>
  392. <el-col :span="12">
  393. <el-form-item label="个税金额">
  394. <el-input-number placeholder="个税金额" v-model="form.individual.amount" style="
  395. display: flex;
  396. align-items: center;
  397. justify-content: center;
  398. width: 100%;
  399. " :controls="false" :precision="2" />
  400. </el-form-item>
  401. </el-col>
  402. <el-col :span="12">
  403. <el-form-item label="备注">
  404. <el-input type="textarea" maxlength="200" show-word-limit rows="2" v-model="form.individual.remark" />
  405. </el-form-item>
  406. </el-col>
  407. </el-row>
  408. </el-form>
  409. </div>
  410. <div class="form-btns-container" style="height: 40px">
  411. <el-button size="small" icon="close" @click="close" style="float: right; margin-left: 12px; margin-right: 12px">
  412. 取消</el-button>
  413. <el-button type="primary" size="small" icon="Finished" style="float: right" @click="handleSave">
  414. 保存</el-button>
  415. </div>
  416. <!-- <feedback-dialog ref="feedbackDialogView" :parent="this" />
  417. <print-dialog ref="printDialog" :parent="this" /> -->
  418. </el-dialog>
  419. </template>
  420. <script setup>
  421. import {
  422. getDetail,
  423. saveDetail,
  424. updateDetail,
  425. } from "@/api/business/crm/serviceWorkOrder";
  426. import { rowNum, numberToCurrencyNo } from "@/utils/index";
  427. import { ref } from "vue";
  428. const { proxy } = getCurrentInstance();
  429. const visible = ref(false);
  430. const width = ref(1430);
  431. const selections = ref([]);
  432. const currentSource = ref(null);
  433. const props = defineProps({
  434. getList: {
  435. type: Function,
  436. default: () => { },
  437. },
  438. });
  439. const selectStatus = ref([
  440. {
  441. label: "未开始",
  442. value: 0,
  443. color: "#fff",
  444. },
  445. {
  446. label: "进行中",
  447. value: 1,
  448. color: "#FFB836",
  449. },
  450. {
  451. label: "已完成",
  452. value: 3,
  453. color: "#2FCB81",
  454. },
  455. ]);
  456. const { getList } = toRefs(props);
  457. const total = ref(0);
  458. const employeeEmptyData = {
  459. id: null,
  460. title: "",
  461. remark: "",
  462. employeeName: "",
  463. departmentName: "",
  464. idCode: "",
  465. salaryAmount: "",
  466. bonusAmount: "",
  467. allowanceAmount: "",
  468. subsidyAmount: "",
  469. absenceCut: "",
  470. planSalary: 0,
  471. actuallySalary: 0,
  472. endowmentInsurance: 0,
  473. medicalInsurance: 0,
  474. unemploymentBenefit: 0,
  475. seriousIllnessInsurance: 0,
  476. housingFund: 0,
  477. otherCut: 0,
  478. cumulativeIncome: 0,
  479. cumulativeSpecialCut: 0,
  480. cumulativeChildEduCut: 0,
  481. cumulativeHouseLoanInterestCut: 0,
  482. cumulativeHouseRentCut: 0,
  483. cumulativeSupportElderCut: 0,
  484. cumulativeContinuingEduCut: 0,
  485. cumulativeBabyCareCut: 0,
  486. sumSpecialCumulativeCut: 0,
  487. cumulativeOtherCut: 0,
  488. cumulativeIndividualIncomeTax: 0,
  489. cumulativeHasPaidIit: 0,
  490. currentIndividualIncomeTax: 0,
  491. idiograph: "",
  492. details: [],
  493. editStatus: true,
  494. };
  495. const form = ref({});
  496. const emptyForm = {
  497. salary: {
  498. details: [],
  499. },
  500. ticket: {},
  501. keepAccount: {},
  502. reportTax: {},
  503. individual: {},
  504. details: [],
  505. };
  506. function open(detail) {
  507. visible.value = true;
  508. form.value = { ...emptyForm, ...detail };
  509. loadData();
  510. }
  511. function loadData() {
  512. getDetail(form.value).then((res) => {
  513. form.value = { ...proxy.deepClone(emptyForm), ...res.data };
  514. computeTotal();
  515. });
  516. }
  517. function close() {
  518. visible.value = false;
  519. reset();
  520. }
  521. function reset() {
  522. form.value = proxy.deepClone(emptyForm);
  523. }
  524. function printSalary() { }
  525. function exportSalary() { }
  526. function handleCurrentChange(row) {
  527. currentSource.value = row;
  528. }
  529. function handleCheckChange(selection) {
  530. selections.value = selection.map((item) => item);
  531. }
  532. function handleEmployeeCreate() {
  533. // 此处必须进行深拷贝,否则添加的明细,将都指向了一个对象
  534. const _newSource = JSON.parse(JSON.stringify(employeeEmptyData));
  535. form.value.salary.details.push(_newSource);
  536. handleCurrentChange(_newSource);
  537. }
  538. function handleEmployeeBatchDelete() {
  539. proxy.$modal
  540. .confirm("确定删除?")
  541. .then(() => {
  542. form.value.salary.details = form.value.salary.details.filter(
  543. (item) => selections.value.indexOf(item) === -1
  544. );
  545. })
  546. .catch(() => {
  547. proxy.$modal.msg("已取消删除");
  548. });
  549. }
  550. function rowChangeSum(row) {
  551. let actuallySalary = 0;
  552. actuallySalary += row.planSalary == null ? 0 : row.planSalary;
  553. actuallySalary += row.bonusAmount == null ? 0 : row.bonusAmount;
  554. actuallySalary -= row.endowmentInsurance == null ? 0 : row.endowmentInsurance;
  555. actuallySalary -= row.medicalInsurance == null ? 0 : row.medicalInsurance;
  556. actuallySalary -=
  557. row.unemploymentBenefit == null ? 0 : row.unemploymentBenefit;
  558. actuallySalary -=
  559. row.seriousIllnessInsurance == null ? 0 : row.seriousIllnessInsurance;
  560. actuallySalary -= row.housingFund == null ? 0 : row.housingFund;
  561. actuallySalary -=
  562. row.currentIndividualIncomeTax == null ? 0 : row.currentIndividualIncomeTax;
  563. actuallySalary -= row.otherCut == null ? 0 : row.otherCut;
  564. row.actuallySalary = actuallySalary;
  565. computeTotal();
  566. }
  567. function computeTotal() {
  568. let totalSalay = 0;
  569. form.value.salary.details.forEach((l) => {
  570. totalSalay += l.actuallySalary == null ? 0 : l.actuallySalary;
  571. });
  572. form.value.salary.amount = totalSalay.toFixed(2);
  573. }
  574. function getSummaries(param) {
  575. const { columns, data } = param;
  576. const sums = [];
  577. columns.forEach((column, index) => {
  578. if (index === 0) {
  579. sums[index] = "合计";
  580. return;
  581. } else if (index === 1) {
  582. sums[index] = "";
  583. return;
  584. }
  585. const values = data.map((item) => Number(item[column.property]));
  586. if (!values.every((value) => isNaN(value))) {
  587. sums[index] = values.reduce((prev, curr) => {
  588. const value = Number(curr);
  589. if (!isNaN(value)) {
  590. return (Number(prev) + Number(curr)).toFixed(2);
  591. } else {
  592. return Number(prev).toFixed(2);
  593. }
  594. }, 0);
  595. sums[index] = numberToCurrencyNo(sums[index]);
  596. } else {
  597. sums[index] = "";
  598. }
  599. });
  600. return sums;
  601. }
  602. function handleSave() {
  603. proxy.$modal
  604. .confirm("确认保存么?")
  605. .then(() => {
  606. const saveValue = proxy.deepClone(form.value);
  607. saveDetail(saveValue).then((res) => {
  608. proxy.$modal.msgSuccess("保存成功");
  609. reset();
  610. close();
  611. getList.value();
  612. });
  613. })
  614. .catch((err) => {
  615. proxy.$modal.msg("取消保存");
  616. });
  617. }
  618. function ticketNumberChange() {
  619. let amount = 0;
  620. amount +=
  621. form.value.ticket.incomeTicket == null ? 0 : form.value.ticket.incomeTicket;
  622. amount +=
  623. form.value.ticket.costTicket == null ? 0 : form.value.ticket.costTicket;
  624. amount +=
  625. form.value.ticket.feeTicketNumber == null
  626. ? 0
  627. : form.value.ticket.feeTicketNumber;
  628. amount +=
  629. form.value.ticket.ssafTicket == null ? 0 : form.value.ticket.ssafTicket;
  630. amount +=
  631. form.value.ticket.salaryTicket == null ? 0 : form.value.ticket.salaryTicket;
  632. amount +=
  633. form.value.ticket.bankSlipsNumber == null
  634. ? 0
  635. : form.value.ticket.bankSlipsNumber;
  636. amount +=
  637. form.value.ticket.bankCopyNumber == null
  638. ? 0
  639. : form.value.ticket.bankCopyNumber;
  640. amount += form.value.ticket.bankCopy == null ? 0 : form.value.ticket.bankCopy;
  641. amount +=
  642. form.value.ticket.otherTicket == null ? 0 : form.value.ticket.otherTicket;
  643. form.value.ticket.sumNumber = amount;
  644. console.log("合计", amount);
  645. console.log("合计1", form.value.ticket.costTicket);
  646. }
  647. /** 计算税额 */
  648. function taxChangeHandler() {
  649. let amount = 0;
  650. amount +=
  651. form.value.reportTax.ladditionsTaxOfEducation == null
  652. ? 0
  653. : form.value.reportTax.ladditionsTaxOfEducation;
  654. amount +=
  655. form.value.reportTax.valueAddedTax == null
  656. ? 0
  657. : form.value.reportTax.valueAddedTax;
  658. amount +=
  659. form.value.reportTax.cityConstructTax == null
  660. ? 0
  661. : form.value.reportTax.cityConstructTax;
  662. amount +=
  663. form.value.reportTax.additionsTaxOfEducation == null
  664. ? 0
  665. : form.value.reportTax.additionsTaxOfEducation;
  666. amount +=
  667. form.value.reportTax.businessIncomeTax == null
  668. ? 0
  669. : form.value.reportTax.businessIncomeTax;
  670. amount +=
  671. form.value.reportTax.stampTax == null ? 0 : form.value.reportTax.stampTax;
  672. amount +=
  673. form.value.reportTax.culturalConstructTax == null
  674. ? 0
  675. : form.value.reportTax.culturalConstructTax;
  676. amount +=
  677. form.value.reportTax.excise == null ? 0 : form.value.reportTax.excise;
  678. form.value.reportTax.sumTax = amount;
  679. }
  680. // 暴露给父组件的方法
  681. defineExpose({
  682. open,
  683. });
  684. </script>