|
@@ -0,0 +1,631 @@
|
|
|
+<template>
|
|
|
+ <!-- 新增托书 -->
|
|
|
+ <div id="addBookDrawer">
|
|
|
+ <a-drawer
|
|
|
+ title="新增托书"
|
|
|
+ width="89%"
|
|
|
+ placement="right"
|
|
|
+ :closable="true"
|
|
|
+ :visible="visible"
|
|
|
+ @close="handleCancel">
|
|
|
+ <!-- 主表信息 填写 为什么原先图部分回显??-->
|
|
|
+ <a-card :bordered="true">
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
+ <a-form-model layout="inline" ref="form" :model="addBook" :rules="validatorRules">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="托书日期" prop="bookDate">
|
|
|
+ <a-date-picker
|
|
|
+ placeholder="请选择托书日期"
|
|
|
+ style="width:100%;"
|
|
|
+ :format="dateFormat"
|
|
|
+ v-model="addBook.bookDate"
|
|
|
+ />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="托书号" prop="bookNum">
|
|
|
+ <a-input placeholder="请输入托书号" v-model="addBook.bookNum"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="12" :sm="12">
|
|
|
+ <a-form-model-item label="外销发票号码" prop="exportInvoiceNo">
|
|
|
+ <a-input placeholder="请输入外销发票号码" v-model="addBook.exportInvoiceNo"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="经营单位" prop="businessUnit">
|
|
|
+ <a-input placeholder="请输入经营单位" v-model="addBook.businessUnit"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="经营单位地址" prop="businessUnitAdd">
|
|
|
+ <a-select placeholder="请选择经营单位地址" v-model="addBook.businessUnitAdd">
|
|
|
+ <a-select-option value="">请选择</a-select-option>
|
|
|
+ <a-select-option :value="0">客户1</a-select-option>
|
|
|
+ <a-select-option :value="1">客户2</a-select-option>
|
|
|
+ <a-select-option :value="2">客户3</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="装运期限" prop="latestShipmentDate">
|
|
|
+ <a-date-picker
|
|
|
+ placeholder="请选择装运期限"
|
|
|
+ style="width:100%;"
|
|
|
+ :format="dateFormat"
|
|
|
+ v-model="addBook.latestShipmentDate"
|
|
|
+ />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="最终船期" prop="finalShipDate">
|
|
|
+ <a-input placeholder="请输入最终船期" v-model="addBook.finalShipDate"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="收货人" prop="consignee">
|
|
|
+ <a-input placeholder="请输入收货人" v-model="addBook.consignee"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="收货人地址" prop="consigneeAdd">
|
|
|
+ <a-select placeholder="请选择收货人地址" v-model="addBook.consigneeAdd">
|
|
|
+ <a-select-option value="">请选择</a-select-option>
|
|
|
+ <a-select-option value="0">收货人1</a-select-option>
|
|
|
+ <a-select-option value="1">收货人2</a-select-option>
|
|
|
+ <a-select-option value="2">收货人3</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="通知方" prop="notifying">
|
|
|
+ <a-input placeholder="请输入通知方" v-model="addBook.notifying"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="通知方地址" prop="notifyingAdd">
|
|
|
+ <a-input placeholder="请输入通知方地址" v-model="addBook.notifyingAdd"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="贸易国别" prop="tradeCountry">
|
|
|
+ <a-input placeholder="请输入贸易国别" v-model="addBook.tradeCountry"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="运抵国别" prop="arriveCountry">
|
|
|
+ <a-input placeholder="请输入运抵国别" v-model="addBook.arriveCountry"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="出口口岸" prop="exportPort">
|
|
|
+ <a-input placeholder="请输入出口口岸" v-model="addBook.exportPort"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="目的港" prop="destinationport">
|
|
|
+ <a-input placeholder="请输入目的港" v-model="addBook.destinationport"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="收汇方式" prop="collectionMethod">
|
|
|
+ <a-input placeholder="请输入收汇方式" v-model="addBook.collectionMethod"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="成交方式" prop="soldType">
|
|
|
+ <a-input placeholder="请输入成交方式" v-model="addBook.soldType"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="金额" prop="money">
|
|
|
+ <a-input placeholder="请输入金额" v-model="addBook.money"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="人民币" prop="RMB">
|
|
|
+ <a-input placeholder="请输入人民币" v-model="addBook.RMB"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-model-item label="美元" prop="dollar">
|
|
|
+ <a-input placeholder="请输入美元" v-model="addBook.dollar"></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form-model>
|
|
|
+ </div>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ <!--操作按钮区域 参照装箱单 増行-->
|
|
|
+ <a-card :bordered="true" style="margin:10px 0 40px 0;">
|
|
|
+ <div class="table-operator">
|
|
|
+ <a-button type="primary" @click="referPackingList" icon="ordered-list">参照装箱单</a-button>
|
|
|
+ <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 子表-->
|
|
|
+ <a-spin :spinning="confirmLoading">
|
|
|
+ <a-form-model ref="formRef" :rules="validatorRules">
|
|
|
+ <a-table
|
|
|
+ bordered
|
|
|
+ :row-key="record => record.id"
|
|
|
+ :columns="addBookColumns"
|
|
|
+ :data-source="addBookData"
|
|
|
+ :loading="loading"
|
|
|
+ :pagination="ipagination"
|
|
|
+ :scroll="{ x: 1500 }"
|
|
|
+ @change="handleTableChange"
|
|
|
+ :footer="addBookFooterShow"
|
|
|
+ >
|
|
|
+ <!-- 集装箱代号 输入框 -->
|
|
|
+ <template slot="containerCode" slot-scope="text, record, index">
|
|
|
+ <a-form-model-item prop="containerCode" :rules="rules.containerCode" required>
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.containerCode" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 集装箱号 输入框-->
|
|
|
+ <template slot="containerNo" slot-scope="text, record, index">
|
|
|
+ <a-form-model-item prop="containerNo" :rules="rules.containerNo">
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.containerNo" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 操作 -->
|
|
|
+ <span slot="operationSlot" slot-scope="text, record">
|
|
|
+ <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
|
|
|
+ <a href="javascript:void(0);" style="color:red;">删除</a>
|
|
|
+ </a-popconfirm>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ </a-form-model>
|
|
|
+
|
|
|
+ <!-- 人民币、美金 -->
|
|
|
+ <a-row style="margin:60px 0;">
|
|
|
+ <div class="purchase-order-table" style="width:48%;marginRight:4%;float:left;">
|
|
|
+ <h6 class="table-title">人民币</h6>
|
|
|
+ <a-table
|
|
|
+ :row-key="record => record.id"
|
|
|
+ :loading="loading"
|
|
|
+ :columns="CNYColumns"
|
|
|
+ :data-source="CNYData"
|
|
|
+ bordered
|
|
|
+ :pagination="false"
|
|
|
+ >
|
|
|
+ <!-- CNY项目列 -->
|
|
|
+ <template slot="CNYProjectList" slot-scope="text, record, index">
|
|
|
+ <a-form-model-item prop="CNYProjectList" :rules="rules.CNYProjectList">
|
|
|
+ <a-select v-model="record.CNYProjectList" style="width:100%">
|
|
|
+ <a-select-option :value="1">项目列1</a-select-option>
|
|
|
+ <a-select-option :value="2">项目列2</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="purchase-order-table" style="width:48%;float:right;">
|
|
|
+ <h6 class="table-title">美金</h6>
|
|
|
+ <a-table
|
|
|
+ :row-key="record => record.id"
|
|
|
+ :loading="loading"
|
|
|
+ :columns="USDColumns"
|
|
|
+ :data-source="USDData"
|
|
|
+ bordered
|
|
|
+ :pagination="false"
|
|
|
+ >
|
|
|
+ <!-- USD项目列 -->
|
|
|
+ <template slot="USDProjectList" slot-scope="text, record, index">
|
|
|
+ <a-form-model-item prop="USDProjectList" :rules="rules.USDProjectList">
|
|
|
+ <a-select v-model="record.USDProjectList" style="width:100%">
|
|
|
+ <a-select-option :value="1">项目列1</a-select-option>
|
|
|
+ <a-select-option :value="2">项目列2</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </a-row>
|
|
|
+ </a-spin>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ <!-- 页面底部保存取消 -->
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ position: 'absolute',
|
|
|
+ right: 0,
|
|
|
+ bottom: 0,
|
|
|
+ width: '100%',
|
|
|
+ borderTop: '1px solid #e9e9e9',
|
|
|
+ padding: '10px 16px',
|
|
|
+ background: '#fff',
|
|
|
+ textAlign: 'right',
|
|
|
+ zIndex: 1
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
|
|
|
+ <a-button :style="{ marginRight: '8px' }">取消</a-button>
|
|
|
+ </a-popconfirm>
|
|
|
+ <a-button type="primary" @click="submitAdd">
|
|
|
+ 提交
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
+ </a-drawer>
|
|
|
+ <!-- 参照装箱单 -->
|
|
|
+ <packingList-modal ref="packingListModal" :father="aa" @ok="modalFormOk"></packingList-modal>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
+import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
+import moment from 'moment'
|
|
|
+
|
|
|
+import packingListModal from '@views/book/packingListModal.vue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'AddBookDrawer', // 新增 托书
|
|
|
+ mixins: [JeecgListMixin],
|
|
|
+ components: { packingListModal, JEllipsis, moment }, // 参照装箱单 弹框
|
|
|
+ data() {
|
|
|
+ let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
|
|
|
+ return {
|
|
|
+ // 表头
|
|
|
+ addBookColumns: [
|
|
|
+ {
|
|
|
+ title: '英文名称',
|
|
|
+ dataIndex: 'englishName',
|
|
|
+ width: 120,
|
|
|
+ fixed: 'left',
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '款号',
|
|
|
+ dataIndex: 'styleNum',
|
|
|
+ width: 120,
|
|
|
+ fixed: 'left',
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '小po号',
|
|
|
+ dataIndex: 'smallPoNum',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '数量',
|
|
|
+ dataIndex: 'quantity',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '箱数',
|
|
|
+ dataIndex: 'boxedNum',
|
|
|
+ width: 90,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '毛重',
|
|
|
+ dataIndex: 'roughWeigh',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '净重',
|
|
|
+ dataIndex: 'suttle',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '体积',
|
|
|
+ dataIndex: 'volume',
|
|
|
+ width: 160,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '分销点',
|
|
|
+ dataIndex: 'distributionPoint',
|
|
|
+ customRender: t => ellipsis(t),
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '集装箱代号',
|
|
|
+ dataIndex: 'containerCode',
|
|
|
+ width: 120,
|
|
|
+ scopedSlots: { customRender: 'containerCode' },
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '集装箱号',
|
|
|
+ dataIndex: 'containerNo',
|
|
|
+ width: 120,
|
|
|
+ scopedSlots: { customRender: 'containerNo' },
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '单价',
|
|
|
+ dataIndex: 'price',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: '创建时间',
|
|
|
+ // dataIndex: 'createTime',
|
|
|
+ // align: 'center',
|
|
|
+ // sorter: true,
|
|
|
+ // customRender: text => {
|
|
|
+ // return moment(text).format('YYYY-MM-DD')
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title: '预发货日期',
|
|
|
+ dataIndex: 'scheduledShipDate',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '业务员',
|
|
|
+ dataIndex: 'salesman',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '业务部门',
|
|
|
+ dataIndex: 'operatingDepartment',
|
|
|
+ width: 120,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '采购/委外订单号',
|
|
|
+ dataIndex: 'purchaseAboardOrderNum',
|
|
|
+ width: 160,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '采购/委外工厂',
|
|
|
+ dataIndex: 'purchaseAboardFactory',
|
|
|
+ width: 160,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'operation',
|
|
|
+ scopedSlots: { customRender: 'operationSlot' },
|
|
|
+ width: 160,
|
|
|
+ fixed: 'right',
|
|
|
+ className: 'replacecolor'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ addBookData: [{ englishName: 'morningFresh', styleNum: 'MWBBW2068', quantity: '1200', boxedNum: '588' }, {}],
|
|
|
+ CNYColumns: [
|
|
|
+ {
|
|
|
+ title: '货代',
|
|
|
+ dataIndex: 'CNYfreighForward',
|
|
|
+ width: 60,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '金额',
|
|
|
+ dataIndex: 'CNYmoney',
|
|
|
+ width: 60,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '项目列',
|
|
|
+ dataIndex: 'CNYProjectList',
|
|
|
+ width: 60,
|
|
|
+ scopedSlots: { customRender: 'CNYProjectList' },
|
|
|
+ className: 'replacecolor'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ CNYData: [{ CNYmoney: '487576,87' }],
|
|
|
+ USDColumns: [
|
|
|
+ {
|
|
|
+ title: '货代',
|
|
|
+ dataIndex: 'USDfreighForward',
|
|
|
+ width: 20,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '金额',
|
|
|
+ dataIndex: 'USDmoney',
|
|
|
+ width: 20,
|
|
|
+ className: 'replacecolor'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '项目列',
|
|
|
+ dataIndex: 'USDProjectList',
|
|
|
+ width: 90,
|
|
|
+ scopedSlots: { customRender: 'USDProjectList' },
|
|
|
+ className: 'replacecolor'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ USDData: [{}],
|
|
|
+ loading: false, // 表格加载
|
|
|
+ addBook: {},
|
|
|
+ confirmLoading: false,
|
|
|
+ visible: false,
|
|
|
+ dateFormat: 'YYYY-MM-DD',
|
|
|
+ validatorRules: {
|
|
|
+ bookDate: [{ required: true, message: '托书日期不能为空', trigger: 'blur' }]
|
|
|
+ // 确定必填项
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ // 参照装箱单
|
|
|
+ referPackingList() {
|
|
|
+ console.log('打开参照装箱单')
|
|
|
+ this.$refs.packingListModal.packingListModVis = true
|
|
|
+ },
|
|
|
+ // 増行
|
|
|
+ handleAddColumn() {
|
|
|
+ console.log('増行')
|
|
|
+
|
|
|
+ const addrow = {
|
|
|
+ englishName: '',
|
|
|
+ styleNum: '',
|
|
|
+ smallPoNum: '',
|
|
|
+ quantity: '',
|
|
|
+ boxedNum: '',
|
|
|
+ roughWeigh: '',
|
|
|
+ suttle: '',
|
|
|
+ volume: '',
|
|
|
+ distributionPoint: '',
|
|
|
+ containerCode: '',
|
|
|
+ containerNo: '',
|
|
|
+ price: '',
|
|
|
+ scheduledShipDate: '',
|
|
|
+ salesman: '',
|
|
|
+ operatingDepartment: '',
|
|
|
+ purchaseAboardOrderNum: '',
|
|
|
+ purchaseAboardFactory: '',
|
|
|
+ operation: ''
|
|
|
+ }
|
|
|
+
|
|
|
+ this.addBookData.push(addrow)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 新增托书 子表合计
|
|
|
+ addBookFooterShow(data) {
|
|
|
+ console.log('新增托书 子表 ----合计行')
|
|
|
+ console.log('data', data)
|
|
|
+ return (
|
|
|
+ <a-table
|
|
|
+ rowKey={Math.random}
|
|
|
+ bordered={false}
|
|
|
+ pagination={false}
|
|
|
+ columns={this.addBookColumns}
|
|
|
+ dataSource={this.addBookFooterDataSource || []}
|
|
|
+ showHeader={false}
|
|
|
+ ></a-table>
|
|
|
+ )
|
|
|
+ },
|
|
|
+
|
|
|
+ // 操作 删除
|
|
|
+ handleDelete(id) {
|
|
|
+ console.log('id:', id)
|
|
|
+ },
|
|
|
+ // 抽屉 取消
|
|
|
+ handleCancel() {
|
|
|
+ console.log('点击抽屉取消')
|
|
|
+ this.close()
|
|
|
+ },
|
|
|
+ // 抽屉 提交
|
|
|
+ submitAdd() {
|
|
|
+ console.log('保存新增、刷新托书')
|
|
|
+ const that = this
|
|
|
+ // 触发表单验证
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ that.confirmLoading = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.close()
|
|
|
+ // this.getShipmentList() // 刷新托书列表
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.$emit('close')
|
|
|
+ this.visible = false
|
|
|
+ this.$refs.form.resetFields()
|
|
|
+ },
|
|
|
+
|
|
|
+ // ------------------------------------------
|
|
|
+ modalFormOk() {},
|
|
|
+ aa() {}
|
|
|
+ // // 分页、排序、筛选变化时触发
|
|
|
+ // handleTableChange(pagination, filters, sorter) {
|
|
|
+ // // console.log('当前页信息>>>>',pagination)
|
|
|
+ // this.queryParam.pageNo = pagination.current
|
|
|
+ // this.getAnnList()
|
|
|
+ // }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 出现滚动条,合计栏跟随 table 滚动
|
|
|
+ watch: {
|
|
|
+ dataSource(val) {
|
|
|
+ console.log(val)
|
|
|
+ // 同步表与footer滚动
|
|
|
+ let dom = this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[0]
|
|
|
+ dom.addEventListener(
|
|
|
+ 'scroll',
|
|
|
+ () => {
|
|
|
+ this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[1].scrollLeft = dom.scrollLeft
|
|
|
+ console.log('走到这')
|
|
|
+ },
|
|
|
+ true
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 构建合计数据 --合计
|
|
|
+ // TODO:合计行 有滚动待解决
|
|
|
+ computed: {
|
|
|
+ addBookFooterDataSource() {
|
|
|
+ // 新增托书 子表 合计
|
|
|
+ const total = Object.assign({}, this.addBookData[0])
|
|
|
+ for (const attr in total) {
|
|
|
+ total[attr] = '合计'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ return [total]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+// }
|
|
|
+
|
|
|
+// 抽屉里的card样式
|
|
|
+/deep/ .ant-drawer-content {
|
|
|
+ background-color: #f0f2f5;
|
|
|
+}
|
|
|
+/deep/ .ant-drawer-body {
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+/deep/ .ant-table-footer .ant-table.body {
|
|
|
+ // overflow: hidden !important;
|
|
|
+}
|
|
|
+/deep/ .ant-table.ant-table-bordered .ant-table-footer {
|
|
|
+ border: none;
|
|
|
+ padding: 0;
|
|
|
+}
|
|
|
+</style>
|