index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="录单单位名称">
  5. <el-input v-model="queryParams.lddwmc"></el-input>
  6. </el-form-item>
  7. <el-form-item>
  8. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  9. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  10. </el-form-item>
  11. </el-form>
  12. <el-row :gutter="10" class="mb8">
  13. <el-col :span="1.5">
  14. <el-button
  15. type="primary"
  16. plain
  17. icon="el-icon-plus"
  18. size="mini"
  19. @click="handleAdd"
  20. v-hasPermi="['business:BONDEDUPPLY:add']"
  21. >新增</el-button
  22. >
  23. </el-col>
  24. <el-col :span="1.5">
  25. <el-button
  26. type="success"
  27. plain
  28. icon="el-icon-edit"
  29. size="mini"
  30. :disabled="single"
  31. @click="handleUpdate"
  32. v-hasPermi="['business:BONDEDUPPLY:edit']"
  33. >修改</el-button
  34. >
  35. </el-col>
  36. <el-col :span="1.5">
  37. <el-button
  38. type="danger"
  39. plain
  40. icon="el-icon-delete"
  41. size="mini"
  42. :disabled="multiple"
  43. @click="handleDelete"
  44. v-hasPermi="['business:BONDEDUPPLY:remove']"
  45. >删除</el-button
  46. >
  47. </el-col>
  48. <!-- <el-col :span="1.5">
  49. <el-button
  50. type="warning"
  51. plain
  52. icon="el-icon-download"
  53. size="mini"
  54. @click="handleExport"
  55. v-hasPermi="['business:BONDEDUPPLY:export']"
  56. >导出</el-button
  57. >
  58. </el-col> -->
  59. <right-toolbar
  60. :showSearch.sync="showSearch"
  61. @queryTable="getList"
  62. ></right-toolbar>
  63. </el-row>
  64. <el-table :data="BONDEDUPPLYList" @selection-change="handleSelectionChange">
  65. <el-table-column type="selection" width="55" align="center" />
  66. <el-table-column label="录单单位名称 " align="center" prop="lddwmc">
  67. </el-table-column>
  68. <el-table-column label="进出口标志 " align="center" prop="jckbz">
  69. </el-table-column>
  70. <el-table-column label="进出口日期 " align="center" prop="jckrq">
  71. </el-table-column>
  72. <el-table-column label="净重 " align="center" prop="jz">
  73. </el-table-column>
  74. <el-table-column label="净值 " align="center" prop="jingzhi">
  75. </el-table-column>
  76. <el-table-column label="件数 " align="center" prop="js">
  77. </el-table-column>
  78. <el-table-column label="境内收发货人编号 " align="center" prop="jnsfhrbh">
  79. </el-table-column>
  80. <el-table-column label="境内收发货人名称 " align="center" prop="jnsfhrmc">
  81. </el-table-column>
  82. <el-table-column label="境外发货人代码 " align="center" prop="jwfhrdm">
  83. </el-table-column>
  84. <el-table-column label="境外收发货人名称 " align="center" prop="jwsfhrmc">
  85. </el-table-column>
  86. <el-table-column label="境外收发货人地址 " align="center" prop="jwsfhrdz">
  87. </el-table-column>
  88. <el-table-column label="启运日期 " align="center" prop="qyrq">
  89. </el-table-column>
  90. <el-table-column label="卸毕日期 " align="center" prop="xbrq">
  91. </el-table-column>
  92. <el-table-column label="供应链主键" align="center" prop="id">
  93. </el-table-column>
  94. <el-table-column label="保税区主键" align="center" prop="deptId">
  95. </el-table-column>
  96. <el-table-column label="报关单币种统计 " align="center" prop="bgdbztj">
  97. </el-table-column>
  98. <el-table-column label="申报单位名称 " align="center" prop="sbdwmc">
  99. </el-table-column>
  100. <el-table-column label="录单单位编码名称 " align="center" prop="lddwbmmc">
  101. </el-table-column>
  102. <el-table-column label="创建时间" align="center" prop="createTime">
  103. </el-table-column>
  104. <el-table-column
  105. fixed="right"
  106. label="操作"
  107. align="center"
  108. class-name="small-padding fixed-width"
  109. width="120px"
  110. >
  111. <template slot-scope="scope">
  112. <el-button
  113. size="mini"
  114. type="text"
  115. icon="el-icon-edit"
  116. @click="handleUpdate(scope.row)"
  117. v-hasPermi="['business:BONDEDUPPLY:edit']"
  118. >修改</el-button
  119. >
  120. <el-button
  121. size="mini"
  122. type="text"
  123. icon="el-icon-delete"
  124. @click="handleDelete(scope.row)"
  125. v-hasPermi="['business:BONDEDUPPLY:remove']"
  126. >删除</el-button
  127. >
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <pagination
  132. v-show="total > 0"
  133. :total="total"
  134. :page.sync="queryParams.pageNum"
  135. :limit.sync="queryParams.pageSize"
  136. @pagination="getList"
  137. />
  138. <!-- 添加或修改保税区供应链数据对话框 -->
  139. <el-dialog
  140. :title="title"
  141. :visible.sync="open"
  142. :close-on-click-modal="false"
  143. width="35%"
  144. append-to-body
  145. >
  146. <el-tabs v-model="activeName">
  147. <el-tab-pane label="基本信息" name="first">
  148. <el-form ref="forms" :model="form" :rules="rules" label-width="140px">
  149. <el-form-item label="录单单位名称" prop="lddwmc">
  150. <el-input v-model="form.lddwmc"></el-input>
  151. </el-form-item>
  152. <el-form-item label="进出口标志" prop="jckbz">
  153. <el-input v-model="form.jckbz"></el-input>
  154. </el-form-item>
  155. <el-form-item label="进出口日期" prop="jckrq">
  156. <el-date-picker
  157. v-model="form.jckrq"
  158. type="date"
  159. value-format="yyyy-MM-dd"
  160. placeholder="选择日期"
  161. >
  162. </el-date-picker>
  163. </el-form-item>
  164. <el-form-item label="净重" prop="jz">
  165. <el-input v-model="form.jz"></el-input>
  166. </el-form-item>
  167. <el-form-item label="净值" prop="jingzhi">
  168. <el-input v-model="form.jingzhi"></el-input>
  169. </el-form-item>
  170. <el-form-item label="件数" prop="js">
  171. <el-input v-model="form.js"></el-input>
  172. </el-form-item>
  173. <el-form-item label="启运日期 " prop="qyrq">
  174. <el-date-picker
  175. v-model="form.qyrq"
  176. type="date"
  177. value-format="yyyy-MM-dd"
  178. placeholder="选择日期"
  179. >
  180. </el-date-picker>
  181. </el-form-item>
  182. <el-form-item label="卸毕日期 " prop="xbrq">
  183. <!-- <el-input v-model="form.xbrq"></el-input> -->
  184. <el-date-picker
  185. v-model="form.xbrq"
  186. type="date"
  187. value-format="yyyy-MM-dd"
  188. placeholder="选择日期"
  189. >
  190. </el-date-picker>
  191. </el-form-item>
  192. <el-form-item label="报关单币种统计 " prop="bgdbztj">
  193. <el-input v-model="form.bgdbztj"></el-input>
  194. </el-form-item>
  195. <el-form-item label="申报单位名称 " prop="sbdwmc">
  196. <el-input v-model="form.sbdwmc"></el-input>
  197. </el-form-item>
  198. <el-form-item label="录单单位编码名称 " prop="lddwbmmc">
  199. <el-input v-model="form.lddwbmmc"></el-input>
  200. </el-form-item>
  201. </el-form>
  202. </el-tab-pane>
  203. <el-tab-pane label="境内外信息" name="second">
  204. <el-form ref="form" :model="form" :rules="rules" label-width="140px">
  205. <el-form-item label="境内收发货人标号" prop="jnsfhrbh">
  206. <el-input v-model="form.jnsfhrbh"></el-input>
  207. </el-form-item>
  208. <el-form-item label="境内收发货人名称 " prop="jnsfhrmc">
  209. <el-input v-model="form.jnsfhrmc"></el-input>
  210. </el-form-item>
  211. <el-form-item label="境外发货人代码 " prop="jwfhrdm">
  212. <el-input v-model="form.jwfhrdm"></el-input>
  213. </el-form-item>
  214. <el-form-item label="境外收发货人名称 " prop="jwsfhrmc">
  215. <el-input v-model="form.jwsfhrmc"></el-input>
  216. </el-form-item>
  217. <el-form-item label="境外收发货人地址 " prop="jwsfhrdz">
  218. <el-input v-model="form.jwsfhrdz"></el-input>
  219. </el-form-item>
  220. </el-form>
  221. </el-tab-pane>
  222. </el-tabs>
  223. <div slot="footer" class="dialog-footer">
  224. <el-button type="primary" @click="submitForm">确 定</el-button>
  225. <el-button @click="cancel">取 消</el-button>
  226. </div>
  227. </el-dialog>
  228. </div>
  229. </template>
  230. <script>
  231. import {
  232. listBONDEDUPPLY,
  233. getBONDEDUPPLY,
  234. delBONDEDUPPLY,
  235. addBONDEDUPPLY,
  236. updateBONDEDUPPLY,
  237. } from "@/api/portal/BONDEDUPPLY/BONDEDUPPLY";
  238. export default {
  239. name: "BONDEDUPPLY",
  240. data() {
  241. return {
  242. activeName: "first",
  243. // 根路径
  244. baseURL: process.env.VUE_APP_BASE_API,
  245. // 遮罩层
  246. loading: true,
  247. // 选中数组
  248. ids: [],
  249. // 非单个禁用
  250. single: true,
  251. // 非多个禁用
  252. multiple: true,
  253. // 显示搜索条件
  254. showSearch: true,
  255. // 总条数
  256. total: 0,
  257. // 保税区供应链数据表格数据
  258. BONDEDUPPLYList: [],
  259. // 弹出层标题
  260. title: "",
  261. // 是否显示弹出层
  262. open: false,
  263. // 查询参数
  264. queryParams: {
  265. pageNum: 1,
  266. pageSize: 10,
  267. lddwmc: null,
  268. jckbz: null,
  269. jckrq: null,
  270. jz: null,
  271. jingzhi: null,
  272. js: null,
  273. jnsfhrbh: null,
  274. jnsfhrmc: null,
  275. jwfhrdm: null,
  276. jwsfhrmc: null,
  277. jwsfhrdz: null,
  278. qyrq: null,
  279. xbrq: null,
  280. id: null,
  281. deptId: null,
  282. bgdbztj: null,
  283. sbdwmc: null,
  284. lddwbmmc: null,
  285. createTime: null,
  286. },
  287. // 表单参数
  288. form: {},
  289. // 表单校验
  290. rules: {
  291. lddwmc: [
  292. { required: true, message: "录单单位名称 不能为空", trigger: "blur" },
  293. ],
  294. jckbz: [
  295. { required: true, message: "进出口标志 不能为空", trigger: "blur" },
  296. ],
  297. jckrq: [
  298. { required: true, message: "进出口日期 不能为空", trigger: "blur" },
  299. ],
  300. jz: [{ required: true, message: "净重 不能为空", trigger: "blur" }],
  301. jingzhi: [
  302. { required: true, message: "净值 不能为空", trigger: "blur" },
  303. ],
  304. js: [{ required: true, message: "件数 不能为空", trigger: "blur" }],
  305. jnsfhrbh: [
  306. {
  307. required: true,
  308. message: "境内收发货人编号 不能为空",
  309. trigger: "blur",
  310. },
  311. ],
  312. jnsfhrmc: [
  313. {
  314. required: true,
  315. message: "境内收发货人名称 不能为空",
  316. trigger: "blur",
  317. },
  318. ],
  319. jwfhrdm: [
  320. {
  321. required: true,
  322. message: "境外发货人代码 不能为空",
  323. trigger: "blur",
  324. },
  325. ],
  326. jwsfhrmc: [
  327. {
  328. required: true,
  329. message: "境外收发货人名称 不能为空",
  330. trigger: "blur",
  331. },
  332. ],
  333. jwsfhrdz: [
  334. {
  335. required: true,
  336. message: "境外收发货人地址 不能为空",
  337. trigger: "blur",
  338. },
  339. ],
  340. qyrq: [
  341. { required: true, message: "启运日期 不能为空", trigger: "blur" },
  342. ],
  343. xbrq: [
  344. { required: true, message: "卸毕日期 不能为空", trigger: "blur" },
  345. ],
  346. id: [
  347. { required: true, message: "供应链主键不能为空", trigger: "blur" },
  348. ],
  349. deptId: [
  350. { required: true, message: "保税区主键不能为空", trigger: "blur" },
  351. ],
  352. bgdbztj: [
  353. {
  354. required: true,
  355. message: "报关单币种统计 不能为空",
  356. trigger: "blur",
  357. },
  358. ],
  359. sbdwmc: [
  360. { required: true, message: "申报单位名称 不能为空", trigger: "blur" },
  361. ],
  362. lddwbmmc: [
  363. {
  364. required: true,
  365. message: "录单单位编码名称 不能为空",
  366. trigger: "blur",
  367. },
  368. ],
  369. },
  370. };
  371. },
  372. created() {
  373. this.getList();
  374. },
  375. methods: {
  376. /** 查询保税区供应链数据列表 */
  377. getList() {
  378. this.loading = true;
  379. listBONDEDUPPLY(this.queryParams).then((response) => {
  380. this.BONDEDUPPLYList = response.rows;
  381. this.total = response.total;
  382. this.loading = false;
  383. });
  384. },
  385. // 取消按钮
  386. cancel() {
  387. this.open = false;
  388. this.reset();
  389. },
  390. // 表单重置
  391. reset() {
  392. this.form = {
  393. lddwmc: null,
  394. jckbz: null,
  395. jckrq: null,
  396. jz: null,
  397. jingzhi: null,
  398. js: null,
  399. jnsfhrbh: null,
  400. jnsfhrmc: null,
  401. jwfhrdm: null,
  402. jwsfhrmc: null,
  403. jwsfhrdz: null,
  404. qyrq: null,
  405. xbrq: null,
  406. id: null,
  407. deptId: null,
  408. bgdbztj: null,
  409. sbdwmc: null,
  410. lddwbmmc: null,
  411. };
  412. this.resetForm("form");
  413. },
  414. /** 搜索按钮操作 */
  415. handleQuery() {
  416. this.queryParams.pageNum = 1;
  417. this.getList();
  418. },
  419. /** 重置按钮操作 */
  420. resetQuery() {
  421. this.resetForm("queryForm");
  422. this.handleQuery();
  423. },
  424. // 多选框选中数据
  425. handleSelectionChange(selection) {
  426. this.ids = selection.map((item) => item.id);
  427. console.log(this.ids);
  428. this.single = selection.length !== 1;
  429. this.multiple = !selection.length;
  430. },
  431. /** 新增按钮操作 */
  432. handleAdd() {
  433. this.reset();
  434. this.open = true;
  435. this.title = "添加保税区供应链数据";
  436. },
  437. /** 修改按钮操作 */
  438. handleUpdate(row) {
  439. console.log(row.lddwmc);
  440. this.reset();
  441. let lddwmc = row.id || this.ids;
  442. getBONDEDUPPLY(lddwmc).then((response) => {
  443. this.form = response.data;
  444. this.open = true;
  445. this.title = "修改保税区供应链数据";
  446. console.log(this.form, "form");
  447. });
  448. },
  449. /** 提交按钮 */
  450. submitForm() {
  451. let is;
  452. this.$refs["forms"].validate((valid) => {
  453. if (!valid) {
  454. this.$message.error("请补全基本信息");
  455. is = true;
  456. return;
  457. }
  458. });
  459. if (is) return;
  460. this.$refs["form"].validate((valid) => {
  461. if (valid) {
  462. if (this.form.id == null) {
  463. addBONDEDUPPLY(this.form).then((response) => {
  464. this.$modal.msgSuccess("新增成功");
  465. this.open = false;
  466. this.getList();
  467. this.reset();
  468. });
  469. } else {
  470. updateBONDEDUPPLY(this.form).then((response) => {
  471. this.$modal.msgSuccess("修改成功");
  472. this.open = false;
  473. this.getList();
  474. this.reset();
  475. });
  476. }
  477. }else{
  478. this.$message.error("请补全境内外信息");
  479. }
  480. });
  481. },
  482. /** 删除按钮操作 */
  483. handleDelete(row) {
  484. const lddwmcs = row.id || this.ids;
  485. console.log(lddwmcs);
  486. this.$modal
  487. .confirm(
  488. '是否确认删除保税区供应链数据编号为"' + lddwmcs + '"的数据项?'
  489. )
  490. .then(function () {
  491. return delBONDEDUPPLY(lddwmcs);
  492. })
  493. .then(() => {
  494. this.getList();
  495. this.$modal.msgSuccess("删除成功");
  496. })
  497. .catch(() => {});
  498. },
  499. /** 导出按钮操作 */
  500. handleExport() {
  501. this.download(
  502. "/BONDEDUPPLY/export",
  503. {
  504. ...this.queryParams,
  505. },
  506. `BONDEDUPPLY_new Date().getTme()}.xlsx`
  507. );
  508. },
  509. },
  510. };
  511. </script>