tranManagementDriverAdd.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. //添加司机
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">添加新司机</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnsales()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <ws-form
  25. ref="deptBudgetList"
  26. :rules="mainReportAdd"
  27. :model="deptBudgetList"
  28. >
  29. <div class="drivermessage">
  30. <div class="small-title">司机信息</div>
  31. <ws-info-table>
  32. <!--司机姓名-->
  33. <ws-form-item
  34. label="姓名"
  35. span="1"
  36. prop="contractNo"
  37. class="readonly bg-right"
  38. >
  39. <ws-input
  40. v-model="deptBudgetList.driverName"
  41. placeholder="请输入司机姓名"
  42. maxlength="20"
  43. size="small"
  44. />
  45. </ws-form-item>
  46. <!--手机号-->
  47. <ws-form-item
  48. label="手机号"
  49. span="1"
  50. prop="driverPhone"
  51. class="readonly"
  52. >
  53. <ws-input
  54. v-model="deptBudgetList.driverPhone"
  55. placeholder="请输入手机号"
  56. maxlength="100"
  57. size="small"
  58. />
  59. </ws-form-item>
  60. <!--常驻城市-->
  61. <ws-form-item label="常驻城市" span="1" prop="acceptanceMethod">
  62. <el-cascader
  63. :options="options_"
  64. v-model="selectedOptions"
  65. clearable
  66. size="large"
  67. placeholder="请选择常驻城市"
  68. style="width: 200%"
  69. class="el-cascader"
  70. @change="handleChange"
  71. />
  72. </ws-form-item>
  73. <!--身份证号-->
  74. <ws-form-item
  75. label="身份证号"
  76. span="1"
  77. prop="driverNo"
  78. class="readonly"
  79. >
  80. <ws-input
  81. @input="cardchange"
  82. v-model="deptBudgetList.numberCard"
  83. placeholder="请输入身份证号"
  84. maxlength="100"
  85. size="small"
  86. />
  87. </ws-form-item>
  88. </ws-info-table>
  89. <span v-if="age && age < 60" class="small">{{ age }}岁</span>
  90. <span v-if="age && age > 60" class="big">{{ age }}岁</span>
  91. </div>
  92. </ws-form>
  93. <ws-form
  94. ref="deptBudgetList"
  95. :rules="mainReportAdd"
  96. :model="deptBudgetList"
  97. >
  98. <div class="small-title">货车信息</div>
  99. <div
  100. style="width: 100%"
  101. class="flex position"
  102. v-for="(item, index) in freightspace"
  103. >
  104. <div class="trucks">
  105. <div class="driver">货车信息-{{ index + 1 }}</div>
  106. <ws-info-table class="el-table">
  107. <!--车牌号-->
  108. <ws-form-item
  109. label="车牌号"
  110. span="1"
  111. prop="carNumber"
  112. class="forlist"
  113. width="400px"
  114. >
  115. <ws-input
  116. v-model="item.carNumber"
  117. placeholder="请输入车牌号"
  118. maxlength="20"
  119. size="small"
  120. />
  121. </ws-form-item>
  122. <!--车型-->
  123. <ws-form-item label="车型" span="1" prop="carModel" class="forlist">
  124. <ws-select
  125. v-model="item.carModel"
  126. placeholder=""
  127. class="typeselect"
  128. @change="selectcarModel"
  129. >
  130. <ws-option
  131. v-for="item in carModelList"
  132. :key="item.constKey"
  133. :label="item.constValue"
  134. :value="item.constValue"
  135. />
  136. </ws-select>
  137. </ws-form-item>
  138. <!--车长-->
  139. <ws-form-item
  140. label="不含车头车长(米)"
  141. span="1"
  142. prop="carLength"
  143. class="forlist"
  144. >
  145. <el-select
  146. v-model="item.carLength"
  147. placeholder=""
  148. class="typeselect"
  149. @change="selectcarLength"
  150. filterable
  151. allow-create
  152. default-first-option
  153. >
  154. <el-option
  155. v-for="item in carLengthList"
  156. :key="item.constKey"
  157. :label="item.constValue"
  158. :value="item.constValue"
  159. />
  160. </el-select>
  161. </ws-form-item>
  162. <!--载重-->
  163. <ws-form-item label="载重" span="1" prop="carLoad" class="forlist">
  164. <ws-input
  165. v-model="item.carLoad"
  166. placeholder="请输入载重"
  167. maxlength="100"
  168. size="small"
  169. />
  170. </ws-form-item>
  171. <!--出厂年份-->
  172. <ws-form-item
  173. label="出厂年份"
  174. span="1"
  175. prop="yearManufacture"
  176. class="forlist"
  177. >
  178. <ws-input
  179. v-model="item.yearManufacture"
  180. placeholder="请输入年份"
  181. maxlength="100"
  182. size="small"
  183. />
  184. </ws-form-item>
  185. </ws-info-table>
  186. <img
  187. width="22"
  188. height="22"
  189. class="add"
  190. @click="add"
  191. src="../../../public/img/add.png"
  192. alt=""
  193. />
  194. <img
  195. width="22"
  196. height="22"
  197. class="del"
  198. @click="del(index)"
  199. src="../../../public/img/del.png"
  200. alt=""
  201. />
  202. </div>
  203. </div>
  204. </ws-form>
  205. <ws-form
  206. ref="deptBudgetList"
  207. :rules="mainReportAdd"
  208. :model="deptBudgetList"
  209. >
  210. <div class="small-title">收款人账户信息</div>
  211. <div
  212. style="width: 100%"
  213. class="flex position"
  214. v-for="(item, index) in freightspace1"
  215. >
  216. <div class="gathering">
  217. <div class="driver">收款人账户信息-{{ index + 1 }}</div>
  218. <ws-info-table class="el-table">
  219. <!--账户类型-->
  220. <ws-form-item
  221. label="账户类型"
  222. span="1"
  223. prop="contractNo"
  224. class="el-car bg-right"
  225. >
  226. <el-radio v-model="item.accountTypeFlag" label="1"
  227. >私人账号</el-radio
  228. >
  229. <el-radio v-model="item.accountTypeFlag" label="2"
  230. >企业账户</el-radio
  231. >
  232. </ws-form-item>
  233. <!--账号-->
  234. <ws-form-item label="账号" span="1" prop="bankCard" class="el-car">
  235. <ws-input
  236. v-model="item.bankCard"
  237. placeholder="请输入账号"
  238. maxlength="100"
  239. size="small"
  240. />
  241. <el-upload
  242. action="https://www.zthymaoyi.com/upload/admin"
  243. :show-file-list="false"
  244. :on-success="
  245. (res, file) => {
  246. uploadSuccessHandle1(index, res, file)
  247. }
  248. "
  249. class="avatar-uploader"
  250. accept=".jpg, .jpeg, .png, .gif"
  251. ><img
  252. width="18"
  253. height="20"
  254. style="
  255. vertical-align: text-top;
  256. position: relative;
  257. top: -1px;
  258. "
  259. src="../../../public/img/fujian.png"
  260. alt=""
  261. />
  262. </el-upload>
  263. </ws-form-item>
  264. <!--开户行-->
  265. <ws-form-item
  266. label="开户行"
  267. span="1"
  268. prop="bankDeposit"
  269. class="el-car"
  270. >
  271. <ws-input
  272. v-model="item.bankDeposit"
  273. placeholder="请输入开户行"
  274. maxlength="100"
  275. size="small"
  276. />
  277. </ws-form-item>
  278. <!--姓名-->
  279. <ws-form-item
  280. label="姓名"
  281. v-if="item.accountTypeFlag == 1"
  282. span="1"
  283. prop="payeeName"
  284. class="el-car"
  285. width="150px"
  286. >
  287. <ws-input
  288. v-model="item.payeeName"
  289. placeholder="请输入姓名"
  290. maxlength="100"
  291. size="small"
  292. />
  293. </ws-form-item>
  294. <!--企业名称-->
  295. <ws-form-item
  296. label="企业名称"
  297. v-else
  298. span="1"
  299. prop="compName"
  300. class="el-car"
  301. width="150px"
  302. >
  303. <ws-input
  304. v-model="item.compName"
  305. placeholder="请输入企业名称"
  306. maxlength="100"
  307. size="small"
  308. />
  309. </ws-form-item>
  310. <!--身份证号-->
  311. <ws-form-item
  312. label="身份证号"
  313. v-if="item.accountTypeFlag == 1"
  314. span="1"
  315. prop="payeeNumberCard"
  316. class="el-car"
  317. >
  318. <ws-input
  319. v-model="item.payeeNumberCard"
  320. placeholder="请输入身份证号"
  321. maxlength="100"
  322. size="small"
  323. />
  324. <el-upload
  325. action="https://www.zthymaoyi.com/upload/admin"
  326. :show-file-list="false"
  327. :on-success="
  328. (res, file) => {
  329. uploadSuccessHandle(index, res, file)
  330. }
  331. "
  332. class="avatar-uploader"
  333. accept=".jpg, .jpeg, .png, .gif"
  334. ><img
  335. width="18"
  336. height="20"
  337. style="
  338. vertical-align: text-top;
  339. position: relative;
  340. top: -1px;
  341. "
  342. src="../../../public/img/fujian.png"
  343. alt=""
  344. />
  345. </el-upload>
  346. </ws-form-item>
  347. <ws-form-item
  348. class="el-car"
  349. label="开户支行"
  350. span="1"
  351. prop="bankDepositBranch"
  352. >
  353. <ws-select
  354. v-model="item.bankDepositBranch"
  355. placeholder=""
  356. class="typeselect"
  357. @change="
  358. (value) => {
  359. selectbankDepositBranch(value, index)
  360. }
  361. "
  362. >
  363. <ws-option
  364. v-for="(items, index) in item.bankDepositBranchList"
  365. :key="index"
  366. :label="items"
  367. :value="items"
  368. />
  369. </ws-select>
  370. </ws-form-item>
  371. </ws-info-table>
  372. <img
  373. width="22"
  374. height="22"
  375. class="add"
  376. @click="add1"
  377. src="../../../public/img/add.png"
  378. alt=""
  379. />
  380. <img
  381. width="22"
  382. height="22"
  383. class="del"
  384. @click="del1(index)"
  385. src="../../../public/img/del.png"
  386. alt=""
  387. />
  388. </div>
  389. </div>
  390. </ws-form>
  391. <ws-form
  392. ref="deptBudgetList"
  393. :rules="mainReportAdd"
  394. :model="deptBudgetList"
  395. >
  396. <div class="flex">
  397. <div>
  398. <el-upload
  399. action="https://www.zthymaoyi.com/upload/admin"
  400. :show-file-list="false"
  401. :on-success="uploadSuccessHandletravel"
  402. class="avatar-uploader"
  403. accept=".jpg, .jpeg, .png, .gif"
  404. ><el-button class="upload button" size="small" type="primary"
  405. >行驶证</el-button
  406. >
  407. </el-upload>
  408. <img
  409. v-show="addressUrls.travel"
  410. width="100"
  411. height="100"
  412. :src="addressUrls.travel"
  413. alt=""
  414. />
  415. </div>
  416. <div>
  417. <el-upload
  418. action="https://www.zthymaoyi.com/upload/admin"
  419. :show-file-list="false"
  420. :on-success="uploadSuccessHandledrive"
  421. class="avatar-uploader"
  422. accept=".jpg, .jpeg, .png, .gif"
  423. ><el-button class="upload button" size="small" type="primary"
  424. >驾驶证</el-button
  425. >
  426. </el-upload>
  427. <img
  428. v-if="addressUrls.drive"
  429. width="100"
  430. height="100"
  431. :src="addressUrls.drive"
  432. alt=""
  433. />
  434. </div>
  435. <div>
  436. <el-upload
  437. action="https://www.zthymaoyi.com/upload/admin"
  438. :show-file-list="false"
  439. :on-success="uploadSuccessHandleway"
  440. class="avatar-uploader"
  441. accept=".jpg, .jpeg, .png, .gif"
  442. ><el-button class="upload button-green" size="small" type="primary"
  443. >道路运营证</el-button
  444. >
  445. </el-upload>
  446. <img
  447. v-if="addressUrls.way"
  448. width="100"
  449. height="100"
  450. :src="addressUrls.way"
  451. alt=""
  452. />
  453. </div>
  454. <div>
  455. <el-upload
  456. action="https://www.zthymaoyi.com/upload/admin"
  457. :show-file-list="false"
  458. :on-success="uploadSuccessHandlequalification"
  459. class="avatar-uploader"
  460. accept=".jpg, .jpeg, .png, .gif"
  461. ><el-button class="upload button-green" size="small" type="primary"
  462. >从业资格证</el-button
  463. >
  464. </el-upload>
  465. <img
  466. v-if="addressUrls.qualification"
  467. width="100"
  468. height="100"
  469. :src="addressUrls.qualification"
  470. alt=""
  471. />
  472. </div>
  473. <div>
  474. <el-upload
  475. action="https://www.zthymaoyi.com/upload/admin"
  476. :show-file-list="false"
  477. :on-success="uploadSuccessHandleidentityjust"
  478. class="avatar-uploader"
  479. accept=".jpg, .jpeg, .png, .gif"
  480. ><el-button class="upload button-yellow" size="small" type="primary"
  481. >身份证正面</el-button
  482. >
  483. </el-upload>
  484. <img
  485. v-if="addressUrls.identityjust"
  486. width="100"
  487. height="100"
  488. :src="addressUrls.identityjust"
  489. alt=""
  490. />
  491. </div>
  492. <div>
  493. <el-upload
  494. action="https://www.zthymaoyi.com/upload/admin"
  495. :show-file-list="false"
  496. :on-success="uploadSuccessHandleidentityagainst"
  497. class="avatar-uploader"
  498. accept=".jpg, .jpeg, .png, .gif"
  499. ><el-button class="upload button-yellow" size="small" type="primary"
  500. >身份证反面</el-button
  501. >
  502. </el-upload>
  503. <img
  504. v-if="addressUrls.identityagainst"
  505. width="100"
  506. height="100"
  507. :src="addressUrls.identityagainst"
  508. alt=""
  509. />
  510. </div>
  511. </div>
  512. </ws-form>
  513. <!-- 提交 -->
  514. <div style="text-align: right; padding: 10px" class="center">
  515. <el-button
  516. class="bg-bottom"
  517. type="primary"
  518. size="small"
  519. @click="submit(deptBudgetList)"
  520. >提交</el-button
  521. >
  522. </div>
  523. </div>
  524. </template>
  525. <script>
  526. import { provinceAndCityData, CodeToText } from 'element-china-area-data'
  527. import { packList } from '@/model/contarct/index'
  528. import { getidentity, getbank, addDriver } from '@/model/transport/index'
  529. import WsUpload from '@/components/WsUpload'
  530. import mapDrag from '@/components/mapdrag/mapdrag'
  531. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  532. export default {
  533. name: 'viewSpareMoney',
  534. components: {
  535. WsUpload,
  536. mapDrag,
  537. },
  538. watch: {
  539. vesselId(val) {
  540. this.getVesselData()
  541. },
  542. isShow(val) {
  543. this.showType = val
  544. },
  545. },
  546. data() {
  547. let self = this
  548. return {
  549. deptBudgetList: {
  550. totalStorage: 0,
  551. drivercarInfo: {
  552. goodsName: '',
  553. },
  554. driverPayeeInfo: {},
  555. },
  556. radio: '1',
  557. carModelList: [],
  558. carLengthList: [],
  559. options_: provinceAndCityData,
  560. selectedOptions: [],
  561. window: '',
  562. district: null,
  563. citylist: [],
  564. compId: sessionStorage.getItem('ws-pf_compId'),
  565. mainReportAdd: {},
  566. size: 10,
  567. value1: '',
  568. unitList: [],
  569. accessoryBankTFs: false,
  570. addressUrls: {},
  571. freightspace: [
  572. {
  573. carNumber: '',
  574. carModel: '高栏',
  575. carModelKey: '1',
  576. carLength: '13',
  577. carLengthKey: '1',
  578. carLoad: '',
  579. yearManufacture: '',
  580. },
  581. ],
  582. freightspace1: [
  583. {
  584. accountTypeFlag: '1',
  585. payeeName: '',
  586. payeeNumberCard: '',
  587. compName: '',
  588. bankDeposit: '',
  589. addressUrlArray: [],
  590. bankCard: '',
  591. },
  592. ],
  593. name: '',
  594. age: '',
  595. }
  596. },
  597. activated() {
  598. this.loaddata()
  599. this.showType = this.isShow
  600. },
  601. computed: {},
  602. methods: {
  603. cardchange(e) {
  604. if (e.length == 15 || e.length == 18) {
  605. this.IdCard(e)
  606. }
  607. },
  608. IdCard(UUserCard) {
  609. //获取年龄
  610. var myDate = new Date()
  611. var month = myDate.getMonth() + 1
  612. var day = myDate.getDate()
  613. var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1
  614. if (
  615. UUserCard.substring(10, 12) < month ||
  616. (UUserCard.substring(10, 12) == month &&
  617. UUserCard.substring(12, 14) <= day)
  618. ) {
  619. age++
  620. }
  621. this.age = age
  622. },
  623. bankcardfujian(item) {
  624. this.accessoryBankTFs = true
  625. },
  626. loaddata() {
  627. // 车型
  628. packList({ constId: 'TRAN1' })
  629. .toPromise()
  630. .then((response) => {
  631. this.carModelList = response
  632. })
  633. // 车长
  634. packList({ constId: 'TRAN2' })
  635. .toPromise()
  636. .then((response) => {
  637. this.carLengthList = response
  638. })
  639. },
  640. uploadSuccessHandle(index, e, fileList) {
  641. console.log(index, e, fileList)
  642. const that = this
  643. getidentity({ personImg: e.url })
  644. .toPromise()
  645. .then((response) => {
  646. for (var i = 0; i < this.freightspace1.length; i++) {
  647. if (i == index) {
  648. this.freightspace1[i].cardAddressUrl = e.url
  649. this.freightspace1[i].payeeName = response.recPerson
  650. this.freightspace1[i].payeeNumberCard = response.recPersonNo
  651. }
  652. }
  653. })
  654. },
  655. uploadSuccessHandle1(index, e, fileList) {
  656. console.log(index, e, fileList)
  657. const that = this
  658. // this.deptBudgetList.cardAddressUrl = e.url
  659. getbank({ bankImg: e.url })
  660. .toPromise()
  661. .then((response) => {
  662. for (var i = 0; i < this.freightspace1.length; i++) {
  663. if (i == index) {
  664. this.freightspace1[i].payeeAddressUrl = e.url
  665. this.freightspace1[i].bankCard = response.bankNo
  666. this.freightspace1[i].bankDeposit = response.bankName
  667. this.freightspace1[i].bankDepositBranchList =
  668. response.bankNameZhihang
  669. }
  670. }
  671. })
  672. },
  673. uploadSuccessHandletravel(e) {
  674. this.$set(this.addressUrls, 'travel', e.url)
  675. },
  676. uploadSuccessHandledrive(e) {
  677. this.$set(this.addressUrls, 'drive', e.url)
  678. },
  679. uploadSuccessHandleway(e) {
  680. this.$set(this.addressUrls, 'way', e.url)
  681. this.addressUrls.way = e.url
  682. },
  683. uploadSuccessHandlequalification(e) {
  684. this.$set(this.addressUrls, 'qualification', e.url)
  685. },
  686. uploadSuccessHandleidentityjust(e) {
  687. this.$set(this.addressUrls, 'identityjust', e.url)
  688. },
  689. uploadSuccessHandleidentityagainst(e) {
  690. this.$set(this.addressUrls, 'identityagainst', e.url)
  691. },
  692. selectbankDepositBranch(e, index) {
  693. this.freightspace1[index].bankDepositBranch = e
  694. },
  695. // 关闭 dialog时 处理文件url 初始化upload组件
  696. handleClose() {
  697. this.dialogViewSpareMoney = false
  698. },
  699. add() {
  700. this.freightspace.push({
  701. carNumber: '',
  702. carModel: '高栏',
  703. carModelKey: '1',
  704. carLength: '13',
  705. carLengthKey: '1',
  706. carLoad: '',
  707. yearManufacture: '',
  708. })
  709. },
  710. del(index) {
  711. if (this.freightspace.length > 1) {
  712. this.freightspace.splice(index, 1)
  713. }
  714. },
  715. add1() {
  716. this.freightspace1.push({
  717. accountTypeFlag: '1',
  718. payeeName: '',
  719. payeeNumberCard: '',
  720. compName: '',
  721. bankDeposit: '',
  722. bankCard: '',
  723. addressUrlArray: [],
  724. })
  725. },
  726. del1(index) {
  727. if (this.freightspace1.length > 1) {
  728. this.freightspace1.splice(index, 1)
  729. }
  730. },
  731. identitycardfujian(item) {},
  732. handleChange(value) {
  733. this.selectedOptions = value
  734. },
  735. returnsales() {
  736. this.$router.push({ path: 'tranManagementDriver' })
  737. },
  738. // confirmPosition() {
  739. // this.draggable = false
  740. // },
  741. // 上传附件
  742. uploadSuccess(data, files, url) {
  743. console.log(data, files, url)
  744. // this.deptBudgetList.
  745. // this.formData.append('files', files)
  746. // this.feedbackObj.uploadNameAttachment = data.appendixName
  747. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  748. // // this.newAppendixs = files
  749. // this.onChangeFlag = true
  750. },
  751. selectcarModel(e) {
  752. for (var i = 0; i < this.carModelList.length; i++) {
  753. if (this.carModelList[i].constValue == e) {
  754. this.deptBudgetList.carModelKey = this.carModelList[i].constKey
  755. }
  756. }
  757. },
  758. selectcarLength(e) {
  759. for (var i = 0; i < this.carLengthList.length; i++) {
  760. if (this.carLengthList[i].constValue == e) {
  761. this.deptBudgetList.carLengthKey = this.carLengthList[i].constKey
  762. }
  763. }
  764. },
  765. onChange(files) {
  766. this.fileNum = files
  767. this.$refs.upload.handleSaveBill().then((res) => {
  768. console.log(files)
  769. })
  770. },
  771. submit() {
  772. if (!this.deptBudgetList.driverName) {
  773. EventBus.$emit('error', '司机姓名不能为空')
  774. return
  775. }
  776. if (
  777. this.deptBudgetList.driverName.length < 2 ||
  778. this.deptBudgetList.driverName.length > 10
  779. ) {
  780. EventBus.$emit('error', '司机姓名输入错误')
  781. return
  782. }
  783. if (!this.deptBudgetList.driverPhone) {
  784. EventBus.$emit('error', '司机手机不能为空')
  785. return
  786. }
  787. if (this.deptBudgetList.driverPhone.length != 11) {
  788. console.log(this.deptBudgetList.driverPhone.length)
  789. EventBus.$emit('error', '司机手机号输入有误')
  790. return
  791. }
  792. if (!this.deptBudgetList.numberCard) {
  793. EventBus.$emit('error', '司机身份证不能为空')
  794. return
  795. }
  796. if (this.deptBudgetList.numberCard.length != 18) {
  797. EventBus.$emit('error', '司机身份证号输入错误')
  798. return
  799. }
  800. for (var i = 0; i < this.freightspace.length; i++) {
  801. if (this.freightspace[i].carNumber == '') {
  802. EventBus.$emit('error', '车牌号不能为空')
  803. return
  804. }
  805. if (this.freightspace[i].carNumber.length != 7) {
  806. EventBus.$emit('error', '车牌号输入错误')
  807. return
  808. }
  809. if (this.freightspace[i].carLoad == '') {
  810. EventBus.$emit('error', '载重不能为空')
  811. return
  812. }
  813. if (this.freightspace[i].carLength > 50) {
  814. EventBus.$emit('error', '载重量输入错误')
  815. return
  816. }
  817. if (this.freightspace[i].yearManufacture == '') {
  818. EventBus.$emit('error', '出厂年份不能为空')
  819. return
  820. }
  821. if (this.freightspace[i].yearManufacture.length != 4) {
  822. EventBus.$emit('error', '出厂年份输入错误')
  823. return
  824. }
  825. }
  826. for (var i = 0; i < this.freightspace1.length; i++) {
  827. if (this.freightspace1[i].bankCard == '') {
  828. EventBus.$emit('error', '银行卡账号不能为空')
  829. return
  830. }
  831. if (this.freightspace1[i].bankDeposit == '') {
  832. EventBus.$emit('error', '开户行不能为空')
  833. return
  834. }
  835. if (this.freightspace1[i].bankDepositBranch == '') {
  836. EventBus.$emit('error', '开户支行不能为空')
  837. return
  838. }
  839. if (
  840. this.freightspace1[i].accountTypeFlag == 1 &&
  841. this.freightspace1[i].payeeName == ''
  842. ) {
  843. EventBus.$emit('error', '收款人姓名不能为空')
  844. return
  845. }
  846. if (
  847. this.freightspace1[i].accountTypeFlag == 1 &&
  848. this.freightspace1[i].payeeNumberCard == ''
  849. ) {
  850. EventBus.$emit('error', '收款人身份证号码不能为空')
  851. return
  852. }
  853. if (
  854. (this.freightspace1[i].accountTypeFlag == 1 &&
  855. this.freightspace1[i].payeeName.length < 2) ||
  856. (this.freightspace1[i].accountTypeFlag == 1 &&
  857. this.freightspace1[i].payeeName.length > 10)
  858. ) {
  859. EventBus.$emit('error', '收款人姓名输入错误')
  860. return
  861. }
  862. console.log(this.freightspace1[i].payeeNumberCard != 18)
  863. if (
  864. this.freightspace1[i].accountTypeFlag == 1 &&
  865. this.freightspace1[i].payeeNumberCard.length != 18
  866. ) {
  867. EventBus.$emit('error', '收款人身份证号输入错误')
  868. return
  869. }
  870. if (
  871. this.freightspace1[i].accountTypeFlag == 2 &&
  872. this.freightspace1[i].compName == ''
  873. ) {
  874. EventBus.$emit('error', '企业名称不能为空')
  875. return
  876. }
  877. if (
  878. (this.freightspace1[i].accountTypeFlag == 2 &&
  879. this.freightspace1[i].compName.length < 2) ||
  880. (this.freightspace1[i].accountTypeFlag == 2 &&
  881. this.freightspace1[i].compName.length > 30)
  882. ) {
  883. EventBus.$emit('error', '企业名称输入有误')
  884. return
  885. }
  886. }
  887. if (!this.addressUrls.travel) {
  888. EventBus.$emit('error', '行驶证不能为空')
  889. return
  890. }
  891. if (!this.addressUrls.drive) {
  892. EventBus.$emit('error', '驾驶证不能为空')
  893. return
  894. }
  895. if (!this.addressUrls.way) {
  896. EventBus.$emit('error', '道路运营证不能为空')
  897. return
  898. }
  899. if (!this.addressUrls.qualification) {
  900. EventBus.$emit('error', '从业资格证不能为空')
  901. return
  902. }
  903. if (!this.addressUrls.identityjust) {
  904. EventBus.$emit('error', '身份证正面不能为空')
  905. return
  906. }
  907. if (!this.addressUrls.identityagainst) {
  908. EventBus.$emit('error', '身份证反面不能为空')
  909. return
  910. }
  911. var arr = []
  912. for (let key in this.addressUrls) {
  913. arr.push(this.addressUrls[key])
  914. }
  915. this.$refs.deptBudgetList.validate((valid) => {
  916. if (valid) {
  917. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  918. this.deptBudgetList.residentCityProvincial =
  919. CodeToText[this.selectedOptions[0]]
  920. this.deptBudgetList.residentCityMunicipal =
  921. CodeToText[this.selectedOptions[1]]
  922. this.deptBudgetList.addressUrl = arr.toString()
  923. this.deptBudgetList.driverCarInfoList = this.freightspace
  924. this.deptBudgetList.driverPayeeInfoList = this.freightspace1
  925. // addDriver(this.deptBudgetList)
  926. // .toPromise()
  927. // .then((response) => {
  928. // this.$message.success('添加成功')
  929. // this.deptBudgetList = {}
  930. // this.freightspace = [
  931. // {
  932. // carNumber: '',
  933. // carModel: '高栏',
  934. // carModelKey: '1',
  935. // carLength: '13',
  936. // carLengthKey: '1',
  937. // carLoad: '',
  938. // yearManufacture: '',
  939. // },
  940. // ]
  941. // this.freightspace1 = [
  942. // {
  943. // accountTypeFlag: '1',
  944. // payeeName: '',
  945. // payeeNumberCard: '',
  946. // compName: '',
  947. // bankDeposit: '',
  948. // addressUrlArray: [],
  949. // bankCard: '',
  950. // },
  951. // ]
  952. // this.$router.push({ path: 'tranManagementDriver' })
  953. // })
  954. } else {
  955. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  956. return false
  957. }
  958. })
  959. },
  960. resetForm(deptBudgetList) {
  961. this.$refs[deptBudgetList].resetFields()
  962. },
  963. },
  964. }
  965. </script>
  966. <style lang="scss" scoped>
  967. .position {
  968. position: relative;
  969. }
  970. .add,
  971. .del {
  972. position: absolute;
  973. right: -38px;
  974. top: 9px;
  975. cursor: pointer;
  976. }
  977. .del {
  978. right: -70px;
  979. }
  980. .amap-page-container {
  981. width: 300px;
  982. height: 300px;
  983. }
  984. .el-form {
  985. padding: 0 10%;
  986. }
  987. /deep/.ws-info-table .el-form-item {
  988. border-right: 1px solid #cdd2dc;
  989. border-bottom: 1px solid #cdd2dc;
  990. }
  991. .readonly {
  992. position: relative;
  993. }
  994. .title {
  995. position: relative;
  996. }
  997. .el-car {
  998. width: 413px;
  999. }
  1000. .title::before {
  1001. content: '';
  1002. display: inline-block;
  1003. width: 5px;
  1004. height: 30px;
  1005. background: #5473e8;
  1006. position: absolute;
  1007. left: 0;
  1008. }
  1009. .el-col {
  1010. background: #f6f7fc;
  1011. }
  1012. .button-container {
  1013. display: flex;
  1014. flex-wrap: nowrap;
  1015. justify-content: space-between;
  1016. align-items: center;
  1017. background-color: #fff;
  1018. width: 100%;
  1019. height: 50px;
  1020. padding: 0 10px;
  1021. & > div {
  1022. margin-left: 10px;
  1023. display: flex;
  1024. flex-wrap: nowrap;
  1025. flex-direction: row;
  1026. & > span {
  1027. line-height: 50px;
  1028. }
  1029. }
  1030. /deep/.auditFlow-box {
  1031. position: unset;
  1032. margin-left: 10px;
  1033. &/deep/.auditFlow-icon {
  1034. width: auto;
  1035. padding-right: 30px;
  1036. }
  1037. &/deep/.auditFlow-main {
  1038. position: absolute;
  1039. }
  1040. }
  1041. }
  1042. .box-app {
  1043. display: inline-block;
  1044. float: left;
  1045. margin-left: 30px;
  1046. line-height: 50px;
  1047. }
  1048. /deep/.el-dialog {
  1049. .el-form-item {
  1050. margin-bottom: 0 !important;
  1051. .el-input--medium {
  1052. textarea {
  1053. min-height: 100px !important;
  1054. }
  1055. }
  1056. }
  1057. }
  1058. .avatar-uploader {
  1059. margin: 0 5px;
  1060. }
  1061. .collapse-bottom {
  1062. margin-bottom: 20px;
  1063. }
  1064. .input-main .textarea .el-textarea__inner {
  1065. width: 100%;
  1066. z-index: 1;
  1067. }
  1068. .el-form-item__label {
  1069. text-align: center;
  1070. }
  1071. // 控制select为只读的时候显示样式
  1072. /deep/.ws-class-table-col {
  1073. height: auto;
  1074. padding: 0px 2px;
  1075. /deep/.el-input__inner {
  1076. padding: 0px 2px;
  1077. }
  1078. }
  1079. .winseaview-view {
  1080. padding: 0 0 20px;
  1081. }
  1082. .container {
  1083. overflow: scroll;
  1084. height: 93vh;
  1085. }
  1086. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1087. width: 80px;
  1088. }
  1089. /deep/.ws-info-table .el-form-item {
  1090. width: 25%;
  1091. }
  1092. .el-form {
  1093. margin-top: 50px;
  1094. }
  1095. .readonly {
  1096. width: 16%;
  1097. }
  1098. .el-cascader {
  1099. width: 145px;
  1100. }
  1101. .forlist {
  1102. width: 20%;
  1103. }
  1104. .el-form-item.forlist.is-success.el-form-item--small {
  1105. width: 20%;
  1106. }
  1107. .el-form-item.forlist.el-form-item--small {
  1108. width: 20%;
  1109. }
  1110. .el-form-item.readonly.is-success.el-form-item--small.showLableToopTip {
  1111. width: 20%;
  1112. }
  1113. .el-form-item.el-car.el-form-item--small {
  1114. width: 33.3%;
  1115. }
  1116. .trucks {
  1117. color: #69708c;
  1118. border: 1px solid #d8dce6;
  1119. width: 90%;
  1120. padding: 12px;
  1121. border-radius: 3px;
  1122. margin: 10px 0;
  1123. }
  1124. /deep/.trucks .ws-info-table,
  1125. /deep/.trucks .ws-info-table .el-form-item,
  1126. /deep/.trucks .ws-info-table .el-form-item .el-form-item__content {
  1127. border: none;
  1128. }
  1129. /deep/.trucks .el-table__expanded-cell,
  1130. /deep/.trucks .ws-info-table .el-form-item .el-form-item__label,
  1131. /deep/.trucks .ws-info-table .el-form-item .el-form-item__content {
  1132. background: transparent;
  1133. }
  1134. /deep/.trucks .ws-info-table .el-form-item .el-form-item__label {
  1135. color: #8890b1;
  1136. }
  1137. /deep/.trucks .el-table:before {
  1138. height: 0;
  1139. }
  1140. .gathering {
  1141. background: #f5f7fa;
  1142. border: 1px solid #d8dce6;
  1143. border-radius: 3px;
  1144. width: 90%;
  1145. }
  1146. /deep/.gathering .ws-info-table {
  1147. border-left: none;
  1148. border-top: 1px solid #d8dce6;
  1149. }
  1150. /deep/.gathering .driver {
  1151. padding: 10px;
  1152. }
  1153. /deep/.gathering .el-form-item .el-form-item__label {
  1154. background: #f5f7fa;
  1155. text-align: center;
  1156. }
  1157. /deep/.gathering .ws-info-table .el-form-item .el-form-item__content {
  1158. border-left: 1px solid #d8dce6;
  1159. }
  1160. /deep/.gathering .ws-info-table .el-form-item.compname,
  1161. /deep/.gathering .ws-info-table .el-form-item.bankDeposit,
  1162. /deep/.gathering .ws-info-table .el-form-item.bankDeposit1 {
  1163. border-right: 1px solid transparent;
  1164. }
  1165. /deep/.gathering .ws-info-table .el-form-item.compname {
  1166. width: 100%;
  1167. }
  1168. .button.el-button--primary,
  1169. .button-green.el-button--primary,
  1170. .button-yellow.el-button--primary {
  1171. height: 28px;
  1172. background: #edf1ff;
  1173. border-radius: 4px;
  1174. color: #5473e8;
  1175. font-size: 12px;
  1176. text-align: center;
  1177. line-height: 28px;
  1178. margin: 0 10px;
  1179. padding: 0 10px;
  1180. border: 1px solid transparent;
  1181. }
  1182. .button-green.el-button--primary {
  1183. background: #ecf8f9;
  1184. color: #50cad4;
  1185. }
  1186. .button-yellow.el-button--primary {
  1187. background: #fff6eb;
  1188. color: #ff9f24;
  1189. }
  1190. .el-button--primary {
  1191. background: #5878e8;
  1192. border-color: #5878e8;
  1193. }
  1194. .drivermessage {
  1195. position: relative;
  1196. }
  1197. .drivermessage .ws-info-table {
  1198. border: none;
  1199. }
  1200. /deep/.drivermessage .ws-info-table .el-form-item__label {
  1201. background: #fff;
  1202. width: 80px;
  1203. }
  1204. /deep/.drivermessage .ws-info-table .el-form-item__content,
  1205. /deep/.drivermessage .ws-info-table .el-form-item {
  1206. border: none;
  1207. }
  1208. //蓝标
  1209. .small-title {
  1210. position: relative;
  1211. padding: 10px;
  1212. font-weight: 600;
  1213. }
  1214. .bg-left {
  1215. padding-left: 30px;
  1216. }
  1217. .bg-right {
  1218. padding-right: 10px;
  1219. text-align: right;
  1220. }
  1221. .bg-bottom {
  1222. margin: 15px 0px;
  1223. }
  1224. .small-title::before {
  1225. position: absolute;
  1226. content: '';
  1227. display: block;
  1228. background: #5473e8;
  1229. width: 4px;
  1230. height: 14px;
  1231. left: 0px;
  1232. top: 13px;
  1233. padding: 4px 2px;
  1234. }
  1235. .small,
  1236. .big {
  1237. color: #ccc;
  1238. line-height: 16px;
  1239. position: absolute;
  1240. right: -50px;
  1241. top: 44px;
  1242. border: 1px solid #ccc;
  1243. padding: 5px 10px;
  1244. border-radius: 20px;
  1245. }
  1246. .big {
  1247. color: #f46060;
  1248. background: #ffeeee;
  1249. }
  1250. </style>