tranManagementDriverAdd.vue 35 KB

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