index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. <template>
  2. <div class="app-container">
  3. <div v-show="pageShow">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. v-show="showSearch"
  8. label-width="70px"
  9. size="small"
  10. >
  11. <el-row>
  12. <el-col :span="6">
  13. <el-form-item label="业务类型" prop="fBilltype">
  14. <el-select
  15. clearable
  16. filterable
  17. placeholder="请选择"
  18. style="width: 100%"
  19. v-model="queryParams.fBilltype"
  20. >
  21. <el-option
  22. v-for="(item, index) in billTypeList"
  23. :key="index.dictValue"
  24. :label="item.dictLabel"
  25. :value="item.dictValue"
  26. />
  27. </el-select>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="6">
  31. <el-form-item label="船公司" prop="fCorpid">
  32. <el-select
  33. clearable
  34. filterable
  35. placeholder="请输入关键词"
  36. style="width: 100%"
  37. v-model="queryParams.fCorpid"
  38. >
  39. <el-option
  40. v-for="(item, index) in fMblnoOptions"
  41. :key="index.fId"
  42. :label="item.fName"
  43. :value="item.fId"
  44. ></el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="6">
  49. <el-form-item label="状态" prop="fBillstatus">
  50. <el-select
  51. clearable
  52. filterable
  53. placeholder="请选择"
  54. style="width: 100%"
  55. v-model="queryParams.fBillstatus"
  56. >
  57. <el-option
  58. v-for="(item, index) in statusList"
  59. :key="index.dictValue"
  60. :label="item.dictLabel"
  61. :value="item.dictValue"
  62. />
  63. </el-select>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="6">
  67. <el-form-item label="起运港" prop="polId">
  68. <el-select
  69. v-model="queryParams.polId"
  70. clearable
  71. filterable
  72. placeholder="请输入关键词"
  73. style="width: 100%"
  74. >
  75. <el-option
  76. v-for="(item, index) in podList"
  77. :key="index.fId"
  78. :label="item.fName"
  79. :value="item.fId"
  80. ></el-option>
  81. </el-select>
  82. </el-form-item>
  83. </el-col>
  84. </el-row>
  85. <el-collapse-transition>
  86. <div v-show="show">
  87. <el-row>
  88. <el-col :span="6">
  89. <el-form-item label="目的港" prop=" podId">
  90. <el-select
  91. v-model="queryParams.podId"
  92. clearable
  93. filterable
  94. placeholder="请输入关键词"
  95. style="width: 100%"
  96. >
  97. <el-option
  98. v-for="(item, index) in podList"
  99. :key="index.fId"
  100. :label="item.fName"
  101. :value="item.fId"
  102. ></el-option>
  103. </el-select>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="6">
  107. <el-form-item label="有效期" prop="validdateList">
  108. <el-date-picker
  109. v-model="queryParams.validdateList"
  110. type="daterange"
  111. value-format="yyyy-MM-dd HH:mm:ss"
  112. :default-time="['00:00:00', '23:59:59']"
  113. clearable
  114. style="width: 230px"
  115. range-separator="至"
  116. start-placeholder="开始日期"
  117. end-placeholder="结束日期"
  118. @keyup.enter.native="handleQuery"
  119. >
  120. </el-date-picker>
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="6">
  124. <el-form-item label="航线" prop="fLineid">
  125. <el-select
  126. size="small"
  127. clearable
  128. filterable
  129. placeholder="请选择"
  130. style="width: 80%"
  131. v-model="queryParams.fLineid"
  132. >
  133. <el-option
  134. v-for="(item, index) in fLineList"
  135. :key="index.fId"
  136. :label="item.fName"
  137. :value="item.fId"
  138. />
  139. </el-select>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="6">
  143. <el-form-item label="订舱代理" prop="fBookagentid">
  144. <el-select
  145. size="small"
  146. clearable
  147. filterable
  148. placeholder="请选择"
  149. style="width: 80%"
  150. v-model="queryParams.fBookagentid"
  151. >
  152. <el-option
  153. v-for="(item, index) in fBookagentList"
  154. :key="index.fId"
  155. :label="item.fName"
  156. :value="item.fId"
  157. />
  158. </el-select>
  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="['warehouseBusiness:stockTransfer:add']"
  173. >新增
  174. </el-button>
  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="single"
  182. @click="handleUpdate"
  183. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  184. >修改
  185. </el-button>
  186. </el-col>
  187. <el-col :span="1.5">
  188. <el-button
  189. type="warning"
  190. icon="el-icon-download"
  191. size="mini"
  192. @click="handleExport"
  193. v-hasPermi="['warehouseBusiness:stockTransfer:export']"
  194. >导出
  195. </el-button>
  196. </el-col>
  197. <el-col :span="1.5">
  198. <el-button
  199. type="warning"
  200. icon="el-icon-download"
  201. size="mini"
  202. @click="handleExport"
  203. :disabled="multiple"
  204. v-hasPermi="['warehouseBusiness:stockTransfer:export']"
  205. >导入
  206. </el-button>
  207. </el-col>
  208. <el-col :span="1.5">
  209. <el-button
  210. type="info"
  211. icon="el-icon-download"
  212. size="mini"
  213. :disabled="single"
  214. @click="copyUpdate"
  215. v-hasPermi="['agreement:agreementStorage:export']"
  216. >复制新增
  217. </el-button>
  218. </el-col>
  219. <div class="tabSetting">
  220. <div style="margin-right: 20px">
  221. <el-button
  222. type="cyan"
  223. icon="el-icon-search"
  224. size="mini"
  225. @click="handleQuery"
  226. >搜索</el-button
  227. >
  228. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  229. >重置</el-button
  230. >
  231. <el-button
  232. v-show="show"
  233. @click="show = !show"
  234. icon="el-icon-arrow-up"
  235. size="mini"
  236. >展开</el-button
  237. >
  238. <el-button
  239. v-show="!show"
  240. @click="show = !show"
  241. icon="el-icon-arrow-down"
  242. size="mini"
  243. >展开</el-button
  244. >
  245. </div>
  246. <right-toolbar
  247. :showSearch.sync="showSearch"
  248. @queryTable="getList"
  249. ></right-toolbar>
  250. <div style="margin: 0 12px">
  251. <el-button
  252. icon="el-icon-setting"
  253. size="mini"
  254. circle
  255. @click="showSetting = !showSetting"
  256. ></el-button>
  257. </div>
  258. </div>
  259. </el-row>
  260. <el-dialog
  261. title="自定义列显示"
  262. :visible.sync="showSetting"
  263. width="700px"
  264. v-dialogDrag
  265. :close-on-click-modal="false"
  266. >
  267. <template slot="title">
  268. <div class="avue-crud__dialog__header">
  269. <span class="el-dialog__title">
  270. <span
  271. style="
  272. display: inline-block;
  273. width: 3px;
  274. height: 20px;
  275. margin-right: 5px;
  276. float: left;
  277. margin-top: 2px;
  278. "
  279. ></span>
  280. </span>
  281. </div>
  282. </template>
  283. <div>配置排序列数据(拖动调整顺序)</div>
  284. <div style="margin-left: 17px">
  285. <el-checkbox
  286. v-model="allCheck"
  287. label="全选"
  288. @change="allChecked"
  289. ></el-checkbox>
  290. </div>
  291. <div style="padding: 4px; display: flex; justify-content: center">
  292. <draggable
  293. v-model="setRowList"
  294. group="site"
  295. animation="300"
  296. @start="onStart"
  297. @end="onEnd"
  298. handle=".indraggable"
  299. >
  300. <transition-group>
  301. <div
  302. v-for="item in setRowList"
  303. :key="item.surface"
  304. class="listStyle"
  305. >
  306. <div style="width: 500px" class="indraggable">
  307. <div class="progress" :style="{ width: item.width + 'px' }">
  308. <el-checkbox
  309. :label="item.name"
  310. v-model="item.checked"
  311. :true-label="0"
  312. :false-label="1"
  313. >{{ item.name }}
  314. </el-checkbox>
  315. </div>
  316. </div>
  317. <el-input-number
  318. v-model.number="item.width"
  319. controls-position="right"
  320. :min="1"
  321. :max="500"
  322. size="mini"
  323. ></el-input-number>
  324. </div>
  325. </transition-group>
  326. </draggable>
  327. </div>
  328. <span slot="footer" class="dialog-footer">
  329. <el-button @click="showSetting = false">取 消</el-button>
  330. <el-button @click="delRow" type="danger">重 置</el-button>
  331. <el-button type="primary" @click="save()">确 定</el-button>
  332. </span>
  333. </el-dialog>
  334. <el-table
  335. v-loading="loading"
  336. :data="warehousebillsList"
  337. @selection-change="handleSelectionChange"
  338. show-summary
  339. :summary-method="getSum"
  340. >
  341. <el-table-column type="selection" width="50" fixed align="center" />
  342. <el-table-column
  343. type="index"
  344. label="行号"
  345. width="50"
  346. align="center"
  347. fixed
  348. />
  349. <el-table-column
  350. v-for="(item, index) in getRowList"
  351. :key="index"
  352. :label="item.name"
  353. :width="item.width"
  354. :prop="item.label"
  355. align="center"
  356. :fixed="item.fixed"
  357. :show-overflow-tooltip="true"
  358. sortable
  359. >
  360. <template slot-scope="scope">
  361. <span v-if="item.label == 'fMblno'">
  362. <el-link :underline="false" type="primary"
  363. ><div @click="handleUpdate(scope.row)">
  364. {{ scope.row.fMblno }}
  365. </div></el-link
  366. >
  367. </span>
  368. <span v-else>{{ scope.row[item.label] }}</span>
  369. </template>
  370. </el-table-column>
  371. <el-table-column
  372. label="操作"
  373. align="center"
  374. class-name="small-padding fixed-width"
  375. min-width="180"
  376. fixed="right"
  377. >
  378. <template slot-scope="scope">
  379. <el-button
  380. size="mini"
  381. type="text"
  382. icon="el-icon-edit"
  383. @click="handleUpdate(scope.row, true)"
  384. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  385. >查看
  386. </el-button>
  387. <el-button
  388. size="mini"
  389. type="text"
  390. icon="el-icon-edit"
  391. v-if="
  392. scope.row.fBillstatus == '录入' ||
  393. scope.row.fBillstatus == '暂存' ||
  394. scope.row.fBillstatus == '驳回'
  395. "
  396. @click="handleUpdate(scope.row, false)"
  397. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  398. >修改
  399. </el-button>
  400. <el-button
  401. size="mini"
  402. type="text"
  403. icon="el-icon-delete"
  404. v-if="scope.row.fItemsStatus == '计划'"
  405. @click="handleDelete(scope.row)"
  406. v-hasPermi="['warehouseBusiness:stockTransfer:remove']"
  407. >删除
  408. </el-button>
  409. <el-button
  410. size="mini"
  411. type="text"
  412. icon="el-icon-delete"
  413. v-if="
  414. scope.row.fBillstatus == '请核' ||
  415. scope.row.fBillstatus == '审核中'
  416. "
  417. @click="handleUpdate(scope.row, true)"
  418. >审核进度
  419. </el-button>
  420. </template>
  421. </el-table-column>
  422. </el-table>
  423. <pagination
  424. v-show="total > 0"
  425. :total="total"
  426. :page.sync="queryParams.pageNum"
  427. :limit.sync="queryParams.pageSize"
  428. @pagination="getList"
  429. />
  430. </div>
  431. <add-or-update
  432. v-show="pageShow2"
  433. @changeShow="showAddOrUpdate"
  434. ref="addOrUpdateRef"
  435. :chiId="formId"
  436. :copyStatus="copyStatus"
  437. :key="timer"
  438. ></add-or-update>
  439. </div>
  440. </template>
  441. <script>
  442. import AddOrUpdate from "./AddOrUpdate.vue";
  443. import {listCorpsList, query, shippingCompany,listRoute} from "@/api/warehouseBusiness/shipping";
  444. import { listCorps } from "@/api/basicdata/corps";
  445. import { listWarehousesss } from "@/api/basicdata/warehouse";
  446. import { listGoods } from "@/api/basicdata/goods";
  447. import { listUser, queryUserVal } from "@/api/system/user";
  448. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  449. import Cookies from "js-cookie";
  450. import { addSet, select, resetModule } from "@/api/system/set";
  451. import draggable from "vuedraggable";
  452. export default {
  453. name: "plans",
  454. data() {
  455. return {
  456. timer: "",
  457. pageShow: true,
  458. pageShow2: false,
  459. queryParams: {
  460. pageNum: 1,
  461. pageSize: 10,
  462. fBilltype: null,
  463. fCorpid: null,
  464. polId: null,
  465. podId: null,
  466. fValiddate: null,
  467. remarks: null,
  468. },
  469. // 显示搜索条件
  470. showSearch: true,
  471. userOptions: [],
  472. fTrademodeidOptions: [],
  473. warehouseOptions: [],
  474. goodsOptions: [],
  475. fLineList:[],
  476. fBookagentList:[],
  477. fMblnoOptions: [],
  478. show: false,
  479. drag: false,
  480. tableDate: [
  481. {
  482. surface: "1",
  483. label: "fCorpid",
  484. name: "船公司",
  485. checked: 0,
  486. width: 100,
  487. },
  488. {
  489. surface: "2",
  490. label: "fBilltype",
  491. name: "业务类型",
  492. checked: 0,
  493. width: 100,
  494. },
  495. {
  496. surface: "3",
  497. label: "fBillstatus",
  498. name: "状态",
  499. checked: 0,
  500. width: 100,
  501. },
  502. {
  503. surface: "4",
  504. label: "polId",
  505. name: "起运港",
  506. checked: 0,
  507. width: 100,
  508. },
  509. {
  510. surface: "5",
  511. label: "podId",
  512. name: "目的港",
  513. checked: 0,
  514. width: 100,
  515. },
  516. {
  517. surface: "5",
  518. label: "fValiddate",
  519. name: "有效期",
  520. checked: 0,
  521. width: 100,
  522. },
  523. {
  524. surface: "5",
  525. label: "createBy",
  526. name: "录入人",
  527. checked: 0,
  528. width: 100,
  529. },{
  530. surface: "6",
  531. label: "fLineName",
  532. name: "航线",
  533. checked: 0,
  534. width: 100,
  535. },{
  536. surface: "7",
  537. label: "fBookagentName",
  538. name: "订舱代理",
  539. checked: 0,
  540. width: 100,
  541. },
  542. {
  543. surface: "8",
  544. label: "remarks",
  545. name: "备注",
  546. checked: 0,
  547. width: 100,
  548. },
  549. ],
  550. setRowList: [],
  551. getRowList: [],
  552. allCheck: false,
  553. showSetting: false,
  554. total: 0,
  555. warehousebillsList: [],
  556. loading: true,
  557. single: true,
  558. multiple: true,
  559. formId: null,
  560. ids: [],
  561. copyStatus: null,
  562. billTypeList: [],
  563. statusList: [],
  564. polList: [],
  565. podList: [],
  566. };
  567. },
  568. // 使用子组件
  569. components: { draggable, AddOrUpdate },
  570. created() {
  571. this.setRowList = this.tableDate;
  572. this.getRowList = this.tableDate;
  573. this.getDicts("data_trademodes").then((response) => {
  574. this.fTrademodeidOptions = response.data;
  575. });
  576. listGoods({ fStatus: 0, delFlag: 0 }).then((response) => {
  577. this.goodsOptions = response.rows;
  578. });
  579. listWarehousesss({ fStatus: 0, delFlag: 0 }).then((response) => {
  580. this.warehouseOptions = response.rows;
  581. });
  582. listCorpsList().then( response =>{
  583. this.fLineList = response.rows
  584. })
  585. shippingCompany().then( response =>{
  586. this.fBookagentList = response.rows
  587. })
  588. listUser().then((response) => {
  589. this.userOptions = response.rows;
  590. });
  591. listCorps({ type: 1 }).then((response) => {
  592. this.fMblnoOptions = response.rows;
  593. });
  594. this.getDicts("data_billType").then((response) => {
  595. this.billTypeList = response.data;
  596. });
  597. this.getDicts("data_status").then((response) => {
  598. this.statusList = response.data;
  599. });
  600. // this.getDicts("port_start").then((response) => {
  601. // this.polList = response.data;
  602. // });
  603. // this.getDicts("port_end").then((response) => {
  604. // this.podList = response.data;
  605. // });
  606. listRoute({}).then(response => {
  607. this.podList = response.rows
  608. });
  609. this.getRow();
  610. this.getList();
  611. },
  612. activated() {
  613. if (this.$route.query.id) {
  614. this.handleUpdate(this.$route.query.id);
  615. }
  616. },
  617. methods: {
  618. //列设置全选
  619. allChecked() {
  620. if (this.allCheck == true) {
  621. this.setRowList.map((e) => {
  622. return (e.checked = 0);
  623. });
  624. } else {
  625. this.setRowList.map((e) => {
  626. return (e.checked = 1);
  627. });
  628. }
  629. },
  630. //查询列数据
  631. getRow() {
  632. let that = this;
  633. this.data = {
  634. tableName: "调拨",
  635. userId: Cookies.get("userName"),
  636. };
  637. select(this.data).then((res) => {
  638. if (res.data.length != 0) {
  639. this.getRowList = res.data.filter((e) => e.checked == 0);
  640. this.setRowList = res.data;
  641. this.setRowList = this.setRowList.reduce((res, item) => {
  642. res.push({
  643. surface: item.surface,
  644. label: item.label,
  645. name: item.name,
  646. checked: item.checked,
  647. width: item.width,
  648. fixed: item.fixed,
  649. });
  650. return res;
  651. }, []);
  652. }
  653. });
  654. },
  655. //重置列表
  656. delRow() {
  657. this.data = {
  658. tableName: "调拨",
  659. userId: Cookies.get("userName"),
  660. };
  661. resetModule(this.data).then((res) => {
  662. if (res.code == 200) {
  663. this.showSetting = false;
  664. this.setRowList = this.$options.data().tableDate;
  665. this.getRowList = this.$options.data().tableDate;
  666. }
  667. });
  668. },
  669. //保存列设置
  670. save() {
  671. this.showSetting = false;
  672. this.data = {
  673. tableName: "调拨",
  674. userId: Cookies.get("userName"),
  675. sysTableSetList: this.setRowList,
  676. };
  677. addSet(this.data).then((res) => {
  678. if (res.code == 200) {
  679. this.showSetting = false;
  680. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  681. console.log(this.tableDate);
  682. }
  683. });
  684. },
  685. //开始拖拽事件
  686. onStart() {
  687. this.drag = true;
  688. },
  689. //拖拽结束事件
  690. onEnd() {
  691. this.drag = false;
  692. },
  693. getList() {
  694. //获取仓库
  695. query(this.queryParams).then((response) => {
  696. this.warehousebillsList = response.rows;
  697. this.total = response.total;
  698. this.loading = false;
  699. });
  700. },
  701. //合计
  702. getSum(param) {
  703. const { columns, data } = param;
  704. const sums = [];
  705. var values = [];
  706. columns.forEach((column, index) => {
  707. if (index === 0) {
  708. sums[index] = "";
  709. return;
  710. }
  711. if (column.property === "fGrossweight") {
  712. values = data.map((item) => Number(item["fGrossweight"]));
  713. }
  714. if (column.property === "fNetweight") {
  715. values = data.map((item) => Number(item["fNetweight"]));
  716. }
  717. if (column.property === "fQty") {
  718. values = data.map((item) => Number(item["fQty"]));
  719. }
  720. if (column.property === "fPlanqty") {
  721. values = data.map((item) => Number(item.fPlanqty));
  722. }
  723. if (
  724. column.property === "fGrossweight" ||
  725. column.property === "fNetweight" ||
  726. column.property === "fQty" ||
  727. column.property === "fPlanqty"
  728. ) {
  729. sums[index] = values.reduce((prev, curr) => {
  730. const value = Number(curr);
  731. if (!isNaN(value)) {
  732. return prev + curr;
  733. } else {
  734. return prev;
  735. }
  736. }, 0);
  737. if (column.property === "fGrossweight") {
  738. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  739. }
  740. if (column.property === "fNetweight") {
  741. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  742. }
  743. if (column.property === "fQty") {
  744. sums[index] = sums[index].toFixed(2);
  745. }
  746. if (column.property === "fPlanqty") {
  747. if (sums[index]) {
  748. sums[index] = sums[index];
  749. }
  750. }
  751. }
  752. });
  753. return sums;
  754. },
  755. handleAdd() {
  756. this.timer = new Date().getTime();
  757. this.pageShow = false;
  758. this.pageShow2 = true;
  759. },
  760. // 多选框选中数据
  761. handleSelectionChange(selection) {
  762. this.ids = selection.map((item) => item.fId);
  763. this.single =
  764. selection.length !== 1 ||
  765. selection.map((item) => item.fBillstatus) == 6 ||
  766. selection.map((item) => item.fBillstatus) == 4;
  767. this.multiple = !selection.length;
  768. },
  769. /** 修改按钮操作 */
  770. handleUpdate(row) {
  771. const fId = row.fId || this.ids[0] || row;
  772. this.copyStatus = null;
  773. this.formId = fId;
  774. this.$nextTick(() => {
  775. this.$refs.addOrUpdateRef.init();
  776. });
  777. setTimeout(() => {
  778. this.pageShow = false;
  779. this.pageShow2 = true;
  780. }, 200);
  781. },
  782. copyUpdate() {
  783. this.formId = this.ids[0];
  784. this.copyStatus = 2;
  785. this.$nextTick(() => {
  786. this.$refs.addOrUpdateRef.init();
  787. });
  788. setTimeout(() => {
  789. this.pageShow = false;
  790. this.pageShow2 = true;
  791. }, 200);
  792. },
  793. handleDelete(row) {
  794. const ids = row.fId || this.ids;
  795. delstockTransfer_s(ids).then((data) => {
  796. switch (data.msg) {
  797. case "0": {
  798. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  799. break;
  800. }
  801. case "1": {
  802. this.delete(ids, "当前主表有数据从表无数据是否删除");
  803. break;
  804. }
  805. case "2": {
  806. this.delete(ids, "当前主表有数据从表有数据是否删除");
  807. break;
  808. }
  809. default: {
  810. return this.$message.error("未知错误,无状态");
  811. }
  812. }
  813. });
  814. },
  815. delete(ids, tips) {
  816. this.$confirm(tips, "警告", {
  817. confirmButtonText: "确定",
  818. cancelButtonText: "取消",
  819. type: "warning",
  820. }).then(() => {
  821. delStockTransfer(ids);
  822. this.msgSuccess("删除成功");
  823. this.getList();
  824. });
  825. },
  826. /** 导出按钮操作 */
  827. handleExport() {
  828. // require.ensure([], () => {
  829. // const { export_json_to_excel } = require("../../../excel/Export2Excel");
  830. // const tHeader = ["客户名称", "制单日期"];
  831. // // 上面设置Excel的表格第一行的标题
  832. // const filterVal = ["corpId", "createTime"];
  833. // // 上面的index、nickName、name是tableData里对象的属性
  834. // const list = this.ftmsorderbillsList; //把data里的tableData存到list
  835. // const data = this.formatJson(filterVal, list);
  836. // export_json_to_excel(
  837. // tHeader,
  838. // data,
  839. // "列表excel",
  840. // true,
  841. // );
  842. // });
  843. },
  844. formatJson(filterVal, jsonData) {
  845. return jsonData.map((v) => filterVal.map((j) => v[j]));
  846. },
  847. /** 搜索按钮操作 */
  848. handleQuery() {
  849. this.queryParams.pageNum = 1;
  850. this.getList();
  851. },
  852. /** 重置按钮操作 */
  853. resetQuery() {
  854. this.queryParams = {
  855. pageNum: 1,
  856. pageSize: 10,
  857. fBilltype: null,
  858. fCorpid: null,
  859. polId: null,
  860. podId: null,
  861. fValiddate: null,
  862. remarks: null,
  863. };
  864. this.handleQuery();
  865. },
  866. showAddOrUpdate(data) {
  867. if (data) {
  868. this.getList();
  869. this.pageShow = true;
  870. this.pageShow2 = false;
  871. }
  872. },
  873. },
  874. };
  875. </script>