index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  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: "billNo",
  471. name: "系统编号",
  472. checked: 0,
  473. width: 100,
  474. },
  475. {
  476. surface: "3",
  477. label: "createTime",
  478. name: "制单日期",
  479. checked: 0,
  480. width: 100,
  481. },
  482. {
  483. surface: "4",
  484. label: "loadDate",
  485. name: "提箱日期",
  486. checked: 0,
  487. width: 100,
  488. },
  489. {
  490. surface: "5",
  491. label: "billType",
  492. name: "业务类型",
  493. checked: 0,
  494. width: 100,
  495. },
  496. {
  497. surface: "6",
  498. label: "transType",
  499. name: "运输方式",
  500. checked: 0,
  501. width: 100,
  502. },
  503. {
  504. surface: "7",
  505. label: "transProp",
  506. name: "运输性质",
  507. checked: 0,
  508. width: 100,
  509. },
  510. {
  511. surface: "8",
  512. label: "qtyPlan",
  513. name: "计划件数",
  514. checked: 0,
  515. width: 100,
  516. },
  517. {
  518. surface: "9",
  519. label: "loadAddr",
  520. name: "提箱地点",
  521. checked: 0,
  522. width: 100,
  523. },
  524. {
  525. surface: "10",
  526. label: "mdLoadAddr",
  527. name: "装卸货地点",
  528. checked: 0,
  529. width: 110,
  530. },
  531. {
  532. surface: "11",
  533. label: "unLoadAddr",
  534. name: "卸箱地点",
  535. checked: 0,
  536. width: 100,
  537. },
  538. {
  539. surface: "12",
  540. label: "cntrDesc",
  541. name: "箱型箱量",
  542. checked: 0,
  543. width: 100,
  544. },
  545. {
  546. surface: "13",
  547. label: "billStatus",
  548. name: "状态",
  549. checked: 0,
  550. width: 100,
  551. },
  552. {
  553. surface: "14",
  554. label: "remarks",
  555. name: "备注",
  556. checked: 0,
  557. width: 100,
  558. },
  559. ],
  560. allCheck: false,
  561. title: "",
  562. form: {},
  563. planList: [],
  564. DList: [],
  565. CList: [],
  566. schedulingList: [],
  567. fMblnoOptions: [],
  568. goodsOptions: [],
  569. show: false,
  570. collapses: [],
  571. relevantAttachments: [],
  572. };
  573. },
  574. // 使用子组件
  575. components: {
  576. AddOrUpdate,
  577. draggable,
  578. },
  579. created() {
  580. this.setRowList = this.tableDate;
  581. this.getRowList = this.tableDate;
  582. this.getList();
  583. this.getDicts("data_billType").then((response) => {
  584. this.billTypeList = response.data;
  585. });
  586. this.getDicts("data_transType").then((response) => {
  587. this.transTypeList = response.data;
  588. });
  589. this.getDicts("data_transProp").then((response) => {
  590. this.transPropList = response.data;
  591. });
  592. listGoods().then((response) => {
  593. this.goodsOptions = response.rows;
  594. });
  595. listCorps().then((response) => {
  596. this.fMblnoOptions = response.rows;
  597. });
  598. this.getRow();
  599. },
  600. methods: {
  601. //列设置全选
  602. allChecked() {
  603. if (this.allCheck == true) {
  604. this.setRowList.map((e) => {
  605. return (e.checked = 0);
  606. });
  607. } else {
  608. this.setRowList.map((e) => {
  609. return (e.checked = 1);
  610. });
  611. }
  612. },
  613. //查询列数据
  614. getRow() {
  615. let that = this;
  616. this.data = {
  617. tableName: "计划下达",
  618. userId: Cookies.get("userName"),
  619. };
  620. select(this.data).then((res) => {
  621. if (res.data.length != 0) {
  622. this.getRowList = res.data.filter((e) => e.checked == 0);
  623. this.setRowList = res.data;
  624. this.setRowList = this.setRowList.reduce((res, item) => {
  625. res.push({
  626. surface: item.surface,
  627. label: item.label,
  628. name: item.name,
  629. checked: item.checked,
  630. width: item.width,
  631. fixed: item.fixed,
  632. });
  633. return res;
  634. }, []);
  635. }
  636. });
  637. },
  638. //重置列表
  639. delRow() {
  640. this.data = {
  641. tableName: "计划下达",
  642. userId: Cookies.get("userName"),
  643. };
  644. resetModule(this.data).then((res) => {
  645. if (res.code == 200) {
  646. this.showSetting = false;
  647. this.setRowList = this.tableDate;
  648. this.getRowList = this.tableDate;
  649. }
  650. });
  651. },
  652. //保存列设置
  653. save() {
  654. this.showSetting = false;
  655. this.data = {
  656. tableName: "计划下达",
  657. userId: Cookies.get("userName"),
  658. sysTableSetList: this.setRowList,
  659. };
  660. addSet(this.data).then((res) => {
  661. if (res.code == 200) {
  662. this.showSetting = false;
  663. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  664. }
  665. });
  666. },
  667. //开始拖拽事件
  668. onStart() {
  669. this.drag = true;
  670. },
  671. //拖拽结束事件
  672. onEnd() {
  673. this.drag = false;
  674. },
  675. /** 查询订单主列表 */
  676. getList() {
  677. this.loading = true;
  678. listFtmsorderbills(this.queryParams).then((response) => {
  679. response.rows.map((e) => {
  680. if (e.createTime) {
  681. e.createTime = e.createTime.substring(0, 10);
  682. }
  683. if (e.loadDate) {
  684. e.loadDate = e.loadDate.substring(0, 10);
  685. }
  686. if (e.billStatus == 1) {
  687. e.billStatus = "新建";
  688. }
  689. if (e.billStatus == 2) {
  690. e.billStatus = "计划暂存";
  691. }
  692. if (e.billStatus == 3) {
  693. e.billStatus = "计划撤回";
  694. }
  695. if (e.billStatus == 6) {
  696. e.billStatus = "计划提交";
  697. }
  698. if (e.billStatus == 20) {
  699. e.billStatus = "调度暂存";
  700. }
  701. if (e.billStatus == 30) {
  702. e.billStatus = "调度撤回";
  703. }
  704. if (e.billStatus == 60) {
  705. e.billStatus = "调度提交";
  706. }
  707. });
  708. this.ftmsorderbillsList = response.rows;
  709. this.total = response.total;
  710. this.loading = false;
  711. });
  712. },
  713. /** 新增按钮操作 */
  714. handleAdd() {
  715. this.reset();
  716. this.addOrUpdateVisible = !this.addOrUpdateVisible;
  717. this.title = "添加订单主";
  718. },
  719. // 表单重置
  720. reset() {
  721. this.form = {
  722. id: null,
  723. billNo: null,
  724. actId: null,
  725. corpId: null,
  726. transUserName: null,
  727. planUserName: null,
  728. billType: null,
  729. transType: null,
  730. transProp: null,
  731. ifContracted: null,
  732. contractNo: null,
  733. refNo: null,
  734. accstlType: null,
  735. accdays: null,
  736. goodsId: null,
  737. goodsPrice: null,
  738. goodsLossType: null,
  739. goodsLossStd: null,
  740. mblno: null,
  741. ysl: null,
  742. voy: null,
  743. pol: null,
  744. pod: null,
  745. qtyPlan: null,
  746. qtyDisPatch: null,
  747. weightPlan: null,
  748. cntrDesc: null,
  749. carNoList: null,
  750. loadAddr: null,
  751. loadAttn: null,
  752. loadAttntel: null,
  753. loadDate: null,
  754. mdLoadAddr: null,
  755. mdLoadAttn: null,
  756. mdLoadAttnTel: null,
  757. mdLoadDate: null,
  758. unLoadAddr: null,
  759. unLoadAttn: null,
  760. unLoadAttnTel: null,
  761. unLoadDate: null,
  762. routeId: null,
  763. routeDesc: null,
  764. ifWaybill: null,
  765. ifNeedinvDr: null,
  766. postDate: null,
  767. billStatus: 0,
  768. delFlag: null,
  769. createBy: null,
  770. createTime: null,
  771. updateBy: null,
  772. updateTime: null,
  773. remarks: null,
  774. };
  775. this.resetForm("form");
  776. this.planList = [];
  777. this.DList = [];
  778. this.CList = [];
  779. this.schedulingList = [];
  780. this.relevantAttachments = [];
  781. this.disabled = false;
  782. this.collapses = ["1"];
  783. },
  784. // 多选框选中数据
  785. handleSelectionChange(selection) {
  786. this.ids = selection.map((item) => item.id);
  787. this.single = selection.length !== 1;
  788. this.multiple = !selection.length;
  789. },
  790. /** 修改按钮操作 */
  791. handleUpdate(row) {
  792. this.reset();
  793. const id = row.id || this.ids;
  794. getFtmsorderbills(id).then((response) => {
  795. if (response.data.tmsorder.billType) {
  796. response.data.tmsorder.billType = response.data.tmsorder.billType.toString();
  797. }
  798. // if (response.data.tmsorder.polId) {
  799. // response.data.tmsorder.polId = response.data.tmsorder.polId.toString();
  800. // }
  801. // if (response.data.tmsorder.podId) {
  802. // response.data.tmsorder.podId = response.data.tmsorder.podId.toString();
  803. // }
  804. if (response.data.scntrs.length != 0) {
  805. response.data.scntrs.map((e) => {
  806. if (e.cntrId) {
  807. e.cntrId = e.cntrId.toString();
  808. }
  809. if (e.priceType) {
  810. e.priceType = e.priceType.toString();
  811. }
  812. });
  813. }
  814. if (response.data.plans.length != 0) {
  815. response.data.plans.cntrId = response.data.plans.map((e) => {
  816. if (e.cntrId) {
  817. return (e.cntrId = e.cntrId.toString());
  818. }
  819. });
  820. }
  821. this.disabled = true;
  822. this.title = "查看订单";
  823. // this.$refs.addOrUpdateRef.showSure();
  824. this.form = response.data.tmsorder;
  825. this.planList = response.data.scntrs;
  826. if (response.data.fees.length) {
  827. this.DList = response.data.fees.filter((e) => e.fDc == "D");
  828. this.CList = response.data.fees.filter((e) => e.fDc == "C");
  829. response.data.fees.map((e) => {
  830. if (e.fFeeunitid) {
  831. e.fFeeunitid = e.fFeeunitid.toString();
  832. }
  833. });
  834. } else {
  835. this.DList = [];
  836. this.CList = [];
  837. }
  838. this.schedulingList = response.data.plans;
  839. this.relevantAttachments = response.data.attach;
  840. this.addOrUpdateVisible = !this.addOrUpdateVisible;
  841. });
  842. },
  843. //获取到保存并复制
  844. getSave(data) {
  845. if (data.data.tmsorder.billType) {
  846. data.data.tmsorder.billType = data.data.tmsorder.billType.toString();
  847. }
  848. if (data.data.scntrs.length != 0) {
  849. data.data.scntrs.map((e) => {
  850. if (e.cntrId) {
  851. e.cntrId = e.cntrId.toString();
  852. }
  853. if (e.priceType) {
  854. e.priceType = e.priceType.toString();
  855. }
  856. });
  857. }
  858. if (data.data.plans.length != 0) {
  859. data.data.plans.cntrId = data.data.plans.map((e) => {
  860. if (e.cntrId) {
  861. e.cntrId = e.cntrId.toString();
  862. }
  863. });
  864. }
  865. if (data.data.fees.length != 0) {
  866. data.data.fees.ffeeunitid = data.data.fees.map((e) => {
  867. if (e.ffeeunitid != null) {
  868. return (e.ffeeunitid = e.ffeeunitid.toString());
  869. }
  870. });
  871. }
  872. this.title = "修改订单主";
  873. this.form = data.data.tmsorder;
  874. this.planList = data.data.scntrs;
  875. if (data.data.fees.length != 0) {
  876. this.DList = data.data.fees.filter((e) => e.fDc == "D");
  877. this.CList = data.data.fees.filter((e) => e.fDc == "C");
  878. } else {
  879. this.DList = [];
  880. this.CList = [];
  881. }
  882. this.schedulingList = data.data.plans;
  883. },
  884. getSave2(data) {
  885. if (data.length != 0) {
  886. data.map((e) => {
  887. if (e.cntrId) {
  888. e.cntrId = e.cntrId.toString();
  889. }
  890. if (e.priceType) {
  891. e.priceType = e.priceType.toString();
  892. }
  893. });
  894. }
  895. this.planList = data;
  896. },
  897. /** 删除按钮操作 */
  898. handleDelete(row) {
  899. const ids = row.id || this.ids;
  900. this.$confirm('是否确认删除订单主编号为"' + ids + '"的数据项?', "警告", {
  901. confirmButtonText: "确定",
  902. cancelButtonText: "取消",
  903. type: "warning",
  904. })
  905. .then(function () {
  906. return delFtmsorderbills(ids);
  907. })
  908. .then(() => {
  909. this.getList();
  910. this.msgSuccess("删除成功");
  911. });
  912. },
  913. /** 导出按钮操作 */
  914. handleExport() {
  915. // require.ensure([], () => {
  916. // const { export_json_to_excel } = require("../../../excel/Export2Excel");
  917. // const tHeader = ["客户名称", "制单日期"];
  918. // // 上面设置Excel的表格第一行的标题
  919. // const filterVal = ["corpId", "createTime"];
  920. // // 上面的index、nickName、name是tableData里对象的属性
  921. // const list = this.ftmsorderbillsList; //把data里的tableData存到list
  922. // const data = this.formatJson(filterVal, list);
  923. // export_json_to_excel(
  924. // tHeader,
  925. // data,
  926. // "列表excel",
  927. // true,
  928. // );
  929. // });
  930. },
  931. formatJson(filterVal, jsonData) {
  932. return jsonData.map((v) => filterVal.map((j) => v[j]));
  933. },
  934. /** 搜索按钮操作 */
  935. handleQuery() {
  936. this.queryParams.pageNum = 1;
  937. this.getList();
  938. },
  939. /** 重置按钮操作 */
  940. resetQuery() {
  941. this.resetForm("queryForm");
  942. this.handleQuery();
  943. },
  944. // 监听 子组件弹窗关闭后触发,有子组件调用
  945. showAddOrUpdate(data) {
  946. if (data === "false") {
  947. this.addOrUpdateVisible = false;
  948. this.disabled = false;
  949. } else {
  950. this.addOrUpdateVisible = true;
  951. }
  952. },
  953. fixDisabled(data) {
  954. if (data === "false") {
  955. this.disabled = false;
  956. }
  957. },
  958. // //客户名称
  959. // changefCorpid(row) {
  960. // console.log(row);
  961. // this.$set(row, "fSbu", row.fCorpid);
  962. // for (let corp in this.fMblnoOptions) {
  963. // if (row.fCorpid === this.fMblnoOptions[corp].fId) {
  964. // this.$set(
  965. // this.form,
  966. // "fStltypeid",
  967. // this.fMblnoOptions[corp].fStltypeid + ""
  968. // );
  969. // }
  970. // }
  971. // },
  972. // /* 远程模糊查询用户 */
  973. // corpsRemoteMethod(name) {
  974. // console.log(name);
  975. // if (name == null || name === "") {
  976. // this.fMblnoOptions = [];
  977. // return;
  978. // }
  979. // let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 };
  980. // },
  981. },
  982. };
  983. </script>
  984. <style lang="scss" scoped>
  985. .tabSetting {
  986. display: flex;
  987. justify-content: flex-end;
  988. }
  989. .listStyle {
  990. display: flex;
  991. border-top: 1px solid #dcdfe6;
  992. border-left: 1px solid #dcdfe6;
  993. border-right: 1px solid #dcdfe6;
  994. }
  995. .listStyle:last-child {
  996. border-bottom: 1px solid #dcdfe6;
  997. }
  998. .progress {
  999. display: flex;
  1000. align-items: center;
  1001. padding: 2px;
  1002. background-color: rgba(0, 0, 0, 0.05);
  1003. height: 100%;
  1004. }
  1005. </style>