index.vue 29 KB

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