index.vue 26 KB

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