index.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. v-show="showSearch"
  7. label-width="100px"
  8. size="mini"
  9. >
  10. <el-row>
  11. <el-col :span="6">
  12. <el-col :span="6">
  13. <el-form-item label-width="100px" label="提单号" prop="mblno">
  14. <el-input
  15. v-model="queryParams.mblno"
  16. placeholder="请输入提单号"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. style="max-width: 187px"
  21. />
  22. </el-form-item>
  23. </el-col>
  24. <el-form-item label="客户名称" prop="corpId">
  25. <el-select
  26. v-model="queryParams.corpId"
  27. placeholder="请输入客户名称"
  28. clearable
  29. size="small"
  30. filterable
  31. >
  32. <el-option
  33. v-for="(dict, index) in fMblnoOptions"
  34. :key="index.fId"
  35. :label="dict.fName"
  36. :value="dict.fId"
  37. />
  38. </el-select> </el-form-item
  39. ></el-col>
  40. <el-col :span="6">
  41. <el-form-item label-width="100px" label="业务类型" prop="billType">
  42. <el-select
  43. v-model="queryParams.billType"
  44. placeholder="请选择业务类型"
  45. clearable
  46. size="small"
  47. >
  48. <el-option
  49. v-for="(dict, index) in billTypeList"
  50. :key="index.dictValue"
  51. :label="dict.dictLabel"
  52. :value="dict.dictValue"
  53. />
  54. </el-select>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="6">
  58. <el-form-item label-width="100px" label="运输方式" prop="transType">
  59. <el-select
  60. v-model="queryParams.transType"
  61. placeholder="请选择运输方式"
  62. clearable
  63. size="small"
  64. >
  65. <el-option
  66. v-for="(dict, index) in transTypeList"
  67. :key="index.dictValue"
  68. :label="dict.dictLabel"
  69. :value="dict.dictValue"
  70. />
  71. </el-select>
  72. </el-form-item>
  73. </el-col>
  74. </el-row>
  75. <el-collapse-transition>
  76. <div v-show="show">
  77. <el-row>
  78. <el-col :span="6">
  79. <el-form-item
  80. label-width="100px"
  81. label="运输性质"
  82. prop="transProp"
  83. >
  84. <el-select
  85. v-model="queryParams.transProp"
  86. placeholder="请选择运输性质"
  87. clearable
  88. size="small"
  89. >
  90. <el-option
  91. v-for="(dict, index) in transPropList"
  92. :key="index.dictValue"
  93. :label="dict.dictLabel"
  94. :value="dict.dictValue"
  95. />
  96. </el-select>
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="6">
  100. <el-form-item label-width="100px" label="货品名称" prop="goodsId">
  101. <el-select
  102. v-model="queryParams.goodsId"
  103. placeholder="请输入货品名称"
  104. clearable
  105. size="small"
  106. filterable
  107. >
  108. <el-option
  109. v-for="(dict, index) in goodsOptions"
  110. :key="index.fId"
  111. :label="dict.fName"
  112. :value="dict.fId"
  113. />
  114. </el-select>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="6">
  118. <el-form-item
  119. label-width="100px"
  120. label="提箱地点"
  121. prop="loadAddr"
  122. >
  123. <el-input
  124. v-model="queryParams.loadAddr"
  125. placeholder="请输入提箱地点"
  126. clearable
  127. size="small"
  128. @keyup.enter.native="handleQuery"
  129. style="max-width: 187px"
  130. />
  131. </el-form-item>
  132. </el-col>
  133. <el-col :span="6">
  134. <el-form-item
  135. label-width="100px"
  136. label="装卸货地点"
  137. prop="mdLoadAddr"
  138. >
  139. <el-input
  140. v-model="queryParams.mdLoadAddr"
  141. placeholder="请输入装卸货地点"
  142. clearable
  143. size="small"
  144. @keyup.enter.native="handleQuery"
  145. style="max-width: 187px"
  146. /> </el-form-item
  147. ></el-col>
  148. </el-row>
  149. <el-row>
  150. <el-col :span="6"
  151. ><el-form-item
  152. label-width="100px"
  153. label="卸箱地点"
  154. prop="unLoadAddr"
  155. >
  156. <el-input
  157. v-model="queryParams.unLoadAddr"
  158. placeholder="请输入卸箱地点"
  159. clearable
  160. size="small"
  161. @keyup.enter.native="handleQuery"
  162. style="max-width: 187px"
  163. /> </el-form-item
  164. ></el-col>
  165. </el-row>
  166. </div>
  167. </el-collapse-transition>
  168. </el-form>
  169. <el-row :gutter="10" class="mb8">
  170. <!-- <el-col :span="1.5">
  171. <el-button
  172. type="primary"
  173. icon="el-icon-plus"
  174. size="mini"
  175. @click="handleAdd"
  176. v-hasPermi="['fleet:plans:add']"
  177. >新增</el-button
  178. >
  179. </el-col> -->
  180. <el-col :span="1.5">
  181. <el-button
  182. type="success"
  183. icon="el-icon-edit"
  184. size="mini"
  185. :disabled="single"
  186. @click="handleUpdate"
  187. v-hasPermi="['fleet:plans:edit']"
  188. >修改</el-button
  189. >
  190. </el-col>
  191. <el-col :span="1.5">
  192. <el-button
  193. type="danger"
  194. icon="el-icon-delete"
  195. size="mini"
  196. :disabled="multiple"
  197. @click="handleDelete"
  198. v-hasPermi="['fleet:plans:remove']"
  199. >删除</el-button
  200. >
  201. </el-col>
  202. <el-col :span="1.5">
  203. <el-button
  204. type="warning"
  205. icon="el-icon-download"
  206. size="mini"
  207. @click="handleExport"
  208. v-hasPermi="['fleet:plans:export']"
  209. >导出</el-button
  210. >
  211. </el-col>
  212. <div class="tabSetting">
  213. <div style="margin-right: 20px">
  214. <el-button
  215. type="cyan"
  216. icon="el-icon-search"
  217. size="mini"
  218. @click="handleQuery"
  219. >搜索</el-button
  220. >
  221. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  222. >重置</el-button
  223. >
  224. <el-button
  225. v-show="show"
  226. @click="show = !show"
  227. icon="el-icon-arrow-up"
  228. size="mini"
  229. >展开</el-button
  230. >
  231. <el-button
  232. v-show="!show"
  233. @click="show = !show"
  234. icon="el-icon-arrow-down"
  235. size="mini"
  236. >展开</el-button
  237. >
  238. </div>
  239. <right-toolbar
  240. :showSearch.sync="showSearch"
  241. @queryTable="getList"
  242. ></right-toolbar>
  243. <div style="margin: 0 12px">
  244. <el-button
  245. icon="el-icon-setting"
  246. size="mini"
  247. circle
  248. @click="showSetting = !showSetting"
  249. ></el-button>
  250. </div>
  251. </div>
  252. </el-row>
  253. <el-dialog title="提示" :visible.sync="showSetting" width="700px">
  254. <div>配置排序列数据(拖动调整顺序)</div>
  255. <div style="margin-left: 17px">
  256. <el-checkbox
  257. v-model="allCheck"
  258. label="全选"
  259. @change="allChecked"
  260. ></el-checkbox>
  261. </div>
  262. <div style="padding: 4px; display: flex; justify-content: center">
  263. <draggable
  264. v-model="setRowList"
  265. group="site"
  266. animation="300"
  267. @start="onStart"
  268. @end="onEnd"
  269. handle=".indraggable"
  270. >
  271. <transition-group>
  272. <div
  273. v-for="item in setRowList"
  274. :key="item.surface"
  275. class="listStyle"
  276. >
  277. <div style="width: 500px" class="indraggable">
  278. <div class="progress" :style="{ width: item.width + 'px' }">
  279. <el-checkbox
  280. :label="item.name"
  281. v-model="item.checked"
  282. :true-label="0"
  283. :false-label="1"
  284. >{{ item.name }}
  285. </el-checkbox>
  286. </div>
  287. </div>
  288. <el-input-number
  289. v-model.number="item.width"
  290. controls-position="right"
  291. :min="1"
  292. :max="500"
  293. size="mini"
  294. ></el-input-number>
  295. </div>
  296. </transition-group>
  297. </draggable>
  298. </div>
  299. <span slot="footer" class="dialog-footer">
  300. <el-button @click="showSetting = false">取 消</el-button>
  301. <el-button type="primary" @click="save()">确 定</el-button>
  302. </span>
  303. </el-dialog>
  304. <el-table
  305. v-loading="loading"
  306. :data="ftmsorderbillsList"
  307. @selection-change="handleSelectionChange"
  308. >
  309. <el-table-column type="selection" width="55" align="center" />
  310. <el-table-column
  311. v-for="(item, index) in getRowList"
  312. :key="index"
  313. :label="item.name"
  314. :width="item.width"
  315. :prop="item.label"
  316. align="center"
  317. :show-overflow-tooltip="true"
  318. sortable
  319. :fixed="item.fixed"
  320. />
  321. <el-table-column
  322. label="操作"
  323. align="center"
  324. class-name="small-padding fixed-width"
  325. fixed="right"
  326. width="150px"
  327. >
  328. <template slot-scope="scope">
  329. <el-button
  330. size="mini"
  331. type="text"
  332. icon="el-icon-edit"
  333. @click="handleUpdate(scope.row)"
  334. >查看</el-button
  335. >
  336. <!-- <el-button
  337. v-if="scope.row.billStatus != 6"
  338. size="mini"
  339. type="text"
  340. icon="el-icon-edit"
  341. @click="handleUpdate(scope.row)"
  342. v-hasPermi="['fleet:plans:edit']"
  343. >修改</el-button
  344. > -->
  345. <el-button
  346. size="mini"
  347. type="text"
  348. icon="el-icon-delete"
  349. @click="handleDelete(scope.row)"
  350. v-hasPermi="['fleet:plans:remove']"
  351. >删除</el-button
  352. >
  353. </template>
  354. </el-table-column>
  355. </el-table>
  356. <pagination
  357. v-show="total > 0"
  358. :total="total"
  359. :page.sync="queryParams.pageNum"
  360. :limit.sync="queryParams.pageSize"
  361. @pagination="getList"
  362. />
  363. <!-- 新增编辑弹框子组件 -->
  364. <add-or-update
  365. :addOrUpdateVisible="addOrUpdateVisible"
  366. :title="title"
  367. :form="form"
  368. :disabled="disabled"
  369. :disabled2="disabled2"
  370. :DList="DList"
  371. :CList="CList"
  372. :schedulingList="schedulingList"
  373. :vehicleList="vehicleList"
  374. :collapses="collapses"
  375. @changeShow="showAddOrUpdate"
  376. @fixDisabled="fixDisabled"
  377. ref="addOrUpdateRef"
  378. ></add-or-update>
  379. </div>
  380. </template>
  381. <script>
  382. import AddOrUpdate from "./AddOrUpdate.vue";
  383. import {
  384. getFtmsorderbills,
  385. delFtmsorderbills,
  386. exportFtmsorderbills,
  387. } from "@/api/fleet/ftmsorderbills";
  388. import { listFtmsorderbillsplans } from "@/api/fleet/ftmsorderbillsplans";
  389. import { getFtmsorderbillscars } from "@/api/fleet/ftmsorderbillscars";
  390. import { listGoods } from "@/api/basicdata/goods";
  391. import { listCorps } from "@/api/basicdata/corps";
  392. import { addSet, select } from "@/api/system/set";
  393. import Cookies from "js-cookie";
  394. import draggable from "vuedraggable";
  395. export default {
  396. name: "plans",
  397. data() {
  398. return {
  399. disabled: false,
  400. disabled2: false,
  401. // 控制新增编辑弹窗的显示与隐藏
  402. addOrUpdateVisible: false,
  403. // 非单个禁用
  404. single: true,
  405. // 非多个禁用
  406. multiple: true,
  407. // 显示搜索条件
  408. showSearch: true,
  409. // 订单主表格数据
  410. ftmsorderbillsList: [],
  411. // 总条数
  412. total: 0,
  413. // 查询参数
  414. queryParams: {
  415. pageNum: 1,
  416. pageSize: 10,
  417. corpId: null,
  418. billType: null,
  419. transType: null,
  420. transProp: null,
  421. goodsId: null,
  422. mblno: null,
  423. loadAddr: null,
  424. mdLoadAddr: null,
  425. unLoadAddr: null,
  426. },
  427. billTypeList: [],
  428. transTypeList: [],
  429. transPropList: [],
  430. showSetting: false,
  431. drag: false,
  432. setRowList: [
  433. {
  434. surface: "1",
  435. label: "corpId",
  436. name: "客户名称",
  437. checked: 0,
  438. width: 100,
  439. },
  440. {
  441. surface: "2",
  442. label: "createTime",
  443. name: "制单日期",
  444. checked: 0,
  445. width: 100,
  446. },
  447. {
  448. surface: "3",
  449. label: "loadDate",
  450. name: "提箱日期",
  451. checked: 0,
  452. width: 100,
  453. },
  454. {
  455. surface: "4",
  456. label: "billType",
  457. name: "业务类型",
  458. checked: 0,
  459. width: 100,
  460. },
  461. {
  462. surface: "5",
  463. label: "transType",
  464. name: "运输方式",
  465. checked: 0,
  466. width: 100,
  467. },
  468. {
  469. surface: "6",
  470. label: "transProp",
  471. name: "运输性质",
  472. checked: 0,
  473. width: 100,
  474. },
  475. {
  476. surface: "7",
  477. label: "mblno",
  478. name: "提单号",
  479. checked: 0,
  480. width: 100,
  481. fixed: "left",
  482. },
  483. {
  484. surface: "8",
  485. label: "qtyPlan",
  486. name: "计划件数",
  487. checked: 0,
  488. width: 100,
  489. },
  490. {
  491. surface: "9",
  492. label: "loadAddr",
  493. name: "提箱地点",
  494. checked: 0,
  495. width: 100,
  496. },
  497. {
  498. surface: "10",
  499. label: "mdLoadAddr",
  500. name: "装卸货地点",
  501. checked: 0,
  502. width: 110,
  503. },
  504. {
  505. surface: "11",
  506. label: "unLoadAddr",
  507. name: "卸箱地点",
  508. checked: 0,
  509. width: 100,
  510. },
  511. {
  512. surface: "12",
  513. label: "carQty",
  514. name: "已安排箱量",
  515. checked: 0,
  516. width: 100,
  517. },
  518. {
  519. surface: "13",
  520. label: "cntrName",
  521. name: "箱型",
  522. checked: 0,
  523. width: 100,
  524. },
  525. {
  526. surface: "14",
  527. label: "carnolist",
  528. name: "车号",
  529. checked: 0,
  530. width: 100,
  531. },
  532. {
  533. surface: "15",
  534. label: "carcorPid",
  535. name: "车队名称",
  536. checked: 0,
  537. width: 100,
  538. },
  539. {
  540. surface: "16",
  541. label: "billStatus",
  542. name: "状态",
  543. checked: 0,
  544. width: 100,
  545. },
  546. {
  547. surface: "17",
  548. label: "remarks",
  549. name: "备注",
  550. checked: 0,
  551. width: 100,
  552. },
  553. {
  554. surface: "18",
  555. label: "cntrQty",
  556. name: "调度数量",
  557. checked: 0,
  558. width: 100,
  559. },
  560. ],
  561. getRowList: [
  562. {
  563. surface: "1",
  564. label: "corpId",
  565. name: "客户名称",
  566. checked: 0,
  567. width: 100,
  568. },
  569. {
  570. surface: "2",
  571. label: "createTime",
  572. name: "制单日期",
  573. checked: 0,
  574. width: 100,
  575. },
  576. {
  577. surface: "3",
  578. label: "loadDate",
  579. name: "提箱日期",
  580. checked: 0,
  581. width: 100,
  582. },
  583. {
  584. surface: "4",
  585. label: "billType",
  586. name: "业务类型",
  587. checked: 0,
  588. width: 100,
  589. },
  590. {
  591. surface: "5",
  592. label: "transType",
  593. name: "运输方式",
  594. checked: 0,
  595. width: 100,
  596. },
  597. {
  598. surface: "6",
  599. label: "transProp",
  600. name: "运输性质",
  601. checked: 0,
  602. width: 100,
  603. },
  604. {
  605. surface: "7",
  606. label: "mblno",
  607. name: "提单号",
  608. checked: 0,
  609. width: 100,
  610. fixed: "left",
  611. },
  612. {
  613. surface: "8",
  614. label: "qtyPlan",
  615. name: "计划件数",
  616. checked: 0,
  617. width: 100,
  618. },
  619. {
  620. surface: "9",
  621. label: "loadAddr",
  622. name: "提箱地点",
  623. checked: 0,
  624. width: 100,
  625. },
  626. {
  627. surface: "10",
  628. label: "mdLoadAddr",
  629. name: "装卸货地点",
  630. checked: 0,
  631. width: 110,
  632. },
  633. {
  634. surface: "11",
  635. label: "unLoadAddr",
  636. name: "卸箱地点",
  637. checked: 0,
  638. width: 100,
  639. },
  640. {
  641. surface: "12",
  642. label: "carQty",
  643. name: "已安排箱量",
  644. checked: 0,
  645. width: 100,
  646. },
  647. {
  648. surface: "13",
  649. label: "cntrName",
  650. name: "箱型",
  651. checked: 0,
  652. width: 100,
  653. },
  654. {
  655. surface: "14",
  656. label: "carnolist",
  657. name: "车号",
  658. checked: 0,
  659. width: 100,
  660. },
  661. {
  662. surface: "15",
  663. label: "carcorPid",
  664. name: "车队名称",
  665. checked: 0,
  666. width: 100,
  667. },
  668. {
  669. surface: "16",
  670. label: "billStatus",
  671. name: "状态",
  672. checked: 0,
  673. width: 100,
  674. },
  675. {
  676. surface: "17",
  677. label: "remarks",
  678. name: "备注",
  679. checked: 0,
  680. width: 100,
  681. },
  682. {
  683. surface: "18",
  684. label: "cntrQty",
  685. name: "调度数量",
  686. checked: 0,
  687. width: 100,
  688. },
  689. ],
  690. allCheck: false,
  691. title: "",
  692. form: {},
  693. DList: [],
  694. CList: [],
  695. schedulingList: [],
  696. fMblnoOptions: [],
  697. goodsOptions: [],
  698. vehicleList: [],
  699. show: false,
  700. collapses: [],
  701. };
  702. },
  703. // 使用子组件
  704. components: {
  705. AddOrUpdate,
  706. draggable,
  707. },
  708. created() {
  709. this.getList();
  710. this.getDicts("data_billType").then((response) => {
  711. this.billTypeList = response.data;
  712. });
  713. this.getDicts("data_transType").then((response) => {
  714. this.transTypeList = response.data;
  715. });
  716. this.getDicts("data_transProp").then((response) => {
  717. this.transPropList = response.data;
  718. });
  719. listGoods().then((response) => {
  720. this.goodsOptions = response.rows;
  721. });
  722. listCorps().then((response) => {
  723. this.fMblnoOptions = response.rows;
  724. });
  725. this.getRow();
  726. console.log(window.location);
  727. },
  728. methods: {
  729. //列设置全选
  730. allChecked() {
  731. if (this.allCheck == true) {
  732. this.setRowList.map((e) => {
  733. return (e.checked = 0);
  734. });
  735. } else {
  736. this.setRowList.map((e) => {
  737. return (e.checked = 1);
  738. });
  739. }
  740. },
  741. //查询列数据
  742. getRow() {
  743. let that = this;
  744. this.data = {
  745. tableName: "车队派车",
  746. userId: Cookies.get("userName"),
  747. };
  748. select(this.data).then((res) => {
  749. if (res.data.length != 0) {
  750. this.getRowList = res.data.filter((e) => e.checked == 0);
  751. this.setRowList = res.data;
  752. this.setRowList = this.setRowList.reduce((res, item) => {
  753. res.push({
  754. surface: item.surface,
  755. label: item.label,
  756. name: item.name,
  757. checked: item.checked,
  758. width: item.width,
  759. });
  760. return res;
  761. }, []);
  762. }
  763. });
  764. },
  765. //保存列设置
  766. save() {
  767. this.showSetting = false;
  768. this.data = {
  769. tableName: "车队派车",
  770. userId: Cookies.get("userName"),
  771. sysTableSetList: this.setRowList,
  772. };
  773. addSet(this.data).then((res) => {
  774. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  775. });
  776. },
  777. //开始拖拽事件
  778. onStart() {
  779. this.drag = true;
  780. },
  781. //拖拽结束事件
  782. onEnd() {
  783. this.drag = false;
  784. },
  785. /** 查询订单主列表 */
  786. getList() {
  787. this.loading = true;
  788. listFtmsorderbillsplans(this.queryParams).then((response) => {
  789. response.rows.map((e) => {
  790. if (e.createTime) {
  791. e.createTime = e.createTime.substring(0, 10);
  792. }
  793. if (e.loadDate) {
  794. e.loadDate = e.loadDate.substring(0, 10);
  795. }
  796. if (e.billStatus == 1) {
  797. e.billStatus = "新建";
  798. }
  799. if (e.billStatus == 2) {
  800. e.billStatus = "暂存";
  801. }
  802. if (e.billStatus == 3) {
  803. e.billStatus = "撤销";
  804. }
  805. if (e.billStatus == 6) {
  806. e.billStatus = "待派车";
  807. }
  808. if (e.billStatus == 20) {
  809. e.billStatus = "派车中";
  810. }
  811. if (e.billStatus == 30) {
  812. e.billStatus = "派车撤回";
  813. }
  814. if (e.billStatus == 60) {
  815. e.billStatus = "派车完成";
  816. }
  817. });
  818. this.ftmsorderbillsList = response.rows;
  819. this.total = response.total;
  820. this.loading = false;
  821. });
  822. },
  823. /** 新增按钮操作 */
  824. handleAdd() {
  825. this.reset();
  826. this.addOrUpdateVisible = !this.addOrUpdateVisible;
  827. this.title = "添加订单主";
  828. },
  829. // 表单重置
  830. reset() {
  831. this.form = {
  832. id: null,
  833. billNo: null,
  834. actId: null,
  835. corpId: null,
  836. transUserName: null,
  837. planUserName: null,
  838. billType: null,
  839. transType: null,
  840. transProp: null,
  841. ifContracted: null,
  842. contractNo: null,
  843. refNo: null,
  844. accstlType: null,
  845. accdays: null,
  846. goodsId: null,
  847. goodsPrice: null,
  848. goodsLossType: null,
  849. goodsLossStd: null,
  850. mblno: null,
  851. ysl: null,
  852. voy: null,
  853. pol: null,
  854. pod: null,
  855. qtyPlan: null,
  856. qtyDisPatch: null,
  857. weightPlan: null,
  858. cntrDesc: null,
  859. carNoList: null,
  860. loadAddr: null,
  861. loadAttn: null,
  862. loadAttntel: null,
  863. loadDate: null,
  864. mdLoadAddr: null,
  865. mdLoadAttn: null,
  866. mdLoadAttnTel: null,
  867. mdLoadDate: null,
  868. unLoadAddr: null,
  869. unLoadAttn: null,
  870. unLoadAttnTel: null,
  871. unLoadDate: null,
  872. routeId: null,
  873. routeDesc: null,
  874. ifWaybill: null,
  875. ifNeedinvDr: null,
  876. postDate: null,
  877. billStatus: 0,
  878. delFlag: null,
  879. createBy: null,
  880. createTime: null,
  881. updateBy: null,
  882. updateTime: null,
  883. remarks: null,
  884. };
  885. this.resetForm("form");
  886. this.DList = [];
  887. this.CList = [];
  888. this.schedulingList = [];
  889. this.vehicleList = [];
  890. this.disabled = false;
  891. this.disabled2 = false;
  892. this.collapses = ["1", "2"];
  893. },
  894. // 多选框选中数据
  895. handleSelectionChange(selection) {
  896. this.ids = selection.map((item) => item.id);
  897. this.single = selection.length !== 1;
  898. this.multiple = !selection.length;
  899. },
  900. /** 修改按钮操作 */
  901. handleUpdate(row) {
  902. this.reset();
  903. const id = row.id || this.ids;
  904. getFtmsorderbillscars(id).then((response) => {
  905. if (response.data.tmsorder.billType) {
  906. response.data.tmsorder.billType = response.data.tmsorder.billType.toString();
  907. }
  908. if (response.data.plans.billStatus == 60) {
  909. this.disabled2 = true;
  910. }
  911. let arr = [];
  912. arr.push(response.data.plans);
  913. this.disabled = true;
  914. this.title = "查看订单";
  915. this.form = response.data.tmsorder;
  916. if (response.data.fees.length) {
  917. response.data.fees.map((e) => {
  918. if (e.fFeeunitid) {
  919. e.fFeeunitid = e.fFeeunitid.toString();
  920. }
  921. });
  922. this.DList = response.data.fees.filter((e) => e.fdc == "D");
  923. this.CList = response.data.fees.filter((e) => e.fdc == "C");
  924. } else {
  925. this.DList = [];
  926. this.CList = [];
  927. }
  928. arr.map((e) => {
  929. if (e.cntrId) {
  930. e.cntrId = e.cntrId.toString();
  931. }
  932. });
  933. this.schedulingList = arr;
  934. if (response.data.cars.length != 0) {
  935. response.data.cars.map((e) => {
  936. if (e.cntrId) {
  937. e.cntrId = e.cntrId.toString();
  938. }
  939. });
  940. }
  941. this.vehicleList = response.data.cars;
  942. this.addOrUpdateVisible = !this.addOrUpdateVisible;
  943. });
  944. },
  945. //获取到保存并复制
  946. getSave(data) {
  947. data.data.map((e) => {
  948. if (e.cntrId != null) {
  949. return (e.cntrId = e.cntrId.toString());
  950. }
  951. });
  952. this.vehicleList = data.data;
  953. },
  954. /** 删除按钮操作 */
  955. handleDelete(row) {
  956. const ids = row.id || this.ids;
  957. this.$confirm('是否确认删除订单主编号为"' + ids + '"的数据项?', "警告", {
  958. confirmButtonText: "确定",
  959. cancelButtonText: "取消",
  960. type: "warning",
  961. })
  962. .then(function () {
  963. return delFtmsorderbills(ids);
  964. })
  965. .then(() => {
  966. this.getList();
  967. this.msgSuccess("删除成功");
  968. });
  969. },
  970. /** 导出按钮操作 */
  971. handleExport() {
  972. const queryParams = this.queryParams;
  973. this.$confirm("是否确认导出所有订单主数据项?", "警告", {
  974. confirmButtonText: "确定",
  975. cancelButtonText: "取消",
  976. type: "warning",
  977. })
  978. .then(function () {
  979. return exportFtmsorderbills(queryParams);
  980. })
  981. .then((response) => {
  982. this.download(response.msg);
  983. });
  984. },
  985. /** 搜索按钮操作 */
  986. handleQuery() {
  987. this.queryParams.pageNum = 1;
  988. this.getList();
  989. },
  990. /** 重置按钮操作 */
  991. resetQuery() {
  992. this.resetForm("queryForm");
  993. this.handleQuery();
  994. },
  995. // 监听 子组件弹窗关闭后触发,有子组件调用
  996. showAddOrUpdate(data) {
  997. if (data === "false") {
  998. this.addOrUpdateVisible = false;
  999. this.disabled = false;
  1000. } else {
  1001. this.addOrUpdateVisible = true;
  1002. }
  1003. },
  1004. fixDisabled(data) {
  1005. if (data === "false") {
  1006. this.disabled = false;
  1007. }
  1008. },
  1009. },
  1010. };
  1011. </script>
  1012. <style lang="scss" scoped>
  1013. .tabSetting {
  1014. display: flex;
  1015. justify-content: flex-end;
  1016. }
  1017. .listStyle {
  1018. display: flex;
  1019. border-top: 1px solid #dcdfe6;
  1020. border-left: 1px solid #dcdfe6;
  1021. border-right: 1px solid #dcdfe6;
  1022. }
  1023. .listStyle:last-child {
  1024. border-bottom: 1px solid #dcdfe6;
  1025. }
  1026. .progress {
  1027. display: flex;
  1028. align-items: center;
  1029. padding: 2px;
  1030. background-color: rgba(0, 0, 0, 0.05);
  1031. height: 100%;
  1032. }
  1033. </style>