123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576 |
- <template>
- <a-modal
- title="参照订单数据"
- v-model="referOrderDataModVis"
- :confirmLoading="confirmLoading"
- @ok="onSubmit"
- @cancel="handleCancel"
- width="90%"
- >
- <!-- tabel 加载 -->
- <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.orderNumber"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="账套">
- <j-search-select-tag
- placeholder="请选择账套"
- v-model="queryParam.account"
- 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.salesman"></a-input>
- </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.customerName"
- dict="view_customer,customerfullname,customerfullname">
- </j-search-select-tag>
- </a-form-item>
-
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="订单日期">
- <a-range-picker
- style="width: 100%"
- :mode="dataRangeMode"
- :placeholder="['开始日期', '结束日期']"
- :value="dateRange"
- format = "YYYY-MM-DD"
- @change="dateRangeSelectChange"
- />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="类型">
- <a-select v-model="queryParam.flourOrGarment">
- <a-select-option value="">请选择</a-select-option>
- <a-select-option value="1">成衣</a-select-option>
- <a-select-option value="0">面辅料</a-select-option>
- </a-select>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="预发货日期">
- <a-date-picker
- placeholder="请选择预发货日期"
- format="YYYY-MM-DD"
- style="width:100%;"
- v-model="queryParam.preDeliveryDate"
- />
- </a-form-model-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>
- <!-- 勾选表 :row-key="record => record.id" { pageSize: 50 } , y: 800 -->
- <a-table
- bordered
- size="small"
- rowKey="id"
- v-if="orderListData"
- :columns="referOerderColumns"
- :data-source="orderListData"
- :loading="loading"
- :pagination="pagination"
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
- @change="handleTableChange"
- :scroll="{ x: 1500, y:450 }"
- >
- </a-table>
- </a-spin>
- </a-modal>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import { randomUUID } from '@/utils/util'
- import { queryOrderData, confimOrderData } from '@api/document/shipmentList'
- export default {
- name: 'ReferOrderDataModal', // 参照订单数据弹框
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment },
- data() {
- let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
- return {
- selectedRowKeys: [],
- selectedRows: {}, // 勾选项
- loading: false, // 表格加载
- // 表头
- referOerderColumns: [
- {
- title: '订单号',
- dataIndex: 'orderNumber',
- width: 180,
- fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '款号',
- dataIndex: 'itemNumber',
- width: 150,
- fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '小po',
- dataIndex: 'smallPo',
- width: 100,
- className: 'replacecolor'
- },
- // 账套替换
- {
- title: '账套',
- dataIndex: 'account',
- width: 80,
- className: 'replacecolor'
- },
- {
- title: '预发货日期',
- dataIndex: 'preDeliveryDate',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '预完工日期',
- dataIndex: 'preCompletionDate',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: 'packId',
- dataIndex: 'packId',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '分销点',
- dataIndex: 'distributionPoint',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '存货编码',
- dataIndex: 'inventoryCode',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '存货名称',
- dataIndex: 'inventoryName',
- customRender: t => ellipsis(t),
- width: 250,
- className: 'replacecolor'
- },
- {
- title: '颜色',
- dataIndex: 'colour',
- width: 160,
- customRender: t => ellipsis(t),
- className: 'replacecolor'
- },
- // {
- // title: '尺码',
- // dataIndex: 'size',
- // width: 100,
- // className: 'replacecolor'
- // },
- {
- title: '配码规格',
- dataIndex: 'codingRules',
- width: 180,
- className: 'replacecolor'
- },
- {
- title: '箱数',
- dataIndex: 'boxNumber',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '数量',
- dataIndex: 'quantity',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '订单剩余数量',
- dataIndex: 'surplusNum',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '含税单价',
- dataIndex: 'unitPriceIncludingTax',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '成衣工厂',
- dataIndex: 'garmentFactory',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '成衣件数',
- dataIndex: 'garmentNmb',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '业务类型',
- dataIndex: 'businessTypeText',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '客户订单',
- dataIndex: 'customerOrderNumber',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '销售类型',
- dataIndex: 'salesTypeText',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '客户简称',
- dataIndex: 'customerAbbreviation',
- width: 220,
- align: 'left',
- className: 'replacecolor'
- },
- {
- title: '客户名称',
- dataIndex: 'customerName',
- customRender: t => ellipsis(t),
- width: 220,
- className: 'replacecolor'
- },
- {
- title: '供应商编码',
- dataIndex: 'supplierCode',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '供应商',
- dataIndex: 'supplier',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '汇率',
- dataIndex: 'exchangeRate',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '整单合计',
- dataIndex: 'wholeOrderTotal',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '销售部门',
- dataIndex: 'salesDepartment',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '业务员',
- dataIndex: 'salesman',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '币种',
- dataIndex: 'currencyText',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '品牌方',
- dataIndex: 'brandSide',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '第三方',
- dataIndex: 'thirdParty',
- width: 220,
- align: 'left',
- className: 'replacecolor'
- },
- {
- title: '定金比例(%)',
- dataIndex: 'depositRatio',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '定金',
- dataIndex: 'deposit',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '协同路线',
- dataIndex: 'collaborativeRoute',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '付款条件',
- dataIndex: 'termOfPayment',
- width: 120,
- customRender: t => ellipsis(t),
- className: 'replacecolor'
- },
- {
- title: '最终客户',
- dataIndex: 'endCustomer',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '订单备注',
- dataIndex: 'orderRemarks',
- width: 280,
- customRender: t => ellipsis(t),
- className: 'replacecolor'
- },
- {
- title: '价格备注',
- dataIndex: 'priceRemarks',
- width: 280,
- customRender: t => ellipsis(t),
- className: 'replacecolor'
- },
- {
- title: '订单变更说明',
- dataIndex: 'orderChangeDescription',
- width: 220,
- customRender: t => ellipsis(t),
- className: 'replacecolor'
- },
- {
- title: '订单日期',
- dataIndex: 'orderDate',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '订单主表ID',
- dataIndex: 'syOrderDataId',
- width: 120,
- // fixed: 'right',
- className: 'replacecolor1'
- },
- {
- title: '订单子表ID',
- dataIndex: 'syOrderDataItemId',
- width: 450,
- // fixed: 'right',
- className: 'replacecolor'
- }
- ],
- orderListData: [], //订单数据
- confirmLoading: false,
- referOrderDataModVis: false,
- // 查询条件
- queryParam: {
- orderNumber: '', // 订单号
- account: '', //账套
- pageSize:100,
- preDeliveryDate:'', //预发货日期
- flourOrGarment:'', //类型
- // pageNo: '', // 初始页
- // pageSize: '-1' // 每页显示条数
- },
- // 分页
- pagination: {},
- confimList: [], //勾选的订单数组
- propList: [], //需要给新增页的数据
- dateRange:[],
- dataRangeMode:['date','date'],
- }
- },
- // 接收父组件 方法
- // props: {},
- created() {
- this.getOrderList()
- },
- methods: {
- // 参照订单数据 查询
- getOrderList() {
- this.confirmLoading = true;
- if (this.queryParam.preDeliveryDate != ""){
- this.queryParam.preDeliveryDate = this.queryParam.preDeliveryDate.format('YYYY-MM-DD');
- }
- this.$nextTick(() => {
- queryOrderData(this.queryParam).then(res => {
- this.confirmLoading = false;
- if (res.success) {
- for (var i=0; i<res.result.records.length;i++){
- res.result.records[i].id = randomUUID();
- }
- this.orderListData = res.result.records
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size
- }
- }
- })
- })
- },
- // 弹框确定
- onSubmit() {
- this.confimList = [];
- if (this.selectedRowKeys.length == 0) {
- this.$message.error('请勾选订单数据')
- } else {
- this.selectedRows.forEach(item => {
- this.confimList.push(item.syOrderDataItemId);
- })
- confimOrderData(this.confimList).then(res => {
- if (res.success) {
- this.propList = res.result;
- this.$emit('bao', this.propList);
- }
- })
- this.referOrderDataModVis = false;
- this.selectedRowKeys = [];
- this.selectedRows = [];
- this.searchReset();
- }
- },
- handleTableChange(pagination, filters, sorter) {
- this.queryParam.pageNo = pagination.current;
- this.getOrderList();
- },
- searchQuery() {
- this.queryParam.pageNo = '';
- this.getOrderList();
- },
- // 重置
- searchReset() {
- this.queryParam.orderNumber = '';
- this.queryParam.account = '';
- this.queryParam.salesman = '';
- this.queryParam.customerName = '';
- this.dateRange = [];
- this.queryParam.flourOrGarment = '';
- this.queryParam.preDeliveryDate = '';
- this.getOrderList();
- this.selectedRowKeys = [];
- this.selectedRows = [];
- },
- // 选中行
- onSelectChange(keys, rows) {
- this.selectedRowKeys = keys;
- this.selectedRows = rows;
- },
- close() {
- this.$emit('close')
- this.referOrderDataModVis = false;
- this.selectedRowKeys = [];
- this.orderListData = [];
- this.searchReset();
- },
- handleCancel() {
- this.close();
- },
- // 时间发生变化的回调,发生在用户选择时间时
- dateRangeSelectChange(value) {
- this.dateRange = value;
- if (value.length == 0){
- this.queryParam.startDeliveryDate = "";
- this.queryParam.endDeliveryDate = "";
- }else{
- this.queryParam.startDeliveryDate = value[0].format('YYYY-MM-DD');
- this.queryParam.endDeliveryDate = value[1].format('YYYY-MM-DD');
- }
- },
- },
- 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';
- /deep/ .ant-table-thead > tr > th {
- text-align: center;
- // font-weight: 700;
- }
- /deep/ .ant-table-tbody {
- text-align: center;
- }
- // /deep/ th.replacecolor1 {
- // display: none;
- // }
- </style>
|