123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- <template>
- <a-modal
- title="参照发运明细"
- v-model="referShipDetModVis"
- :confirmLoading="confirmLoading"
- @ok="onSubmit"
- @cancel="handleCancel"
- width="86%"
- style="top:330px;left:100px;"
- >
- <a-spin :spinning="confirmLoading">
- <!-- 查询 -->
- <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.documentNo"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="客户">
- <a-input placeholder="请输入客户" v-model="queryParam.customer"></a-input>
- </a-form-item>
- </a-col>
- <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>
- <!-- table -->
- <a-table
- bordered
- size="small"
- rowKey="id"
- v-if="data"
- :columns="columns"
- :data-source="data"
- :loading="loading"
- :pagination="pagination"
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
- @change="handleTableChange"
- :scroll="{ x: 1500 }"
- >
- </a-table>
- </a-spin>
- </a-modal>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import { shipList } from '@api/document/advance-packingList.js'
- export default {
- name: 'ReferShipmentDetailsModal',
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment },
- data() {
- let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
- return {
- selectedRowKeys: [], // 勾选行
- selectedRows: {}, // 勾选项
- loading: false, // 表格加载
- // 表头
- columns: [
- {
- title: '单据号',
- dataIndex: 'documentNo',
- width: 120,
- fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '销售订单号',
- dataIndex: 'orderNumber',
- width: 120,
- fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '客户简称',
- dataIndex: 'customerAbbreviation',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '部门',
- dataIndex: 'salesDepartment',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '业务员',
- dataIndex: 'salesman',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '小po',
- dataIndex: 'smallPo',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: 'Pack Id',
- dataIndex: 'packId',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '分销点',
- dataIndex: 'distributionPoint',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '款号',
- dataIndex: 'itemNumber',
- width: 120,
- className: 'replacecolor'
- },
- // {
- // title: '创建时间',
- // dataIndex: 'createTime',
- // align: 'center',
- // sorter: true,
- // customRender: text => {
- // return moment(text).format('YYYY-MM-DD')
- // }
- // },
- {
- title: '预发货日期',
- dataIndex: 'preDeliveryDate',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '计划到货日期',
- dataIndex: 'plannedArrivalDate',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '存货名称',
- dataIndex: 'inventoryName',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '数量(合计)',
- dataIndex: 'bb',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '单价(销售)',
- dataIndex: 'salesUnitPrice',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '采购/委外订单号',
- dataIndex: 'purOrSubOrder',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '订单类型',
- dataIndex: 'orderType',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '工厂单价(采购/委外单价)',
- dataIndex: 'factoryUnitPrice',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '申报要素(单证维护)',
- dataIndex: 'declarationElements',
- width: 140,
- customRender: t => ellipsis(t),
- className: 'replacecolor'
- },
- {
- title: '套装件数(存货自定义项)',
- dataIndex: 'numberOfSets',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '是否TC功能',
- dataIndex: 'isTC',
- // 0 否 、 1 是
- width: 90,
- className: 'replacecolor'
- },
- {
- title: 'HScode',
- dataIndex: 'hsCode',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '中文品名',
- dataIndex: 'chineseName',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '英文品名',
- dataIndex: 'englishProductName',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '成衣工厂',
- dataIndex: 'garmentFactory',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '报关单价',
- dataIndex: 'customsDeclarationUnitPrice',
- width: 120,
- className: 'replacecolor'
- }
- ],
- data: [],
- confirmLoading: false,
- referShipDetModVis: false,
- // 查询条件
- queryParam: {
- documentNo: '',
- customer: '',
- pageNo: ''
- },
- // 分页
- pagination: {
- // total: 0,
- // current: 0,
- // pageSize: 0
- }
- }
- },
- // 接收父组件 方法
- // props: {
- // father: {
- // type: Function,
- // default: null
- // }
- // },
- created() {
- this.getShipData()
- },
- methods: {
- //参照发运明细数据
- getShipData() {
- this.$nextTick(() => {
- shipList(this.queryParam).then(res => {
- // console.log('参照订单数据res', res)
- if (res.success) {
- // 后台数据赋值给参照订单数据
- this.data = res.result.records
- // console.log('新增参照订单数据', this.data)
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size
- }
- }
- })
- })
- },
- // 弹框确定
- onSubmit() {
- if (this.selectedRowKeys.length == 0) {
- this.$message.error('请勾选参照发运明细')
- }
- if ((this.selectedRowKeys.length = 2 || this.selectedRowKeys.length > 1)) {
- alert('error')
- } else {
- // console.log('需要传给父组件的数据', this.selectedRows)
- // bao父组件指定的传数据绑定的函数 || this.selectedRows子组件给父组件传递的数据
- this.$emit('bao', this.selectedRows)
- this.referShipDetModVis = false
- this.selectedRowKeys = []
- this.selectedRows = []
- }
- },
- // 弹框查询按钮
- searchQuery() {
- this.queryParam.pageNo = ''
- this.getShipData()
- },
- // 重置
- searchReset() {
- this.queryParam.documentNo = ''
- this.queryParam.customer = ''
- this.getShipData()
- },
- close() {
- this.$emit('close')
- this.referShipDetModVis = false
- this.selectedRowKeys = []
- this.data = []
- this.getShipData()
- },
- handleCancel() {
- this.close()
- },
- // 选中行
- onSelectChange(keys, rows) {
- this.selectedRowKeys = keys
- this.selectedRows = rows
- if (this.selectedRows.length > 1) {
- // alert('error')
- // var newOne = keys.shift()
- // this.selectedRows = newOne
- // console.log('最新选择', this.selectedRows)
- // this.$error.message('只能参照一条发运明细')
- }
- },
- handleTableChange(pagination, filters, sorter) {
- this.queryParam.pageNo = pagination.current
- this.getShipData()
- }
- },
- computed: {
- // 选中项
- rowSelection() {
- return {
- onChange: (selectedRowKeys, selectedRows) => {
- console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
- },
- getCheckboxProps: record => ({
- props: {
- disabled: record.title === 'Disabled User',
- // Column configuration not to be checked
- title: record.title
- }
- })
- }
- }
- }
- }
- </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;
- // }
- </style>
|