1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168 |
- <template>
- <!-- 预装箱单-成衣 列表-->
- <div id="adPaListClothes">
- <!-- 查询 -->
- <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.documentNo"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <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="款号">
- <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
- </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.distributionPoint"></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>
-
- <template v-if="toggleSearchStatus">
- <!-- <a-col :md="6" :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-model-item label="是否被参照">
- <a-select v-model="queryParam.isReference">
- <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-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.garmentFactory"></a-input> -->
- <j-search-select-tag
- placeholder="请选择成衣工厂"
- v-model="queryParam.garmentFactory"
- dict="view_garmentfactory,garmentfactory,garmentfactory">
- </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="rangeMode"
- :placeholder="['开始日期', '结束日期']"
- :value="range"
- format = "YYYY-MM-DD"
- @change="rangeSelectChange"
- />
- </a-form-item>
-
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="导入时间">
- <a-date-picker placeholder="请选择导入时间" v-model="queryParam.createTime" format="YYYY-MM-DD" @change="createTimeChange"></a-date-picker>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="制单人">
- <a-input placeholder="请输入制单人" v-model="queryParam.createBy"></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>
- <a-col :md="6" :sm="8">
- <a-form-item label="客户简称">
- <j-search-select-tag
- placeholder="请选择客户简称"
- v-model="queryParam.customerAbbreviation"
- dict="view_customer,customername,customername">
- </j-search-select-tag>
- <!-- <a-input placeholder="请输入客户简称" v-model="queryParam.customerAbbreviation"></a-input> -->
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="是否提交">
- <a-select v-model="queryParam.status">
- <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>
- </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="margin:10px 0">
- <div class="table-operator">
- <a-button type="primary" @click="addAdpacking" icon="plus">新增</a-button>
- <a-button type="primary" icon="download" @click="handleExportXls1('预装箱单-成衣','0')">预装箱单成衣导出</a-button>
- <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣','1')">预装箱单成衣导出-装箱单</a-button>
- <a-button type="primary" icon="download" @click="handleExportXls2('预装箱单列表')">预装箱单列表导出</a-button>
- <a-upload productName="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel" :customRequest="uploadFlie">
- <a-button type="primary" icon="import">导入-来源出运明细</a-button>
- </a-upload>
- <a-button type="primary" @click="batchSubmit" icon="check">批量提交</a-button>
- <a-button type="primary" @click="batchCanelSubmit" icon="close">批量取消提交</a-button>
- <a-button type="primary" @click="batchPush" icon="export">批量推送</a-button>
- <a-button type="primary" @click="majorityDelet" icon="export">批量删除</a-button>
- </div>
- <!-- table rowKey="id" -->
- <a-table
- bordered
- :columns="adPaListClothesColumns"
- :data-source="adPaListClothesData"
- :loading="loading"
- :pagination="pagination"
- :row-key="record => record.id"
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,fixed:true }"
- @change="handleTableChange"
- :scroll="{ x: 1500 , y: 600}"
- >
- <!-- 推送状态 -->
- <span slot="pushStatesSlot" slot-scope="text, record" :title="record.memo">
- <a-tag color="#2db7f5" v-if="record.pushStatus == '0' || record.pushStatus == null ">未推送</a-tag>
- <a-tag color="#87d068" v-if="record.pushStatus == '1'">推送成功</a-tag>
- <a-tag color="#f50" v-if="record.pushStatus == '2'">推送失败</a-tag>
- </span>
- <!-- 单据状态 -->
- <span slot="statusSlot" slot-scope="text, record">
- <a-tag color="orange" v-if="record.status == 0 || record.status == null">未提交</a-tag>
- <a-tag color="green" v-if="record.status == 1">已提交</a-tag>
- </span>
- <!-- 操作 默认按钮 未提交未推送-->
- <span slot="operationSlot" slot-scope="text, record">
- <a href="javascript:void(0);" @click="itemXls(record,'0')" 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.status == '0' || record.status == null">
- <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 href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</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.pushStatus == '1' && record.status == '1'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- <!-- <a-menu-item>
- <a href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</a>
- </a-menu-item> -->
- </a-menu>
- <!-- 已提交 且 推送失败 -->
- <a-menu slot="overlay" v-if="record.pushStatus == '2' && record.status == '1'">
- <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-item>
- <a href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</a>
- </a-menu-item> -->
- </a-menu>
- <!-- 已提交 -->
- <a-menu slot="overlay" v-if="record.status == '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 href="javascript:void(0);" @click="itemXls(record,'1')" >成衣模版导出</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-menu slot="overlay" v-if="record.pushStatus == '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-item>
- <a href="javascript:void(0);" @click="itemXls(record,'1')">成衣模版导出</a>
- </a-menu-item> -->
- </a-menu>
- </a-dropdown>
- </span>
- </a-table>
- <span style="position: absolute;bottom: 4%;">共勾选{{selectedNumber}}条数</span>
- </a-card>
- <!-- 抽屉 -->
- <div>
- <addAdpacking-drawer
- ref="addAdpackingDrawer"
- :fatherList="getadPaListClothes"
- @ok="modalFormOk"
- @hand-submit="submit"
- ></addAdpacking-drawer>
- <detailsAdpacking-drawer ref="detailsAdpackingDrawer" @ok="modalFormOk"></detailsAdpacking-drawer>
- </div>
- <!-- 导入确认框 -->
- <div>
- <a-modal :visible="visible" title="是否继续导入" @ok="handleOk" @cancel="handleCancel">
- <template #footer>
- <a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
- <a-button type="primary" @click="handleOk" :disabled="handleOkButton">确定</a-button>
- </template>
- <ul>
- <li v-for="(item,index) in message" :key="index">{{item}}</li>
- </ul>
- </a-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 addAdpackingDrawer from '@views/advance-packingList/addAdpackingDrawer.vue'
- import detailsAdpackingDrawer from '@views/advance-packingList/detailsAdpackingDrawer.vue'
- import { getadPaList, itemByMainId, submit, cancelSubmit, deleteAdPaList,batchSubmit,deleteBatch,batchPush,push,batchCanelSubmit,exportList,fileDetail,upload} from '@api/document/advance-packingList.js'
- export default {
- productName: 'AdPaListClothes', // 预装箱单-成衣
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment, addAdpackingDrawer, detailsAdpackingDrawer },
- data() {
- let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
- return {
- loading: false, // 表格加载
- id: '',
- range:[],//预发货日期数组
- rangeMode:['date','date'],
- timeRange:'',
- selectedNumber:0,//已选择条数
- handleOkButton:false,
- // 表头
- adPaListClothesColumns: [
- {
- title: '订单号',
- dataIndex: 'orderNumber',
- width: 150,
- ellipsis: true,
- // fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '款号',
- dataIndex: 'itemNumber',
- width: 120,
- ellipsis: true,
- // fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '客户(简称)',
- dataIndex: 'customerAbbreviation',
- width: 100,
- ellipsis: true,
- // fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '预发货日期',
- dataIndex: 'preDeliveryDate',
- width: 120,
- ellipsis: true,
- customRender: text => {
- return moment(text).format('YYYY-MM-DD')
- },
- className: 'replacecolor'
- },
- {
- title: '小po',
- dataIndex: 'smallPo',
- width: 110,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '分销点',
- dataIndex: 'distributionPoint',
- width: 110,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '存货名称',
- dataIndex: 'inventoryName',
- width: 220,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '颜色',
- dataIndex: 'colour',
- width: 110,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '成衣工厂',
- dataIndex: 'garmentFactory',
- width: 100,
- ellipsis: true,
- className: 'replacecolor'
- },
-
- // {
- // title: '订单类型',
- // dataIndex: 'orderType',
- // width: 100,
- // ellipsis: true,
- // className: 'replacecolor'
- // },
- // {
- // title: '工厂单价',
- // dataIndex: 'factoryUnitPrice',
- // width: 100,
- // ellipsis: true,
- // className: 'replacecolor'
- // },
- {
- title: '数量',
- dataIndex: 'total',
- width: 80,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '箱数',
- dataIndex: 'totalBoxes',
- width: 90,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '总净重',
- dataIndex: 'totalNetWeight',
- width: 90,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '总毛重',
- dataIndex: 'totalGrossWeight',
- width: 90,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '总体积',
- dataIndex: 'totalVolume',
- ellipsis: true,
- width: 90,
- className: 'replacecolor'
- },
- // {
- // title: '总价',
- // dataIndex: 'totalPrice',
- // width: 100,
- // className: 'replacecolor'
- // },
- // {
- // title: '集装箱代号',
- // dataIndex: 'containerCode',
- // width: 120,
- // ellipsis: true,
- // className: 'replacecolor'
- // },
- {
- title: '集装箱号',
- dataIndex: 'containerNumber',
- width: 100,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '预托书号',
- dataIndex: 'depositaryReceiptNo',
- width: 100,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '采购/委外订单号',
- dataIndex: 'spurOrSubOrder',
- width: 200,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '单据号',
- dataIndex: 'documentNo',
- ellipsis: true,
- width: 160,
- // fixed: 'left',
- className: 'replacecolor',
-
- },
- // {
- // title: '推送状态',
- // dataIndex: 'pushStatus',
- // width: 100,
- // scopedSlots: { customRender: 'pushStatesSlot' },
- // fixed: 'right',
- // className: 'replacecolor'
- // },
- {
- title: '单据状态',
- dataIndex: 'status',
- width: 100,
- scopedSlots: { customRender: 'statusSlot' },
- fixed: 'right',
- className: 'replacecolor'
- },
- // {
- // title: '原因',
- // dataIndex: 'memo',
- // width: 220,
- // fixed: 'right',
- // customRender: t => ellipsis(t),
- // className: 'replacecolor'
- // },
- {
- title: '操作',
- dataIndex: 'operation',
- scopedSlots: { customRender: 'operationSlot' },
- width: 180,
- fixed: 'right',
- className: 'replacecolor'
- }
- ],
- adPaListClothesData: [],
- visible:false,
- message:[],//导入文件信息
- file:{},//导入文件
- queryParam: {
- isReference:'0',
- pageSize:50
- // pageNo: '',
- // orderNumber: '',
- // itemNumber: '',
- // productName: '' // 品名
- },
- pagination: {
- pageSizeOptions: ["50", "100", "150"],
- showSizeChanger: true,
- pageSize:50
- // total: '',
- // current: 0,
- // pageSize: 0
- },
- selectedRowKeys: [], // 勾选航
- dateFormat: 'YYYY-MM-DD',
- url: {
- list: '/sys/user/list',
- importExcelUrl: '/spapl/syPreAssembledPackingList/importExcel3' // 导入
- },
- }
- },
- created() {
- this.getadPaListClothes()
- },
- watch:{
- selectedRowKeys(newVal){
- this.selectedNumber =newVal.length
- }
- },
- methods: {
- // 分页查询 预装箱单-成衣
- getadPaListClothes() {
- console.log(this.queryParam)
- this.$nextTick(() => {
- this.loading = true
- getadPaList(this.queryParam).then(res => {
- this.loading = false
- if (res.success) {
- this.adPaListClothesData = [];
- if (res.result.records != null){
- this.adPaListClothesData = res.result.records;
- }
- this.selectedRowKeys = []
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size,
- pageSizeOptions: ["50", "100", "150"],
- showSizeChanger: true,
- }
- }else{
- this.$message.error(res.message);
- }
- })
- })
- },
- // 编辑
- edit(record) {
- itemByMainId({id:record.id}).then(res => {
- if (res.success) {
- this.$refs.addAdpackingDrawer.visible = true;
- this.$refs.addAdpackingDrawer.editDecide = 'edit';
- this.$refs.addAdpackingDrawer.addAdpacking = res.result; //接口参数
- this.$refs.addAdpackingDrawer.addState = '0';
- this.$refs.addAdpackingDrawer.loadSizeTables(res.result.sizeTables);
- // var totalNetWeight = 0;
- // var totalGrossWeight = 0;
- // var totalVolume = 0;
- // var totalPrice = 0;
- // var total = 0;
- for (var i=0; i<res.result.syPreAssembledPackingListItemList.length;i++){
- var row = res.result.syPreAssembledPackingListItemList[i];
- var sizeTables = row.sizeTables;
- for (var j=0; j<sizeTables.length;j++){
- row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
- }
- // totalNetWeight += row.totalNetWeight*1;
- // totalGrossWeight += row.totalGrossWeight*1;
- // totalVolume += row.totalVolume*1;
- // totalPrice += row.totalPrice*1;
- // total += row.total*1
- }
- // res.result.totalNetWeight = totalNetWeight;
- // res.result.totalGrossWeight = totalGrossWeight;
- // res.result.totalVolume = totalVolume;
- // res.result.totalPrice = totalPrice;
- // res.result.total = total;
- }else{
- this.$message.error(res.message);
- }
- });
-
- },
- // 详情
- details(record) {
- itemByMainId({id:record.id}).then(res => {
- if (res.success) {
-
- this.$refs.detailsAdpackingDrawer.visible = true;
- res.result.syPreAssembledPackingListItemList.map(item=>item.hod = moment(item.hod).format('YYYY-MM-DD'))
- this.$refs.detailsAdpackingDrawer.addAdpacking = res.result; //接口参数
- this.$refs.detailsAdpackingDrawer.loadSizeTables(res.result.sizeTables);
- var totalNetWeight = 0;
- var totalGrossWeight = 0;
- var totalVolume = 0;
- var totalPrice = 0;
- for (var i=0; i<res.result.syPreAssembledPackingListItemList.length;i++){
- var row = res.result.syPreAssembledPackingListItemList[i];
- var sizeTables = row.sizeTables;
- for (var j=0; j<sizeTables.length;j++){
- row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
- }
- // totalNetWeight += row.totalNetWeight*1;
- // totalGrossWeight += row.totalGrossWeight*1;
- // totalVolume += row.totalVolume*1;
- // totalPrice += row.totalPrice*1;
- }
- // res.result.totalNetWeight = totalNetWeight;
- // res.result.totalGrossWeight = totalGrossWeight;
- // res.result.totalVolume = totalVolume;
- // res.result.totalPrice = totalPrice;
-
- }else{
- this.$message.error(res.message);
- }
- });
- },
- // 新增
- addAdpacking() {
- this.$refs.addAdpackingDrawer.visible = true;
- this.$refs.addAdpackingDrawer.addState = '0';
- },
- // 列表导出
- handleExportXls(fileName,sta) {
- // const data = this.queryParam
- // data['status'] = sta
- var obj ={}
- if(this.selectedRowKeys.length == this.pagination.pageSize || this.selectedRowKeys.length==this.adPaListClothesData.length){
- obj=this.queryParam
- obj.selectAll = '1'
- }else{
- var arr =[]
- this.adPaListClothesData.map(item=>{
- this.selectedRowKeys.map(e=>{
- if(item.id == e){
- arr.push(item.id)
- }
- })
- })
- obj.ids = arr.toString()
- obj.selectAll = '2'
- }
- downFile('/spapl/syPreAssembledPackingList/exportXls',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对象
- }
- })
- },
- // 列表导出
- handleExportXls1(fileName,sta) {
- // const data = this.queryParam
- var obj ={}
- if(this.selectedRowKeys.length == this.pagination.pageSize || this.selectedRowKeys.length==this.adPaListClothesData.length){
- obj=this.queryParam
- obj.selectAll = '1'
- }else{
- var arr =[]
- this.adPaListClothesData.map(item=>{
- this.selectedRowKeys.map(e=>{
- if(item.id == e){
- arr.push(item.id)
- }
- })
- })
- obj.ids = arr.toString()
- obj.selectAll = '2'
- }
- downFile('/spapl/syPreAssembledPackingList/exportXls2',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对象
- }
- })
- },
- handleExportXls2(fileName) {
- // const data = this.queryParam
- var obj ={}
- if(this.selectedRowKeys.length == this.pagination.pageSize || this.selectedRowKeys.length==this.adPaListClothesData.length){
- obj=this.queryParam
- obj.selectAll = '1'
- }else{
- var arr =[]
- this.adPaListClothesData.map(item=>{
- this.selectedRowKeys.map(e=>{
- if(item.id == e){
- arr.push(item.id)
- }
- })
- })
- obj.ids = arr.toString()
- obj.selectAll = '2'
- }
- downFile('/spapl/syPreAssembledPackingList/exportXls3',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对象
- }
- })
- },
- // 导入信息
- uploadFlie(file) {
- const formData = new FormData()
- formData.append('file',file.file)
- fileDetail(formData).then(res => {
- if (res.success) {
- this.visible = true
- this.message = res.message.split(';').filter((element) => {
- return element !== "";
- });
- this.file = file
- }else{
- this.loading = false
- this.$message.error(res.message);
- }
- })},
- //继续导入
- handleOk(){
- this.handleOkButton = true
- const formData = new FormData()
- formData.append('file', this.file.file)
- upload(formData).then(res => {
- this.visible = false
- if (res.success) {
- this.getadPaListClothes()
- this.$message.success('导入成功')
- this.handleOkButton = false
- }else{
- this.loading = false
- this.$message.error(res.message);
- this.handleOkButton = false
- }
- })
- },
- //取消导入
- handleCancel(){
- this.visible = false
- this.loading = false
- },
- // 删除
- handleDelete(record) {
- console.log('点击删除项id:', record.id)
- this.$nextTick(() => {
- if(this.queryParam.pageNo > 1 && this.adPaListClothesData.length === 1){
- this.queryParam.pageNo = this.queryParam.pageNo -1
- }
- deleteAdPaList({ id: record.id }).then(res => {
- if (res.success) {
- console.log('res:', res)
- this.getadPaListClothes()
- this.$message.success('删除成功')
- } else {
- this.$message.error('删除成功')
- }
-
- })
- })
- },
- searchQuery() {
- this.toggleSearchStatus = false
- this.queryParam.pageNo = ''
- this.getadPaListClothes()
- },
- searchReset() {
- this.range = []
- var dd = this.queryParam
- this.queryParam = {
- isReference:'0',
- pageSize:this.queryParam.pageSize
- }
- this.getadPaListClothes()
- },
- // 操作 单条数据导出
- itemXls(record,sta) {
- var data = sta
- downFile('/spapl/syPreAssembledPackingList/exportXls',{id:record.id,status:data}).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' }), item + '.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', '预装箱单' + '.xlsx')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link) // 下载完成移除元素
- window.URL.revokeObjectURL(url) // 释放掉blob对象
- }
- })
- },
- // 提交
- submit(record) {
- var that = this;
- this.$nextTick(() => {
- submit({ id: record.id }).then(res => {
- if (res.success) {
- this.adPaListClothesData.map(item =>{
- if(item.id == record.id){
- item.status = 1
- }
- })
- this.$forceUpdate()
- that.$message.success('提交成功');
- }else{
- that.$message.error(res.message);
- }
- })
- })
- },
- // // 取消提交
- // cancelSubmit(record){
- // var that = this;
- // this.$nextTick(() => {
- // if(record.isReference == 2){
- // that.$message.error('不可取消提交!');
- // }else {
- // cancelSubmit({ id: record.id }).then(res => {
- // if (res.success) {
- // record.status=0;
- // that.$message.success('取消提交成功');
- // }else{
- // that.$message.error(res.message);
- // }
- // })
- // }
-
- // })
- // },
- //批量提交
- batchSubmit(){
- this.$nextTick(() => {
- // for(var i =0;i<this.selectedRows.length;i++){
- // var tickRow = this.selectedRows[i]
- // if(tickRow.status === '1'){
- // var clo = i+1
- // this.$message.error("部分数据是已提交,请勿重复提交!");
- // return
- // }
- // }
- var ids = this.selectedRowKeys.toString()
- batchSubmit({ id: ids }).then(res => {
- if (res.success) {
- this.getadPaListClothes()
- this.$message.success('批量提交成功');
- this.selectedRowKeys = []
- }else {
- this.$message.error(res.message);
- }
- })
- })
- },
- //批量取消提交
- batchCanelSubmit(){
- this.$nextTick(() => {
- // for(var i =0;i<this.selectedRows.length;i++){
- // var tickRow = this.selectedRows[i]
- // if(tickRow.status === '0'){
- // this.$message.error("含有未提交数据,请重新选择!");
- // return
- // }
- // }
- var ids = this.selectedRowKeys.toString()
- batchCanelSubmit({ ids:ids }).then(res => {
- if (res.success) {
- this.getadPaListClothes()
- this.selectedRowKeys = []
- this.$message.success('批量取消提交成功');
- }else if(res.code == 111){
- for(var i=0;i<this.selectedRows.length;i++){
- if(res.result.indexOf(this.selectedRows[i].id) !== -1){
- this.$message.error(res.message+'(所选第'+(i+1) +'行数据)');
- return
- }
- }
- }else {
- this.$message.error(res.message);
- }
- })
- })
- },
- //批量推送
- batchPush(){
- this.$nextTick(() => {
-
- if(this.selectedRowKeys.length==0){
- this.$message.error("请勾选数据");
- }else{
- for(var i =0;i<this.selectedRows.length;i++){
- var tickRow = this.selectedRows[i]
- var clo = i+1
- if(tickRow.status == '0'){
- this.$message.error("勾选的第"+clo+"行数据未提交,不能推送!");
- return
- }
- if(tickRow.status === '1' && tickRow.pushStatus === '1'){
- this.$message.error("勾选的第"+clo+"行数据是已推送!");
- return
- }
- }
- var ids = this.selectedRowKeys.toString()
- batchPush({ id: ids }).then(res => {
- if (res.success) {
- this.selectedRows.map(item=>{
- item.pushStatus = 1
- })
- this.$message.success('批量推送成功');
- }else {
- this.$message.error(res.message);
- this.selectedRows.map(item=>{
- item.pushStatus = 2
- })
- this.$message.error(res.message);
- }
- })
- this.selectedRowKeys = []
- }
- })
- },
- //批量删除
- majorityDelet(){
- var ids = this.selectedRowKeys.toString()
- deleteBatch({ ids: ids }).then(res => {
- if (res.success) {
- this.$message.success('批量删除成功');
- this.getadPaListClothes()
- }else {
- this.$message.error(res.message);
- }
- })
- this.selectedRowKeys = []
- },
- //推送
- push(record){
- this.$nextTick(() => {
- push({ id: record.id }).then(res => {
- if (res.success) {
- record.pushStatus=1;
- this.$message.success('推送成功');
- }else{
- record.pushStatus = 2
- this.$message.error(res.message);
- }
- })
- })
- },
- // 选中行
- onSelectChange(keys, rows) {
- this.selectedRowKeys = keys
- this.selectedRows = rows
- },
- handleTableChange(pagination, filters, sorter) {
- // console.log('当前页信息>>>>',pagination)
- this.queryParam.pageNo = pagination.current
- this.queryParam.pageSize =pagination.pageSize
- this.getadPaListClothes()
- },
- aa() {},
- onDateChange(value, dateString) {
- this.queryParam.startTime = dateString[0]
- this.queryParam.endTime = dateString[1]
- },
-
- rangeSelectChange(value) {
- this.range = value
- if (value.length == 0){
- this.queryParam.stratDate = "";
- this.queryParam.endDate = "";
- }else{
- this.queryParam.stratDate = value[0].format('YYYY-MM-DD');
- this.queryParam.endDate = value[1].format('YYYY-MM-DD');
- }
- },
- createTimeChange(){
- this.queryParam.createTime = this.queryParam.createTime.format('YYYY-MM-DD')
- }
- },
- computed: {
- // 导入
- importExcelUrl() {
- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
- // this.
- },
- // 选中项
- 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;
- // }
- /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/ .ant-table-fixed-left table,.ant-table-fixed-right table{
- width: min-content;
- }
- /deep/ thead.ant-table-thead>tr{
- height: 0 !important;
- }
- /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
- padding: 9px 16px
- }
- </style>
|