tranManagementDriver.vue 18 KB

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