tranManagementDriverAdd.vue 35 KB

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