index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291
  1. <template>
  2. <div class="app-container">
  3. <basic-container v-show="pageShow">
  4. <avue-crud
  5. ref="crud"
  6. :option="option"
  7. :search.sync="queryParams"
  8. :data="warehousebillsList"
  9. @resetColumn="resetColumn('crud','option','optionList',169)"
  10. @saveColumn="saveColumn('crud','option','optionList',169)">
  11. <template slot="menuLeft">
  12. <el-button
  13. type="primary"
  14. icon="el-icon-plus"
  15. size="mini"
  16. @click="handleAdd"
  17. v-hasPermi="['warehouseBusiness:stockTransfer:add']"
  18. >新增
  19. </el-button>
  20. <el-button
  21. type="success"
  22. icon="el-icon-edit"
  23. size="mini"
  24. :disabled="single"
  25. @click="handleUpdate"
  26. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  27. >修改
  28. </el-button>
  29. <el-button
  30. type="warning"
  31. icon="el-icon-download"
  32. size="mini"
  33. @click="handleExport"
  34. v-hasPermi="['warehouseBusiness:stockTransfer:export']"
  35. >导出
  36. </el-button>
  37. <el-button
  38. type="info"
  39. icon="el-icon-download"
  40. size="mini"
  41. :disabled="single"
  42. @click="copyUpdate"
  43. v-hasPermi="['agreement:agreementStorage:export']"
  44. >复制新增
  45. </el-button>
  46. </template>
  47. </avue-crud>
  48. </basic-container>
  49. <div v-show="pageShow" v-if="false">
  50. <el-form
  51. :model="queryParams"
  52. ref="queryForm"
  53. v-show="showSearch"
  54. label-width="70px"
  55. size="small"
  56. >
  57. <el-row>
  58. <el-col :span="6">
  59. <el-form-item label="客户" prop="fCorpid">
  60. <el-select
  61. v-model="queryParams.fCorpid"
  62. clearable
  63. filterable
  64. placeholder="请输入关键词"
  65. style="width: 200px"
  66. >
  67. <el-option
  68. v-for="(item, index) in fMblnoOptions"
  69. :key="index.fId"
  70. :label="item.fName"
  71. :value="item.fId"
  72. ></el-option>
  73. </el-select>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="6">
  77. <el-form-item label="提单号" prop="fMblno">
  78. <el-input
  79. v-model="queryParams.fMblno"
  80. placeholder="请输入提单号"
  81. clearable
  82. style="width: 200px"
  83. @keyup.enter.native="handleQuery"
  84. />
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="6">
  88. <el-form-item label="仓库" prop="fWarehouseid">
  89. <el-select
  90. v-model="queryParams.fWarehouseid"
  91. clearable
  92. filterable
  93. placeholder="请选择仓库"
  94. style="width: 200px"
  95. @keyup.enter.native="handleQuery"
  96. >
  97. <el-option
  98. v-for="(item, index) in warehouseOptions"
  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="timeInterval">
  108. <el-date-picker
  109. v-model="queryParams.timeInterval"
  110. type="daterange"
  111. value-format="yyyy-MM-dd"
  112. clearable
  113. style="width: 230px"
  114. range-separator="至"
  115. start-placeholder="开始日期"
  116. end-placeholder="结束日期"
  117. @keyup.enter.native="handleQuery"
  118. :picker-options="pickerOptions"
  119. unlink-panels
  120. >
  121. </el-date-picker>
  122. </el-form-item>
  123. </el-col>
  124. </el-row>
  125. <el-collapse-transition>
  126. <div v-show="show">
  127. <el-row>
  128. <el-col :span="6">
  129. <el-form-item label="货物名称" prop="fGoodsid">
  130. <el-select
  131. v-model="queryParams.fGoodsid"
  132. clearable
  133. filterable
  134. placeholder="请选择货物名称"
  135. style="width: 200px"
  136. @keyup.enter.native="handleQuery"
  137. >
  138. <el-option
  139. v-for="(item, index) in goodsOptions"
  140. :key="index.fId"
  141. :label="item.fName"
  142. :value="item.fId"
  143. ></el-option>
  144. </el-select>
  145. </el-form-item>
  146. </el-col>
  147. <el-col :span="6">
  148. <el-form-item label="品牌" prop="fMarks">
  149. <el-input
  150. v-model="queryParams.fMarks"
  151. placeholder="请输入品牌"
  152. clearable
  153. style="width: 200px"
  154. @keyup.enter.native="handleQuery"
  155. />
  156. </el-form-item>
  157. </el-col>
  158. <el-col :span="6">
  159. <el-form-item label="通关状态" prop="fItemsStatus">
  160. <el-select
  161. style="width: 200px"
  162. v-model="queryParams.fItemsStatus"
  163. placeholder="请选择通关状态"
  164. >
  165. <el-option label="计划" value="1" />
  166. <el-option label="待通关" value="2" />
  167. <el-option label="通关中" value="3" />
  168. <el-option label="已通关" value="4" />
  169. </el-select>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="6">
  173. <el-form-item label="费用状态" prop="fFeeStatus">
  174. <el-select
  175. style="width: 200px"
  176. v-model="queryParams.fFeeStatus"
  177. placeholder="请选择费用状态"
  178. >
  179. <el-option label="暂存" :value="1"></el-option>
  180. <el-option label="部分" :value="2"></el-option>
  181. <el-option label="全部入账" :value="3"></el-option>
  182. </el-select>
  183. </el-form-item>
  184. </el-col>
  185. </el-row>
  186. <el-row>
  187. <el-col :span="6">
  188. <el-form-item label="业务编号" prop="fBillno">
  189. <el-input
  190. v-model="queryParams.fBillno"
  191. placeholder="请输入业务编号"
  192. clearable
  193. @keyup.enter.native="handleQuery"
  194. style="width: 200px"
  195. />
  196. </el-form-item>
  197. </el-col>
  198. <el-col :span="6">
  199. <el-form-item label="制单人" prop="createBy">
  200. <el-select
  201. v-model="queryParams.createBy"
  202. filterable
  203. clearable
  204. placeholder="请输入关键词"
  205. style="width: 200px"
  206. >
  207. <el-option
  208. v-for="(item, index) in userOptions"
  209. :key="index.userName"
  210. :label="item.nickName"
  211. :value="item.userName"
  212. >
  213. </el-option>
  214. </el-select>
  215. </el-form-item>
  216. </el-col>
  217. <el-col :span="6">
  218. <el-form-item label="经营单位" prop="fSbu">
  219. <el-select
  220. v-model="queryParams.fSbu"
  221. clearable
  222. filterable
  223. placeholder="请输入关键词"
  224. style="width: 200px"
  225. >
  226. <el-option
  227. v-for="(item, index) in fMblnoOptions"
  228. :key="index.fId"
  229. :label="item.fName"
  230. :value="item.fId"
  231. ></el-option>
  232. </el-select>
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="6">
  236. <el-form-item label="贸易方式" prop="fTrademodeid">
  237. <el-select
  238. v-model="queryParams.fTrademodeid"
  239. placeholder="请选择贸易方式"
  240. clearable
  241. @keyup.enter.native="handleQuery"
  242. style="width: 200px"
  243. >
  244. <el-option
  245. v-for="(item, index) in fTrademodeidOptions"
  246. :key="index.dictValue"
  247. :label="item.dictLabel"
  248. :value="item.dictValue"
  249. />
  250. </el-select>
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. </div>
  255. </el-collapse-transition>
  256. </el-form>
  257. <el-row :gutter="10" class="mb8">
  258. <el-col :span="1.5">
  259. <el-button
  260. type="primary"
  261. icon="el-icon-plus"
  262. size="mini"
  263. @click="handleAdd"
  264. v-hasPermi="['warehouseBusiness:stockTransfer:add']"
  265. >新增
  266. </el-button>
  267. </el-col>
  268. <el-col :span="1.5">
  269. <el-button
  270. type="success"
  271. icon="el-icon-edit"
  272. size="mini"
  273. :disabled="single"
  274. @click="handleUpdate"
  275. v-hasPermi="['warehouseBusiness:stockTransfer:edit']"
  276. >修改
  277. </el-button>
  278. </el-col>
  279. <el-col :span="1.5">
  280. <el-button
  281. type="warning"
  282. icon="el-icon-download"
  283. size="mini"
  284. @click="handleExport"
  285. v-hasPermi="['warehouseBusiness:stockTransfer:export']"
  286. >导出
  287. </el-button>
  288. </el-col>
  289. <el-col :span="1.5">
  290. <el-button
  291. type="info"
  292. icon="el-icon-download"
  293. size="mini"
  294. :disabled="single"
  295. @click="copyUpdate"
  296. v-hasPermi="['agreement:agreementStorage:export']"
  297. >复制新增
  298. </el-button>
  299. </el-col>
  300. <div class="tabSetting">
  301. <div style="margin-right: 20px">
  302. <el-button
  303. type="cyan"
  304. icon="el-icon-search"
  305. size="mini"
  306. @click="handleQuery"
  307. >搜索</el-button
  308. >
  309. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  310. >重置</el-button
  311. >
  312. <el-button
  313. v-show="show"
  314. @click="show = !show"
  315. icon="el-icon-arrow-up"
  316. size="mini"
  317. >展开</el-button
  318. >
  319. <el-button
  320. v-show="!show"
  321. @click="show = !show"
  322. icon="el-icon-arrow-down"
  323. size="mini"
  324. >展开</el-button
  325. >
  326. </div>
  327. <right-toolbar
  328. :showSearch.sync="showSearch"
  329. @queryTable="getList"
  330. ></right-toolbar>
  331. <div style="margin: 0 12px">
  332. <el-button
  333. icon="el-icon-setting"
  334. size="mini"
  335. circle
  336. @click="showSetting = !showSetting"
  337. ></el-button>
  338. </div>
  339. </div>
  340. </el-row>
  341. <el-dialog
  342. title="自定义列显示"
  343. :visible.sync="showSetting"
  344. width="700px"
  345. v-dialogDrag
  346. :close-on-click-modal="false"
  347. >
  348. <template slot="title">
  349. <div class="avue-crud__dialog__header">
  350. <span class="el-dialog__title">
  351. <span
  352. style="
  353. display: inline-block;
  354. width: 3px;
  355. height: 20px;
  356. margin-right: 5px;
  357. float: left;
  358. margin-top: 2px;
  359. "
  360. ></span>
  361. </span>
  362. </div>
  363. </template>
  364. <div>配置排序列数据(拖动调整顺序)</div>
  365. <div style="margin-left: 17px">
  366. <el-checkbox
  367. v-model="allCheck"
  368. label="全选"
  369. @change="allChecked"
  370. ></el-checkbox>
  371. </div>
  372. <div style="padding: 4px; display: flex; justify-content: center">
  373. <draggable
  374. v-model="setRowList"
  375. group="site"
  376. animation="300"
  377. @start="onStart"
  378. @end="onEnd"
  379. handle=".indraggable"
  380. >
  381. <transition-group>
  382. <div
  383. v-for="item in setRowList"
  384. :key="item.surface"
  385. class="listStyle"
  386. >
  387. <div style="width: 500px" class="indraggable">
  388. <div class="progress" :style="{ width: item.width + 'px' }">
  389. <el-checkbox
  390. :label="item.name"
  391. v-model="item.checked"
  392. :true-label="0"
  393. :false-label="1"
  394. >{{ item.name }}
  395. </el-checkbox>
  396. </div>
  397. </div>
  398. <el-input-number
  399. v-model.number="item.width"
  400. controls-position="right"
  401. :min="1"
  402. :max="500"
  403. size="mini"
  404. ></el-input-number>
  405. </div>
  406. </transition-group>
  407. </draggable>
  408. </div>
  409. <span slot="footer" class="dialog-footer">
  410. <el-button @click="showSetting = false">取 消</el-button>
  411. <el-button @click="delRow" type="danger">重 置</el-button>
  412. <el-button type="primary" @click="save()">确 定</el-button>
  413. </span>
  414. </el-dialog>
  415. <el-table
  416. v-loading="loading"
  417. :data="warehousebillsList"
  418. @selection-change="handleSelectionChange"
  419. show-summary
  420. :summary-method="getSum"
  421. ref="table"
  422. :height="tableHeight">
  423. <el-table-column type="selection" width="60" fixed align="center" />
  424. <el-table-column
  425. type="index"
  426. label="行号"
  427. width="50"
  428. align="center"
  429. fixed/>
  430. <el-table-column
  431. v-for="(item, index) in getRowList"
  432. :key="index"
  433. :label="item.name"
  434. :width="item.width"
  435. :prop="item.label"
  436. align="center"
  437. :fixed="item.fixed"
  438. :show-overflow-tooltip="true"
  439. sortable>
  440. <template slot-scope="scope">
  441. <span v-if="item.label == 'fMblno'">
  442. <el-link :underline="false" type="primary">
  443. <div @click="handleUpdate(scope.row)">
  444. {{ scope.row.fMblno }}
  445. </div>
  446. </el-link>
  447. </span>
  448. <span v-else>{{ scope.row[item.label] }}</span>
  449. </template>
  450. </el-table-column>
  451. <el-table-column
  452. label="操作"
  453. align="center"
  454. class-name="small-padding fixed-width"
  455. min-width="200"
  456. fixed="right">
  457. <template slot-scope="scope">
  458. <el-button
  459. size="mini"
  460. type="text"
  461. icon="el-icon-edit"
  462. @click="handleUpdate(scope.row, true)"
  463. v-hasPermi="['warehouseBusiness:stockTransfer:edit']">
  464. 查看
  465. </el-button>
  466. <el-button
  467. size="mini"
  468. type="text"
  469. icon="el-icon-edit"
  470. v-if="
  471. scope.row.fBillstatus == '录入' ||
  472. scope.row.fBillstatus == '暂存' ||
  473. scope.row.fBillstatus == '驳回'"
  474. @click="handleUpdate(scope.row, false)"
  475. v-hasPermi="['warehouseBusiness:stockTransfer:edit']">
  476. 修改
  477. </el-button>
  478. <el-button
  479. size="mini"
  480. type="text"
  481. icon="el-icon-delete"
  482. v-if="(scope.row.fItemsStatus == '待通关' || scope.row.fItemsStatus == '计划') && scope.row.isCreate == 1 || (scope.row.fItemsStatus == '待通关' || scope.row.fItemsStatus == '计划') && scope.row.isCreate == 0"
  483. @click="handleDelete(scope.row)"
  484. v-hasPermi="['warehouseBusiness:stockTransfer:remove']">
  485. 删除
  486. </el-button>
  487. <el-button
  488. size="mini"
  489. type="text"
  490. icon="el-icon-delete"
  491. v-if=" scope.row.fBillstatus == '请核' || scope.row.fBillstatus == '审核中'"
  492. @click="handleUpdate(scope.row, true)">
  493. 审核进度
  494. </el-button>
  495. </template>
  496. </el-table-column>
  497. </el-table>
  498. <pagination
  499. v-show="total > 0"
  500. :total="total"
  501. :page.sync="queryParams.pageNum"
  502. :limit.sync="queryParams.pageSize"
  503. @pagination="getList"/>
  504. </div>
  505. <add-or-update
  506. v-show="pageShow2"
  507. @changeShow="showAddOrUpdate"
  508. ref="addOrUpdateRef"
  509. :chiId="formId"
  510. :copyStatus="copyStatus"
  511. :key="timer"
  512. ></add-or-update>
  513. </div>
  514. </template>
  515. <script>
  516. import AddOrUpdate from "./AddOrUpdate.vue";
  517. // import {
  518. // backFee,
  519. // RevocationApproval,
  520. // addWhgenleg,
  521. // getStockTransferList,
  522. // getStockTransfer,
  523. // delStockTransfer,
  524. // updateCredit,
  525. // addJoblist,
  526. // disChargelist,
  527. // addStockTransfer,
  528. // warehouseSubmission,
  529. // updateStockTransfer,
  530. // exportStockTransfer,
  531. // delstockTransfer_s,
  532. // serialNumber,
  533. // } from "@/api/warehouseBusiness/stockTransfer";
  534. // import { listCorps } from "@/api/basicdata/corps";
  535. // import { listWarehousesss } from "@/api/basicdata/warehouse";
  536. // import { listGoods } from "@/api/basicdata/goods";
  537. // import { listUser, queryUserVal } from "@/api/system/user";
  538. // import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  539. import Cookies from "js-cookie";
  540. // import { addSet, select, resetModule } from "@/api/system/set";
  541. import draggable from "vuedraggable";
  542. export default {
  543. name: "plans",
  544. data() {
  545. return {
  546. option:{},
  547. optionList:{
  548. border: true,
  549. align: 'center',
  550. stripe: true,
  551. index: true,
  552. menu: false,
  553. addBtn: false,
  554. editBtn: false,
  555. delBtn: false,
  556. height: "auto",
  557. searchSpan: 8,
  558. searchIcon: true,
  559. searchIndex: 2,
  560. highlightCurrentRow: true,
  561. column:[
  562. {
  563. index: "0",
  564. prop: "fMblno",
  565. label: "提单号",
  566. width: 200,
  567. search: true,
  568. },
  569. {
  570. index: "1",
  571. prop: "createBy",
  572. label: "制单人",
  573. width: 100,
  574. search: true,
  575. type:'select',
  576. },
  577. {
  578. index: "2",
  579. prop: "fStorekeeper",
  580. label: "仓管员",
  581. width: 100,
  582. },
  583. {
  584. index: "3",
  585. prop: "fItemsStatus",
  586. label: "通关状态",
  587. width: 100,
  588. search: true,
  589. type:'select',
  590. },
  591. {
  592. index: "4",
  593. prop: "fCorpid",
  594. label: "客户",
  595. width: 100,
  596. search: true,
  597. type:'select',
  598. },
  599. {
  600. index: "6",
  601. prop: "fProductName",
  602. label: "品名",
  603. width: 100,
  604. search: true,
  605. type:'select',
  606. },
  607. {
  608. index: "7",
  609. prop: "fMarks",
  610. label: "品牌",
  611. width: 100,
  612. search: true,
  613. type:'select',
  614. },
  615. {
  616. index: "8",
  617. prop: "fBsdate",
  618. searchProp:"timeInterval",
  619. label: "通关日期",
  620. width: 100,
  621. type:'datetime',
  622. searchRange:true,
  623. search:true,
  624. unlinkPanels:true,
  625. defaultTime: ['00:00:00', '23:59:59'],
  626. format:'yyyy-MM-dd HH:mm:ss',
  627. valueFormat:'yyyy-MM-dd HH:mm:ss',
  628. },
  629. {
  630. index: "9",
  631. prop: "fWarehouseid",
  632. label: "调入仓库",
  633. width: 100,
  634. search: true,
  635. type:'select',
  636. },
  637. {
  638. index: "10",
  639. prop: "fInwarehouseid",
  640. label: "调出仓库",
  641. width: 100,
  642. },
  643. {
  644. index: "11",
  645. prop: "fPlanqty",
  646. label: "计划通关件数",
  647. width: 180,
  648. },
  649. {
  650. index: "12",
  651. prop: "fQty",
  652. label: "通关件数",
  653. width: 100,
  654. },
  655. {
  656. index: "13",
  657. prop: "fGrossweight",
  658. label: "通关毛重(KG)",
  659. width: 180,
  660. },
  661. {
  662. index: "14",
  663. prop: "fNetweight",
  664. label: "通关净重(kg)",
  665. width: 180,
  666. },
  667. {
  668. index: "15",
  669. prop: "fBusinessType",
  670. label: "业务类别",
  671. width: 100,
  672. },
  673. {
  674. index: "16",
  675. prop: "fFeeStatus",
  676. label: "费用状态",
  677. width: 100,
  678. search: true,
  679. type:'select',
  680. },
  681. {
  682. index: "17",
  683. prop: "fBillno",
  684. label: "系统编号",
  685. width: 100,
  686. search: true,
  687. },
  688. {
  689. index: "18",
  690. prop: "fSbu",
  691. label: "经营单位",
  692. width: 100,
  693. search: true,
  694. type:'select',
  695. showColumn: false,
  696. hide:true
  697. },
  698. {
  699. index: "19",
  700. prop: "fTrademodeid",
  701. label: "贸易方式",
  702. width: 100,
  703. search: true,
  704. type:'select',
  705. showColumn: false,
  706. hide:true
  707. }
  708. ]
  709. },
  710. tableHeight:'600',
  711. timer: "",
  712. pageShow: true,
  713. pageShow2: false,
  714. queryParams: {
  715. pageNum: 1,
  716. pageSize: 10,
  717. type: 2,
  718. fBillno: null,
  719. createBy: null,
  720. fTrademodeid: null,
  721. fCorpid: null,
  722. fMblno: null,
  723. fSbu: null,
  724. fGoodsid: null,
  725. fWarehouseid: null,
  726. fMarks: null,
  727. fBillstatus: null,
  728. fItemsStatus: null,
  729. timeInterval: null,
  730. fFeeStatus: null,
  731. },
  732. // 显示搜索条件
  733. showSearch: true,
  734. userOptions: [],
  735. fTrademodeidOptions: [],
  736. warehouseOptions: [],
  737. goodsOptions: [],
  738. fMblnoOptions: [],
  739. show: false,
  740. drag: false,
  741. tableDate: [
  742. {
  743. surface: "0",
  744. label: "fMblno",
  745. name: "提单号",
  746. checked: 0,
  747. width: 200,
  748. fixed: "left",
  749. },
  750. {
  751. surface: "1",
  752. label: "createBy",
  753. name: "制单人",
  754. checked: 0,
  755. width: 100,
  756. },
  757. {
  758. surface: "2",
  759. label: "fStorekeeper",
  760. name: "仓管员",
  761. checked: 0,
  762. width: 100,
  763. },
  764. {
  765. surface: "3",
  766. label: "fItemsStatus",
  767. name: "通关状态",
  768. checked: 0,
  769. width: 100,
  770. },
  771. {
  772. surface: "4",
  773. label: "fCorpid",
  774. name: "客户",
  775. checked: 0,
  776. width: 100,
  777. },
  778. {
  779. surface: "6",
  780. label: "fProductName",
  781. name: "品名",
  782. checked: 0,
  783. width: 100,
  784. },
  785. {
  786. surface: "7",
  787. label: "fMarks",
  788. name: "品牌",
  789. checked: 0,
  790. width: 100,
  791. },
  792. {
  793. surface: "8",
  794. label: "fBsdate",
  795. name: "通关日期",
  796. checked: 0,
  797. width: 100,
  798. },
  799. {
  800. surface: "9",
  801. label: "fWarehouseid",
  802. name: "调入仓库",
  803. checked: 0,
  804. width: 100,
  805. },
  806. {
  807. surface: "10",
  808. label: "fInwarehouseid",
  809. name: "调出仓库",
  810. checked: 0,
  811. width: 100,
  812. },
  813. {
  814. surface: "11",
  815. label: "fPlanqty",
  816. name: "计划通关件数",
  817. checked: 0,
  818. width: 180,
  819. },
  820. {
  821. surface: "12",
  822. label: "fQty",
  823. name: "通关件数",
  824. checked: 0,
  825. width: 100,
  826. },
  827. {
  828. surface: "13",
  829. label: "fGrossweight",
  830. name: "通关毛重(KG)",
  831. checked: 0,
  832. width: 180,
  833. },
  834. {
  835. surface: "14",
  836. label: "fNetweight",
  837. name: "通关净重(kg)",
  838. checked: 0,
  839. width: 180,
  840. },
  841. {
  842. surface: "15",
  843. label: "fBusinessType",
  844. name: "业务类别",
  845. checked: 0,
  846. width: 100,
  847. },
  848. {
  849. surface: "16",
  850. label: "fFeeStatus",
  851. name: "费用状态",
  852. checked: 0,
  853. width: 100,
  854. },
  855. {
  856. surface: "17",
  857. label: "fBillno",
  858. name: "系统编号",
  859. checked: 0,
  860. width: 100,
  861. },
  862. ],
  863. setRowList: [],
  864. getRowList: [],
  865. allCheck: false,
  866. showSetting: false,
  867. total: 0,
  868. warehousebillsList: [],
  869. loading: true,
  870. single: true,
  871. multiple: true,
  872. formId: null,
  873. ids: [],
  874. copyStatus: null,
  875. pickerOptions: {
  876. shortcuts: [{
  877. text: '最近一周',
  878. onClick(picker) {
  879. const end = new Date();
  880. const start = new Date();
  881. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  882. picker.$emit('pick', [start, end]);
  883. }
  884. }, {
  885. text: '最近一个月',
  886. onClick(picker) {
  887. const end = new Date();
  888. const start = new Date();
  889. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  890. picker.$emit('pick', [start, end]);
  891. }
  892. }, {
  893. text: '最近三个月',
  894. onClick(picker) {
  895. const end = new Date();
  896. const start = new Date();
  897. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  898. picker.$emit('pick', [start, end]);
  899. }
  900. }]
  901. },
  902. };
  903. },
  904. // 使用子组件
  905. components: { draggable, AddOrUpdate },
  906. async created() {
  907. this.option = await this.getColumnData(this.getColumnName(169), this.optionList);
  908. let date = new Date();
  909. let lYear = parseInt(date.getFullYear())
  910. let lMonth = parseInt(date.getMonth())
  911. if (lMonth == 0) {
  912. lMonth = 12
  913. lYear = lYear - 1
  914. }
  915. let nYear = parseInt(date.getFullYear())
  916. let nMonth = parseInt(date.getMonth() + 2)
  917. if (nMonth > 12) {
  918. nMonth = nMonth - 12
  919. nYear = nYear + 1
  920. }
  921. let day30 = [4, 6, 9, 11]
  922. let day31 = [1, 3, 5, 7, 8, 10, 12]
  923. let nDay = null
  924. if (day31.indexOf(nMonth) > -1) {
  925. nDay = 31
  926. } else if (day30.indexOf(nMonth) > -1) {
  927. nDay = 30
  928. } else if ((nYear % 4 == 0) && (nYear % 100 != 0 || nYear % 400 == 0)) {
  929. nDay = 29
  930. } else {
  931. nDay = 28
  932. }
  933. this.queryParams.timeInterval = [lYear + '-' + lMonth + '-' + '01 00:00:00', nYear + '-' + nMonth + '-' + nDay + ' 23:59:59']
  934. this.setRowList = this.tableDate;
  935. this.getRowList = this.tableDate;
  936. this.getDicts("data_trademodes").then((response) => {
  937. this.fTrademodeidOptions = response.data;
  938. });
  939. listGoods({ fStatus: 0, delFlag: 0 }).then((response) => {
  940. this.goodsOptions = response.rows;
  941. });
  942. listWarehousesss({ fStatus: 0, delFlag: 0 }).then((response) => {
  943. this.warehouseOptions = response.rows;
  944. });
  945. listUser().then((response) => {
  946. this.userOptions = response.rows;
  947. });
  948. listCorps({ type: 1 }).then((response) => {
  949. this.fMblnoOptions = response.rows;
  950. });
  951. this.getRow();
  952. this.getList();
  953. },
  954. activated() {
  955. if (this.$route.query.id) {
  956. this.handleUpdate(this.$route.query.id);
  957. }
  958. },
  959. mounted() {
  960. this.$nextTick(() => {
  961. // 监听浏览器高度变化,改变表格高度
  962. window.onresize = () => {
  963. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  964. }
  965. })
  966. },
  967. methods: {
  968. //自定义列保存
  969. async saveColumn(ref,option,optionBack,code) {
  970. /**
  971. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  972. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  973. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  974. */
  975. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  976. if (inSave) {
  977. this.$message.success("保存成功");
  978. //关闭窗口
  979. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  980. }
  981. },
  982. //自定义列重置
  983. async resetColumn(ref,option,optionBack,code) {
  984. this[option] = this[optionBack];
  985. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  986. if (inSave) {
  987. this.$message.success("重置成功");
  988. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  989. }
  990. },
  991. // 获取当前月的第一天和最后一天
  992. // getMonth() {
  993. // let date = new Date();
  994. // let year = parseInt(date.getFullYear())
  995. // let month = parseInt(date.getMonth() + 1)
  996. // let currentMonth = date.getMonth()
  997. // let nextMonth = ++currentMonth
  998. // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  999. // let oneDay = 1000*60*60*24
  1000. // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  1001. // let day = lastTime.getDate()
  1002. // if (day < 10) {
  1003. // day = '0' + day
  1004. // }
  1005. // this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
  1006. // },
  1007. //列设置全选
  1008. allChecked() {
  1009. if (this.allCheck == true) {
  1010. this.setRowList.map((e) => {
  1011. return (e.checked = 0);
  1012. });
  1013. } else {
  1014. this.setRowList.map((e) => {
  1015. return (e.checked = 1);
  1016. });
  1017. }
  1018. },
  1019. //查询列数据
  1020. getRow() {
  1021. let that = this;
  1022. this.data = {
  1023. tableName: "通关",
  1024. userId: Cookies.get("userName"),
  1025. };
  1026. select(this.data).then((res) => {
  1027. if (res.data.length != 0) {
  1028. this.getRowList = res.data.filter((e) => e.checked == 0);
  1029. this.setRowList = res.data;
  1030. this.setRowList = this.setRowList.reduce((res, item) => {
  1031. res.push({
  1032. surface: item.surface,
  1033. label: item.label,
  1034. name: item.name,
  1035. checked: item.checked,
  1036. width: item.width,
  1037. fixed: item.fixed,
  1038. });
  1039. return res;
  1040. }, []);
  1041. }
  1042. });
  1043. },
  1044. //重置列表
  1045. delRow() {
  1046. this.data = {
  1047. tableName: "通关",
  1048. userId: Cookies.get("userName"),
  1049. };
  1050. resetModule(this.data).then((res) => {
  1051. if (res.code == 200) {
  1052. this.showSetting = false;
  1053. this.setRowList = this.$options.data().tableDate;
  1054. this.getRowList = this.$options.data().tableDate;
  1055. }
  1056. });
  1057. },
  1058. //保存列设置
  1059. save() {
  1060. this.showSetting = false;
  1061. this.data = {
  1062. tableName: "通关",
  1063. userId: Cookies.get("userName"),
  1064. sysTableSetList: this.setRowList,
  1065. };
  1066. addSet(this.data).then((res) => {
  1067. if (res.code == 200) {
  1068. this.showSetting = false;
  1069. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1070. console.log(this.tableDate);
  1071. }
  1072. });
  1073. },
  1074. //开始拖拽事件
  1075. onStart() {
  1076. this.drag = true;
  1077. },
  1078. //拖拽结束事件
  1079. onEnd() {
  1080. this.drag = false;
  1081. },
  1082. getList() {
  1083. //获取仓库
  1084. getStockTransferList(this.queryParams).then((response) => {
  1085. this.warehousebillsList = response.rows;
  1086. this.total = response.total;
  1087. this.loading = false;
  1088. // 根据浏览器高度设置初始高度
  1089. setTimeout(() => {
  1090. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  1091. }, 300)
  1092. });
  1093. },
  1094. //合计
  1095. getSum(param) {
  1096. const { columns, data } = param;
  1097. const sums = [];
  1098. var values = [];
  1099. columns.forEach((column, index) => {
  1100. if (index === 0) {
  1101. sums[index] = "合计";
  1102. return;
  1103. }
  1104. if (column.property === "fGrossweight") {
  1105. values = data.map((item) => Number(item["fGrossweight"]));
  1106. }
  1107. if (column.property === "fNetweight") {
  1108. values = data.map((item) => Number(item["fNetweight"]));
  1109. }
  1110. if (column.property === "fQty") {
  1111. values = data.map((item) => Number(item["fQty"]));
  1112. }
  1113. if (column.property === "fPlanqty") {
  1114. values = data.map((item) => Number(item.fPlanqty));
  1115. }
  1116. if (
  1117. column.property === "fGrossweight" ||
  1118. column.property === "fNetweight" ||
  1119. column.property === "fQty" ||
  1120. column.property === "fPlanqty"
  1121. ) {
  1122. sums[index] = values.reduce((prev, curr) => {
  1123. const value = Number(curr);
  1124. if (!isNaN(value)) {
  1125. return prev + curr;
  1126. } else {
  1127. return prev;
  1128. }
  1129. }, 0);
  1130. if (column.property === "fGrossweight") {
  1131. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  1132. }
  1133. if (column.property === "fNetweight") {
  1134. sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
  1135. }
  1136. if (column.property === "fQty") {
  1137. sums[index] = sums[index].toFixed(2);
  1138. }
  1139. if (column.property === "fPlanqty") {
  1140. if (sums[index]) {
  1141. sums[index] = sums[index];
  1142. }
  1143. }
  1144. }
  1145. });
  1146. return sums;
  1147. },
  1148. handleAdd() {
  1149. this.timer = new Date().getTime();
  1150. this.pageShow = false;
  1151. this.pageShow2 = true;
  1152. },
  1153. // 多选框选中数据
  1154. handleSelectionChange(selection) {
  1155. this.ids = selection.map((item) => item.fId);
  1156. this.single =
  1157. selection.length !== 1 ||
  1158. selection.map((item) => item.fBillstatus) == 6 ||
  1159. selection.map((item) => item.fBillstatus) == 4;
  1160. this.multiple = !selection.length;
  1161. },
  1162. /** 修改按钮操作 */
  1163. handleUpdate(row) {
  1164. const fId = row.fId || this.ids[0] || row;
  1165. this.copyStatus = null;
  1166. this.formId = fId;
  1167. this.$nextTick(() => {
  1168. this.$refs.addOrUpdateRef.init();
  1169. });
  1170. setTimeout(() => {
  1171. this.pageShow = false;
  1172. this.pageShow2 = true;
  1173. }, 200);
  1174. },
  1175. copyUpdate() {
  1176. this.formId = this.ids[0];
  1177. this.copyStatus = 2;
  1178. this.$nextTick(() => {
  1179. this.$refs.addOrUpdateRef.init();
  1180. });
  1181. setTimeout(() => {
  1182. this.pageShow = false;
  1183. this.pageShow2 = true;
  1184. }, 200);
  1185. },
  1186. handleDelete(row) {
  1187. const ids = row.fId || this.ids;
  1188. delstockTransfer_s(ids).then((data) => {
  1189. switch (data.msg) {
  1190. case "0": {
  1191. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  1192. break;
  1193. }
  1194. case "1": {
  1195. this.delete(ids, "当前主表有数据从表无数据是否删除");
  1196. break;
  1197. }
  1198. case "2": {
  1199. this.delete(ids, "当前主表有数据从表有数据是否删除");
  1200. break;
  1201. }
  1202. default: {
  1203. return this.$message.error("未知错误,无状态");
  1204. }
  1205. }
  1206. });
  1207. },
  1208. delete(ids, tips) {
  1209. this.$confirm(tips, "警告", {
  1210. confirmButtonText: "确定",
  1211. cancelButtonText: "取消",
  1212. type: "warning",
  1213. }).then(() => {
  1214. delStockTransfer(ids).then(res => {
  1215. this.msgSuccess("删除成功");
  1216. this.getList();
  1217. });
  1218. });
  1219. },
  1220. /** 导出按钮操作 */
  1221. handleExport() {
  1222. this.$confirm('是否确认导出所有货物通关数据项?', '警告', {
  1223. confirmButtonText: "确定",
  1224. cancelButtonText: "取消",
  1225. type: "warning",
  1226. }).then(() => {
  1227. exportStockTransfer(this.queryParams).then(res => {
  1228. this.download(res.msg);
  1229. })
  1230. })
  1231. //this.$message.warning('功能开发中')
  1232. // require.ensure([], () => {
  1233. // const { export_json_to_excel } = require("../../../excel/Export2Excel");
  1234. // const tHeader = ["客户名称", "制单日期"];
  1235. // // 上面设置Excel的表格第一行的标题
  1236. // const filterVal = ["corpId", "createTime"];
  1237. // // 上面的index、nickName、name是tableData里对象的属性
  1238. // const list = this.ftmsorderbillsList; //把data里的tableData存到list
  1239. // const data = this.formatJson(filterVal, list);
  1240. // export_json_to_excel(
  1241. // tHeader,
  1242. // data,
  1243. // "列表excel",
  1244. // true,
  1245. // );
  1246. // });
  1247. },
  1248. formatJson(filterVal, jsonData) {
  1249. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1250. },
  1251. /** 搜索按钮操作 */
  1252. handleQuery() {
  1253. this.queryParams.pageNum = 1;
  1254. this.getList();
  1255. },
  1256. /** 重置按钮操作 */
  1257. resetQuery() {
  1258. this.queryParams = {
  1259. pageNum: 1,
  1260. pageSize: 10,
  1261. type: 2,
  1262. fBillno: null,
  1263. createBy: null,
  1264. fTrademodeid: null,
  1265. fCorpid: null,
  1266. fMblno: null,
  1267. fSbu: null,
  1268. fGoodsid: null,
  1269. fWarehouseid: null,
  1270. fMarks: null,
  1271. fBillstatus: null,
  1272. fItemsStatus: null,
  1273. timeInterval: null,
  1274. fFeeStatus: null,
  1275. };
  1276. this.handleQuery();
  1277. },
  1278. showAddOrUpdate(data) {
  1279. if (data) {
  1280. //正式后要调用查询接口
  1281. // this.getList();
  1282. this.pageShow = true;
  1283. this.pageShow2 = false;
  1284. }
  1285. },
  1286. },
  1287. };
  1288. </script>