tranManagementDriverAdd.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316
  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. 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: sessionStorage.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. // EventBus.$emit('error', '道路运营证不能为空')
  927. // return
  928. // }
  929. // if (!this.addressUrls.qualification) {
  930. // EventBus.$emit('error', '从业资格证不能为空')
  931. // return
  932. // }
  933. if (!this.addressUrls.identityjust) {
  934. EventBus.$emit('error', '身份证正面不能为空')
  935. return
  936. }
  937. if (!this.addressUrls.identityagainst) {
  938. EventBus.$emit('error', '身份证反面不能为空')
  939. return
  940. }
  941. var arr = []
  942. for (let key in this.addressUrls) {
  943. arr.push(this.addressUrls[key])
  944. }
  945. this.$refs.deptBudgetList.validate((valid) => {
  946. if (valid) {
  947. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  948. this.deptBudgetList.residentCityProvincial =
  949. CodeToText[this.selectedOptions[0]]
  950. this.deptBudgetList.residentCityMunicipal =
  951. CodeToText[this.selectedOptions[1]]
  952. this.deptBudgetList.addressUrl = arr.toString()
  953. this.deptBudgetList.driverCarInfoList = this.freightspace
  954. this.deptBudgetList.driverPayeeInfoList = this.freightspace1
  955. addDriver(this.deptBudgetList)
  956. .toPromise()
  957. .then((response) => {
  958. this.$message.success('添加成功')
  959. this.deptBudgetList = {}
  960. this.freightspace = [
  961. {
  962. carNumber: '',
  963. carModel: '高栏',
  964. carModelKey: '1',
  965. carLength: '13',
  966. carLengthKey: '1',
  967. carLoad: '',
  968. yearManufacture: '',
  969. },
  970. ]
  971. this.freightspace1 = [
  972. {
  973. accountTypeFlag: '1',
  974. payeeName: '',
  975. payeeNumberCard: '',
  976. compName: '',
  977. bankDeposit: '',
  978. addressUrlArray: [],
  979. bankCard: '',
  980. },
  981. ],
  982. this.addressUrls = {},
  983. this.selectedOptions = [],
  984. this.$router.go(-1)
  985. })
  986. } else {
  987. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  988. return false
  989. }
  990. })
  991. },
  992. resetForm(deptBudgetList) {
  993. this.$refs[deptBudgetList].resetFields()
  994. },
  995. },
  996. }
  997. </script>
  998. <style lang="scss" scoped>
  999. .position {
  1000. position: relative;
  1001. background: #f6f7fc;
  1002. height: 124px;
  1003. margin-top: 20px;
  1004. border: 1px solid #d8dce6;
  1005. border-radius: 3px;
  1006. }
  1007. .add,
  1008. .del {
  1009. position: absolute;
  1010. top: 10px;
  1011. cursor: pointer;
  1012. margin-left: 17px;
  1013. }
  1014. .del {
  1015. margin-left: 50px;
  1016. }
  1017. .amap-page-container {
  1018. width: 300px;
  1019. height: 300px;
  1020. }
  1021. .el-form {
  1022. padding: 0 10%;
  1023. }
  1024. /deep/.ws-info-table .el-form-item {
  1025. border-right: 1px solid #cdd2dc;
  1026. border-bottom: 1px solid #cdd2dc;
  1027. }
  1028. .readonly {
  1029. position: relative;
  1030. }
  1031. .title {
  1032. position: relative;
  1033. }
  1034. .el-car {
  1035. width: 413px;
  1036. }
  1037. .title::before {
  1038. content: '';
  1039. display: inline-block;
  1040. width: 5px;
  1041. height: 30px;
  1042. background: #5473e8;
  1043. position: absolute;
  1044. left: 0;
  1045. }
  1046. .el-col {
  1047. background: #f6f7fc;
  1048. }
  1049. .button-container {
  1050. display: flex;
  1051. flex-wrap: nowrap;
  1052. justify-content: space-between;
  1053. align-items: center;
  1054. background-color: #fff;
  1055. width: 100%;
  1056. height: 50px;
  1057. padding: 0 10px;
  1058. & > div {
  1059. margin-left: 10px;
  1060. display: flex;
  1061. flex-wrap: nowrap;
  1062. flex-direction: row;
  1063. & > span {
  1064. line-height: 50px;
  1065. }
  1066. }
  1067. /deep/.auditFlow-box {
  1068. position: unset;
  1069. margin-left: 10px;
  1070. &/deep/.auditFlow-icon {
  1071. width: auto;
  1072. padding-right: 30px;
  1073. }
  1074. &/deep/.auditFlow-main {
  1075. position: absolute;
  1076. }
  1077. }
  1078. }
  1079. .box-app {
  1080. display: inline-block;
  1081. float: left;
  1082. margin-left: 30px;
  1083. line-height: 50px;
  1084. }
  1085. /deep/.el-dialog {
  1086. .el-form-item {
  1087. margin-bottom: 0 !important;
  1088. .el-input--medium {
  1089. textarea {
  1090. min-height: 100px !important;
  1091. }
  1092. }
  1093. }
  1094. }
  1095. .avatar-uploader {
  1096. margin: 0 5px;
  1097. }
  1098. .collapse-bottom {
  1099. margin-bottom: 20px;
  1100. }
  1101. .input-main .textarea .el-textarea__inner {
  1102. width: 100%;
  1103. z-index: 1;
  1104. }
  1105. .el-form-item__label {
  1106. text-align: center;
  1107. }
  1108. // 控制select为只读的时候显示样式
  1109. /deep/.ws-class-table-col {
  1110. height: auto;
  1111. padding: 0px 2px;
  1112. /deep/.el-input__inner {
  1113. padding: 0px 2px;
  1114. }
  1115. }
  1116. .winseaview-view {
  1117. padding: 0 0 20px;
  1118. }
  1119. .container {
  1120. overflow: scroll;
  1121. height: 93vh;
  1122. }
  1123. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1124. // width: 110px;
  1125. width: 40%;
  1126. text-align: center;
  1127. }
  1128. /deep/.ws-info-table .el-form-item {
  1129. width: 25%;
  1130. }
  1131. .el-form {
  1132. margin-top: 50px;
  1133. }
  1134. .readonly {
  1135. width: 16%;
  1136. }
  1137. .el-cascader {
  1138. width: 145px;
  1139. }
  1140. .forlist {
  1141. width: 20%;
  1142. }
  1143. .el-form-item.forlist.is-success.el-form-item--small {
  1144. width: 20%;
  1145. }
  1146. .el-form-item.forlist.el-form-item--small {
  1147. width: 20%;
  1148. }
  1149. .el-form-item.readonly.is-success.el-form-item--small.showLableToopTip {
  1150. width: 20%;
  1151. }
  1152. .el-form-item.el-car.el-form-item--small {
  1153. width: 33.33%;
  1154. border-top: 1px solid #d8dce6;
  1155. border-bottom: 0px;
  1156. background: #f6f7fc;
  1157. }
  1158. .trucks {
  1159. color: #69708c;
  1160. border: 1px solid #d8dce6;
  1161. padding: 12px;
  1162. border-radius: 3px;
  1163. margin: 10px 0;
  1164. border: 0px;
  1165. font-size: 14px;
  1166. color: #8890b1;
  1167. width: 100%;
  1168. }
  1169. /deep/.trucks .ws-info-table,
  1170. /deep/.trucks .ws-info-table .el-form-item,
  1171. /deep/.trucks .ws-info-table .el-form-item .el-form-item__content {
  1172. border: none;
  1173. background: #f6f7fc;
  1174. border-radius: 4px;
  1175. }
  1176. /deep/.trucks .el-table__expanded-cell,
  1177. /deep/.trucks .ws-info-table .el-form-item .el-form-item__label,
  1178. /deep/.trucks .ws-info-table .el-form-item .el-form-item__content {
  1179. background: transparent;
  1180. }
  1181. /deep/.trucks .ws-info-table .el-form-item .el-form-item__label {
  1182. color: #8890b1;
  1183. }
  1184. /deep/.trucks .el-table:before {
  1185. height: 0;
  1186. }
  1187. .gathering {
  1188. background: #f5f7fa;
  1189. }
  1190. /deep/.gathering .ws-info-table {
  1191. border-left: none;
  1192. border: none;
  1193. }
  1194. /deep/.gathering .driver {
  1195. padding: 10px;
  1196. }
  1197. .driver {
  1198. color: #5473e8;
  1199. line-height: 20px;
  1200. font-size: 14px;
  1201. }
  1202. /deep/.gathering .el-form-item .el-form-item__label {
  1203. background: #f5f7fa;
  1204. text-align: center;
  1205. border-right: 1px solid #d8dce6;
  1206. width: 140px;
  1207. }
  1208. /deep/.gathering .ws-info-table .el-form-item .el-form-item__content {
  1209. border: none;
  1210. background: #f6f7fc;
  1211. }
  1212. /deep/.gathering .ws-info-table .el-form-item.compname,
  1213. /deep/.gathering .ws-info-table .el-form-item.bankDeposit,
  1214. /deep/.gathering .ws-info-table .el-form-item.bankDeposit1 {
  1215. border: none;
  1216. }
  1217. /deep/.gathering .ws-info-table .el-form-item.compname {
  1218. width: 100%;
  1219. }
  1220. .button.el-button--primary,
  1221. .button-green.el-button--primary,
  1222. .button-yellow.el-button--primary {
  1223. height: 28px;
  1224. background: #edf1ff;
  1225. border-radius: 4px;
  1226. color: #5473e8;
  1227. font-size: 12px;
  1228. text-align: center;
  1229. line-height: 28px;
  1230. margin: 0 10px;
  1231. padding: 0 10px;
  1232. border: 1px solid transparent;
  1233. }
  1234. .button-green.el-button--primary {
  1235. background: #ecf8f9;
  1236. color: #50cad4;
  1237. }
  1238. .button-yellow.el-button--primary {
  1239. background: #fff6eb;
  1240. color: #ff9f24;
  1241. }
  1242. .el-button--primary {
  1243. background: #5878e8;
  1244. border-color: #5878e8;
  1245. }
  1246. .drivermessage {
  1247. position: relative;
  1248. }
  1249. .drivermessage .ws-info-table {
  1250. border: none;
  1251. }
  1252. /deep/.drivermessage .ws-info-table .el-form-item__label {
  1253. background: #fff;
  1254. width: 80px;
  1255. }
  1256. /deep/.drivermessage .ws-info-table .el-form-item__content,
  1257. /deep/.drivermessage .ws-info-table .el-form-item {
  1258. border: none;
  1259. }
  1260. //蓝标
  1261. .small-title {
  1262. position: relative;
  1263. padding: 10px;
  1264. font-weight: 600;
  1265. }
  1266. .bg-left {
  1267. padding-left: 30px;
  1268. }
  1269. .bg-right {
  1270. padding-right: 10px;
  1271. text-align: right;
  1272. }
  1273. .bg-bottom {
  1274. margin: 15px 0px;
  1275. }
  1276. .small-title::before {
  1277. position: absolute;
  1278. content: '';
  1279. display: block;
  1280. background: #5473e8;
  1281. width: 4px;
  1282. height: 14px;
  1283. left: 0px;
  1284. top: 13px;
  1285. padding: 4px 2px;
  1286. }
  1287. .small,
  1288. .big {
  1289. color: #ccc;
  1290. line-height: 16px;
  1291. position: absolute;
  1292. right: -50px;
  1293. top: 44px;
  1294. border: 1px solid #ccc;
  1295. padding: 5px 10px;
  1296. border-radius: 20px;
  1297. }
  1298. .big {
  1299. color: #f46060;
  1300. background: #ffeeee;
  1301. }
  1302. </style>