index.vue 29 KB

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