tranManagementDriverAdd.vue 35 KB

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