billEdit.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423
  1. <template>
  2. <div class="app-container">
  3. <el-card class="box-card" style="margin: 0.6%">
  4. <div class="text item">
  5. <el-form ref="bill" label-width="auto" :inline="true">
  6. <el-form-item label="创建人:" style="float: right">{{
  7. form.createUser
  8. }}</el-form-item>
  9. <el-form-item label="创建时间:" style="float: right">{{
  10. parseTime(new Date(form.createTime))
  11. }}</el-form-item>
  12. <el-form-item label="编号:" style="float: right">{{
  13. form.zbiNumber
  14. }}</el-form-item>
  15. </el-form>
  16. </div>
  17. </el-card>
  18. <el-card class="box-card" style="margin: 0.6%">
  19. <div slot="header" class="clearfix">
  20. <span style="color: #666ee8; font-weight: bold">基本信息</span>
  21. </div>
  22. <div class="text item" style="margin-bottom: 20px">
  23. <el-form
  24. ref="form"
  25. :model="form"
  26. :rules="rules"
  27. label-width="auto"
  28. label-position="top"
  29. :inline="true"
  30. >
  31. <el-form-item label="账款类型" prop="wplIsInput" style="width: 300px">
  32. <el-radio-group v-model="type" prop="type" :disabled="true">
  33. <el-radio-button label="00" v-if="type == '00'"
  34. >应付账款</el-radio-button
  35. >
  36. <el-radio-button label="01" v-if="type == '01'"
  37. >应收账款</el-radio-button
  38. >
  39. </el-radio-group>
  40. </el-form-item>
  41. <el-form-item label="账款名称" prop="zbiName">
  42. <el-input
  43. v-model="form.zbiName"
  44. clearable
  45. placeholder="请输入账款名称"
  46. maxlength="20"
  47. style="width: 300px"
  48. />
  49. </el-form-item>
  50. <el-form-item label="应付方" prop="zbiPayerId">
  51. <el-input
  52. v-model="form.payerName"
  53. maxlength="20"
  54. style="width: 300px"
  55. :disabled="true"
  56. v-if="
  57. company.scyId != form.zbiPayerId &&
  58. company.scyId != form.zbiPayeeId
  59. "
  60. />
  61. <el-select
  62. style="width: 300px"
  63. v-model="form.zbiPayerId"
  64. :disabled="true"
  65. filterable
  66. remote
  67. v-if="
  68. (type == '00' && company.scyId == form.zbiPayerId) ||
  69. (type == '00' && company.scyId == form.zbiPayeeId)
  70. "
  71. >
  72. <el-option :label="company.scyName" :value="company.scyId">
  73. </el-option>
  74. </el-select>
  75. <el-select
  76. style="width: 300px"
  77. v-model="form.zbiPayerId"
  78. filterable
  79. clearable
  80. remote
  81. v-if="
  82. (type == '01' && company.scyId == form.zbiPayerId) ||
  83. (type == '01' && company.scyId == form.zbiPayeeId)
  84. "
  85. >
  86. <el-option
  87. v-for="(item, index) in companyRelList"
  88. :key="index"
  89. :label="
  90. item.launchScyId == company.scyId
  91. ? item.receiveScyName
  92. : item.launchScyName
  93. "
  94. :value="
  95. item.launchScyId == company.scyId
  96. ? item.receiveScyId
  97. : item.launchScyId
  98. "
  99. >
  100. </el-option>
  101. </el-select>
  102. </el-form-item>
  103. <el-form-item label="应收方" prop="zbiPayeeId">
  104. <el-input
  105. v-model="form.payeeName"
  106. maxlength="20"
  107. style="width: 300px"
  108. :disabled="true"
  109. v-if="
  110. company.scyId != form.zbiPayerId &&
  111. company.scyId != form.zbiPayeeId
  112. "
  113. />
  114. <el-select
  115. style="width: 300px"
  116. v-model="form.zbiPayeeId"
  117. :disabled="true"
  118. filterable
  119. remote
  120. v-if="
  121. (type == '01' && company.scyId == form.zbiPayerId) ||
  122. (type == '01' && company.scyId == form.zbiPayeeId)
  123. "
  124. >
  125. <el-option :label="company.scyName" :value="company.scyId">
  126. </el-option>
  127. </el-select>
  128. <el-select
  129. style="width: 300px"
  130. v-model="form.zbiPayeeId"
  131. filterable
  132. clearable
  133. remote
  134. v-if="
  135. (type == '00' && company.scyId == form.zbiPayerId) ||
  136. (type == '00' && company.scyId == form.zbiPayeeId)
  137. "
  138. >
  139. <el-option
  140. v-for="(item, index) in companyRelList"
  141. :key="index"
  142. :label="
  143. item.launchScyId == company.scyId
  144. ? item.receiveScyName
  145. : item.launchScyName
  146. "
  147. :value="
  148. item.launchScyId == company.scyId
  149. ? item.receiveScyId
  150. : item.launchScyId
  151. "
  152. >
  153. </el-option>
  154. </el-select>
  155. </el-form-item>
  156. <el-form-item label="贸易日期" prop="zbiDate">
  157. <el-date-picker
  158. style="width: 300px"
  159. v-model="form.zbiDate"
  160. clearable
  161. value-format="yyyy-MM-dd"
  162. type="date"
  163. placeholder="选择日期"
  164. :picker-options="pickerOptionsStart"
  165. >
  166. </el-date-picker>
  167. </el-form-item>
  168. <el-form-item
  169. :label="
  170. type == '00'
  171. ? '预计付款日期'
  172. : type == '01'
  173. ? '预计收款日期'
  174. : '预计收/付款日期'
  175. "
  176. prop="zbiPayDate"
  177. >
  178. <el-date-picker
  179. style="width: 300px"
  180. v-model="form.zbiPayDate"
  181. clearable
  182. value-format="yyyy-MM-dd"
  183. type="date"
  184. placeholder="选择日期"
  185. :picker-options="pickerOptionsEnd"
  186. >
  187. </el-date-picker>
  188. </el-form-item>
  189. <el-form-item label="账款金额">
  190. <el-input
  191. :disabled="true"
  192. :value="allAmount()"
  193. maxlength="20"
  194. style="width: 300px"
  195. >
  196. <template slot="append">元</template>
  197. </el-input>
  198. </el-form-item>
  199. <el-form-item label="账款金额大写">
  200. <el-input
  201. :disabled="true"
  202. :value="smallToBig(allAmount())"
  203. style="width: 300px"
  204. >
  205. </el-input>
  206. </el-form-item>
  207. <el-form-item label="贸易合同编号" prop="zbiContractNo">
  208. <el-input
  209. v-model="form.zbiContractNo"
  210. clearable
  211. placeholder="请输入贸易合同编号"
  212. maxlength="20"
  213. style="width: 300px"
  214. />
  215. </el-form-item>
  216. <el-form-item label="贸易商品/服务">
  217. <el-input
  218. v-model="form.zbiService"
  219. clearable
  220. placeholder="请输入贸易商品/服务"
  221. maxlength="20"
  222. style="width: 300px"
  223. />
  224. </el-form-item>
  225. <el-form-item label="配送企业">
  226. <el-input
  227. v-model="form.zbiDistributor"
  228. clearable
  229. placeholder="请输入配送企业"
  230. maxlength="20"
  231. style="width: 300px"
  232. />
  233. </el-form-item>
  234. <el-form-item label="配送订单号">
  235. <el-input
  236. v-model="form.zbiOrderNo"
  237. clearable
  238. placeholder="请输入配送订单号"
  239. maxlength="20"
  240. style="width: 300px"
  241. />
  242. </el-form-item>
  243. <el-form-item label="备注">
  244. <el-input
  245. v-model="form.zbiRemark"
  246. placeholder="请输入备注"
  247. :autosize="{ minRows: 2, maxRows: 4 }"
  248. maxlength="100"
  249. type="textarea"
  250. style="width: 615px"
  251. />
  252. </el-form-item>
  253. </el-form>
  254. </div>
  255. </el-card>
  256. <el-card class="box-card" style="margin: 0.6%">
  257. <div slot="header" class="clearfix">
  258. <span style="color: #666ee8; font-weight: bold">发票列表</span>
  259. </div>
  260. <div class="text item" style="margin-bottom: 20px">
  261. <el-form ref="invoice" label-width="auto" :inline="true">
  262. <el-form-item label="合计:">{{
  263. handleInput(allAmount())
  264. }}</el-form-item>
  265. <el-form-item label="大写:">{{
  266. smallToBig(allAmount())
  267. }}</el-form-item>
  268. <el-form-item style="float: right"
  269. ><el-button type="primary" @click="delInvoice"
  270. >删除</el-button
  271. ></el-form-item
  272. >
  273. <el-form-item style="float: right"
  274. ><el-button type="primary" @click="openUpload()"
  275. >上传</el-button
  276. ></el-form-item
  277. >
  278. </el-form>
  279. <el-table
  280. :data="fileList"
  281. @selection-change="handleInvoiceSelectionChange"
  282. row-key="ziiId"
  283. default-expand-all
  284. :row-class-name="tableRowClassName"
  285. border
  286. >
  287. <el-table-column type="selection" width="50" align="center" />
  288. <el-table-column
  289. label="发票代码"
  290. align="center"
  291. prop="ziiNo"
  292. maxlength="10"
  293. />
  294. <el-table-column
  295. label="发票号码"
  296. align="center"
  297. prop="ziiNumber"
  298. maxlength="10"
  299. />
  300. <el-table-column label="开票日期" align="center" prop="ziiDate" />
  301. <el-table-column
  302. label="购方识别号"
  303. align="center"
  304. prop="ziiPurchaserNo"
  305. />
  306. <el-table-column
  307. label="销方识别号"
  308. align="center"
  309. prop="ziiSellerNo"
  310. />
  311. <el-table-column
  312. label="合计金额"
  313. align="center"
  314. prop="ziiTotalAmount"
  315. />
  316. <el-table-column label="价税合计" align="center" prop="ziiAmount" />
  317. <el-table-column
  318. label="校验结果"
  319. align="center"
  320. prop="ziiCheckStt"
  321. :formatter="checkSttFormat"
  322. />
  323. <el-table-column
  324. label="附件"
  325. align="center"
  326. class-name="small-padding fixed-width"
  327. fixed="right"
  328. width="200"
  329. >
  330. <template slot-scope="scope">
  331. <el-button
  332. size="mini"
  333. type="text"
  334. @click="invoicePictureCardPreview(scope.row)"
  335. >详情</el-button
  336. >
  337. </template>
  338. </el-table-column>
  339. </el-table>
  340. <!-- 上传附件 -->
  341. <el-dialog
  342. title="上传发票"
  343. :visible.sync="uploadOpen"
  344. width="500px"
  345. append-to-body
  346. >
  347. <el-upload
  348. class="upload-demo"
  349. drag
  350. ref="upload"
  351. :file-list="fileList"
  352. :auto-upload="true"
  353. :http-request="httpRequest"
  354. :before-remove="beforeRemove"
  355. :on-remove="invoiceRemove"
  356. :before-upload="beforeAvatarUpload"
  357. accept=".jpg,.jpeg,.png"
  358. action=""
  359. multiple
  360. >
  361. <i class="el-icon-upload"></i>
  362. <div class="el-upload__text">
  363. 将文件拖到此处,或<em>点击选择文件</em>
  364. </div>
  365. <div class="el-upload__tip">
  366. 按住Ctrl可同时多选,单个文件不能超过2mb
  367. </div>
  368. <div class="el-upload__tip">
  369. 严禁上传包含色情、暴力、反动等相关违法信息的文件。
  370. </div>
  371. </el-upload>
  372. <!-- <el-button type="primary" @click="submitUpload()"
  373. >点击上传</el-button
  374. > -->
  375. <el-button type="primary" @click="toCheck()">完成去验真</el-button>
  376. </el-dialog>
  377. <!-- 发票验真 -->
  378. <el-dialog
  379. title="发票验真"
  380. :visible.sync="open"
  381. width="1050px"
  382. append-to-body
  383. >
  384. <el-container>
  385. <el-aside width="300px" style="background-color: white">
  386. <el-button type="primary" @click="openUploadInvoice"
  387. >上传发票</el-button
  388. >
  389. <el-header style="background-color: #dfe2e8; text-align: center">
  390. <el-checkbox
  391. :indeterminate="isIndeterminate"
  392. v-model="checkAll"
  393. @change="handleCheckAllChange"
  394. >全选</el-checkbox
  395. >
  396. <label>已上传发票列表</label>
  397. </el-header>
  398. <el-main style="height: 550px; border: groove">
  399. <div
  400. :style="
  401. item.ziiCheckStt == '1'
  402. ? { 'background-color': '#a8f87f' }
  403. : {}
  404. "
  405. v-for="(item, index) in fileList"
  406. :label="item"
  407. :key="index"
  408. >
  409. <i
  410. class="el-icon-question"
  411. style="color: blue"
  412. v-if="item.ziiCheckStt == '0'"
  413. ><label @click="changeInvoice(item)"
  414. ><el-link :underline="false">{{
  415. item.name
  416. }}</el-link></label
  417. ></i
  418. >
  419. <i
  420. class="el-icon-success"
  421. style="color: green"
  422. v-if="item.ziiCheckStt == '1'"
  423. ><label @click="changeInvoice(item)"
  424. ><el-link :underline="false">{{
  425. item.name
  426. }}</el-link></label
  427. ></i
  428. >
  429. <i
  430. class="el-icon-error"
  431. style="color: red"
  432. v-if="item.ziiCheckStt == '2' || item.ziiCheckStt == '3'"
  433. ><label @click="changeInvoice(item)"
  434. ><el-link :underline="false">{{
  435. item.name
  436. }}</el-link></label
  437. ><label>{{ checkSttFormat(item) }}</label></i
  438. >
  439. <el-link
  440. style="float: right"
  441. type="primary"
  442. :underline="false"
  443. @click="delInvoice(item)"
  444. >删除</el-link
  445. >
  446. </div>
  447. </el-main>
  448. <div style="text-align: center; margin-top: 20px">
  449. <el-button type="primary" @click="toCheckAgian()"
  450. >再次验证</el-button
  451. >
  452. <el-button type="primary" @click="submitCheck()"
  453. >保存并上传</el-button
  454. >
  455. </div>
  456. </el-aside>
  457. <el-container>
  458. <el-header height="300px">
  459. <el-image
  460. style="width: 650px; height: 267px"
  461. :src="invoice.url"
  462. fit="scale-down"
  463. @click="invoicePictureCardPreview(invoice)"
  464. ></el-image>
  465. <p
  466. v-if="invoice.zbiName"
  467. style="text-align: center; color: red"
  468. >
  469. 发票重复,已存在名称为“{{ invoice.zbiName }}”的往来账款中!
  470. </p>
  471. </el-header>
  472. <el-main>
  473. <el-form
  474. ref="invoice"
  475. label-width="auto"
  476. :inline="true"
  477. label-position="top"
  478. :disabled="invoice.ziiCheckStt == '1'"
  479. >
  480. <el-form-item label="发票代码:">
  481. <el-input v-model="invoice.ziiNo" maxlength="20" />
  482. </el-form-item>
  483. <el-form-item label="发票号码:">
  484. <el-input v-model="invoice.ziiNumber" maxlength="20" />
  485. </el-form-item>
  486. <el-form-item label="开票日期:">
  487. <el-date-picker
  488. v-model="invoice.ziiDate"
  489. value-format="yyyy-MM-dd"
  490. type="date"
  491. placeholder="选择日期"
  492. >
  493. </el-date-picker>
  494. </el-form-item>
  495. <el-form-item label="购货纳税人编号:">
  496. <el-input v-model="invoice.ziiPurchaserNo" maxlength="20" />
  497. </el-form-item>
  498. <el-form-item label="销货纳税人编号:">
  499. <el-input v-model="invoice.ziiSellerNo" maxlength="20" />
  500. </el-form-item>
  501. <el-form-item label="发票金额:">
  502. <el-input v-model="invoice.ziiTotalAmount" maxlength="16" />
  503. </el-form-item>
  504. <el-form-item label="税价金额:">
  505. <el-input v-model="invoice.ziiAmount" maxlength="16" />
  506. </el-form-item>
  507. </el-form>
  508. </el-main>
  509. <el-footer>
  510. <el-button
  511. type="primary"
  512. @click="queryDouble()"
  513. style="float: right"
  514. >确定</el-button
  515. >
  516. </el-footer>
  517. </el-container>
  518. </el-container>
  519. </el-dialog>
  520. </div>
  521. </el-card>
  522. <el-card class="box-card" style="margin: 0.6%">
  523. <div slot="header" class="clearfix">
  524. <span style="color: #666ee8; font-weight: bold">合同附件</span>
  525. </div>
  526. <div class="text item" style="margin-bottom: 20px">
  527. <el-form ref="contract" label-width="auto" :inline="true">
  528. <!-- <el-form-item style="float: right"
  529. ><el-button type="primary" @click="submitUploadContract()"
  530. >上传</el-button
  531. ></el-form-item
  532. > -->
  533. </el-form>
  534. <el-upload
  535. :file-list="contractList"
  536. :auto-upload="true"
  537. :http-request="httpRequestContract"
  538. action=""
  539. ref="contractUpload"
  540. list-type="picture-card"
  541. accept=".jpg,.jpeg,.png"
  542. :before-upload="beforeUpload"
  543. :on-preview="invoicePictureCardPreview"
  544. :before-remove="beforeRemove"
  545. :on-remove="handleRemoveContract"
  546. >
  547. <i class="el-icon-plus"></i>
  548. </el-upload>
  549. </div>
  550. </el-card>
  551. <el-card class="box-card" style="margin: 0.6%">
  552. <div slot="header" class="clearfix">
  553. <span style="color: #666ee8; font-weight: bold">物流附件</span>
  554. </div>
  555. <div class="text item" style="margin-bottom: 20px">
  556. <el-form ref="logistics" label-width="auto" :inline="true">
  557. <!-- <el-form-item style="float: right"
  558. ><el-button type="primary" @click="submitUploadLogistics()"
  559. >上传</el-button
  560. ></el-form-item
  561. > -->
  562. </el-form>
  563. <el-upload
  564. :file-list="logisticsList"
  565. :auto-upload="true"
  566. :http-request="httpRequestLogistics"
  567. action=""
  568. ref="logisticsUpload"
  569. list-type="picture-card"
  570. accept=".jpg,.jpeg,.png"
  571. :before-upload="beforeUpload"
  572. :on-preview="invoicePictureCardPreview"
  573. :before-remove="beforeRemove"
  574. :on-remove="handleRemoveLogistics"
  575. >
  576. <i class="el-icon-plus"></i>
  577. </el-upload>
  578. </div>
  579. </el-card>
  580. <el-card class="box-card" style="margin: 0.6%">
  581. <div slot="header" class="clearfix">
  582. <span style="color: #666ee8; font-weight: bold">其他附件</span>
  583. </div>
  584. <div class="text item" style="margin-bottom: 20px">
  585. <el-form ref="other" label-width="auto" :inline="true">
  586. <!-- <el-form-item style="float: right"
  587. ><el-button type="primary" @click="submitUploadOther()"
  588. >上传</el-button
  589. ></el-form-item
  590. > -->
  591. </el-form>
  592. <el-upload
  593. :file-list="otherList"
  594. :auto-upload="true"
  595. :http-request="httpRequestOther"
  596. action=""
  597. ref="otherUpload"
  598. list-type="picture-card"
  599. accept=".jpg,.jpeg,.png"
  600. :before-upload="beforeUpload"
  601. :on-preview="invoicePictureCardPreview"
  602. :before-remove="beforeRemove"
  603. :on-remove="handleRemoveOther"
  604. >
  605. <i class="el-icon-plus"></i>
  606. </el-upload>
  607. </div>
  608. </el-card>
  609. <!-- 查看图片 -->
  610. <el-dialog :visible.sync="invoiceVisible">
  611. <img width="100%" :src="invoiceImageUrl" alt="" />
  612. </el-dialog>
  613. <div style="text-align: center">
  614. <el-button type="primary" @click="submit()">提交</el-button>
  615. </div>
  616. </div>
  617. </template>
  618. <script>
  619. import {
  620. getBill,
  621. getInvoice,
  622. addBill,
  623. getInvoiceText,
  624. invoiceVerification,
  625. delInvoice,
  626. uploadBillFile,
  627. getFile,
  628. delFile,
  629. commitBill,
  630. getAmount,
  631. queryDouble,
  632. } from "@/api/service/bill/bill";
  633. import { getOwnCompany, companyRelList } from "@/api/common/company";
  634. import { amtformat } from "@/utils/amtCommon";
  635. import { getToken } from "@/utils/auth";
  636. export default {
  637. name: "billEdit",
  638. components: {},
  639. data() {
  640. return {
  641. // 选中数组
  642. ids: [],
  643. // 非单个禁用
  644. single: true,
  645. // 非多个禁用
  646. multiple: true,
  647. // 是否显示弹出层
  648. open: false,
  649. uploadOpen: false,
  650. // 查询参数
  651. queryParams: {},
  652. // 表单参数
  653. form: {},
  654. // 表单校验
  655. rules: {
  656. zbiName: [
  657. {
  658. required: true,
  659. message: "账款名称不能为空",
  660. trigger: ["blur", "change"],
  661. },
  662. {
  663. pattern: /^[\u4E00-\u9FA5A-Za-z0-9]+$/,
  664. message: "账款名称只能包含中文、英文、数字",
  665. trigger: ["blur", "change"],
  666. },
  667. ],
  668. zbiPayerId: [
  669. {
  670. required: true,
  671. message: "应付方不能为空",
  672. trigger: ["blur", "change"],
  673. },
  674. ],
  675. zbiDate: [
  676. {
  677. required: true,
  678. message: "贸易日期不能为空",
  679. trigger: ["blur", "change"],
  680. },
  681. ],
  682. zbiPayDate: [
  683. {
  684. required: true,
  685. message: "预计收/付款日期不能为空",
  686. trigger: ["blur", "change"],
  687. },
  688. ],
  689. zbiPayeeId: [
  690. {
  691. required: true,
  692. message: "应收方不能为空",
  693. trigger: ["blur", "change"],
  694. },
  695. ],
  696. zbiAmount: [
  697. {
  698. required: true,
  699. message: "贸易金额不能为空",
  700. trigger: ["blur", "change"],
  701. },
  702. {
  703. pattern: /^(?:0|[1-9]\d{0,13})(?:\.\d{1,2})?$/,
  704. message: "请输入正确的金额",
  705. trigger: ["blur", "change"],
  706. },
  707. ],
  708. zbiContractNo: [
  709. {
  710. required: true,
  711. message: "合同编号不能为空",
  712. trigger: ["blur", "change"],
  713. },
  714. {
  715. pattern: /^[a-zA-Z0-9]+$/,
  716. message: "请输入数字或英文",
  717. trigger: ["blur", "change"],
  718. },
  719. ],
  720. },
  721. //类型
  722. type: "00",
  723. //合同附件
  724. contractList: [],
  725. //物流附件
  726. logisticsList: [],
  727. //其他附件
  728. otherList: [],
  729. //发票列表
  730. fileList: [],
  731. //全选状态
  732. checkAll: false,
  733. //全选状态
  734. isIndeterminate: false,
  735. //选中值
  736. checkedInvoice: [],
  737. //发票对象
  738. invoice: {},
  739. //合计金额
  740. totalPrice: 0,
  741. //验证结果
  742. checkSttOptions: [],
  743. //图片路径
  744. invoiceImageUrl: null,
  745. //图片显示
  746. invoiceVisible: false,
  747. //等待框
  748. fullscreenLoading: false,
  749. //链属企业
  750. companyRelList: [],
  751. //链属企业
  752. company: {},
  753. pickerOptionsStart: {
  754. disabledDate: (time) => {
  755. if (this.form.zbiPayDate) {
  756. return (
  757. time.getTime() >
  758. new Date(this.form.zbiPayDate).getTime() -
  759. 14 * 24 * 60 * 60 * 1000
  760. );
  761. }
  762. },
  763. },
  764. pickerOptionsEnd: {
  765. disabledDate: (time) => {
  766. if (this.form.zbiDate) {
  767. return (
  768. time.getTime() <
  769. new Date(this.form.zbiDate).getTime() + 13 * 24 * 60 * 60 * 1000
  770. );
  771. }
  772. },
  773. },
  774. };
  775. },
  776. created() {
  777. const zbiId = this.$route.params && this.$route.params.zbiId;
  778. this.fullscreenLoading = true;
  779. getOwnCompany().then((response) => {
  780. this.company = response.data;
  781. });
  782. this.getCompanyRel();
  783. this.getDetail(zbiId);
  784. getInvoice(zbiId).then((response) => {
  785. response.data.forEach((element) => {
  786. element.url = element.url + "/" + getToken();
  787. });
  788. this.fileList = response.data;
  789. this.invoice = this.fileList[0] ? this.fileList[0] : {};
  790. this.ids = [];
  791. });
  792. getFile("0", zbiId).then((response) => {
  793. response.data.forEach((element) => {
  794. element.url = element.url + "/" + getToken();
  795. });
  796. this.contractList = response.data;
  797. });
  798. //查询物流
  799. getFile("1", zbiId).then((response) => {
  800. response.data.forEach((element) => {
  801. element.url = element.url + "/" + getToken();
  802. });
  803. this.logisticsList = response.data;
  804. });
  805. //查询其他附件
  806. getFile("2", zbiId).then((response) => {
  807. response.data.forEach((element) => {
  808. element.url = element.url + "/" + getToken();
  809. });
  810. this.otherList = response.data;
  811. });
  812. this.getDicts("zc_invoice_checkStt").then((response) => {
  813. this.checkSttOptions = response.data;
  814. });
  815. },
  816. activated() {},
  817. methods: {
  818. //查询往来账款详情
  819. getDetail(zbiId) {
  820. const loading = this.$loading({
  821. lock: true,
  822. text: "Loading",
  823. spinner: "el-icon-loading",
  824. background: "rgba(0, 0, 0, 0.7)",
  825. });
  826. getBill(zbiId)
  827. .then((response) => {
  828. this.form = response.data;
  829. if (this.form.zbiPayerId == this.company.scyId) {
  830. this.type = "00";
  831. } else {
  832. this.type = "01";
  833. }
  834. loading.close();
  835. })
  836. .catch(() => {
  837. loading.close();
  838. });
  839. },
  840. //切换账款类型
  841. changePayer(val) {
  842. if (val == "00") {
  843. this.form.zbiPayerId = this.company.scyId;
  844. this.form.zbiPayeeId = null;
  845. } else if (val == "01") {
  846. this.form.zbiPayerId = null;
  847. this.form.zbiPayeeId = this.company.scyId;
  848. }
  849. },
  850. //查询链属企业
  851. getCompanyRel(val) {
  852. this.queryParams.companyName = val;
  853. companyRelList(this.queryParams).then((response) => {
  854. this.companyRelList = response.data;
  855. });
  856. },
  857. //全选
  858. handleCheckAllChange(val) {
  859. this.checkedInvoice = val ? this.fileList : [];
  860. this.ids = val ? this.fileList.map((item) => item.id) : [];
  861. this.isIndeterminate = false;
  862. },
  863. // 多选框选中数据
  864. handleInvoiceSelectionChange(selection) {
  865. this.ids = selection.map((item) => item.id);
  866. this.single = selection.length !== 1;
  867. this.multiple = !selection.length;
  868. },
  869. //发票上传窗口
  870. openUpload() {
  871. this.open = true;
  872. },
  873. //上传
  874. submitUpload() {
  875. this.$refs.upload.submit();
  876. },
  877. //上传发票窗口
  878. openUploadInvoice() {
  879. this.uploadOpen = true;
  880. },
  881. //判重验证
  882. queryDouble() {
  883. const loading = this.$loading({
  884. lock: true,
  885. text: "Loading",
  886. spinner: "el-icon-loading",
  887. background: "rgba(0, 0, 0, 0.7)",
  888. });
  889. if (
  890. this.invoice &&
  891. this.invoice.ziiId &&
  892. this.invoice.ziiCheckStt != "1"
  893. ) {
  894. queryDouble(this.invoice).then((response) => {
  895. this.fileList.forEach((file) => {
  896. if (response.id == file.id) {
  897. file.ziiCheckStt = response.ziiCheckStt;
  898. file.zbiName = response.zbiName;
  899. }
  900. });
  901. // this.invoice = this.fileList[0] ? this.fileList[0] : {};
  902. loading.close();
  903. });
  904. }
  905. },
  906. //去验真
  907. toCheck() {
  908. this.uploadOpen = false;
  909. const loading = this.$loading({
  910. lock: true,
  911. text: "Loading",
  912. spinner: "el-icon-loading",
  913. background: "rgba(0, 0, 0, 0.7)",
  914. });
  915. let fd = new FormData(); // FormData 对象
  916. fd.append("fileList", JSON.stringify(this.fileList)); // 文件对象
  917. invoiceVerification(fd)
  918. .then((response) => {
  919. response.forEach((element) => {
  920. this.fileList.forEach((file) => {
  921. if (element.id == file.id) {
  922. file.ziiCheckStt = element.ziiCheckStt;
  923. file.zbiName = element.zbiName;
  924. }
  925. });
  926. });
  927. this.invoice = this.fileList[0] ? this.fileList[0] : {};
  928. loading.close();
  929. })
  930. .catch(() => {
  931. loading.close();
  932. });
  933. },
  934. //重新验真
  935. toCheckAgian() {
  936. const loading = this.$loading({
  937. lock: true,
  938. text: "Loading",
  939. spinner: "el-icon-loading",
  940. background: "rgba(0, 0, 0, 0.7)",
  941. });
  942. let checkList = this.checkedInvoice.filter((element) => {
  943. return element.ziiCheckStt == "0";
  944. });
  945. let fd = new FormData(); // FormData 对象
  946. fd.append("fileList", JSON.stringify(checkList)); // 文件对象
  947. invoiceVerification(fd)
  948. .then((response) => {
  949. response.forEach((element) => {
  950. this.fileList.forEach((file) => {
  951. if (element.id == file.id) {
  952. file.ziiCheckStt = element.ziiCheckStt;
  953. file.zbiName = element.zbiName;
  954. }
  955. });
  956. });
  957. loading.close();
  958. })
  959. .catch(() => {
  960. loading.close();
  961. });
  962. },
  963. //表格置灰
  964. tableRowClassName({ row, rowIndex }) {
  965. if (row.ziiCheckStt != "1") {
  966. return "warning-row";
  967. }
  968. return "";
  969. },
  970. //切换发票
  971. changeInvoice(item) {
  972. this.invoice = item;
  973. },
  974. //手动上传发票触发
  975. httpRequest(param) {
  976. const loading = this.$loading({
  977. lock: true,
  978. text: "Loading",
  979. spinner: "el-icon-loading",
  980. background: "rgba(0, 0, 0, 0.7)",
  981. });
  982. let fileObj = param.file; // 相当于input里取得的files
  983. let fd = new FormData(); // FormData 对象
  984. fd.append("file", fileObj); // 文件对象
  985. fd.append("zbiId", this.form.zbiId); //文件类型
  986. getInvoiceText(fd)
  987. .then((response) => {
  988. response.data.url = response.data.url + "/" + getToken();
  989. var flag = true;
  990. this.fileList.forEach((element) => {
  991. if (element.ziiNo == response.data.ziiNo) {
  992. flag = false;
  993. }
  994. });
  995. if (flag) {
  996. this.fileList.push(response.data);
  997. } else {
  998. let uid = fileObj.uid; // 关键作用代码,去除文件列表失败文件
  999. let idx = this.$refs.upload.uploadFiles.findIndex(
  1000. (item) => item.uid === uid
  1001. ); // 关键作用代码,去除文件列表失败文件(uploadFiles为el-upload中的ref值)
  1002. this.$refs.upload.uploadFiles.splice(idx, 1); // 关键作用代码,去除文件列表失败文件
  1003. this.$message.error("检测发票重复上传,请检查后重试");
  1004. }
  1005. loading.close();
  1006. })
  1007. .catch(() => {
  1008. let uid = fileObj.uid; // 关键作用代码,去除文件列表失败文件
  1009. let idx = this.$refs.upload.uploadFiles.findIndex(
  1010. (item) => item.uid === uid
  1011. ); // 关键作用代码,去除文件列表失败文件(uploadFiles为el-upload中的ref值)
  1012. this.$refs.upload.uploadFiles.splice(idx, 1); // 关键作用代码,去除文件列表失败文件
  1013. loading.close();
  1014. });
  1015. },
  1016. beforeUpload(files) {
  1017. var testmsg = files.name.substring(files.name.lastIndexOf(".") + 1);
  1018. const extension = testmsg === "jpg";
  1019. const extension2 = testmsg === "jpeg";
  1020. const extension3 = testmsg === "png";
  1021. if (!extension && !extension2 && !extension3) {
  1022. this.$message.warning(`请选择图片格式文件`);
  1023. }
  1024. return extension || extension2 || extension3;
  1025. },
  1026. //上传前校验
  1027. beforeAvatarUpload(file) {
  1028. const isJPG = file.type === "image/jpeg" || file.type === "image/png";
  1029. const isLt2M = file.size / 1024 / 1024 < 2;
  1030. if (!isJPG) {
  1031. this.$message.error("上传图片只能是 JPG/PNG 格式");
  1032. }
  1033. if (!isLt2M) {
  1034. this.$message.error("上传图片大小不能超过 2MB");
  1035. }
  1036. return isJPG && isLt2M;
  1037. },
  1038. //上传合同
  1039. submitUploadContract() {
  1040. this.$refs.contractUpload.submit();
  1041. },
  1042. //上传物流
  1043. submitUploadLogistics() {
  1044. this.$refs.logisticsUpload.submit();
  1045. },
  1046. //上传其他
  1047. submitUploadOther() {
  1048. this.$refs.otherUpload.submit();
  1049. },
  1050. //手动上传合同触发
  1051. httpRequestContract(param) {
  1052. const loading = this.$loading({
  1053. lock: true,
  1054. text: "Loading",
  1055. spinner: "el-icon-loading",
  1056. background: "rgba(0, 0, 0, 0.7)",
  1057. });
  1058. let fileObj = param.file; // 相当于input里取得的files
  1059. let fd = new FormData(); // FormData 对象
  1060. fd.append("file", fileObj); // 文件对象
  1061. fd.append("zbiId", this.form.zbiId); //文件类型
  1062. fd.append("type", "0"); //文件类型
  1063. uploadBillFile(fd)
  1064. .then((response) => {
  1065. response.data.url = response.data.url + "/" + getToken();
  1066. this.contractList.push(response.data);
  1067. loading.close();
  1068. })
  1069. .catch(() => {
  1070. let uid = fileObj.uid; // 关键作用代码,去除文件列表失败文件
  1071. let idx = this.$refs.contractUpload.uploadFiles.findIndex(
  1072. (item) => item.uid === uid
  1073. ); // 关键作用代码,去除文件列表失败文件(uploadFiles为el-upload中的ref值)
  1074. this.$refs.contractUpload.uploadFiles.splice(idx, 1); // 关键作用代码,去除文件列表失败文件
  1075. loading.close();
  1076. });
  1077. },
  1078. //手动上传物流触发
  1079. httpRequestLogistics(param) {
  1080. const loading = this.$loading({
  1081. lock: true,
  1082. text: "Loading",
  1083. spinner: "el-icon-loading",
  1084. background: "rgba(0, 0, 0, 0.7)",
  1085. });
  1086. let fileObj = param.file; // 相当于input里取得的files
  1087. let fd = new FormData(); // FormData 对象
  1088. fd.append("file", fileObj); // 文件对象
  1089. fd.append("zbiId", this.form.zbiId); //文件类型
  1090. fd.append("type", "1"); //文件类型
  1091. uploadBillFile(fd)
  1092. .then((response) => {
  1093. response.data.url = response.data.url + "/" + getToken();
  1094. this.logisticsList.push(response.data);
  1095. loading.close();
  1096. })
  1097. .catch(() => {
  1098. let uid = fileObj.uid; // 关键作用代码,去除文件列表失败文件
  1099. let idx = this.$refs.logisticsUpload.uploadFiles.findIndex(
  1100. (item) => item.uid === uid
  1101. ); // 关键作用代码,去除文件列表失败文件(uploadFiles为el-upload中的ref值)
  1102. this.$refs.logisticsUpload.uploadFiles.splice(idx, 1); // 关键作用代码,去除文件列表失败文件
  1103. loading.close();
  1104. });
  1105. },
  1106. //手动上传其他触发
  1107. httpRequestOther(param) {
  1108. const loading = this.$loading({
  1109. lock: true,
  1110. text: "Loading",
  1111. spinner: "el-icon-loading",
  1112. background: "rgba(0, 0, 0, 0.7)",
  1113. });
  1114. let fileObj = param.file; // 相当于input里取得的files
  1115. let fd = new FormData(); // FormData 对象
  1116. fd.append("file", fileObj); // 文件对象
  1117. fd.append("zbiId", this.form.zbiId); //文件类型
  1118. fd.append("type", "2"); //文件类型
  1119. uploadBillFile(fd)
  1120. .then((response) => {
  1121. response.data.url = response.data.url + "/" + getToken();
  1122. this.otherList.push(response.data);
  1123. loading.close();
  1124. })
  1125. .catch(() => {
  1126. let uid = fileObj.uid; // 关键作用代码,去除文件列表失败文件
  1127. let idx = this.$refs.otherUpload.uploadFiles.findIndex(
  1128. (item) => item.uid === uid
  1129. ); // 关键作用代码,去除文件列表失败文件(uploadFiles为el-upload中的ref值)
  1130. this.$refs.otherUpload.uploadFiles.splice(idx, 1); // 关键作用代码,去除文件列表失败文件
  1131. loading.close();
  1132. });
  1133. },
  1134. //删除图片
  1135. beforeRemove(file, fileList) {
  1136. let a = true;
  1137. if (file && file.status === "success") {
  1138. a = this.$confirm(`确定移除 ${file.name}?`);
  1139. }
  1140. return a;
  1141. },
  1142. //删除合同附件
  1143. handleRemoveContract(file, fileList) {
  1144. var self = this;
  1145. // if (self.contractList) {
  1146. // const loading = this.$loading({
  1147. // lock: true,
  1148. // text: 'Loading',
  1149. // spinner: 'el-icon-loading',
  1150. // background: 'rgba(0, 0, 0, 0.7)'
  1151. // });
  1152. // delFile(file.id).then(function () {
  1153. self.contractList = self.contractList.reduce((total, current) => {
  1154. current.id !== file.id && total.push(current);
  1155. return total;
  1156. }, []);
  1157. // loading.close();
  1158. // }).catch(() => {
  1159. // loading.close();
  1160. // });
  1161. // }
  1162. },
  1163. //删除物流附件
  1164. handleRemoveLogistics(file, fileList) {
  1165. // var self = this
  1166. // if (this.logisticsList) {
  1167. // const loading = this.$loading({
  1168. // lock: true,
  1169. // text: 'Loading',
  1170. // spinner: 'el-icon-loading',
  1171. // background: 'rgba(0, 0, 0, 0.7)'
  1172. // });
  1173. // delFile(file.id).then(function () {
  1174. self.logisticsList = self.logisticsList.reduce((total, current) => {
  1175. current.id !== file.id && total.push(current);
  1176. return total;
  1177. }, []);
  1178. // loading.close();
  1179. // }).catch(() => {
  1180. // loading.close();
  1181. // });
  1182. // }
  1183. },
  1184. //删除其他附件
  1185. handleRemoveOther(file, fileList) {
  1186. // var self = this
  1187. // if (this.otherList) {
  1188. // const loading = this.$loading({
  1189. // lock: true,
  1190. // text: 'Loading',
  1191. // spinner: 'el-icon-loading',
  1192. // background: 'rgba(0, 0, 0, 0.7)'
  1193. // });
  1194. // delFile(file.id).then(function () {
  1195. self.otherList = self.otherList.reduce((total, current) => {
  1196. current.id !== file.id && total.push(current);
  1197. return total;
  1198. }, []);
  1199. // loading.close();
  1200. // }).catch(() => {
  1201. // loading.close();
  1202. // });
  1203. // }
  1204. },
  1205. //删除附件
  1206. delFile(row) {
  1207. var self = this;
  1208. const ids = row.id || this.ids;
  1209. self.fullscreenLoading = true;
  1210. delFile(ids).then(function () {
  1211. self.fullscreenLoading = false;
  1212. });
  1213. },
  1214. //查看图片
  1215. invoicePictureCardPreview(file) {
  1216. this.invoiceImageUrl = file.url;
  1217. this.invoiceVisible = true;
  1218. },
  1219. //删除发票
  1220. invoiceRemove(file, fileList) {
  1221. var self = this;
  1222. if (file && file.status === "success") {
  1223. this.fileList = this.fileList.filter((item) => {
  1224. if (item.uid !== file.uid) {
  1225. return item;
  1226. } else {
  1227. // const loading = this.$loading({
  1228. // lock: true,
  1229. // text: 'Loading',
  1230. // spinner: 'el-icon-loading',
  1231. // background: 'rgba(0, 0, 0, 0.7)'
  1232. // });
  1233. // delFile(item.id)
  1234. // .then(function () {
  1235. // loading.close();
  1236. // this.msgSuccess("删除成功");
  1237. // })
  1238. // .catch(() => {
  1239. // loading.close();
  1240. // });
  1241. }
  1242. });
  1243. }
  1244. },
  1245. //删除发票
  1246. delInvoice(row) {
  1247. var self = this;
  1248. const ids = row.id ? [row.id] : this.ids;
  1249. if (ids && ids.length != 0) {
  1250. this.$confirm("是否确认删除此数据项?", "警告", {
  1251. confirmButtonText: "确定",
  1252. cancelButtonText: "取消",
  1253. type: "warning",
  1254. })
  1255. // .then(function () {
  1256. // self.fullscreenLoading = true;
  1257. // return delFile(ids);
  1258. // })
  1259. .then(() => {
  1260. // self.fullscreenLoading = false;
  1261. ids.forEach((element) => {
  1262. self.fileList = self.fileList.reduce((total, current) => {
  1263. current.id !== element && total.push(current);
  1264. return total;
  1265. }, []);
  1266. });
  1267. this.msgSuccess("删除成功");
  1268. });
  1269. }
  1270. },
  1271. //确认发票
  1272. submitCheck() {
  1273. this.open = false;
  1274. },
  1275. //发票合计
  1276. allAmount() {
  1277. var strarr = [0.0];
  1278. for (let i in this.fileList) {
  1279. // if (this.fileList[i]["ziiCheckStt"] == "1") {
  1280. strarr.push(this.fileList[i]["ziiAmount"]);
  1281. // }
  1282. }
  1283. return (Math.floor(eval(strarr.join("+")) * 100) / 100).toFixed(2); //结果
  1284. // return this.handleInput(eval(strarr.join("+"))); //结果
  1285. },
  1286. // 结束
  1287. submit() {
  1288. this.$refs["form"].validate((valid) => {
  1289. if (valid) {
  1290. this.form.zbiAmount = this.allAmount();
  1291. this.form.fileList = this.fileList;
  1292. this.form.contractList = this.contractList;
  1293. this.form.logisticsList = this.logisticsList;
  1294. this.form.otherList = this.otherList;
  1295. const loading = this.$loading({
  1296. lock: true,
  1297. text: "Loading",
  1298. spinner: "el-icon-loading",
  1299. background: "rgba(0, 0, 0, 0.7)",
  1300. });
  1301. commitBill(this.form)
  1302. .then((response) => {
  1303. loading.close();
  1304. this.msgSuccess("修改账款成功");
  1305. this.$store.dispatch("tagsView/delView", this.$route);
  1306. this.$router.go(-1);
  1307. })
  1308. .catch(() => {
  1309. loading.close();
  1310. });
  1311. }
  1312. });
  1313. },
  1314. //校验结果字典
  1315. checkSttFormat(row, column) {
  1316. return this.selectDictLabel(this.checkSttOptions, row.ziiCheckStt);
  1317. },
  1318. /* 金额展示 */
  1319. handleInput(str) {
  1320. return amtformat(str, 2, ".", ",");
  1321. },
  1322. /* // 将数字金额转换为大写金额 */
  1323. smallToBig(money) {
  1324. // 将数字金额转换为大写金额
  1325. var cnNums = new Array(
  1326. "零",
  1327. "壹",
  1328. "贰",
  1329. "叁",
  1330. "肆",
  1331. "伍",
  1332. "陆",
  1333. "柒",
  1334. "捌",
  1335. "玖"
  1336. ); //汉字的数字
  1337. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  1338. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  1339. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  1340. var cnInteger = "整"; //整数金额时后面跟的字符
  1341. var cnIntLast = "元"; //整数完以后的单位
  1342. //最大处理的数字
  1343. var maxNum = 999999999999999.9999;
  1344. var integerNum; //金额整数部分
  1345. var decimalNum; //金额小数部分
  1346. //输出的中文金额字符串
  1347. var chineseStr = "";
  1348. var parts; //分离金额后用的数组,预定义
  1349. if (money == "" || money == null || money == undefined) {
  1350. return "零元零角零分";
  1351. }
  1352. money = parseFloat(money);
  1353. if (money >= maxNum) {
  1354. //超出最大处理数字
  1355. return "超出最大处理数字";
  1356. }
  1357. if (money == 0) {
  1358. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  1359. return chineseStr;
  1360. }
  1361. //四舍五入保留两位小数,转换为字符串
  1362. money = Math.round(money * 100).toString();
  1363. integerNum = money.substr(0, money.length - 2);
  1364. decimalNum = money.substr(money.length - 2);
  1365. //获取整型部分转换
  1366. if (parseInt(integerNum, 10) > 0) {
  1367. var zeroCount = 0;
  1368. var IntLen = integerNum.length;
  1369. for (var i = 0; i < IntLen; i++) {
  1370. var n = integerNum.substr(i, 1);
  1371. var p = IntLen - i - 1;
  1372. var q = p / 4;
  1373. var m = p % 4;
  1374. if (n == "0") {
  1375. zeroCount++;
  1376. } else {
  1377. if (zeroCount > 0) {
  1378. chineseStr += cnNums[0];
  1379. }
  1380. //归零
  1381. zeroCount = 0;
  1382. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  1383. }
  1384. if (m == 0 && zeroCount < 4) {
  1385. chineseStr += cnIntUnits[q];
  1386. }
  1387. }
  1388. chineseStr += cnIntLast;
  1389. }
  1390. //小数部分
  1391. if (decimalNum != "") {
  1392. var decLen = decimalNum.length;
  1393. for (var i = 0; i < decLen; i++) {
  1394. var n = decimalNum.substr(i, 1);
  1395. if (n != "0") {
  1396. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  1397. }
  1398. }
  1399. }
  1400. if (chineseStr == "") {
  1401. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  1402. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  1403. chineseStr += cnInteger;
  1404. }
  1405. return chineseStr;
  1406. },
  1407. },
  1408. };
  1409. </script>
  1410. <style>
  1411. .el-table .warning-row {
  1412. background: rgb(223, 223, 223);
  1413. }
  1414. </style>