1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183 |
- <template>
- <!-- 发运明细 列表 -->
- <div id="ShipmentList">
- <!-- 查询 回显 且 可编辑 -->
- <a-card :bordered="false">
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="25">
- <a-col :md="5" :sm="8">
- <a-form-item label="订单号">
- <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="8">
- <a-form-item label="款号">
- <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="5" :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="5" :sm="8">
- <a-form-item label="预发货日期">
- <a-range-picker
- :placeholder="['开始时间', '结束时间']"
- format="YYYY-MM-DD"
- style="width: 100%"
- v-model="preDeliveryDate"
- @change="deliveryDateChange"
- />
- </a-form-item>
- </a-col>
- <template v-if="toggleSearchStatus">
- <a-col :md="5" :sm="8">
- <a-form-item label="账套号">
- <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
- <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="5" :sm="8">
- <a-form-item label="业务员">
- <!-- <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input> -->
- <j-search-select-tag
- placeholder="请选择业务员"
- v-model="queryParam.salesman"
- dict="view_salesman,salesman,salesman">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
-
- <a-col :md="5" :sm="8">
- <a-form-item label="是否被参照">
- <a-select v-model="queryParam.refer">
- <a-select-option value="">请选择</a-select-option>
- <a-select-option value="0">否</a-select-option>
- <a-select-option value="1">是</a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="8">
- <a-form-item label="是否提交">
- <a-select v-model="queryParam.submitStatus">
- <a-select-option value="">请选择</a-select-option>
- <a-select-option value="0">否</a-select-option>
- <a-select-option value="1">是</a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :md="5" :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="5" :sm="8">
- <a-form-item label="起始时间">
- <a-range-picker
- style="width: 100%"
- v-model="timeRange"
- format="YYYY-MM-DD"
- :placeholder="['开始时间', '结束时间']"
- @change="onDateChange"
- @ok="onDateOk"
- />
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="8">
- <a-form-item label="供应商">
- <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
- <j-search-select-tag
- placeholder="请选择供应商"
- v-model="queryParam.supplier"
- dict="view_supplier,supplier,supplier">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="8">
- <a-form-item label="分销点">
- <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
- <j-search-select-tag
- placeholder="请选择分销点"
- v-model="queryParam.distributionPoint"
- dict="view_distributionpoint,distributionPoint,distributionPoint">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="8">
- <a-form-item label="客户简称">
- <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
- <j-search-select-tag
- placeholder="请选择客户简称"
- v-model="queryParam.customerAbbreviation"
- dict="view_customer,customername,customername">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
-
- <a-col :md="5" :sm="8">
- <a-form-model-item label="申报要素是否维护">
- <a-select v-model="queryParam.isElement">
- <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>
- </template>
- <a-col :md="4" :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.stop="addShipDet" icon="plus">新增</a-button> -->
- <a-button type="primary" @click.stop="referOrderDataOpen" icon="plus" >参照订单数据</a-button>
- <a-button type="primary" icon="download" @click="handleExportXls('出运成衣')" :disabled="exportButton == '1'">成衣导出-预装箱单</a-button>
- <a-button type="primary" icon="download" @click="handleExportXls('出运面辅料')" :disabled="exportButton1 == '1'">面辅料导出-装箱单</a-button>
- <a-button type="primary" icon="download" @click="exportXlsShipment('出运明细列表')">出运明细导出</a-button>
- <a-button type="primary" icon="check" @click="submit">批量提交</a-button>
- <a-button type="primary" icon="close" @click="cancelSubmit">批量取消提交</a-button>
- </div>
- <!-- 子表 :row-key="record => record.id" :pagination="ipagination-->
- <a-table
- v-if="shipmentListData"
- bordered
- ref="TableInfo"
- rowKey="itemIds"
- :columns="shipmentListColumns"
- :data-source="shipmentListData"
- :loading="loading"
- :pagination="false"
- :scroll="{ x: 1500 , y: 600}"
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
- @change="handleTableChange"
- >
- <!-- 推送状态 -->
- <span slot="pushState" slot-scope="text, record">
- <a-tag color="#2db7f5" v-if="record.pushState == '0'">未推送</a-tag>
- <a-tag color="#87d068" v-if="record.pushState == '1'">推送成功</a-tag>
- <a-tag color="#f50" v-if="record.pushState == '2'">推送失败</a-tag>
- </span>
- <!-- 单据状态 -->
- <span slot="state" slot-scope="text, record">
- <a-tag color="orange" v-if="record.submitStatus == '0'">已保存</a-tag>
- <a-tag color="green" v-if="record.submitStatus == '1'">已提交</a-tag>
- </span>
- <!-- 操作 默认按钮 未提交未推送-->
- <span slot="operationSlot" slot-scope="text, record">
- <a href="javascript:void(0);" @click="declareElements(record)" style="color:green" v-has="'cymx:sbys'">报关要素</a>
- <a-divider type="vertical" />
- <a href="javascript:void(0);" @click="itemNumberElement(record)" style="color:green">维护款号成分</a>
-
- <a-divider type="vertical" />
- <a-dropdown>
- <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
- <!-- 已保存 -->
- <a-menu slot="overlay" v-if="record.submitStatus == '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-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 arrowPointAtCenter title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
- <a href="javascript:void(0);" style="color:red;">删除</a>
- </a-popconfirm>
- </a-menu-item>
- <!-- <a-menu-item>
- <a href="javascript:void(0);" @click="itemNumberElement(record)">维护款号成分</a>
- </a-menu-item> -->
- </a-menu>
- <!-- 已提交 且 推送成功 -->
- <a-menu slot="overlay" v-if="record.pushState == '1' && record.submitStatus == '1'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- </a-menu>
- <!-- 已提交 且 推送失败 -->
- <a-menu slot="overlay" v-if="record.pushState == '2' && record.submitStatus == '1'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- <a-menu-item>
- <a-popconfirm title="确定重新推送吗?" ok-text="是" cancel-text="否" @confirm="rePush(record)">
- <a href="javascript:void(0);" style="color:green;">重新推送</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- <!-- 已提交 -->
- <a-menu slot="overlay" v-if="record.submitStatus == '1'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- <!-- <a-menu-item>
- <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
- <a href="javascript:void(0);" style="color:red;">取消提交</a>
- </a-popconfirm>
- </a-menu-item> -->
- <a-menu-item>
- <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
- <a href="javascript:void(0);" style="color:green;">推送</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- <!-- 未推送 -->
- <a-menu slot="overlay" v-if="record.pushState == '0'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- <a-menu-item>
- <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
- <a href="javascript:void(0);" style="color:green;">推送</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- </a-dropdown>
- </span>
- </a-table>
- <span >共勾选{{selectedNumber}}条数</span>
- </a-card>
- <!-- 抽屉 -->
- <div>
- <!-- <addShipDet-drawer ref="addShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk" @close="closeAdd"></addShipDet-drawer> -->
- <!-- 参照订单数据 -->
- <referOrderData-modal ref="referOrderDataModal" @close="closeAdd" ></referOrderData-modal>
- <editShipDet-drawer ref="editShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk" @close='closeAddEdit'></editShipDet-drawer>
- <detailsShipDet-drawer ref="detailsShipDetDrawer" @ok="modalFormOk"></detailsShipDet-drawer>
- <!-- 申报要素 弹框 -->
- <declareElements-modal ref="declareElementsModal" @table="getShipmentList" @close-declare="closeDeclare"></declareElements-modal>
- <!-- 维护款号成分 -->
- <itemNumEle-modal ref="itemNumEleModal" @close="judageAdd"></itemNumEle-modal>
- </div>
- </div>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import { downFile } from '@/api/manage'
- import addShipDetDrawer from '@views/shipment-details/addShipDetDrawer.vue'
- import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.vue'
- import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
- import declareElementsModal from '@views/shipment-details/declareElementsModal.vue'
- import ReferOrderDataModal from '@views/shipment-details/referOrderDataModal.vue'
- import itemNumEleModal from '@views/shipment-details/itemNumEleModal.vue'
- import { randomUUID } from '@/utils/util'
- import {
- shipmentList,
- deleteShipment,
- submitShipment,
- shipmentQueryById,
- queryByDetails,
- queryDeclarationElements,
- cancelSubmitShipment,
- pushShipment,
- rePushShipment,
- exportXls,
- listExportXls
- } from '@api/document/shipmentList'
- export default {
- name: 'ShipmentList', // 发运明细列表
- mixins: [JeecgListMixin],
- components: {
- JEllipsis,
- moment,
- addShipDetDrawer,
- detailsShipDetDrawer,
- editShipDetDrawer,
- declareElementsModal,
- ReferOrderDataModal,
- cancelSubmitShipment,
- pushShipment,
- rePushShipment,
- itemNumEleModal
- },
- data() {
- let ellipsis = (v,l) => <j-ellipsis value={v} length={l} />
- return {
- loading: false, // 表格加载
- exportButton: '1',
- exportButton1:'1',
- id: '',
- selectedNumber:0,//已选择条数
- monthStartDate:'',//本月1号
- nextMonthStartDate:'',//下月1号
- nextMonthEndDate:'',//下月最后一天
- shipmentListColumns: [
- {
- title: '账套',
- dataIndex: 'account',
- width: 85,
- fixed: 'left',
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.account - b.account,
- },
- {
- title: '销售订单号',
- dataIndex: 'orderNumber',
- // fixed: 'left',
- // customRender: t => ellipsis(t,17),
- width: 180,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.orderNumber - b.orderNumber,
- },
- {
- title: '款号',
- dataIndex: 'itemNumber',
- width: 130,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.itemNumber - b.itemNumber,
- },
- {
- title: '业务员',
- dataIndex: 'salesman',
- width: 100,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.salesman - b.salesman,
-
- },
- {
- title: '分销点',
- dataIndex: 'distributionPoint',
- width: 110,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.distributionPoint - b.distributionPoint,
- },
- {
- title: '小po',
- dataIndex: 'smallPo',
- width: 110,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.smallPo - b.smallPo,
- },
- {
- title: '存货名称',
- dataIndex: 'inventoryName',
- width: 220,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.inventoryName - b.inventoryName,
- },
- {
- title: '报关品名',
- dataIndex: 'declarationName',
- width: 110,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.declarationName - b.declarationName,
- },
- {
- title: '是否TC',
- dataIndex: 'isTc',
- width: 110,
- customRender: function(text) {
- if (text === '0') {
- return '否'
- }
- if (text === '1') {
- return '是'
- }
- },
- className: 'replacecolor',
- sorter:(a, b) => a.isTc - b.isTc,
- },
- {
- title: '预发货日期',
- dataIndex: 'preDeliveryDate',
- width: 120,
- customRender: text => {
- if (text == "" || text == null)
- return "";
- return moment(text).format('YYYY-MM-DD')
- },
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.preDeliveryDate - b.preDeliveryDate,
- },
- {
- title: '数量',
- dataIndex: 'shipmentQuantity',
- width: 80,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.shipmentQuantity - b.shipmentQuantity,
- },
- {
- title: '报关单价',
- dataIndex: 'customsDeclarationUnitPrice',
- width: 80,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.customsDeclarationUnitPrice - b.customsDeclarationUnitPrice,
- },
- {
- title: '成衣工厂',
- dataIndex: 'garmentFactory',
- width: 100,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.garmentFactory - b.garmentFactory,
- },
- {
- title: 'HScode',
- dataIndex: 'hsCode',
- width: 120,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.hsCode - b.hsCode,
- },
- {
- title: '英文品名',
- dataIndex: 'englishProductName',
- width: 110,
- className: 'replacecolor',
- // customRender: t => ellipsis(t),
- ellipsis: true,
- sorter:(a, b) => a.englishProductName - b.englishProductName,
- },
- {
- title: '物料成分',
- dataIndex: 'materialComposition',
- width: 180,
- ellipsis: true,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.materialComposition - b.materialComposition,
- },
- {
- title: '采购/委外订单号',
- dataIndex: 'purOrSubOrder',
- width: 140,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.purOrSubOrder - b.purOrSubOrder,
- },
- {
- // (存货自定义项)
- title: '套装件数',
- dataIndex: 'numberOfSets',
- width: 90,
- className: 'replacecolor',
- ellipsis: true,
- sorter:(a, b) => a.numberOfSets - b.numberOfSets,
- },
- {
- title: 'pack id',
- dataIndex: 'packId',
- width: 110,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.packId - b.packId,
- },
- {
- title: '客户简称',
- dataIndex: 'customerAbbreviation',
- width: 100,
- align: 'left',
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.customerAbbreviation - b.customerAbbreviation,
- },
- {
- title: '部门',
- dataIndex: 'salesDepartment',
- width: 100,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.salesDepartment - b.salesDepartment,
- },
- {
- title: '单据号',
- dataIndex: 'documentNo',
- // fixed: 'left',
- align: 'left',
- width: 140,
- ellipsis: true,
- className: 'replacecolor',
- sorter:(a, b) => a.documentNo - b.documentNo,
- },
-
- {
- title: '推送结果',
- dataIndex: 'pushState',
- scopedSlots: { customRender: 'pushState' },
- fixed: 'right',
- width: 110,
- className: 'replacecolor',
- sorter:(a, b) => a.pushState - b.pushState,
- },
- {
- title: '单据状态',
- dataIndex: 'submitStatus',
- scopedSlots: { customRender: 'state' },
- fixed: 'right',
- width: 110,
- className: 'replacecolor',
- sorter:(a, b) => a.submitStatus - b.submitStatus,
- },
- {
- title: '操作',
- dataIndex: 'operation',
- scopedSlots: { customRender: 'operationSlot' },
- fixed: 'right',
- width: 250,
- className: 'replacecolor',
- }
- ],
- shipmentListData: [], // 发运明细数据
- // 查询条件
- queryParam: {
- flourOrGarment:'1'
- },
- selectedRowKeys:[],
- selectedRows:[],
- timeRange:[],//起始时间
- preDeliveryDate:[],//预发货日期
- returnId:'',//新增后返回的id筛选条件
- returnFlourOrGarment:'',//新增后返回类型条件
- pagination: {
- // total: '',
- // current: 0,
- // pageSize: 0
- },
- dateFormat: 'YYYY-MM-DD',
-
- }
- },
- created() {
- // this.getShipmentList() // 渲染 发运明细列表
- // this.defalutDate()
- },
- mounted(){
- },
- watch:{
- selectedRowKeys(newVal){
- this.selectedNumber =newVal.length
- }
- },
- methods: {
- moment,
- //默认预发货日期
- defalutDate(){
- var now = new Date(); //当前日期
- var nowMonth = now.getMonth(); //当前月
- var nextMonth = nowMonth+1; //下个月
- var nowYear = now.getFullYear(); //当前年
- this.monthStartDate = moment(new Date(nowYear, nowMonth, 1)).format('YYYY-MM-DD');
- this.nextMonthStartDate = moment(new Date(nowYear, nextMonth, 1)).format('YYYY-MM-DD');
- if([1, 3, 5, 7, 8, 10, 12].indexOf(nextMonth+1) > -1){
- this.nextMonthEndDate = moment(new Date(nowYear, nextMonth, 31)).format('YYYY-MM-DD');
- }else {
- this.nextMonthEndDate = moment(new Date(nowYear, nextMonth, 30)).format('YYYY-MM-DD');
- }
- this.preDeliveryDate.push(this.nextMonthStartDate,this.nextMonthEndDate)
- this.queryParam.preDeliveryDateB = this.nextMonthStartDate
- this.queryParam.preDeliveryDateE = this.nextMonthEndDate
- },
- // 分页查询 发运明细
- async getShipmentList() {
- this.loading = true
- await shipmentList(this.queryParam).then(res => {
- if (res.success) {
- this.loading = false
- if(this.queryParam.flourOrGarment == '1'){
- this.exportButton ='0'
- this.exportButton1 = '1'
- }else {
- this.exportButton ='1'
- this.exportButton1 = '0'
- }
- this.shipmentListData = res.result.records
- for (var i=0; i<this.shipmentListData.length; i++){
- this.shipmentListData.randomId = randomUUID();
- }
-
- this.selectedRowKeys = []
- // this.pagination = {
- // total: res.result.total,
- // current: res.result.current,
- // pageSize: res.result.size
- // }
- }else {
- this.$message.error(res.message)
- this.loading = false
- }
- })
- },
- //关闭申报要素弹窗
- async closeDeclare(){
- //判断是否是新增的数据
- await this.judageAdd()
- var cc = []
- this.shipmentListData.map(item =>{
- this.selectedRows.map(item1 =>{
- if(item.itemIds == item1.itemIds){
- cc.push(item)
- }
- })
- })
- this.selectedRows = cc
- cc.map(item => this.selectedRowKeys.push(item.itemIds))
- },
- // // 新增
- // addShipDet() {
- // this.$refs.addShipDetDrawer.syShippingDetailsItemList = [];
- // this.$refs.addShipDetDrawer.visible = true
- // },
- //参照订单数据
- referOrderDataOpen(){
- this.$refs.referOrderDataModal.referOrderDataModVis = true
- this.$refs.referOrderDataModal.range.push(this.monthStartDate)
- this.$refs.referOrderDataModal.queryParam.preDeliveryDateS = this.monthStartDate;
- this.$refs.referOrderDataModal.queryParam.preDeliveryDateE = '';
- },
- // 申报要素
- declareElements(record) {
- if (record.inventoryName == ""){
- this.$message.error('当前行存货名称为空,无法维护报关要素');
- }else{
- this.$refs.declareElementsModal.declareElementsModVis = true
- queryDeclarationElements({
- id: record.elementsId,
- syShippingids:record.itemIds
- }).then(res => {
- if (res.success) {
- // console.log('申报要素子表数据', res.result.syDeclarationElementsItemList)
- res.result['itemIds'] = record.itemIds;
- this.$refs.declareElementsModal.declareElements = res.result
- this.$refs.declareElementsModal.flourOrGarment = this.queryParam.flourOrGarment
- this.$refs.declareElementsModal.orderNumber = record.orderNumber
- if(!res.result.hsCode || res.result.hsCode == ''){
- this.$refs.declareElementsModal.query = '0'
- }else{
- this.$refs.declareElementsModal.query = '1'
- }
-
- // 子表赋值
- this.$refs.declareElementsModal.declareElementsData = res.result.syDeclarationElementsItemList
- if(record.pushState == '1' && record.submitStatus == '1'){
- this.$refs.declareElementsModal.pushState = true
- }
- }
- })
- }
- },
- // 维护款号成分
- itemNumberElement(record) {
- this.$refs.itemNumEleModal.itemNumEleModVis = true
- this.$refs.itemNumEleModal.editItemNumber.itemIds = record.itemIds
- this.$refs.itemNumEleModal.editItemNumber.itemNumber = record.itemNumber
-
- this.$refs.itemNumEleModal.editItemNumber.materialComposition = record.materialComposition
- this.$refs.itemNumEleModal.editItemNumber.isTc = record.isTc
- if(record.materialComposition == '' || !record.materialComposition){
- var ccode = record.inventoryCcode.substring(0,2);
-
- if(ccode =='19'){ //如果是成衣取规格型号,否则取物料名称
- this.$refs.itemNumEleModal.editItemNumber.materialComposition = record.specificationAndModel
- }else{
- var split = record.inventoryName.split(" ");
- this.$refs.itemNumEleModal.editItemNumber.materialComposition = split[0];
- }
- }
- },
- //判断是否是新增的数据-刷新数据
- async judageAdd(){
- await this.getShipmentList()
- // if(!this.queryParam.flourOrGarment || this.queryParam.flourOrGarment == ''){
- // // this.queryParam ={}
- // this.queryParam.id = this.returnId
- // this.queryParam.flourOrGarment =this.returnFlourOrGarment
- // await this.getShipmentList()
- // // this.queryParam = {}
- // // this.defalutDate()
- // }else{
- // await this.getShipmentList()
- // }
- },
-
- // 导出
- handleExportXls(fileName) {
- if(!this.queryParam.flourOrGarment || this.queryParam.flourOrGarment == ''){
- this.queryParam ={}
- this.queryParam.id = this.returnId
- this.queryParam.flourOrGarment =this.returnFlourOrGarment
- }
- var obj ={}
- if(this.selectedRowKeys.length==this.shipmentListData.length){
- obj = this.queryParam
- obj.selectAll = '1'
- }else{
- var grouyIdList=[]
- this.shipmentListData.map(item=>{
- this.selectedRowKeys.map(e=>{
- if(item.itemIds == e){
- grouyIdList.push(item.groupId)
- }
- })
- })
- obj.groupidList = grouyIdList.toString()
- obj.selectAll = '0'
- obj.flourOrGarment =this.queryParam.flourOrGarment
- }
- exportXls(obj).then(res =>{
- if(res.success==false){
- this.$message.error(res.message)
- }else{
- downFile('/shippingDetails/syShippingDetails/exportXls',obj).then(data => {
- // this.queryParam = {}
- // this.defalutDate()
- if (!data) {
- this.$message.warning('文件下载失败')
- return
- }
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.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', fileName + '.xlsx')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link) // 下载完成移除元素
- window.URL.revokeObjectURL(url) // 释放掉blob对象
- }
- })
- }
- })
-
- },
- //明细导出
- exportXlsShipment(fileName){
- var obj ={}
- if(this.selectedRowKeys.length==this.shipmentListData.length){
- obj = this.queryParam
- obj.selectAll = '1'
- }else{
- var grouyIdList=[]
- this.shipmentListData.map(item=>{
- this.selectedRowKeys.map(e=>{
- if(item.itemIds == e){
- grouyIdList.push(item.groupId)
- }
- })
- })
- obj.groupidList = grouyIdList.toString()
- obj.selectAll = '0'
- obj.flourOrGarment =this.queryParam.flourOrGarment
- }
- listExportXls(obj).then(res =>{
- if(res.success==false){
- this.$message.error(res.message)
- }else{
- downFile('/shippingDetails/syShippingDetails/exportXlsShipping',obj).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' }), fileName + '.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', fileName + '.xlsx')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link) // 下载完成移除元素
- window.URL.revokeObjectURL(url) // 释放掉blob对象
- }
- })
- }
- })
- },
- // 编辑
- edit(record) {
- this.$refs.editShipDetDrawer.visible = true
- queryByDetails({ id: record.id,itemIds: record.itemIds }).then(res => {
- if (res.success) {
- // console.log('编辑对象', res.result)
- this.$refs.editShipDetDrawer.editShipDet = res.result
- res.result.syShippingDetailsItemList.map(item =>{
- item.manualYarnFlag = res.result.syShippingDetailsItemList[0].mjudageAddanualYarnFlag
- item.customsDeclarationUnitPrice = item.salesUnitPrice - item.ymoney
- if(item.manualYarnFlag === 0){
- item.manualYarnUnitPrice = null
- item.manualYarnProportion = null
- this.$refs.editShipDetDrawer.manualYarnDisabled = true
- this.$forceUpdate()
- }else {
- this.$refs.editShipDetDrawer.manualYarnDisabled = false
- }
- })
- this.$refs.editShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
- this.$refs.editShipDetDrawer.readyFabric = this.queryParam.flourOrGarment
- }
- })
- },
- // 详情
- details(record) {
- this.$refs.detailsShipDetDrawer.visible = true
- queryByDetails({ id: record.id,itemIds: record.itemIds}).then(res => {
- if (res.success) {
- console.log('点击的对象', res.result)
- // 把通过id查询到的对象,赋值给子组件
- this.$refs.detailsShipDetDrawer.detailsShipDet = res.result
- this.$refs.detailsShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
- }
- })
- },
- // 提交
- submit() {
- this.$nextTick(() => {
- // for(var i =0;i<this.selectedRows.length;i++){
- // var selectRow = this.selectedRows[i]
- // if(selectRow.elementsId===''||!selectRow.elementsId){
- // this.$message.error('勾选的第'+(i+1)+'行数据报关要素未填写,不可提交!')
- // return
- // }
- // }
- var grouyIdList = []
- this.shipmentListData.map(item =>{
- this.selectedRowKeys.map(e=>{
- if(item.itemIds == e){
- grouyIdList.push(item.groupId)
- }
- })
- })
- submitShipment({ submitListId: this.selectedRowKeys, type: '1' ,grouyIdList:grouyIdList}).then(res => {
- if (res.success) {
- console.log('提交成功,单据状态改为【已提交】')
- this.shipmentListData.submitStatus = '1'
- this.selectedRowKeys =[]
- this.judageAdd()
- // 渲染 发运明细列表
- this.$message.success('提交成功')
- }else {
- this.judageAdd()
- this.$message.error(res.message)
- }
- })
- })
- },
- // 取消提交
- cancelSubmit(record) {
- console.log('取消订单id:', record.id)
- this.$nextTick(() => {
- cancelSubmitShipment({ submitListId: this.selectedRowKeys, type: '2' }).then(res => {
- if (res.success) {
- console.log('取消提交成功,单据状态改为【仅保存】')
- this.shipmentListData.submitStatus = '0'
- this.selectedRowKeys = []
- this.judageAdd()
- this.$message.success('取消提交成功')
- }else {
- this.$message.error(res.message)
- }
- })
- })
- },
- // 推送
- push(record) {
- console.log('推送id:', record.id)
- this.$nextTick(() => {
- if(this.queryParam.flourOrGarment == '1'){
- this.$message.error("成衣不可推送!")
- }else {
- pushShipment({ id: record.id }).then(res => {
- if (res.success) {
- console.log('推送成功,推送状态【推送成功】')
- this.shipmentListData.pushState = '1'
- this.judageAdd()
- this.$message.success('推送成功')
- }else {
- this.$message.error(res.message)
- }
- })
- }
-
- })
- },
- // 重新推送
- rePush(record) {
- console.log('重新推送record:', record)
- this.$nextTick(() => {
- if(this.queryParam.flourOrGarment == '1'){
- this.$message.error("成衣不可推送!")
- }else {
- rePushShipment({ id: record.id }).then(res => {
- if (res.success) {
- console.log('重新推送成功,推送状态【推送成功】')
- this.shipmentListData.pushState = '1'
- this.judageAdd()
- this.$message.success('重新推送成功')
- }else {
- this.$message.error(res.message)
- }
- })
- }
-
- })
- },
- // 删除
- handleDelete(record) {
- console.log('点击删除项id:', record.id)
- this.$nextTick(() => {
- deleteShipment({ id: record.id,itemIds: record.itemIds }).then(res => {
- console.log('res:', res)
- this.judageAdd() // 渲染 发运明细列表
- this.$message.success('删除成功')
- })
- })
- },
- onDateChange(value, dateString) {
- console.log('查询开始时间', dateString[0], '查询结束时间', dateString[1])
- this.queryParam.startTime = dateString[0]
- this.queryParam.endTime = dateString[1]
- },
- onDateOk(value) {
- console.log('value', value)
- },
- deliveryDateChange(value, dateString) {
- console.log('预发货日期', dateString)
- this.queryParam.preDeliveryDateB = dateString[0]
- this.queryParam.preDeliveryDateE = dateString[1]
- },
- searchQuery() {
- this.toggleSearchStatus = false
- if(this.queryParam.flourOrGarment === '' || !this.queryParam.hasOwnProperty('flourOrGarment')){
- this.$message.error('请选择查询类型!');
- }else if(this.queryParam.flourOrGarment == '1' &&
- ((this.queryParam.itemNumber==''||!this.queryParam.itemNumber)&&
- (this.queryParam.orderNumber==''||!this.queryParam.orderNumber)&&
- (this.queryParam.salesman==''||!this.queryParam.salesman)&&
- (this.queryParam.supplier==''||!this.queryParam.supplier)&&
- (this.queryParam.customerAbbreviation==''||!this.queryParam.customerAbbreviation)&&
- this.preDeliveryDate.length == 0
- )){
- this.$message.error('款号/订单号/预发货日期/业务员/供应商/客户均未选择!');
- }else{
- if(this.preDeliveryDate.length ==2){
- var separator = "-"; //日期分隔符
- var startDates = this.queryParam.preDeliveryDateB.split(separator);
- var endDates = this.queryParam.preDeliveryDateE.split(separator);
- var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);
- var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);
- var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
- if(timeInterval > 60){
- this.$message.error('预发货时间区间超过60天,请重新选择!');
- }else {
- this.queryParam.id = ''
- this.getShipmentList()
-
- }
- }else{
- this.queryParam.id = ''
- this.getShipmentList()
- }
-
- }
- },
- searchReset() {
- this.queryParam = {
- flourOrGarment:'1'
- }
- this.timeRange = []
- this.preDeliveryDate = []
- // this.defalutDate()
- this.selectedRows = []
- this.selectedRowKeys = []
- this.shipmentListData = [] // 渲染 发运明细列表
- },
- //选中行
- onSelectChange(keys,rows){
- this.selectedRowKeys = keys;
- this.selectedRows = rows;
- },
- // 分页变化时触发
- handleTableChange(pagination, filters, sorter) {
- this.queryParam.pageNo = pagination.current
- this.getShipmentList()
- },
- //关闭新增弹窗
- async closeAdd(data,id,range){
- this.queryParam ={}
- this.queryParam.flourOrGarment = data
- this.queryParam.id = id
- this.preDeliveryDate=range
- this.queryParam.preDeliveryDateB =(this.preDeliveryDate[0]&&this.preDeliveryDate[0]!=='')? this.preDeliveryDate[0].format('YYYY-MM-DD'):'';
- this.queryParam.preDeliveryDateE =(this.preDeliveryDate[1]&&this.preDeliveryDate[1]!=='')? this.preDeliveryDate[1].format('YYYY-MM-DD'):'';
- //其他地方使用
- this.returnId = id
- this.returnFlourOrGarment = data
- await this.getShipmentList()
- // this.queryParam = {}
- // this.defalutDate()
- },
- async closeAddEdit(){
- this.judageAdd()
- }
- }
- }
- </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-form-item {
- // // margin-bottom: 0 !important;
- // }
- /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
- }
- </style>
|