index.vue 15 KB

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