book-list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <template>
  2. <!-- 预托书列表 -->
  3. <div id="preBookList">
  4. <!-- 查询区域 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-item label="订单号">
  11. <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :md="6" :sm="8">
  15. <a-form-item label="订单日期" has-feedback>
  16. <a-date-picker style="width: 100%" v-model="queryParam.orderDate"> </a-date-picker>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="8">
  20. <a-form-item label="客户简称">
  21. <a-input placeholder="请输入客户简称" v-model="queryParam.clientAbbreviation"></a-input>
  22. </a-form-item>
  23. </a-col>
  24. <template v-if="toggleSearchStatus">
  25. <!-- <a-col :md="6" :sm="8">
  26. <a-form-item label="箱号">
  27. <a-input placeholder="请输入箱号" v-model="queryParam.containerNumber"></a-input>
  28. </a-form-item>
  29. </a-col> -->
  30. <a-col :md="6" :sm="8">
  31. <a-form-item label="小po号">
  32. <a-input placeholder="请输入小po号" v-model="queryParam.smailPo"></a-input>
  33. </a-form-item>
  34. </a-col>
  35. <a-col :md="6" :sm="8">
  36. <a-form-item label="托书号">
  37. <a-input placeholder="请输入托书号" v-model="queryParam.shippingOrderNumber"></a-input>
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="8">
  41. <a-form-item label="外销发票">
  42. <a-input placeholder="请输入外销发票" v-model="queryParam.exportInvoiceNo"></a-input>
  43. </a-form-item>
  44. </a-col>
  45. <!-- <a-col :md="6" :sm="8">
  46. <a-form-model-item label="类型">
  47. <a-select v-model="queryParam.flourOrGarment">
  48. <a-select-option value="">请选择</a-select-option>
  49. <a-select-option value="1">成衣</a-select-option>
  50. <a-select-option value="0">面辅料</a-select-option>
  51. </a-select>
  52. </a-form-model-item>
  53. </a-col> -->
  54. </template>
  55. <a-col :md="6" :sm="8">
  56. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  57. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  58. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  59. <a @click="handleToggleSearch" style="margin-left: 8px">
  60. {{ toggleSearchStatus ? '收起' : '展开' }}
  61. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  62. </a>
  63. </span>
  64. </a-col>
  65. </a-row>
  66. </a-form>
  67. </div>
  68. </a-card>
  69. <!-- 操作按钮区域 新增-->
  70. <a-card :bordered="false" style="marginTop:10px;">
  71. <div class="table-operator">
  72. <a-button type="primary" @click="addBookDrawer" icon="plus">新增</a-button>
  73. </div>
  74. <!-- 子表 -->
  75. <a-table
  76. bordered
  77. :columns="bookListColumns"
  78. :data-source="bookListData"
  79. :loading="loading"
  80. :scroll="{ y: 500 }"
  81. :pagination="pagination"
  82. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  83. @change="handleTableChange"
  84. >
  85. <!-- 金额 输入框
  86. <template slot="money" slot-scope="text, record, index">
  87. <a-form-model-item prop="money" :rules="rules.money" required>
  88. <a-input style="width:100%" type="text" v-model="record.money" />
  89. </a-form-model-item>
  90. </template> -->
  91. <!-- 单据状态 -->
  92. <span slot="documentStateSlot" slot-scope="text, record">
  93. <a-tag color="orange" v-if="record.theDocumentsState == '0'">仅保存</a-tag>
  94. <a-tag color="green" v-if="record.theDocumentsState == '1'">已提交</a-tag>
  95. </span>
  96. <!-- if 已提交 -->
  97. <!-- <span slot="documentStateSlot">
  98. <a-tag color="#2db7f5">已提交</a-tag>
  99. </span> -->
  100. <!-- 操作 -->
  101. <span slot="operationSlot" slot-scope="text, record">
  102. <a @click="settlementExinvoicePrint(record)" style="color:green;">结汇发票打印</a>
  103. <a-divider type="vertical" />
  104. <a-dropdown>
  105. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  106. <a-menu slot="overlay" v-if="record.theDocumentsState == '0'">
  107. <a-menu-item><a @click="submit(record)">提交</a></a-menu-item>
  108. <a-menu-item><a @click="edit(record,'2')">详情</a></a-menu-item>
  109. <a-menu-item><a @click="edit(record,'1')">编辑</a></a-menu-item>
  110. <a-menu-item><a @click="print(record)">打印</a></a-menu-item>
  111. <a-menu-item>
  112. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
  113. <a href="javascript:void(0);" style="color:red;">删除</a>
  114. </a-popconfirm></a-menu-item
  115. >
  116. </a-menu>
  117. <a-menu slot="overlay" v-if="record.theDocumentsState == '1'">
  118. <a-menu-item><a @click="canaleSubmit(record)">取消提交</a></a-menu-item>
  119. <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
  120. </a-menu>
  121. </a-dropdown>
  122. </span>
  123. </a-table>
  124. </a-card>
  125. <!-- 抽屉 -->
  126. <addBook-drawer ref="addBookDrawer" :father="aa" @ok="modalFormOk" @back="getBookList"></addBook-drawer>
  127. <detailsBook-drawer ref="detailsBookDrawer" :father="bb" @ok="modalFormOk"></detailsBook-drawer>
  128. <!-- <editBook-drawer ref="editBookDrawer" :father="cc" @ok="modalFormOk"></editBook-drawer> -->
  129. </div>
  130. </template>
  131. <script>
  132. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  133. import JEllipsis from '@/components/jeecg/JEllipsis'
  134. import moment from 'moment'
  135. import addBookDrawer from '@views/book/addBookDrawer.vue'
  136. import detailsBookDrawer from '@views/book/detailsBookDrawer.vue'
  137. import editBookDrawer from '@views/book/editBookDrawer.vue'
  138. import {bookList,bookListId,submitPackingList,deletePackingList} from '@api/document/book.js'
  139. export default {
  140. name: 'BookList', // 托书列表
  141. mixins: [JeecgListMixin],
  142. components: { JEllipsis, moment, addBookDrawer, detailsBookDrawer, editBookDrawer },
  143. data() {
  144. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  145. return {
  146. // 表头
  147. bookListColumns: [
  148. { title: '托书号', width: 120, dataIndex: 'shippingOrderNumber', fixed: 'left', className: 'replacecolor' , ellipsis: true,},
  149. { title: '订单号', width: 140, dataIndex: 'orderNumber', fixed: 'left', className: 'replacecolor', ellipsis: true, },
  150. { title: '外销发票号码', dataIndex: 'exportInvoiceNo', width: 120, className: 'replacecolor', ellipsis: true, },
  151. { title: '客户简称', dataIndex: 'clientAbbreviation', width: 120, className: 'replacecolor' , ellipsis: true,},
  152. {
  153. title: '分销点',
  154. dataIndex: 'distributionPoint',
  155. width: 120,
  156. ellipsis: true,
  157. className: 'replacecolor'
  158. },
  159. {
  160. title: '经营单位',
  161. dataIndex: 'unitInOperation',
  162. width: 150,
  163. ellipsis: true,
  164. className: 'replacecolor'
  165. },
  166. { title: '总箱数', dataIndex: 'boxNumber', width: 120, className: 'replacecolor', ellipsis: true, },
  167. { title: '总毛重', dataIndex: 'totalGrossWeight', width: 120, className: 'replacecolor', ellipsis: true, },
  168. { title: '总体积', dataIndex: 'totalVolume', width: 100, className: 'replacecolor', ellipsis: true, },
  169. {
  170. title: '金额',
  171. dataIndex: 'money',
  172. // scopedSlots: { customRender: 'money' },
  173. width: 140,
  174. ellipsis: true,
  175. className: 'replacecolor'
  176. },
  177. {
  178. title: '实际船期',
  179. dataIndex: 'theActualShippingDate',
  180. ellipsis: true,
  181. width: 130,
  182. // customRender: text => { 有问题 显示当日日期
  183. // return moment(text).format('YYYY-MM-DD')
  184. // },
  185. className: 'replacecolor'
  186. },
  187. // { title: '收汇方式', dataIndex: 'exchangeEarningsValue', width: 120, className: 'replacecolor' },
  188. // {
  189. // title: '收货人',
  190. // dataIndex: 'consignee',
  191. // width: 100,
  192. // customRender: t => ellipsis(t),
  193. // className: 'replacecolor'
  194. // },
  195. // {
  196. // title: '提单或承运收据',
  197. // dataIndex: 'billOfLadingOrCarriageReceipt',
  198. // width: 140,
  199. // customRender: t => ellipsis(t),
  200. // className: 'replacecolor'
  201. // },
  202. // {
  203. // title: '抬头人',
  204. // dataIndex: 'addressee',
  205. // width: 120,
  206. // customRender: t => ellipsis(t),
  207. // className: 'replacecolor'
  208. // },
  209. // { title: '贸易国别', dataIndex: 'tradeCountry', width: 100, className: 'replacecolor' },
  210. // { title: '运抵国别', dataIndex: 'arriveInCountry', width: 100, className: 'replacecolor' },
  211. // { title: '出口口岸', dataIndex: 'exportPort', width: 100, className: 'replacecolor' },
  212. // {
  213. // title: '通知人',
  214. // dataIndex: 'notifier',
  215. // width: 100,
  216. // customRender: t => ellipsis(t),
  217. // className: 'replacecolor'
  218. // },
  219. // { title: 'NOTIFY', dataIndex: 'nottfy', width: 150, className: 'replacecolor' },
  220. // { title: '目的港', dataIndex: 'destinationPort', width: 100, className: 'replacecolor' },
  221. // { title: '装运期限', dataIndex: 'latestDateOfShipment', width: 100, className: 'replacecolor' },
  222. // {
  223. // title: '单据状态',
  224. // dataIndex: 'theDocumentsState',
  225. // width: 90,
  226. // scopedSlots: { customRender: 'documentStateSlot' },
  227. // fixed: 'right',
  228. // className: 'replacecolor'
  229. // },
  230. {
  231. title: '操作',
  232. dataIndex: 'operation',
  233. scopedSlots: { customRender: 'operationSlot' },
  234. width: 180,
  235. fixed: 'right',
  236. className: 'replacecolor'
  237. }
  238. ],
  239. bookListData: [],
  240. id: '',
  241. loading: false, // 表格加载
  242. pagination:{},
  243. // 查询条件
  244. queryParam: {
  245. pageNo:''
  246. }
  247. }
  248. },
  249. created() {
  250. this.getBookList( )
  251. },
  252. methods: {
  253. //获取表格数据
  254. getBookList(){
  255. this.$nextTick(() => {
  256. this.queryParam.pageSize = 20
  257. bookList(this.queryParam).then(res => {
  258. if (res.success) {
  259. this.bookListData = res.result.records
  260. this.pagination = {
  261. total: res.result.total,
  262. current: res.result.current,
  263. pageSize: res.result.size
  264. }
  265. }else {
  266. this.$message.error(res.message);
  267. }
  268. })
  269. })
  270. },
  271. // 查询按钮
  272. searchQuery() {
  273. this.queryParam.pageNo = ''
  274. this.getBookList()
  275. // this.getpreBookList() // 渲染渲染预托书
  276. },
  277. // 重置
  278. searchReset() {
  279. this.queryParam = {
  280. pageNo:''
  281. }
  282. this.getBookList()
  283. // this.getpreBookList()
  284. },
  285. // 新增
  286. addBookDrawer() {
  287. console.log('新增托书')
  288. this.$refs.addBookDrawer.visible = true
  289. },
  290. // -----------------------------------
  291. // 结汇发票打印
  292. settlementExinvoicePrint(record) {},
  293. // 上传附件
  294. accessoryUpload() {},
  295. // 操作 提交
  296. submit(record) {
  297. this.$nextTick(() => {
  298. submitPackingList({ id: record.id, type: '1' }).then(res => {
  299. if (res.success) {
  300. record.theDocumentsState = '1'
  301. this.getBookList()
  302. this.$message.success('提交成功')
  303. }else {
  304. this.$message.error(res.message);
  305. }
  306. })
  307. })
  308. },
  309. //取消提交
  310. canaleSubmit(record) {
  311. this.$nextTick(() => {
  312. submitPackingList({ id: record.id, type: '2' }).then(res => {
  313. if (res.success) {
  314. this.$message.success('取消提交成功')
  315. record.theDocumentsState = '0'
  316. this.getBookList()
  317. }else {
  318. this.$message.error(res.message);
  319. }
  320. })
  321. })
  322. },
  323. // 操作 详情
  324. details(record) {
  325. this.$refs.detailsBookDrawer.visible = true
  326. },
  327. // 操作 编辑
  328. edit(record,pattern) {
  329. this.$nextTick(() => {
  330. bookListId({id:record.id}).then(res => {
  331. if (res.success) {
  332. var data =res.result
  333. if(pattern == '1'){
  334. this.$refs.addBookDrawer.visible = true
  335. this.$refs.addBookDrawer.defaultMethod = 'edit'
  336. this.$refs.addBookDrawer.addBook = data
  337. this.$refs.addBookDrawer.addBookData = data.syShippingOrderItemList
  338. this.$refs.addBookDrawer.rmbList = data.rmbList
  339. this.$refs.addBookDrawer.usdList = data.usdList
  340. }else {
  341. this.$refs.detailsBookDrawer.visible = true
  342. this.$refs.detailsBookDrawer.addBook = data
  343. this.$refs.detailsBookDrawer.addBookData = data.syShippingOrderItemList
  344. this.$refs.detailsBookDrawer.rmbList = data.rmbList
  345. this.$refs.detailsBookDrawer.usdList = data.usdList
  346. }
  347. // this.bookListData = res.result.records
  348. }else {
  349. this.$message.error(res.message);
  350. }
  351. })
  352. })
  353. },
  354. // 操作 打印
  355. print(record) {},
  356. // 操作 删除
  357. handleDelete(id) {
  358. this.$nextTick(() => {
  359. if(this.queryParam.pageNo > 1 && this.bookListData.length === 1){
  360. this.queryParam.pageNo = this.queryParam.pageNo -1
  361. }
  362. deletePackingList({id:id}).then(res => {
  363. if (res.success) {
  364. this.getBookList()
  365. }else {
  366. this.$message.error(res.message);
  367. }
  368. })
  369. })
  370. },
  371. // // 分页、排序、筛选变化时触发
  372. handleTableChange(pagination, filters, sorter) {
  373. // console.log('当前页信息>>>>',pagination)
  374. this.queryParam.pageNo = pagination.current
  375. this.getBookList()
  376. },
  377. aa() {},
  378. bb() {},
  379. cc() {}
  380. },
  381. computed: {},
  382. mounted() {}
  383. }
  384. </script>
  385. <style lang="less" scoped>
  386. @import '~@assets/less/common.less';
  387. @import '~@assets/less/overwriter.less';
  388. /deep/ .ant-table-thead > tr > th {
  389. text-align: center;
  390. // font-weight: 700;
  391. }
  392. /deep/ .ant-table-tbody {
  393. text-align: center;
  394. }
  395. // /deep/ th.replacecolor {
  396. // background-color: #ccc;
  397. // }
  398. </style>