index.vue 28 KB

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