index.vue 27 KB

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