tranManagementDriverAdd.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291
  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.$router.push({ path: 'tranManagementDriver' })
  741. },
  742. // confirmPosition() {
  743. // this.draggable = false
  744. // },
  745. // 上传附件
  746. uploadSuccess(data, files, url) {
  747. console.log(data, files, url)
  748. // this.deptBudgetList.
  749. // this.formData.append('files', files)
  750. // this.feedbackObj.uploadNameAttachment = data.appendixName
  751. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  752. // // this.newAppendixs = files
  753. // this.onChangeFlag = true
  754. },
  755. selectcarModel(e) {
  756. for (var i = 0; i < this.carModelList.length; i++) {
  757. if (this.carModelList[i].constValue == e) {
  758. this.deptBudgetList.carModelKey = this.carModelList[i].constKey
  759. }
  760. }
  761. },
  762. selectcarLength(e) {
  763. for (var i = 0; i < this.carLengthList.length; i++) {
  764. if (this.carLengthList[i].constValue == e) {
  765. this.deptBudgetList.carLengthKey = this.carLengthList[i].constKey
  766. }
  767. }
  768. },
  769. onChange(files) {
  770. this.fileNum = files
  771. this.$refs.upload.handleSaveBill().then((res) => {
  772. console.log(files)
  773. })
  774. },
  775. submit() {
  776. if (!this.deptBudgetList.driverName) {
  777. EventBus.$emit('error', '司机姓名不能为空')
  778. return
  779. }
  780. if (
  781. this.deptBudgetList.driverName.length < 2 ||
  782. this.deptBudgetList.driverName.length > 10
  783. ) {
  784. EventBus.$emit('error', '司机姓名输入错误')
  785. return
  786. }
  787. if (!this.deptBudgetList.driverPhone) {
  788. EventBus.$emit('error', '司机手机不能为空')
  789. return
  790. }
  791. if (this.deptBudgetList.driverPhone.length != 11) {
  792. console.log(this.deptBudgetList.driverPhone.length)
  793. EventBus.$emit('error', '司机手机号输入有误')
  794. return
  795. }
  796. if (!this.deptBudgetList.numberCard) {
  797. EventBus.$emit('error', '司机身份证不能为空')
  798. return
  799. }
  800. if (this.deptBudgetList.numberCard.length != 18) {
  801. EventBus.$emit('error', '司机身份证号输入错误')
  802. return
  803. }
  804. for (var i = 0; i < this.freightspace.length; i++) {
  805. if (this.freightspace[i].carNumber == '') {
  806. EventBus.$emit('error', '车牌号不能为空')
  807. return
  808. }
  809. if (this.freightspace[i].carNumber.length != 7) {
  810. EventBus.$emit('error', '车牌号输入错误')
  811. return
  812. }
  813. if (this.freightspace[i].carLoad == '') {
  814. EventBus.$emit('error', '载重不能为空')
  815. return
  816. }
  817. if (this.freightspace[i].carLength > 50) {
  818. EventBus.$emit('error', '载重量输入错误')
  819. return
  820. }
  821. if (this.freightspace[i].yearManufacture == '') {
  822. EventBus.$emit('error', '出厂年份不能为空')
  823. return
  824. }
  825. if (this.freightspace[i].yearManufacture.length != 4) {
  826. EventBus.$emit('error', '出厂年份输入错误')
  827. return
  828. }
  829. }
  830. for (var i = 0; i < this.freightspace1.length; i++) {
  831. if (this.freightspace1[i].bankCard == '') {
  832. EventBus.$emit('error', '银行卡账号不能为空')
  833. return
  834. }
  835. if (this.freightspace1[i].bankDeposit == '') {
  836. EventBus.$emit('error', '开户行不能为空')
  837. return
  838. }
  839. if (this.freightspace1[i].bankDepositBranch == '') {
  840. EventBus.$emit('error', '开户支行不能为空')
  841. return
  842. }
  843. if (
  844. this.freightspace1[i].accountTypeFlag == 1 &&
  845. this.freightspace1[i].payeeName == ''
  846. ) {
  847. EventBus.$emit('error', '收款人姓名不能为空')
  848. return
  849. }
  850. if (
  851. this.freightspace1[i].accountTypeFlag == 1 &&
  852. this.freightspace1[i].payeeNumberCard == ''
  853. ) {
  854. EventBus.$emit('error', '收款人身份证号码不能为空')
  855. return
  856. }
  857. if (
  858. (this.freightspace1[i].accountTypeFlag == 1 &&
  859. this.freightspace1[i].payeeName.length < 2) ||
  860. (this.freightspace1[i].accountTypeFlag == 1 &&
  861. this.freightspace1[i].payeeName.length > 10)
  862. ) {
  863. EventBus.$emit('error', '收款人姓名输入错误')
  864. return
  865. }
  866. console.log(this.freightspace1[i].payeeNumberCard != 18)
  867. if (
  868. this.freightspace1[i].accountTypeFlag == 1 &&
  869. this.freightspace1[i].payeeNumberCard.length != 18
  870. ) {
  871. EventBus.$emit('error', '收款人身份证号输入错误')
  872. return
  873. }
  874. if (
  875. this.freightspace1[i].accountTypeFlag == 2 &&
  876. this.freightspace1[i].compName == ''
  877. ) {
  878. EventBus.$emit('error', '企业名称不能为空')
  879. return
  880. }
  881. if (
  882. (this.freightspace1[i].accountTypeFlag == 2 &&
  883. this.freightspace1[i].compName.length < 2) ||
  884. (this.freightspace1[i].accountTypeFlag == 2 &&
  885. this.freightspace1[i].compName.length > 30)
  886. ) {
  887. EventBus.$emit('error', '企业名称输入有误')
  888. return
  889. }
  890. }
  891. if (!this.addressUrls.travel) {
  892. EventBus.$emit('error', '行驶证不能为空')
  893. return
  894. }
  895. if (!this.addressUrls.drive) {
  896. EventBus.$emit('error', '驾驶证不能为空')
  897. return
  898. }
  899. if (!this.addressUrls.way) {
  900. EventBus.$emit('error', '道路运营证不能为空')
  901. return
  902. }
  903. if (!this.addressUrls.qualification) {
  904. EventBus.$emit('error', '从业资格证不能为空')
  905. return
  906. }
  907. if (!this.addressUrls.identityjust) {
  908. EventBus.$emit('error', '身份证正面不能为空')
  909. return
  910. }
  911. if (!this.addressUrls.identityagainst) {
  912. EventBus.$emit('error', '身份证反面不能为空')
  913. return
  914. }
  915. var arr = []
  916. for (let key in this.addressUrls) {
  917. arr.push(this.addressUrls[key])
  918. }
  919. this.$refs.deptBudgetList.validate((valid) => {
  920. if (valid) {
  921. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  922. this.deptBudgetList.residentCityProvincial =
  923. CodeToText[this.selectedOptions[0]]
  924. this.deptBudgetList.residentCityMunicipal =
  925. CodeToText[this.selectedOptions[1]]
  926. this.deptBudgetList.addressUrl = arr.toString()
  927. this.deptBudgetList.driverCarInfoList = this.freightspace
  928. this.deptBudgetList.driverPayeeInfoList = this.freightspace1
  929. // addDriver(this.deptBudgetList)
  930. // .toPromise()
  931. // .then((response) => {
  932. // this.$message.success('添加成功')
  933. // this.deptBudgetList = {}
  934. // this.freightspace = [
  935. // {
  936. // carNumber: '',
  937. // carModel: '高栏',
  938. // carModelKey: '1',
  939. // carLength: '13',
  940. // carLengthKey: '1',
  941. // carLoad: '',
  942. // yearManufacture: '',
  943. // },
  944. // ]
  945. // this.freightspace1 = [
  946. // {
  947. // accountTypeFlag: '1',
  948. // payeeName: '',
  949. // payeeNumberCard: '',
  950. // compName: '',
  951. // bankDeposit: '',
  952. // addressUrlArray: [],
  953. // bankCard: '',
  954. // },
  955. // ]
  956. // this.$router.push({ path: 'tranManagementDriver' })
  957. // })
  958. } else {
  959. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  960. return false
  961. }
  962. })
  963. },
  964. resetForm(deptBudgetList) {
  965. this.$refs[deptBudgetList].resetFields()
  966. },
  967. },
  968. }
  969. </script>
  970. <style lang="scss" scoped>
  971. .position {
  972. position: relative;
  973. background: #f6f7fc;
  974. height: 124px;
  975. margin-top: 20px;
  976. border: 1px solid #D8DCE6;
  977. border-radius: 3px;
  978. }
  979. .add,
  980. .del {
  981. position: absolute;
  982. top: 10px;
  983. cursor: pointer;
  984. margin-left: 17px;
  985. }
  986. .del {
  987. margin-left: 50px;
  988. }
  989. .amap-page-container {
  990. width: 300px;
  991. height: 300px;
  992. }
  993. .el-form {
  994. padding: 0 10%;
  995. }
  996. /deep/.ws-info-table .el-form-item {
  997. border-right: 1px solid #cdd2dc;
  998. border-bottom: 1px solid #cdd2dc;
  999. }
  1000. .readonly {
  1001. position: relative;
  1002. }
  1003. .title {
  1004. position: relative;
  1005. }
  1006. .el-car {
  1007. width: 413px;
  1008. }
  1009. .title::before {
  1010. content: '';
  1011. display: inline-block;
  1012. width: 5px;
  1013. height: 30px;
  1014. background: #5473e8;
  1015. position: absolute;
  1016. left: 0;
  1017. }
  1018. .el-col {
  1019. background: #f6f7fc;
  1020. }
  1021. .button-container {
  1022. display: flex;
  1023. flex-wrap: nowrap;
  1024. justify-content: space-between;
  1025. align-items: center;
  1026. background-color: #fff;
  1027. width: 100%;
  1028. height: 50px;
  1029. padding: 0 10px;
  1030. & > div {
  1031. margin-left: 10px;
  1032. display: flex;
  1033. flex-wrap: nowrap;
  1034. flex-direction: row;
  1035. & > span {
  1036. line-height: 50px;
  1037. }
  1038. }
  1039. /deep/.auditFlow-box {
  1040. position: unset;
  1041. margin-left: 10px;
  1042. &/deep/.auditFlow-icon {
  1043. width: auto;
  1044. padding-right: 30px;
  1045. }
  1046. &/deep/.auditFlow-main {
  1047. position: absolute;
  1048. }
  1049. }
  1050. }
  1051. .box-app {
  1052. display: inline-block;
  1053. float: left;
  1054. margin-left: 30px;
  1055. line-height: 50px;
  1056. }
  1057. /deep/.el-dialog {
  1058. .el-form-item {
  1059. margin-bottom: 0 !important;
  1060. .el-input--medium {
  1061. textarea {
  1062. min-height: 100px !important;
  1063. }
  1064. }
  1065. }
  1066. }
  1067. .avatar-uploader {
  1068. margin: 0 5px;
  1069. }
  1070. .collapse-bottom {
  1071. margin-bottom: 20px;
  1072. }
  1073. .input-main .textarea .el-textarea__inner {
  1074. width: 100%;
  1075. z-index: 1;
  1076. }
  1077. .el-form-item__label {
  1078. text-align: center;
  1079. }
  1080. // 控制select为只读的时候显示样式
  1081. /deep/.ws-class-table-col {
  1082. height: auto;
  1083. padding: 0px 2px;
  1084. /deep/.el-input__inner {
  1085. padding: 0px 2px;
  1086. }
  1087. }
  1088. .winseaview-view {
  1089. padding: 0 0 20px;
  1090. }
  1091. .container {
  1092. overflow: scroll;
  1093. height: 93vh;
  1094. }
  1095. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1096. // width: 110px;
  1097. width: 40%;
  1098. text-align: center;
  1099. }
  1100. /deep/.ws-info-table .el-form-item {
  1101. width: 25%;
  1102. }
  1103. .el-form {
  1104. margin-top: 50px;
  1105. }
  1106. .readonly {
  1107. width: 16%;
  1108. }
  1109. .el-cascader {
  1110. width: 145px;
  1111. }
  1112. .forlist {
  1113. width: 20%;
  1114. }
  1115. .el-form-item.forlist.is-success.el-form-item--small {
  1116. width: 20%;
  1117. }
  1118. .el-form-item.forlist.el-form-item--small {
  1119. width: 20%;
  1120. }
  1121. .el-form-item.readonly.is-success.el-form-item--small.showLableToopTip {
  1122. width: 20%;
  1123. }
  1124. .el-form-item.el-car.el-form-item--small {
  1125. width: 33.33%;
  1126. border-top: 1px solid #D8DCE6;
  1127. border-bottom: 0px;
  1128. background: #F6F7FC;
  1129. }
  1130. .trucks {
  1131. color: #69708c;
  1132. border: 1px solid #d8dce6;
  1133. padding: 12px;
  1134. border-radius: 3px;
  1135. margin: 10px 0;
  1136. border: 0px;
  1137. font-size: 14px;
  1138. color: #8890b1;
  1139. width: 100%;
  1140. }
  1141. /deep/.trucks .ws-info-table,
  1142. /deep/.trucks .ws-info-table .el-form-item,
  1143. /deep/.trucks .ws-info-table .el-form-item .el-form-item__content {
  1144. border: none;
  1145. background: #f6f7fc;
  1146. border-radius: 4px;
  1147. }
  1148. /deep/.trucks .el-table__expanded-cell,
  1149. /deep/.trucks .ws-info-table .el-form-item .el-form-item__label,
  1150. /deep/.trucks .ws-info-table .el-form-item .el-form-item__content {
  1151. background: transparent;
  1152. }
  1153. /deep/.trucks .ws-info-table .el-form-item .el-form-item__label {
  1154. color: #8890b1;
  1155. }
  1156. /deep/.trucks .el-table:before {
  1157. height: 0;
  1158. }
  1159. .gathering {
  1160. background: #f5f7fa;
  1161. }
  1162. /deep/.gathering .ws-info-table {
  1163. border-left: none;
  1164. border: none;
  1165. }
  1166. /deep/.gathering .driver {
  1167. padding: 10px;
  1168. }
  1169. .driver {
  1170. color: #5473e8;
  1171. line-height: 20px;
  1172. font-size: 14px;
  1173. }
  1174. /deep/.gathering .el-form-item .el-form-item__label {
  1175. background: #f5f7fa;
  1176. text-align: center;
  1177. border-right: 1px solid #D8DCE6;
  1178. width: 140px;
  1179. }
  1180. /deep/.gathering .ws-info-table .el-form-item .el-form-item__content {
  1181. border:none;
  1182. background: #F6F7FC;
  1183. }
  1184. /deep/.gathering .ws-info-table .el-form-item.compname,
  1185. /deep/.gathering .ws-info-table .el-form-item.bankDeposit,
  1186. /deep/.gathering .ws-info-table .el-form-item.bankDeposit1 {
  1187. border:none;
  1188. }
  1189. /deep/.gathering .ws-info-table .el-form-item.compname {
  1190. width: 100%;
  1191. }
  1192. .button.el-button--primary,
  1193. .button-green.el-button--primary,
  1194. .button-yellow.el-button--primary {
  1195. height: 28px;
  1196. background: #edf1ff;
  1197. border-radius: 4px;
  1198. color: #5473e8;
  1199. font-size: 12px;
  1200. text-align: center;
  1201. line-height: 28px;
  1202. margin: 0 10px;
  1203. padding: 0 10px;
  1204. border: 1px solid transparent;
  1205. }
  1206. .button-green.el-button--primary {
  1207. background: #ecf8f9;
  1208. color: #50cad4;
  1209. }
  1210. .button-yellow.el-button--primary {
  1211. background: #fff6eb;
  1212. color: #ff9f24;
  1213. }
  1214. .el-button--primary {
  1215. background: #5878e8;
  1216. border-color: #5878e8;
  1217. }
  1218. .drivermessage {
  1219. position: relative;
  1220. }
  1221. .drivermessage .ws-info-table {
  1222. border: none;
  1223. }
  1224. /deep/.drivermessage .ws-info-table .el-form-item__label {
  1225. background: #fff;
  1226. width: 80px;
  1227. }
  1228. /deep/.drivermessage .ws-info-table .el-form-item__content,
  1229. /deep/.drivermessage .ws-info-table .el-form-item {
  1230. border: none;
  1231. }
  1232. //蓝标
  1233. .small-title {
  1234. position: relative;
  1235. padding: 10px;
  1236. font-weight: 600;
  1237. }
  1238. .bg-left {
  1239. padding-left: 30px;
  1240. }
  1241. .bg-right {
  1242. padding-right: 10px;
  1243. text-align: right;
  1244. }
  1245. .bg-bottom {
  1246. margin: 15px 0px;
  1247. }
  1248. .small-title::before {
  1249. position: absolute;
  1250. content: '';
  1251. display: block;
  1252. background: #5473e8;
  1253. width: 4px;
  1254. height: 14px;
  1255. left: 0px;
  1256. top: 13px;
  1257. padding: 4px 2px;
  1258. }
  1259. .small,
  1260. .big {
  1261. color: #ccc;
  1262. line-height: 16px;
  1263. position: absolute;
  1264. right: -50px;
  1265. top: 44px;
  1266. border: 1px solid #ccc;
  1267. padding: 5px 10px;
  1268. border-radius: 20px;
  1269. }
  1270. .big {
  1271. color: #f46060;
  1272. background: #ffeeee;
  1273. }
  1274. </style>