tranManagementDriver.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. <!--司机管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="12">
  5. <template slot="left">
  6. <ws-button type="primary" @click="handleAdd()"><img width="13" height="13" style="
  7. vertical-align: text-top;
  8. position: relative;
  9. top: 2px;
  10. left: -4px;
  11. " src="../../../public/img/header-add.png" alt="" />添加</ws-button>
  12. </template>
  13. <template slot="right">
  14. <span style="display: inline-block; width: 65px; color: #8890b1">城市:</span>
  15. <el-cascader :options="options_" v-model="searchTypeText" clearable size="large" placeholder="请选择所在城市"
  16. style="width: 30%" @change="selecttaskType" />
  17. <ws-input v-model="searchKeyWord" placeholder="可按司机姓名、手机号、车牌号、身份证号查找" clearable maxlength="200" type="input"
  18. class="findValue findinput" @keyup.enter.native="handleLook()"></ws-input>
  19. <ws-button class='find' type="primary" @click="handleLook()">
  20. <img width="14" height="16" style="
  21. vertical-align: text-top;
  22. position: relative;
  23. top: 0px;
  24. left: -8px;
  25. " src="../../../public/img/sousuo.png" alt="" />
  26. </ws-button>
  27. </template>
  28. </BaseHeaderLayout>
  29. <el-table class="wenzi" :data="driverList.records" style="width: 100%; margin-top: 20px" fit ref="expandstable"
  30. :expand-row-keys="expands" :row-key="getRowKeys" height="calc(100% - 110px)">
  31. <el-table-column type="expand">
  32. <template slot-scope="props">
  33. <ws-form>
  34. <div v-for="item in props.row.driverPayeeInfoList">
  35. <ws-info-table>
  36. <ws-form-item :class="item.accountTypeFlag == 1 ? 'personage' : 'company'"
  37. v-if="item.accountTypeFlag == 1" label="收款人" span="1" prop="payeeName" class="el-car name">
  38. <div style="width: 100%">
  39. {{ item.payeeName }}
  40. </div>
  41. </ws-form-item>
  42. <ws-form-item :class="item.accountTypeFlag == 1 ? 'personage' : 'company'"
  43. v-if="item.accountTypeFlag == 2" label="企业名称" span="1" prop="compName" class="el-car">
  44. <div style="width: 100%">{{ item.compName }}</div>
  45. </ws-form-item>
  46. <ws-form-item :class="item.accountTypeFlag == 1 ? 'personage' : 'company'"
  47. v-if="item.accountTypeFlag == 1" label="身份证" span="1" prop="payeeNumberCard" class="el-car card">
  48. <div style="width: 100%">
  49. {{ item.payeeNumberCard }}
  50. <img width="12" height="13" src="../../../public/img/fujian-grey.png" alt=""
  51. @click="fujian1(item)" />
  52. </div>
  53. </ws-form-item>
  54. <ws-form-item :class="item.accountTypeFlag == 1 ? 'personage' : 'company'" label="开户行" span="1"
  55. prop="bankDeposit" class="el-car">
  56. <span style="
  57. margin: 10px;
  58. display: inline-block;
  59. border-right: 1px solid #e9ecf7;
  60. padding-right: 10px;
  61. ">{{ item.bankDeposit }}</span><span style="
  62. margin: 10px;
  63. padding: 0px;
  64. display: inline-block;
  65. word-wrap: break-word;
  66. line-height: 20px;
  67. white-space: normal;
  68. ">{{ item.bankDepositBranch }}</span>
  69. </ws-form-item>
  70. <ws-form-item :class="item.accountTypeFlag == 1 ? 'personage' : 'company'" label="账号" span="1"
  71. prop="bankCard" class="el-car">
  72. <div style="width: 100%">{{ item.bankCard }}</div>
  73. </ws-form-item>
  74. </ws-info-table>
  75. </div>
  76. </ws-form>
  77. </template>
  78. </el-table-column>
  79. <el-table-column type="index" label="序号" width="80">
  80. <template scope="scope">
  81. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  82. <span v-else>{{ scope.$index + 1 }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="driverName" label="姓名" width="100">
  86. </el-table-column>
  87. <el-table-column prop="numberCard" label="身份证号" width="200">
  88. </el-table-column>
  89. <el-table-column prop="driverPhone" label="手机号" width="160">
  90. </el-table-column>
  91. <el-table-column prop="carNumber" label="车牌号" width="160">
  92. <template scope="scope">
  93. <ws-select v-model="scope.row.carNumber" placeholder="" class="typeselect"
  94. @change="selectcar($event, scope.row)">
  95. <ws-option v-for="item in scope.row.driverCarInfoList" :key="item.constKey" :label="item.carNumber"
  96. :value="item.carNumber" />
  97. </ws-select>
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="binNumber" label="常驻城市" width="160">
  101. <template slot-scope="scope">
  102. {{ scope.row.residentCityProvincial
  103. }}{{ scope.row.residentCityMunicipal }}
  104. </template>
  105. </el-table-column>
  106. <el-table-column prop="carModel" label="车型" width="120">
  107. </el-table-column>
  108. <el-table-column prop="carLength" label="车长" width="120">
  109. </el-table-column>
  110. <el-table-column label="结款账户" width="120">
  111. <template slot-scope="scope">
  112. <el-button v-if="!scope.row.expandsStatus" size="medium" type="text" class="fs-16"
  113. @click="expandsHandle(scope.row)">展开<img width="9" height="6"
  114. style="vertical-align: middle; margin-left: 3px" src="../../../public/img/zhankai.png" alt="" />
  115. </el-button>
  116. <el-button v-if="scope.row.expandsStatus" size="medium" type="text" class="fs-16"
  117. @click="expandsHandle(scope.row)">收起<img width="9" height="6"
  118. style="vertical-align: middle; margin-left: 3px" src="../../../public/img/shouqi.png" alt="" />
  119. </el-button>
  120. </template>
  121. </el-table-column>
  122. <el-table-column prop="addressUrl" label="附件">
  123. <template slot-scope="scope">
  124. <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
  125. src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
  126. <span v-if="scope.row.addressUrlArray.length > 0">{{
  127. scope.row.addressUrlArray.length
  128. }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column prop="address" label="操作" width="300">
  132. <template slot-scope="scope">
  133. <el-button size="medium" type="text" class="record" @click="look(scope.row)">查看</el-button>
  134. <el-button size="medium" type="text" class="record" @click="edit(scope.row)">编辑</el-button>
  135. <el-button size="medium" type="text" class="record" @click="deletes(scope.row)">删除</el-button>
  136. <el-button v-if="scope.row.disableStatusFlag != 1" class="record1" size="medium" type="text"
  137. @click="stop(scope.row)">禁用</el-button>
  138. <!-- <el-tooltip
  139. class="item record"
  140. effect="dark"
  141. :content="scope.row.disableReasons"
  142. placement="right-start"
  143. > -->
  144. <el-button v-if="scope.row.disableStatusFlag == 1" class="record1" size="medium" type="text"
  145. style="font-size:14px;color:#F83535;" @click="relieve(scope.row)">已禁用</el-button>
  146. <!-- </el-tooltip> -->
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  151. :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
  152. </el-pagination>
  153. <!-- <el-dialog v-model="outerVisible">
  154. <el-input
  155. type="textarea"
  156. :rows="2"
  157. placeholder="请输入禁用原因,不超过50个字"
  158. v-model="dsiablieForm"
  159. >
  160. </el-input>
  161. <template #footer>
  162. <div class="dialog-footer">
  163. <el-button @click="outerVisible = false">取 消</el-button>
  164. <el-button type="primary" @click="">确定禁用</el-button>
  165. </div>
  166. </template>
  167. </el-dialog> -->
  168. <WinseaContentModal v-model="outerVisible" title="禁用原因" @on-cancel="handleClose">
  169. <el-input type="textarea" :rows="2" maxlength="50" placeholder="请输入禁用原因,不超过50个字"
  170. v-model="disablieForm.disableReasons">
  171. </el-input>
  172. <div class="dialog-footer">
  173. <el-button @click="outerVisible = false">取 消</el-button>
  174. <el-button type="primary" @click="disableReasons">确定禁用</el-button>
  175. </div>
  176. </WinseaContentModal>
  177. <!-- 附件弹框 -->
  178. <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
  179. @on-cancel="handleClose">
  180. <p>查看附件</p>
  181. <div style="display: inline-block; margin: 5px" v-for="item in appendixIdss">
  182. <img width="100" height="100" :src="item" alt="" />
  183. </div>
  184. </WinseaContentModal>
  185. <WinseaContentModal v-model="accesscard" :title="$t('system.noticeCircular.information')" @on-cancel="handleClose1">
  186. <p>查看附件</p>
  187. <img width="100" height="100" :src="accessurl" alt="" />
  188. </WinseaContentModal>
  189. </div>
  190. </template>
  191. <script>
  192. import {
  193. selectDriver,
  194. billoperatehis,
  195. delDriver,
  196. disableDriver,
  197. } from '@/model/transport/index'
  198. import Pagination from '@/components/Pagination'
  199. import {
  200. provinceAndCityData,
  201. CodeToText
  202. } from 'element-china-area-data'
  203. import WsUpload from '@/components/WsUpload'
  204. import {
  205. dayjs,
  206. fmoney,
  207. EventBus
  208. } from 'base-core-lib'
  209. export default {
  210. name: 'viewSpareMoney',
  211. components: {
  212. WsUpload,
  213. Pagination,
  214. },
  215. watch: {
  216. vesselId(val) {
  217. this.getList()
  218. },
  219. isShow(val) {
  220. this.showType = val
  221. },
  222. },
  223. data() {
  224. return {
  225. //弹出框
  226. dialogViewSpareMoney: false,
  227. dialogApproveFormVisible: false,
  228. options_: provinceAndCityData,
  229. // 表格显示数据
  230. tableDate: [],
  231. // 是否显示
  232. showType: true,
  233. // 年
  234. year: '',
  235. deptBudgetTotal: 0,
  236. currentPage: 1,
  237. pageSize: 10,
  238. searchKeyWord: '',
  239. contractType: 2,
  240. startDate: null,
  241. endDate: null,
  242. carNumber: '',
  243. searchTypeText: [],
  244. outerVisible: false,
  245. //图片
  246. fileList: [],
  247. // 提交类型
  248. submitType: true,
  249. size: 10,
  250. spanArr: [],
  251. pcFlag: 1,
  252. compId: localStorage.getItem('ws-pf_compId'),
  253. deptCircularPage: {},
  254. date: {
  255. year: dayjs().format('YYYY'),
  256. month: dayjs().format('MM'),
  257. },
  258. disablieForm: {},
  259. expands: [], //只展开一行放入当前行id
  260. getRowKeys: (row) => {
  261. //获取当前行id
  262. // console.log(row)
  263. return row.id //这里看这一行中需要根据哪个属性值是id
  264. },
  265. driverList: [],
  266. deptBudgetList: {},
  267. historyList: [],
  268. pickerBeginDateBefore: {
  269. disabledDate: (time) => {
  270. return time.getTime() > Date.now()
  271. },
  272. },
  273. appendixIdss: [],
  274. accessoryTFs: false,
  275. accesscard: false,
  276. accessurl: '',
  277. residentCityProvincial: '',
  278. residentCityMunicipal: '',
  279. }
  280. },
  281. activated() {
  282. this.getList()
  283. this.showType = this.isShow
  284. },
  285. methods: {
  286. expandsHandle(row) {
  287. row.expandsStatus = !row.expandsStatus
  288. this.$refs.expandstable.toggleRowExpansion(row)
  289. },
  290. edit(row) {
  291. this.$router.push({
  292. name: 'driverManagementedit',
  293. query: {
  294. id: row.id
  295. },
  296. })
  297. },
  298. //查找
  299. handleLook() {
  300. if (this.value2) {
  301. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  302. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  303. } else {
  304. this.startDate = ''
  305. this.endDate = ''
  306. }
  307. this.currentPage = 1
  308. this.getList()
  309. },
  310. look(row) {
  311. this.$router.push({
  312. name: 'driverManagementview',
  313. query: {
  314. id: row.id
  315. },
  316. })
  317. },
  318. //添加
  319. handleAdd() {
  320. console.log(11111)
  321. this.$router.push({
  322. name: 'driverManagementadd'
  323. })
  324. },
  325. selectcar(e, row) {
  326. console.log(e, row)
  327. for (var i = 0; i < row.driverCarInfoList.length; i++) {
  328. if (e == row.driverCarInfoList[i].carNumber) {
  329. row.carModel = row.driverCarInfoList[i].carModel
  330. row.carLength = row.driverCarInfoList[i].carLength
  331. }
  332. }
  333. },
  334. stop(row) {
  335. this.outerVisible = true
  336. this.disablieForm.id = row.id
  337. },
  338. disableReasons() {
  339. this.outerVisible = false
  340. this.disablieForm.disableStatusFlag = 0
  341. disableDriver(this.disablieForm)
  342. .toPromise()
  343. .then((response) => {
  344. this.$notify.success({
  345. title: '成功',
  346. message: '禁用成功',
  347. })
  348. this.getList()
  349. })
  350. .catch((response) => {
  351. EventBus.$emit('error', response.message)
  352. })
  353. },
  354. relieve(row) {
  355. this.disablieForm.id = row.id
  356. this.disablieForm.disableStatusFlag = 1
  357. disableDriver(this.disablieForm)
  358. .toPromise()
  359. .then((response) => {
  360. this.$notify.success({
  361. title: '成功',
  362. message: '解除禁用成功',
  363. })
  364. this.getList()
  365. })
  366. .catch((response) => {
  367. EventBus.$emit('error', response.message)
  368. })
  369. },
  370. deletes(row) {
  371. this.$confirm(`司机信息删除后不可恢复,是否确定删除?`, '提示', {
  372. confirmButtonText: '确定',
  373. cancelButtonText: '取消',
  374. type: 'warning',
  375. })
  376. .then(() => {
  377. delDriver({
  378. id: row.id
  379. })
  380. .toPromise()
  381. .then((response) => {
  382. this.$notify.success({
  383. title: '成功',
  384. message: '删除成功',
  385. })
  386. this.getList()
  387. })
  388. .catch((response) => {
  389. console.log(response)
  390. EventBus.$emit('error', response.message)
  391. })
  392. })
  393. .catch(() => {
  394. return false
  395. })
  396. },
  397. handleClose() {
  398. this.accessoryTFs = false
  399. },
  400. handleClose1() {
  401. this.accesscard = false
  402. },
  403. handleSizeChange(val) {
  404. console.log(`每页 ${val} 条`)
  405. this.pageSize = val
  406. this.getList()
  407. },
  408. handleCurrentChange(val) {
  409. this.currentPage = val
  410. console.log(`当前页: ${val}`)
  411. this.getList()
  412. },
  413. getList() {
  414. selectDriver({
  415. compId: localStorage.getItem('ws-pf_compId'),
  416. currentPage: this.currentPage,
  417. pageSize: this.pageSize,
  418. pcFlag: this.pcFlag,
  419. residentCityProvincial: this.residentCityProvincial,
  420. residentCityMunicipal: this.residentCityMunicipal,
  421. searchKeyWord: this.searchKeyWord,
  422. })
  423. .toPromise()
  424. .then((response) => {
  425. for (var i = 0; i < response.records.length; i++) {
  426. if (response.records[i].driverCarInfoList.length > 0) {
  427. response.records[i].carNumber =
  428. response.records[i].driverCarInfoList[0].carNumber
  429. response.records[i].carModel =
  430. response.records[i].driverCarInfoList[0].carModel
  431. response.records[i].carLength =
  432. response.records[i].driverCarInfoList[0].carLength
  433. }
  434. response.records[i].expandsStatus = false
  435. if (response.records[i].addressUrl != null) {
  436. response.records[i].addressUrlArray =
  437. response.records[i].addressUrl.split(',')
  438. this.fileList[i] = response.records[i].addressUrl.split(',')
  439. } else {
  440. response.records[i].addressUrlArray = []
  441. }
  442. }
  443. this.deptCircularPage.currentPage = response.current
  444. this.deptCircularPage.pageSize = response.size
  445. this.deptBudgetTotal = response.total
  446. this.driverList = response
  447. })
  448. },
  449. editClick(row) {
  450. var status = ''
  451. if (row.status == '待执行' || row.status == '已完成') {
  452. status = '执行中'
  453. } else if (row.status == '执行中') {
  454. status = '已完成'
  455. }
  456. //cancelButtonClass: "btn-custom-cancel"
  457. this.$confirm(`是否将状态改为${status}`, {
  458. confirmButtonText: '确定',
  459. cancelButtonText: '取消',
  460. type: 'warning',
  461. })
  462. .then(() => {
  463. editstatus({
  464. id: row.id
  465. })
  466. .toPromise()
  467. .then((response) => {
  468. this.$notify.success({
  469. title: '成功',
  470. message: '状态修改成功',
  471. })
  472. this.getList()
  473. })
  474. .catch((response) => {
  475. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  476. })
  477. })
  478. .catch(() => {
  479. return false
  480. })
  481. },
  482. selecttaskType(e) {
  483. this.residentCityProvincial = CodeToText[e[0]]
  484. this.residentCityMunicipal = CodeToText[e[1]]
  485. // this.selectedOptions = e
  486. this.handleLook()
  487. },
  488. fujian(row) {
  489. if (row.addressUrl === null || row.addressUrl === '') {
  490. EventBus.$emit(
  491. 'warning',
  492. this.$t('system.noticeCircular.NoInformation')
  493. )
  494. } else {
  495. this.accessoryTFs = true
  496. }
  497. this.appendixIdss = row.addressUrlArray
  498. },
  499. fujian1(item) {
  500. if (item.cardAddressUrl === null || item.cardAddressUrl === '') {
  501. EventBus.$emit(
  502. 'warning',
  503. this.$t('system.noticeCircular.NoInformation')
  504. )
  505. } else {
  506. this.accesscard = true
  507. }
  508. this.accessurl = item.cardAddressUrl
  509. },
  510. handleExamine(row) {
  511. this.$router.push({
  512. name: 'salesContractExamine',
  513. query: {
  514. id: row.id
  515. },
  516. })
  517. },
  518. // 关闭 dialog时 处理文件url 初始化upload组件
  519. handleCloe() {
  520. this.dialogViewSpareMoney = false
  521. },
  522. history(row) {
  523. console.log(row)
  524. billoperatehis({
  525. id: row.id
  526. })
  527. .toPromise()
  528. .then((response) => {
  529. this.historyList = response
  530. })
  531. },
  532. find() {
  533. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  534. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  535. this.currentPage = 1
  536. this.getList()
  537. },
  538. },
  539. }
  540. </script>
  541. <style lang="scss" scoped>
  542. .connert {
  543. width: 90%;
  544. margin: 0 auto;
  545. }
  546. .vertical-text-left {
  547. width: 62px;
  548. text-align: right;
  549. }
  550. .findValue {
  551. margin: 0 10px;
  552. }
  553. /deep/.base_header_layout .find.el-button--primary {
  554. width: 30px;
  555. border-top-left-radius: 0px;
  556. border-bottom-left-radius: 0px;
  557. margin-left: -10px;
  558. }
  559. /deep/.base_header_layout .findinput input {
  560. border-top-right-radius: 0px;
  561. border-bottom-right-radius: 0px;
  562. }
  563. /deep/.el-icon-arrow-right {
  564. display: none;
  565. }
  566. /deep/.el-pagination {
  567. text-align: center;
  568. }
  569. .ws-info-table {
  570. border-left: 1px solid #e9ecf7;
  571. border-top: 1px solid #e9ecf7;
  572. }
  573. /deep/.ws-info-table .el-form-item {
  574. border-right: 1px solid #e9ecf7;
  575. border-bottom: 1px solid #e9ecf7;
  576. }
  577. /deep/.ws-info-table .el-form-item .el-form-item__label {
  578. text-align: center;
  579. background: #f6f7fc;
  580. color: #8890b1;
  581. font-size: 12px;
  582. }
  583. /deep/.ws-info-table .el-form-item.company,
  584. /deep/.ws-info-table .el-form-item.personage {
  585. width: 33.333%;
  586. }
  587. /deep/.ws-info-table .el-form-item.name {
  588. width: 15.665%;
  589. }
  590. /deep/.ws-info-table .el-form-item.card {
  591. width: 17.665%;
  592. }
  593. /deep/.ws-info-table .el-form-item .el-form-item__content {
  594. text-align: center;
  595. border-left: 1px solid #e9ecf7;
  596. }
  597. /deep/.el-table .el-table__header .cell,
  598. /deep/.el-table .el-table__body .cell {
  599. text-align: center;
  600. }
  601. /deep/.el-table th.is-leaf,
  602. .el-table td {
  603. border-right: 1px solid #eee;
  604. }
  605. .el-button--text {
  606. color: #5878e8;
  607. }
  608. .el-button--primary {
  609. background: #5878e8;
  610. }
  611. //操作按钮
  612. .record,
  613. .adjustment,
  614. .record1 {
  615. display: inline-block;
  616. color: #5878e8;
  617. padding: 0 4px !important;
  618. position: relative;
  619. font-size: 14px;
  620. }
  621. .record1 {
  622. width: 38px;
  623. height: 32px;
  624. }
  625. .record:after {
  626. position: absolute;
  627. content: '';
  628. display: block;
  629. top: 9px;
  630. right: -7px;
  631. width: 1px;
  632. height: 12px;
  633. background: #e9ecf7;
  634. }
  635. /deep/.el-table td {
  636. border-right: 1px solid #eee;
  637. }
  638. </style>