123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534 |
- <template>
- <!-- 预托书列表 -->
- <div id="preBookList">
- <!-- 查询区域 -->
- <a-card :bordered="false">
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :md="6" :sm="8">
- <a-form-item label="预托书号">
- <a-input placeholder="请输入预托书号" v-model="queryParam.depositaryReceiptNo"></a-input>
- </a-form-item>
- </a-col>
-
- <a-col :md="6" :sm="8">
- <a-form-item label="托书日期" has-feedback>
- <a-date-picker style="width: 100%" v-model="queryParam.shippingOrderDate" @change = "changeTime"> </a-date-picker>
- </a-form-item>
- </a-col>
-
- <a-col :md="6" :sm="8">
- <a-form-item label="客户简称">
- <j-search-select-tag
- placeholder="请选择客户简称"
- v-model="queryParam.clientAbbreviation"
- dict="view_customer,customername,customername">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
- <template v-if="toggleSearchStatus">
- <a-col :md="6" :sm="8">
- <a-form-item label="账套号">
- <j-search-select-tag
- placeholder="请选择账套号"
- v-model="queryParam.acSetNo"
- dict="view_account,account,account">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="制单人">
- <!-- <a-input placeholder="请输入制单人" v-model="queryParam.createBy"></a-input> -->
- <j-search-select-tag
- placeholder="请选择制单人"
- v-model="queryParam.createBy"
- dict="view_createBy,createby,createby">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="小po号">
- <a-input placeholder="请输入小po号" v-model="queryParam.smallPo"></a-input>
- </a-form-item>
- </a-col>
- <!-- <a-col :md="6" :sm="8">
- <a-form-item label="预托书号">
- <a-input placeholder="请输入预托书号" v-model="queryParam.depositaryReceiptNo"></a-input>
- </a-form-item>
- </a-col> -->
- </template>
-
- <a-col :md="6" :sm="8">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
- <a @click="handleToggleSearch" style="margin-left: 8px">
- {{ toggleSearchStatus ? '收起' : '展开' }}
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
- </a>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- </a-card>
- <!-- 操作按钮区域 新增-->
- <a-card :bordered="false" style="marginTop:10px;">
- <div class="table-operator">
- <a-button type="primary" @click="addPreBook" icon="plus">新增</a-button>
- </div>
- <!-- 子表 -->
- <a-table
- bordered
- v-if="preBookListData"
- :rowKey=" (row, index) => {return index;}"
- :columns="preBookListColumns"
- :data-source="preBookListData"
- :loading="loading"
- :pagination="ipagination"
- @change="handleTableChange"
- :scroll="{ x: 1500,y: 600 }"
- >
- <!-- 单据状态 -->
- <span slot="documentStateSlot" slot-scope="text, record">
- <a-tag color="orange" v-if="record.theDocumentsState == '0'">仅保存</a-tag>
- <a-tag color="green" v-if="record.theDocumentsState == '1'">已提交</a-tag>
- </span>
- <!-- 操作 -->
- <span slot="operationSlot" slot-scope="text, record">
- <a @click="print(record)">打印</a>
- <a-divider type="vertical" />
- <a-dropdown>
- <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
- <!-- 仅保存 -->
- <a-menu slot="overlay" v-if="record.theDocumentsState == '0'">
- <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
- <a-menu-item><a @click="edit(record)">编辑</a></a-menu-item>
- <a-menu-item><a @click="copyForm(record)">复制</a></a-menu-item>
- <!-- <a-menu-item>
- <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
- <a href="javascript:void(0);" style="color:green;">提交</a>
- </a-popconfirm>
- </a-menu-item> -->
- <a-menu-item>
- <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
- <a href="javascript:void(0);" style="color:red;">删除</a>
- </a-popconfirm></a-menu-item>
- </a-menu>
- <!-- 已提交 -->
- <a-menu slot="overlay" v-if="record.theDocumentsState == '1'">
- <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
- <a-menu-item><a @click="copyForm(record)">复制</a></a-menu-item>
- <!-- <a-menu-item>
- <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancel(record)">
- <a href="javascript:void(0);" style="color:red;">取消提交</a>
- </a-popconfirm>
- </a-menu-item> -->
- </a-menu>
- </a-dropdown>
- </span>
- </a-table>
- </a-card>
- <!-- 抽屉 -->
- <addPreBook-drawer ref="addPreBookDrawer" :fatherList="getPreBookData" @ok="modalFormOk"></addPreBook-drawer>
- <detailsPreBook-drawer ref="detailsPreBookDrawer" @ok="modalFormOk"></detailsPreBook-drawer>
- </div>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import addPreBookDrawer from '@views/pre-book/addPreBookDrawer.vue'
- import detailsPreBookDrawer from '@views/pre-book/detailsPreBookDrawer.vue'
- import { downFile } from '@/api/manage'
- import editPreBookDrawer from '@views/pre-book/editPreBookDrawer.vue'
- import { preBookList, addPreBook, preBookById, editById,deletePreBook,submit,cancelSubmit } from '@api/document/pre-book.js'
- export default {
- name: 'PreBookList', // 预托书列表
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment, addPreBookDrawer, detailsPreBookDrawer, editPreBookDrawer },
- data() {
- let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
- return {
- // 表头
- preBookListColumns: [
- {
- title: '预托书号',
- width: 150,
- dataIndex: 'depositaryReceiptNo',
- // fixed: 'left',
- align: 'left',
- className: 'replacecolor',
- ellipsis: true,
- },
- // { title: '订单号', width: 120, dataIndex: 'orderNumber', fixed: 'left', className: 'replacecolor' },
- // { title: '外销发票号码', dataIndex: 'exportInvoiceNo', width: 220, align: 'left', className: 'replacecolor' },
- { title: '客户简称', dataIndex: 'clientAbbreviation', width: 90, className: 'replacecolor', ellipsis: true, },
- {
- title: '分销点',
- dataIndex: 'distributionPoint',
- width: 130,
- // customRender: t => ellipsis(t),
- className: 'replacecolor',
- ellipsis: true,
- },
- {
- title: '经营单位',
- dataIndex: 'unitInOperation',
- width: 120,
- // customRender: t => ellipsis(t),
- ellipsis: true,
- className: 'replacecolor'
- },
- { title: '总箱数', dataIndex: 'boxNumber', width: 80, className: 'replacecolor', ellipsis: true, },
- { title: '总毛重', dataIndex: 'totalGrossWeight', width: 90, className: 'replacecolor', ellipsis: true, },
- { title: '总体积', dataIndex: 'totalVolume', width: 90, className: 'replacecolor', ellipsis: true, },
- {
- title: '金额',
- dataIndex: 'money',
- width: 100,
- className: 'replacecolor',
- ellipsis: true,
- },
- // {
- // title: '创建时间',
- // dataIndex: 'createTime',
- // align: 'center',
- // sorter: true,
- // customRender: text => {
- // return moment(text).format('YYYY-MM-DD')
- // }
- // },
- // { title: '实际船期', dataIndex: 'theActualShippingDate', width: 120, className: 'replacecolor' },
- // { title: '收汇方式', dataIndex: 'exchangeEarningsValue', width: 120, className: 'replacecolor' },
- // {
- // title: '收货人',
- // dataIndex: 'consignee',
- // width: 100,
- // customRender: t => ellipsis(t),
- // className: 'replacecolor'
- // },
- // {
- // title: '提单或承运收据',
- // dataIndex: 'billOfLadingOrCarriageReceipt',
- // width: 140,
- // customRender: t => ellipsis(t),
- // className: 'replacecolor'
- // },
- // {
- // title: '抬头人',
- // dataIndex: 'addressee',
- // width: 120,
- // customRender: t => ellipsis(t),
- // className: 'replacecolor'
- // },
- { title: '贸易国别', dataIndex: 'tradeCountry', width: 120, className: 'replacecolor' , ellipsis: true,},
- { title: '运抵国别', dataIndex: 'arriveInCountry', width: 120, className: 'replacecolor', ellipsis: true, },
- { title: '出口口岸', dataIndex: 'exportPort', width: 120, className: 'replacecolor', ellipsis: true, },
- // {
- // title: '通知人',
- // dataIndex: 'notifier',
- // width: 100,
- // customRender: t => ellipsis(t),
- // className: 'replacecolor'
- // },
- // { title: 'nottfy', dataIndex: 'nottfy', width: 150, className: 'replacecolor' },
- { title: '目的港', dataIndex: 'destinationPort', width: 140, className: 'replacecolor', ellipsis: true, },
- // { title: '装运期限', dataIndex: 'latestDateOfShipment', width: 120, className: 'replacecolor' },
- // {
- // title: '单据状态',
- // dataIndex: 'theDocumentsState',
- // width: 90,
- // scopedSlots: { customRender: 'documentStateSlot' },
- // fixed: 'right',
- // className: 'replacecolor'
- // },
- {
- title: '操作',
- dataIndex: 'operation',
- scopedSlots: { customRender: 'operationSlot' },
- width: 160,
- fixed: 'right',
- className: 'replacecolor'
- }
- ],
- preBookListData: [],
- id: '', //
- loading: false, // 表格加载
- // 查询条件
- queryParam: {
- depositaryReceiptNo: '',
- shippingOrderDate: '',//托书日期
- clientAbbreviation: '',
- acSetNo: '',
- smallPo: '',
- pageSize:'50',
- pageNo: '' // 点击的页数
- },
- dateFormat: 'YYYY-MM-DD',
-
- }
- },
- created() {
- // this.getPreBookData() // 渲染预托书
- },
- methods: {
- // 分页查询 预托书
- getPreBookData() {
- this.$nextTick(() => {
- // this.queryParam.pageSize = 50
- this.loading = true
- preBookList(this.queryParam).then(res => {
- this.loading = false
- if (res.success) {
- this.preBookListData = res.result.records;
- this.ipagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size,
- pageSizeOptions: ["50", "100", "150"],
- }
- }else{
- this.$message.error(res.message)
- }
- })
- })
- },
- // 新增
- addPreBook() {
- this.$refs.addPreBookDrawer.addPreBook = {syLetterDepositItemList:[],syRmbList:[],syUsdList:[]};
- this.$refs.addPreBookDrawer.visible = true;
-
- },
- // 详情
- details(record) {
- preBookById({ id: record.id }).then(res => {
- if (res.success) {
- // 把通过id查询到的对象,赋值给子组件
- this.$refs.detailsPreBookDrawer.preBookDetails = res.result; //主表
- res.result.money = res.result.money.toFixed(2)
- res.result.syLetterDepositItemList.map(item =>{
- var str =item.hod
- var n=str.split(" ");
- item.hod = n[0]
- item.preDeliveryDate = item.hod
- })
- this.$refs.detailsPreBookDrawer.data = res.result.syLetterDepositItemList; //子表
- this.$refs.detailsPreBookDrawer.visible = true
- }else{
- this.$message.error(res.message)
- }
- })
- },
- // 编辑
- edit(record) {
- preBookById({ id: record.id }).then(res => {
- if (res.success) {
- res.result.consigneeAll = res.result.consignee+"+"+res.result.consigneeAddress+"+"+res.result.notifyParty+"+"+res.result.notifyPartyAddress;
- res.result.money = res.result.money.toFixed(2)
- this.$refs.addPreBookDrawer.addPreBook = res.result;
- this.$refs.addPreBookDrawer.defultMethod = 'edit';
- res.result.syLetterDepositItemList.map(item =>{
- var str =item.hod
- var n=str.split(" ");
- item.hod = n[0]
- item.preDeliveryDate = item.hod
- })
- this.$refs.addPreBookDrawer.data = res.result.syLetterDepositItemList;
- this.$refs.addPreBookDrawer.visible = true
- }else{
- this.$message.error(res.message)
- }
- })
- },
- //复制
- copyForm(record){
- preBookById({ id: record.id }).then(res => {
- if (res.success) {
- res.result.consigneeAll = res.result.consignee+"+"+res.result.consigneeAddress+"+"+res.result.notifyParty+"+"+res.result.notifyPartyAddress;
- res.result.money = res.result.money.toFixed(2)
- res.result.syLetterDepositItemList = []
- this.$refs.addPreBookDrawer.addPreBook = res.result;
- this.$refs.addPreBookDrawer.addPreBook.id=''
- this.$refs.addPreBookDrawer.defultMethod = 'edit';
- this.$refs.addPreBookDrawer.visible = true
- }else{
- this.$message.error(res.message)
- }
- })
- },
- // 操作 提交
- submit(record) {
- this.$nextTick(() => {
- submit({ id: record.id, type: '1' }).then(res => {
- if (res.success) {
- this.preBookListData.theDocumentsState == '1'
- this.getPreBookData()
- this.$message.success('提交成功')
- }else{
- this.$message.error(res.message)
- }
- })
- })
- },
- // 取消提交
- cancel(record) {
- this.$nextTick(() => {
- cancelSubmit({ id: record.id, type: '2' }).then(res => {
- if (res.success) {
- this.preBookListData.theDocumentsState == '0'
- this.getPreBookData()
- this.$message.success('取消提交成功')
- }else{
- this.$message.error(res.message)
- }
- })
- })
- },
- // 删除
- handleDelete(record) {
- this.$nextTick(() => {
- if(this.queryParam.pageNo > 1 && this.preBookListData.length === 1){
- this.queryParam.pageNo = this.queryParam.pageNo -1
- }
- deletePreBook({ id: record.id }).then(res => {
- if (res.success) {
- this.getPreBookData()
- this.$message.success('删除成功')
- }else{
- this.$message.error(res.message)
- }
- })
- })
- },
-
- //托书日期改变触发
- changeTime(val){
- this.queryParam.shippingOrderDate= val.format('YYYY-MM-DD')
- },
- // 查询按钮
- searchQuery() {
- this.toggleSearchStatus = false
- this.getPreBookData() /// 渲染渲染预托书
- },
- // 重置
- searchReset() {
- var dd =this.queryParam
- this.queryParam = {
- depositaryReceiptNo: '',
- shippingOrderDate: '',//托书日期
- clientAbbreviation: '',
- acSetNo: '',
- smallPo: '',
- pageSize:this.queryParam.pageSize,
- pageNo: '' // 点击的页数
- }
- this.getPreBookData()
- },
- // 操作 打印
- print(record) {
- downFile('/letterDeposit/syLetterDeposit/printSyletterDeposit',{id:record.id}).then(data => {
- if (!data) {
- this.$message.warning('文件下载失败')
- return
- }
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), record.depositaryReceiptN + '.xlsx')
- } else {
- let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
- let link = document.createElement('a')
- link.style.display = 'none'
- link.href = url
- link.setAttribute('download', record.depositaryReceiptNo+'.xlsx')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link) // 下载完成移除元素
- window.URL.revokeObjectURL(url) // 释放掉blob对象
- }
- })
- },
- handleTableChange(pagination, filters, sorter) {
- this.queryParam.pageNo = pagination.current
- this.queryParam.pageSize = pagination.pageSize
- this.getPreBookData()
- },
- aa() {},
- bb() {},
- cc() {}
- },
- computed: {},
- mounted() {}
- }
- </script>
- <style lang="less" scoped>
- @import '~@assets/less/common.less';
- @import '~@assets/less/overwriter.less';
- /deep/ .ant-table-thead > tr > th {
- text-align: center;
- // font-weight: 700;
- }
- /deep/ .ant-table-tbody {
- text-align: center;
- }
- // /deep/ th.replacecolor {
- // background-color: #ccc;
- // }
- /deep/ .ant-table-tbody .ant-table-row td{
- padding-top: 8px;
- padding-bottom: 8px;
- }
- /deep/.ant-card-body{
- padding-top: 10px !important;
- padding-bottom: 0px !important;
- }
- /deep/.table-operator .ant-btn{
- margin: 0 8px 3px 0;
- }
- /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
- margin-bottom: 10px;
- }
- /deep/.table-page-search-wrapper .table-page-search-submitButtons{
- margin-bottom: 10px;
- }
- /deep/ thead.ant-table-thead>tr{
- height: 0 !important;
- }
- /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
- padding: 9px 16px
- }
- /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
- width: calc(100% + 9px);//减去滚动条的宽度
- }
- </style>
|