index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  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 polList"
  77. :key="index.dictValue"
  78. :label="item.dictLabel"
  79. :value="item.dictValue"
  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.dictValue"
  100. :label="item.dictLabel"
  101. :value="item.dictValue"
  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} 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. this.getRow();
  607. this.getList();
  608. },
  609. activated() {
  610. if (this.$route.query.id) {
  611. this.handleUpdate(this.$route.query.id);
  612. }
  613. },
  614. methods: {
  615. //列设置全选
  616. allChecked() {
  617. if (this.allCheck == true) {
  618. this.setRowList.map((e) => {
  619. return (e.checked = 0);
  620. });
  621. } else {
  622. this.setRowList.map((e) => {
  623. return (e.checked = 1);
  624. });
  625. }
  626. },
  627. //查询列数据
  628. getRow() {
  629. let that = this;
  630. this.data = {
  631. tableName: "调拨",
  632. userId: Cookies.get("userName"),
  633. };
  634. select(this.data).then((res) => {
  635. if (res.data.length != 0) {
  636. this.getRowList = res.data.filter((e) => e.checked == 0);
  637. this.setRowList = res.data;
  638. this.setRowList = this.setRowList.reduce((res, item) => {
  639. res.push({
  640. surface: item.surface,
  641. label: item.label,
  642. name: item.name,
  643. checked: item.checked,
  644. width: item.width,
  645. fixed: item.fixed,
  646. });
  647. return res;
  648. }, []);
  649. }
  650. });
  651. },
  652. //重置列表
  653. delRow() {
  654. this.data = {
  655. tableName: "调拨",
  656. userId: Cookies.get("userName"),
  657. };
  658. resetModule(this.data).then((res) => {
  659. if (res.code == 200) {
  660. this.showSetting = false;
  661. this.setRowList = this.$options.data().tableDate;
  662. this.getRowList = this.$options.data().tableDate;
  663. }
  664. });
  665. },
  666. //保存列设置
  667. save() {
  668. this.showSetting = false;
  669. this.data = {
  670. tableName: "调拨",
  671. userId: Cookies.get("userName"),
  672. sysTableSetList: this.setRowList,
  673. };
  674. addSet(this.data).then((res) => {
  675. if (res.code == 200) {
  676. this.showSetting = false;
  677. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  678. console.log(this.tableDate);
  679. }
  680. });
  681. },
  682. //开始拖拽事件
  683. onStart() {
  684. this.drag = true;
  685. },
  686. //拖拽结束事件
  687. onEnd() {
  688. this.drag = false;
  689. },
  690. getList() {
  691. //获取仓库
  692. query(this.queryParams).then((response) => {
  693. this.warehousebillsList = response.rows;
  694. this.total = response.total;
  695. this.loading = false;
  696. });
  697. },
  698. //合计
  699. getSum(param) {
  700. const { columns, data } = param;
  701. const sums = [];
  702. var values = [];
  703. columns.forEach((column, index) => {
  704. if (index === 0) {
  705. sums[index] = "";
  706. return;
  707. }
  708. if (column.property === "fGrossweight") {
  709. values = data.map((item) => Number(item["fGrossweight"]));
  710. }
  711. if (column.property === "fNetweight") {
  712. values = data.map((item) => Number(item["fNetweight"]));
  713. }
  714. if (column.property === "fQty") {
  715. values = data.map((item) => Number(item["fQty"]));
  716. }
  717. if (column.property === "fPlanqty") {
  718. values = data.map((item) => Number(item.fPlanqty));
  719. }
  720. if (
  721. column.property === "fGrossweight" ||
  722. column.property === "fNetweight" ||
  723. column.property === "fQty" ||
  724. column.property === "fPlanqty"
  725. ) {
  726. sums[index] = values.reduce((prev, curr) => {
  727. const value = Number(curr);
  728. if (!isNaN(value)) {
  729. return prev + curr;
  730. } else {
  731. return prev;
  732. }
  733. }, 0);
  734. if (column.property === "fGrossweight") {
  735. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  736. }
  737. if (column.property === "fNetweight") {
  738. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  739. }
  740. if (column.property === "fQty") {
  741. sums[index] = sums[index].toFixed(2);
  742. }
  743. if (column.property === "fPlanqty") {
  744. if (sums[index]) {
  745. sums[index] = sums[index];
  746. }
  747. }
  748. }
  749. });
  750. return sums;
  751. },
  752. handleAdd() {
  753. this.timer = new Date().getTime();
  754. this.pageShow = false;
  755. this.pageShow2 = true;
  756. },
  757. // 多选框选中数据
  758. handleSelectionChange(selection) {
  759. this.ids = selection.map((item) => item.fId);
  760. this.single =
  761. selection.length !== 1 ||
  762. selection.map((item) => item.fBillstatus) == 6 ||
  763. selection.map((item) => item.fBillstatus) == 4;
  764. this.multiple = !selection.length;
  765. },
  766. /** 修改按钮操作 */
  767. handleUpdate(row) {
  768. const fId = row.fId || this.ids[0] || row;
  769. this.copyStatus = null;
  770. this.formId = fId;
  771. this.$nextTick(() => {
  772. this.$refs.addOrUpdateRef.init();
  773. });
  774. setTimeout(() => {
  775. this.pageShow = false;
  776. this.pageShow2 = true;
  777. }, 200);
  778. },
  779. copyUpdate() {
  780. this.formId = this.ids[0];
  781. this.copyStatus = 2;
  782. this.$nextTick(() => {
  783. this.$refs.addOrUpdateRef.init();
  784. });
  785. setTimeout(() => {
  786. this.pageShow = false;
  787. this.pageShow2 = true;
  788. }, 200);
  789. },
  790. handleDelete(row) {
  791. const ids = row.fId || this.ids;
  792. delstockTransfer_s(ids).then((data) => {
  793. switch (data.msg) {
  794. case "0": {
  795. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  796. break;
  797. }
  798. case "1": {
  799. this.delete(ids, "当前主表有数据从表无数据是否删除");
  800. break;
  801. }
  802. case "2": {
  803. this.delete(ids, "当前主表有数据从表有数据是否删除");
  804. break;
  805. }
  806. default: {
  807. return this.$message.error("未知错误,无状态");
  808. }
  809. }
  810. });
  811. },
  812. delete(ids, tips) {
  813. this.$confirm(tips, "警告", {
  814. confirmButtonText: "确定",
  815. cancelButtonText: "取消",
  816. type: "warning",
  817. }).then(() => {
  818. delStockTransfer(ids);
  819. this.msgSuccess("删除成功");
  820. this.getList();
  821. });
  822. },
  823. /** 导出按钮操作 */
  824. handleExport() {
  825. // require.ensure([], () => {
  826. // const { export_json_to_excel } = require("../../../excel/Export2Excel");
  827. // const tHeader = ["客户名称", "制单日期"];
  828. // // 上面设置Excel的表格第一行的标题
  829. // const filterVal = ["corpId", "createTime"];
  830. // // 上面的index、nickName、name是tableData里对象的属性
  831. // const list = this.ftmsorderbillsList; //把data里的tableData存到list
  832. // const data = this.formatJson(filterVal, list);
  833. // export_json_to_excel(
  834. // tHeader,
  835. // data,
  836. // "列表excel",
  837. // true,
  838. // );
  839. // });
  840. },
  841. formatJson(filterVal, jsonData) {
  842. return jsonData.map((v) => filterVal.map((j) => v[j]));
  843. },
  844. /** 搜索按钮操作 */
  845. handleQuery() {
  846. this.queryParams.pageNum = 1;
  847. this.getList();
  848. },
  849. /** 重置按钮操作 */
  850. resetQuery() {
  851. this.queryParams = {
  852. pageNum: 1,
  853. pageSize: 10,
  854. fBilltype: null,
  855. fCorpid: null,
  856. polId: null,
  857. podId: null,
  858. fValiddate: null,
  859. remarks: null,
  860. };
  861. this.handleQuery();
  862. },
  863. showAddOrUpdate(data) {
  864. if (data) {
  865. this.getList();
  866. this.pageShow = true;
  867. this.pageShow2 = false;
  868. }
  869. },
  870. },
  871. };
  872. </script>