Browse Source

发货通知单导入时,新增客户维护项等

支持导入改单等
java8
han\hanst 9 months ago
parent
commit
ab7dfd9065
  1. 10
      src/api/ecss/ecss.js
  2. 10
      src/utils/export-options.js
  3. 430
      src/views/modules/ecss/codelnotify.vue
  4. 7
      src/views/modules/ecss/codelnotifyConfirm.vue
  5. 40
      src/views/modules/ecss/createDeclaration.vue
  6. 4
      src/views/modules/ecss/declaration.vue
  7. 165
      src/views/modules/ecss/del_detail_upload_excel.vue
  8. 274
      src/views/modules/ecss/del_upload_excel.vue
  9. 4
      src/views/modules/ecss/pallet_upload_excel.vue

10
src/api/ecss/ecss.js

@ -3,6 +3,8 @@ import { createAPI } from "@/utils/httpRequest.js";
export const saveEcssCoDelNotifyByExcel = data => createAPI(`/ecss/coDel/saveEcssCoDelNotifyByExcel`,'post',data)
export const modifyNotifyDetailByExcel = data => createAPI(`/ecss/coDel/modifyNotifyDetailByExcel`,'post',data)
export const searchEcssCoDelNotifyHeader = data => createAPI(`/ecss/coDel/searchEcssCoDelNotifyHeader`,'post',data)
export const searchEcssCoDelNotifyDetail = data => createAPI(`/ecss/coDel/searchEcssCoDelNotifyDetail`,'post',data)
@ -109,3 +111,11 @@ export const queryPartListAll = data => createAPI(`/ecss/coDel/queryPartListAll`
export const searchCustomList = (data) => createAPI(`/select/ecssMapper/getCustomerList/list`,'post',data)
export const getCustomerList = data => createAPI(`/select/ecssMapper/getCustomerList/list`,'post',data)
export const getCustomers = data => createAPI(`/select/ecssMapper/getCustomerInfo/list`,'post',data)
export const getCustomerAdd = data => createAPI(`/select/ecssMapper/getCustomerAdd/list`,'post',data)

10
src/utils/export-options.js

@ -59,7 +59,15 @@ const PalletSku = {
{
columnProp: "netWeight",
columnLabel: "净重",
}
},
{
columnProp: "shippingMode",
columnLabel: "运输方式",
},
{
columnProp: "destination",
columnLabel: "客户目的地",
},
],
mergeSetting: {
mergeSetting: {

430
src/views/modules/ecss/codelnotify.vue

@ -71,6 +71,12 @@
{{ '导出' }}
</download-excel>
</el-form-item>
<el-form-item label=" ">
<el-button @click="exportInvoiceList()" type="primary" style="margin-left: 2px">{{'导出发票'}}</el-button>
</el-form-item>
<el-form-item label=" ">
<el-button @click="exportGoodsList()" type="primary" style="margin-left: 2px">{{'导出出口货物委托书'}}</el-button>
</el-form-item>
</el-form>
<el-table
@ -125,6 +131,7 @@
<el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick" >
<el-tab-pane label="明细" name="detail">
<el-button v-show="currentRow.notifyStatus!=='订单取消'" @click="openCreateDetailModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'新增'}}</el-button>
<el-button v-show="currentRow.notifyStatus!=='订单取消'" @click="importDetailModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入'}}</el-button>
<el-table ref="detailTable"
:height="height"
:data="dataList2" :cell-style="cellStyleDetail"
@ -408,6 +415,8 @@
</el-dialog>
<!-- 导入 -->
<del-upload-excel ref="delUploadExcel" @refreshTable="searchTable" v-drag></del-upload-excel>
<!-- 导入 -->
<del-detail-upload-excel ref="delDetailUploadExcel" @refreshTable="searchTable" v-drag></del-detail-upload-excel>
<!--列表的组件-->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="700px">
@ -461,12 +470,203 @@
<el-button type="primary" @click="componentPartModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="导出发票" :close-on-click-modal="false" v-drag :visible.sync="exportInvoiceFlag" width="450px">
<el-form label-position="top" style="margin-left: 2px;margin-top: 10px;">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item :label="''" >
<template #label>
<span slot="label" style="" class="big-label">
<a href="#" @click="openTemplate('发票')">发票模版</a>
</span>
</template>
<el-input v-model="exportInvoice.templateName" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item :label="''" >
<el-checkbox v-model="exportInvoice.hsCodeDesc">品名</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'品名类型'" >
<el-radio v-model="exportInvoice.hsCodeDescType" label="Y">中文</el-radio>
<el-radio v-model="exportInvoice.hsCodeDescType" label="N">英文</el-radio>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item :label="''" >
<el-checkbox v-model="exportInvoice.contractFlag">合同</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item :label="''" >
<el-checkbox v-model="exportInvoice.goodsLabel">货物明细</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'RFID Base Material'" >
<el-checkbox v-model="exportInvoice.material"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'HS Code'" >
<el-input :disabled="!exportInvoice.material" v-model="exportInvoice.hsCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'Non-reusable plastic packaging'" >
<el-checkbox v-model="exportInvoice.packaging"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'plastic packaging'" >
<el-input :disabled="!exportInvoice.packaging" v-model="exportInvoice.kgs"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-show="currentRow.buNo==='01-Label' || currentRow.buNo==='03-RFID'">
<el-form-item :label="'制造地'" >
<el-input v-model="exportInvoice.origin"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-show="currentRow.buNo==='03-RFID'"
:height="240"
:data="notifyPartDetailList"
stripe
highlight-current-row
border :row-style="{ height: '30px' }"
style="width: 100%;">
<el-table-column
prop="partNo"
header-align="center"
align="center"
label="PN">
</el-table-column>
<el-table-column
prop="ehundred"
header-align="center"
align="center"
label="E100">
<template slot-scope="scope">
<el-input v-model="scope.row.ehundred" style="width: 100px;"></el-input>
</template>
</el-table-column>
<el-table-column
prop="lossratio"
header-align="center"
align="center"
label="纯FSC纸重量损耗">
<template slot-scope="scope">
<el-input v-model="scope.row.lossratio" style="width: 100px;"></el-input>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="downloadInvoice()">确定</el-button>
<el-button type="primary" @click="exportInvoiceFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="导出出口货物委托书" :close-on-click-modal="false" v-drag :visible.sync="exportGoodsFlag" width="500px">
<el-form label-position="top" style="margin-left: 7px;margin-top: 10px;">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="'品名类型'" >
<el-radio v-model="exportGoods.hsCodeDescType" label="Y">中文</el-radio>
<el-radio v-model="exportGoods.hsCodeDescType" label="N">英文</el-radio>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'贸易方式'" >
<el-input v-model="exportGoods.salesMethod"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'币制'" >
<el-input v-model="exportGoods.currency"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'货物产地'" >
<el-input v-model="exportGoods.madeArea"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'发货港'" >
<el-input v-model="exportGoods.sendPort"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'唛头'" >
<el-input v-model="exportGoods.voyage"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'提/送货日期'" >
<el-input v-model="exportGoods.deliveryGoodsDate"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'船期'" >
<el-input v-model="exportGoods.shippingDate"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="'发货人'" >
<el-input type="textarea"
:rows="4" v-model="exportGoods.shipper"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer style="height:40px;margin-top: 80px;text-align:center">
<el-button type="primary" @click="downloadExportGoods()">确定</el-button>
<el-button type="primary" @click="exportGoodsFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="模版" @close="closeTemplateDialog" @open="openTemplateDialog" :visible.sync="templateFlag" width="559px" v-drag>
<el-form inline="inline" label-position="top" :model="templateData" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="模版名称">
<el-input v-model="templateData.name" clearable style="width: 110px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" style="padding: 3px 12px" @click="searchTemplateList()">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="height + 110"
:data="templateList"
stripe
highlight-current-row
border
@row-dblclick="templateRowDblclick"
style="width: 100%;">
<el-table-column
prop="buNo"
header-align="center"
align="center"
label="BuNo">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="模版名称">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button @click="templateFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import Chooselist from '@/views/modules/common/Chooselist_eam'
import delUploadExcel from "./del_upload_excel.vue";
import delDetailUploadExcel from "./del_detail_upload_excel.vue";
import {} from "@/api/sysLanguage.js"
import {
searchEcssCoDelNotifyHeader,
@ -478,13 +678,19 @@
updateEcssDelDetail,
deleteEcssDelDetail,
searchCoDelPalletData,
queryPartListAll
queryPartListAll,
searchTemplateList,
getCustomers,
getCustomerAdd,
getNotifyPartDetail
}from "@/api/ecss/ecss.js"
import {getBuList}from '@/api/factory/site.js'
import ExportUtil from "@/utils/export";
export default {
name: "null",
components:{
delUploadExcel,
delDetailUploadExcel,
Chooselist,
},
data() {
@ -1575,6 +1781,42 @@
exportHeader: ["发货通知单"],
exportFooter: [],
// end
exportInvoiceFlag:false,
exportInvoice:{
origin:"made in china",
templateName:'',
hsCodeDesc:'',
contractFlag:'',
packaging:'',
kgs:'',
hsCode:'',
material:'',
hsCodeDescType:'',
goodsLabel:true,
overseasShipper:'',
overseasAddress:'',
},
exportGoodsFlag:false,
exportGoods:{
salesMethod:'EXW',
currency: 'USD',
madeArea: 'Shanghai, China',
sendPort:'Shanghai, China',
deliveryGoodsDate:'',
voyage :'',
shippingDate:'',
hsCodeDescType:'Y',
shipper:'Checkpoint Commercial (Shanghai) Co., Ltd. 保点贸易(上海)有限公司\t\t\t\t\t\t\n' +
'Room 1411, No. 31, Lane 2419, Hunan Road, Pudong New Area, Shanghai\t\t\t\t\t\t\n' +
'电话/Tel: (86-21)38112888 传真/Fax: (86-21)38112990\t\t\t\t\t\t\n' +
'上海市浦东新区沪南路2419弄31号1411室\t\t\t\t\t\t\n'
},
notifyPartDetailList:[],
templateFlag:false,
templateData:{},
templateList:[],
customerData:{},
customerAddData:{},
}
},
mounted() {
@ -1646,6 +1888,11 @@
this.$refs.delUploadExcel.init()
})
},
importDetailModel(){
this.$nextTick(() => {
this.$refs.delDetailUploadExcel.init(this.currentRow)
})
},
refreshCurrentTabTable(){
if(this.currentRow===''||this.currentRow===null){
this.currentRow={site:'',delNo:''}
@ -2047,7 +2294,183 @@
});
this.$nextTick(() => this.$refs.detailTable.doLayout());// ,
return sums;
},
exportInvoiceList() {
if (!this.currentRow || !this.currentRow.buNo) {
this.$message.warning('请选择发货通知单!')
return
}
if (this.currentRow.notifyStatus==='订单取消') {
this.$message.warning('该发货通知单已取消!')
return
}
this.exportInvoice.templateName=''
this.exportInvoice.hsCodeDesc=this.currentRow.hsCodeDesc
this.exportInvoice.contractFlag=this.currentRow.contractFlag
this.exportInvoice.packaging=this.currentRow.packaging
this.exportInvoice.kgs=this.currentRow.kgs
this.exportInvoice.hsCode=this.currentRow.hsCode
this.exportInvoice.material=this.currentRow.material
this.exportInvoice.hsCodeDescType=this.currentRow.hsCodeDescType
this.exportInvoice.goodsLabel=this.currentRow.goodsLabel
this.exportInvoice.origin="made in china"
//this.exportInvoice = this.currentRow
if (!this.exportInvoice.origin) {
this.exportInvoice.origin = 'made in china'
}
if (!this.exportInvoice.itemNo) {
this.exportInvoice.itemNo = 'Y'
}
this.notifyPartDetailList = [];
this.customerData=''
this.customerAddData = ''
this.exportInvoiceFlag = true
if (this.currentRow.buNo==='03-RFID') {
getNotifyPartDetail(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.notifyPartDetailList = data.rows
this.notifyPartDetailList.forEach(o => {
if (!o.lossratio) {
o.lossratio = '1.2';
}
});
} else {
this.notifyPartDetailList = [];
}
});
}
this.templateData.type='发票'
this.searchTemplateOne();
},
searchTemplateOne() {
this.templateData.buNo = this.currentRow.buNo
this.templateData.customName = this.currentRow.customerName
searchTemplateList(this.templateData).then(({data}) => {
if (data && data.code === 0){
if (data.rows && data.rows.length > 0) {
this.templateRowDblclick(data.rows[0]);
}
}
})
},
exportGoodsList() {
if (!this.currentRow || !this.currentRow.buNo) {
this.$message.warning('请选择发货通知单!')
return
}
this.exportGoods.salesMethod = 'EXW'
this.exportGoods.currency = 'USD'
this.exportGoods.madeArea = 'Shanghai, China'
this.exportGoods.sendPort = 'Shanghai, China'
this.exportGoods.deliveryGoodsDate = ''
this.exportGoods.voyage = this.currentRow.buNo==='01-Label' || this.currentRow.buNo==='03-RFID'?this.currentRow.cmcInvoice:''
this.exportGoods.shippingDate = ''
this.exportGoodsFlag = true
},
//
downloadInvoice() {
if (!this.currentRow || !this.currentRow.buNo) {
this.$message.warning('请选择报关单!')
return
}
let exportParam=this.exportInvoice
exportParam.declarationNo = this.currentRow.declarationNo
exportParam.site = this.currentRow.site
exportParam.delNo = this.currentRow.delNo
exportParam.notifyPartDetailList = this.notifyPartDetailList
ExportUtil.export(
"/ecss/coDel/downloadInvoice",
exportParam, this.currentRow.cmcInvoice+"发票.xlsx"
);
this.exportInvoiceFlag=false
this.searchTable()
},
downloadExportGoods() {
if (!this.currentRow || !this.currentRow.buNo) {
this.$message.warning('请选择报关单!')
return
}
let exportParam=this.exportGoods
exportParam.declarationNo = this.currentRow.declarationNo
exportParam.site = this.currentRow.site
exportParam.delNo = this.currentRow.delNo
ExportUtil.export(
"/ecss/coDel/downloadExportGoods",
exportParam, this.currentRow.cmcInvoice+"出口货物委托书.xlsx"
);
this.exportGoodsFlag = false;
this.searchTable()
},
openTemplate (type) {
this.templateData.type=type;
this.templateFlag = true;
},
openTemplateDialog () {
//
this.searchTemplateList();
},
closeTemplateDialog () {
this.templateList = []
this.templateFlag = false
},
searchTemplateList () {
this.templateData.buNo = this.currentRow.buNo
this.templateData.customName = ''
searchTemplateList(this.templateData).then(({data}) => {
if (data && data.code === 0){
this.templateList = data.rows;
}
})
},
templateRowDblclick (row) {
if (this.templateData.type=='发票') {
this.exportInvoice.templateName=row.name
this.exportInvoice.hsCodeDesc=row.hsCodeDesc
this.exportInvoice.contractFlag=row.contractFlag
this.exportInvoice.origin=this.currentRow.origin?this.currentRow.origin:row.origin
this.exportInvoice.packaging=this.currentRow.packaging?this.currentRow.packaging:row.packaging
this.exportInvoice.kgs=this.currentRow.kgs?this.currentRow.kgs:row.kgs
this.exportInvoice.hsCode=this.currentRow.hsCode?this.currentRow.hsCode:row.hsCode
this.exportInvoice.material=this.currentRow.material?this.currentRow.material:row.material
this.exportInvoice.hsCodeDescType=this.currentRow.hsCodeDescType?this.currentRow.hsCodeDescType:row.hsCodeDescType
this.exportInvoice.goodsLabel=this.currentRow.goodsLabel?this.currentRow.goodsLabel:row.goodsLabel
} else if (this.templateData.type=='出口货物委托书'){
this.exportGoods.salesMethod = row.salesMethod
this.exportGoods.currency = row.currency
this.exportGoods.madeArea = row.madeArea
this.exportGoods.sendPort = row.sendPort
this.exportGoods.deliveryGoodsDate = row.deliveryGoodsDate
this.exportGoods.voyage = this.currentRow.buNo==='01-Label' || this.currentRow.buNo==='03-RFID'?this.currentRow.cmcInvoice:row.voyage
this.exportGoods.shippingDate = row.shippingDate;
this.exportGoods.shipper=row.shipper
}
if (this.templateData.type!=='出口货物委托书') {
this.notifyPartDetailList.forEach(o => {
// fsc
if (o.lossratio) {
if (row.fscWeight) {
o.lossratio = o.lossratio;
} else {
o.lossratio = '';
}
} else {
if (row.fscWeight) {
o.lossratio = '1.2';
} else {
o.lossratio = '';
}
}
});
}
this.templateFlag = false
},
},
activated() {
this.searchTable()
@ -2062,4 +2485,9 @@
.warning-row td{
color: darkred !important;
}
.el-table .cell {
line-height: 24px;
font-size: 12px;
height: 24px;
}
</style>

7
src/views/modules/ecss/codelnotifyConfirm.vue

@ -2049,6 +2049,9 @@
},
changeData(row){
this.currentRow = JSON.parse(JSON.stringify(row));
if (this.currentRow.notifyDate==='发货日期不确定') {
this.currentRow.notifyDate=''
}
this.headerData=row;
this.refreshCurrentTabTable ();
},
@ -2213,6 +2216,8 @@
buNo:this.currentRow.buNo,
delNo:this.currentRow.delNo,
cmcInvoice:this.currentRow.cmcInvoice,
shippingMode: this.currentRow.shippingMode,
destination : this.currentRow.destination,
walMartOrderFlag:this.currentRow.walMartOrderFlag
}
this.$nextTick(() => {
@ -2225,6 +2230,8 @@
buNo: this.currentRow.buNo,
delNo: this.currentRow.delNo,
cmcInvoice: this.currentRow.cmcInvoice,
shippingMode: this.currentRow.shippingMode,
destination : this.currentRow.destination,
createBy: this.$store.state.user.name,
}
excel.exportTable({

40
src/views/modules/ecss/createDeclaration.vue

@ -215,26 +215,19 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="'备案号'" >
<el-input v-model="declarationData.filingNo" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="'境外收货人'" >
<!-- <el-input v-model="declarationData.overseasShipper" ></el-input>-->
<el-select v-model="declarationData.overseasShipper" @change="setDestination()" clearable style="width:100%;">
<el-option :label="item.ccontactname" :value="item.ccontactname" v-for="(item,index) in customerData "
:key="index"></el-option>
</el-select>
<el-input v-model="declarationData.overseasShipper" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="12">
<el-form-item :label="'境外收货地址'" >
<el-select v-model="declarationData.overseasAddress" clearable style="width:100%;">
<el-option :label="item.cDeliverAdd" :value="item.cDeliverAdd" v-for="(item,index) in customerAddData "
:key="index"></el-option>
</el-select>
<el-input v-model="declarationData.overseasAddress" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="'备案号'" >
<el-input v-model="declarationData.filingNo" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
@ -1577,6 +1570,9 @@
},
changeData(row){
this.currentRow = JSON.parse(JSON.stringify(row));
if (this.currentRow.notifyDate==='发货日期不确定') {
this.currentRow.notifyDate=''
}
this.headerData=row;
this.refreshCurrentTabTable ();
},
@ -1627,13 +1623,11 @@
row.totalPrice=row.unitPrice*row.qty
},
declarationModel(row){
if(!row.notifyDate || row.notifyDate==='发货日期不确定'){
this.$alert('发货日期不确定,不可创建报关单!', '错误', {
confirmButtonText: '确定'
})
return false
let indata=JSON.parse(JSON.stringify(row));
if (row.notifyDate==='发货日期不确定') {
indata.notifyDate=''
}
getDeclarationDefaultData(row).then(({data}) => {
getDeclarationDefaultData(indata).then(({data}) => {
//
if (data && data.code === 0) {
this.declarationData=data.row
@ -1641,8 +1635,8 @@
this.customerData=data.customers
this.customerAddData = data.customerAdd
if (data.customerAdd && data.customerAdd.length > 0 && data.customers && data.customers.length > 0) {
this.declarationData.overseasAddress = data.customerAdd[0].cDeliverAdd
this.declarationData.overseasShipper = data.customers[0].ccontactname
this.declarationData.overseasAddress = this.declarationData.overseasAddress?this.declarationData.overseasAddress:data.customerAdd[0].cDeliverAdd
this.declarationData.overseasShipper = this.declarationData.overseasShipper?this.declarationData.overseasShipper:data.customers[0].ccontactname
}
this.declarationFlag=true

4
src/views/modules/ecss/declaration.vue

@ -275,7 +275,7 @@
stripe
highlight-current-row
border :row-style="{ height: '30px' }"
style="width: 100%;">
style="width: 100%;margin-top: 70px">
<el-table-column
prop="hsCode"
header-align="center"
@ -332,7 +332,7 @@
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-footer style="height:40px;margin-top: 80px;text-align:center">
<el-button type="primary" @click="exportAll()">确定</el-button>
<el-button type="primary" @click="exportAllFlag=false">关闭</el-button>
</el-footer>

165
src/views/modules/ecss/del_detail_upload_excel.vue

@ -0,0 +1,165 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog" @close="deleteFile">
<el-form :inline="true" label-position="top" label-width="80px">
<el-row>
<el-form-item label=" ">
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button>
</el-form-item>
</el-row>
<el-row>
<el-col :span="24">
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls"
:before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" style="text-align: left;">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveUploadFile">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {queryFileId} from "@/api/qc/qc.js"
import {modifyNotifyDetailByExcel} from '@/api/ecss/ecss.js'
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {getBuList}from '@/api/factory/site.js'
export default {
name: 'bomComponentUpload',
data() {
return {
buList: [],
titleCon: '文件导入',
visible: false,
fileList: [],
pageData: {
site: '',
buNo: '',
createBy: this.$store.state.user.name,
},
}
},
methods: {
//
init (inData) {
this.fileList = []
let tempData = {
username: this.$store.state.user.name,
}
this.pageData.buNo=inData.buNo
getBuList(tempData).then(({data}) => {
if (data.code === 0) {
this.buList = data.row2
if(data.row2.length===1){
this.pageData.buNo=data.row2[0].buNo
}
}
})
//
this.visible = true
},
//
beforeUploadHandle (file) {
let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase()
if (!(extName === '.xlsx' || extName === '.xls')) {
this.$message.error('数据导入失败,请选择正确的xlsx模板文件')
return false
}
},
//
onChange (file) {
this.fileList.push(file)
},
// modal
closeDialog () {
this.deleteFile()
//
this.visible = false
},
deleteFile(){
this.fileList = []
//
this.$refs.uploadFile.clearFiles()
//
this.$emit('refreshTable')
},
//
saveUploadFile () {
//
if (null == this.fileList || 0 === this.fileList.length) {
this.$message.error("请先上传文件!")
return false
}
const formData = new FormData()
formData.append("buNo",this.pageData.buNo)
formData.append("username",this.$store.state.user.name)
formData.append("file", this.fileList[0].raw)
// formData.append("createBy", this.pageData.createBy)
modifyNotifyDetailByExcel(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg)
//
this.closeDialog()
} else {
this.$message.error(data.msg)
}
})
},
//
async downloadFile () {
let file = {
id: 0,
fileName: ''
}
let tempData = {
orderRef1: 'ecss',
orderRef2: 'upLoadDel'
}
await queryFileId(tempData).then(({data}) => {
if (data && data.code === 0) {
file.id = data.data.id
file.fileName = data.data.fileName
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
await downLoadObjectFile(file).then(({data}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
const fileName = file.fileName
// a
const linkNode = document.createElement('a')
// adownload
linkNode.download = fileName
linkNode.style.display = 'none'
// Blob URL
linkNode.href = URL.createObjectURL(blob)
document.body.appendChild(linkNode)
//
linkNode.click()
// URL
URL.revokeObjectURL(linkNode.href)
document.body.removeChild(linkNode)
})
},
}
}
</script>

274
src/views/modules/ecss/del_upload_excel.vue

@ -1,23 +1,65 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog" @close="deleteFile">
<el-form :inline="true" label-position="top" label-width="80px">
<el-row>
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible"
width="600px" class="customer-dialog" @close="deleteFile">
<el-form label-position="top" >
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="BU">
<el-select v-model="pageData.buNo" placeholder="请选择" style="width: 120px">
<el-option
v-for = "i in buList"
:key = "i.buNo"
:label = "i.buDesc"
:value = "i.buNo">
</el-option>
<el-select v-model="pageData.buNo" placeholder="请选择" style="width: 100%">
<el-option v-for = "i in buList" :key = "i.buNo" :label = "i.buDesc" :value = "i.buNo"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="''" >
<template #label>
<span slot="label" style="" class="big-label">
<a href="#" @click="customFlag=true">客户</a>
</span>
</template>
<el-input v-model="pageData.customerName" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="''" >
<template #label>
<span slot="label" style="" class="big-label">
<a href="#" @click="localShipAddressFlag=true">客户地址</a>
</span>
</template>
<el-input v-model="pageData.localShipAddress" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="''" >
<template #label>
<span slot="label" style="" class="big-label">
<a href="#" @click="overseasShipperFlag=true">收货人</a>
</span>
</template>
<el-input v-model="pageData.overseasShipper" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="''" >
<template #label>
<span slot="label" style="" class="big-label">
<a href="#" @click="overseasAddressFlag=true">收货人地址</a>
</span>
</template>
<el-input v-model="pageData.overseasAddress" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'籍贯'" >
<el-input v-model="pageData.cnative"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label=" ">
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button>
</el-form-item>
</el-row>
<el-row>
</el-form-item> </el-col>
<el-col :span="24">
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls"
:before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" style="text-align: left;">
@ -27,17 +69,109 @@
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<span slot="footer" class="dialog-footer" style="margin-top: 10px">
<el-button type="primary" @click="saveUploadFile">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
<el-dialog title="客户" @close="closeCustomDialog" :visible.sync="customFlag" width="500px" v-drag>
<el-form inline="inline" label-position="top" :model="customSearchData" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="客户名称">
<el-input v-model="customSearchData.ccusname" clearable style="width: 150px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" style="padding: 3px 12px" @click="getCustomerList()">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="400"
:data="customerList"
stripe
highlight-current-row
border
@row-dblclick="rowDblclick"
style="width: 100%;">
<el-table-column
prop="ccusname"
header-align="center"
align="left"
label="客户名称">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button @click="customFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="客户地址" @close="localShipAddressFlag = false" :visible.sync="localShipAddressFlag" width="500px" v-drag>
<el-table
:height="400"
:data="customerAddrs"
stripe
highlight-current-row
border
@row-dblclick="rowDblclick2"
style="width: 100%;">
<el-table-column
prop="cDeliverAdd"
header-align="center"
align="left"
label="客户地址">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button @click="localShipAddressFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="收货人地址" @close="overseasAddressFlag = false" :visible.sync="overseasAddressFlag" width="500px" v-drag>
<el-table
:height="400"
:data="customerAddrs"
stripe
highlight-current-row
border
@row-dblclick="rowDblclick3"
style="width: 100%;">
<el-table-column
prop="cDeliverAdd"
header-align="center"
align="left"
label="收货人地址">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button @click="overseasAddressFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="收货人" @close="overseasShipperFlag = false" :visible.sync="overseasShipperFlag" width="500px" v-drag>
<el-table
:height="400"
:data="customerPersons"
stripe
highlight-current-row
border
@row-dblclick="rowDblclick4"
style="width: 100%;">
<el-table-column
prop="ccontactname"
header-align="center"
align="left"
label="收货人">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button @click="overseasShipperFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import {queryFileId} from "@/api/qc/qc.js"
import {saveEcssCoDelNotifyByExcel} from '@/api/ecss/ecss.js'
import {saveEcssCoDelNotifyByExcel,getCustomerList,getCustomers,getCustomerAdd} from '@/api/ecss/ecss.js'
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {getBuList}from '@/api/factory/site.js'
export default {
@ -52,8 +186,21 @@
site: '',
buNo: '',
createBy: this.$store.state.user.name,
customerName:'',
localShipAddress:'',
overseasShipper:'',
overseasAddress:'',
cnative:''
},
customSearchData: {},
customerList : [],//
customerAddrs : [],//
customerPersons : [],//
customerMap:new Map,
customFlag:false,
localShipAddressFlag:false,
overseasShipperFlag:false,
overseasAddressFlag:false,
}
},
methods: {
@ -72,9 +219,78 @@
}
}
})
getCustomerList({}).then(({data}) => {
//
if (data && data.code === 0) {
this.customerList=data.rows
}
});
this.pageData.customerName=''
this.pageData.cnative=''
this.pageData.localShipAddress='',
this.pageData.overseasShipper='',
this.pageData.overseasAddress='',
this.customerPersons=[]
this.customerAddrs=[]
//
this.visible = true
},
getCustomerList(){
getCustomerList(this.customSearchData).then(({data}) => {
//
if (data && data.code === 0) {
this.customerList=data.rows
}
});
},
getCusPersons(){
let cusData = {ccusname: this.pageData.customerName}
getCustomers(cusData).then(({data}) => {
//
if (data && data.code === 0) {
this.customerPersons=data.rows
this.customerPersons.forEach(o => {
if (!this.customerMap.has(o.ccontactname)) {
this.customerMap.set(o.ccontactname, o.cnative);
}
});
}
});
getCustomerAdd(cusData).then(({data}) => {
//
if (data && data.code === 0) {
this.customerAddrs=data.rows
}
});
},
setCnative(){
this.pageData.cnative=this.customerMap.get(this.pageData.overseasShipper)
},
closeCustomDialog () {
this.customFlag = false
},
rowDblclick (row) {
this.pageData.customerName=row.ccusname
this.pageData.cnative='',
this.pageData.localShipAddress='',
this.pageData.overseasShipper='',
this.pageData.overseasAddress='',
this.getCusPersons()
this.customFlag = false
},
rowDblclick2 (row) {
this.pageData.localShipAddress=row.cDeliverAdd
this.localShipAddressFlag = false
},
rowDblclick3 (row) {
this.pageData.overseasAddress=row.cDeliverAdd
this.overseasAddressFlag = false
},
rowDblclick4 (row) {
this.pageData.overseasShipper=row.ccontactname
this.setCnative()
this.overseasShipperFlag = false
},
//
beforeUploadHandle (file) {
@ -111,6 +327,26 @@
this.$message.error("请先选择BU!")
return false
}
if (null == this.pageData.customerName || this.pageData.customerName=='') {
this.$message.error("请先选择客户!")
return false
}
if (null == this.pageData.localShipAddress || this.pageData.localShipAddress=='') {
this.$message.error("请先填写客户发货地址!")
return false
}
if (null == this.pageData.overseasShipper || this.pageData.overseasShipper=='') {
this.$message.error("请先填写收货人!")
return false
}
if (null == this.pageData.overseasAddress || this.pageData.overseasAddress=='') {
this.$message.error("请先填写收货人地址!")
return false
}
if (null == this.pageData.cnative || this.pageData.cnative=='') {
this.$message.error("请先填写收货人籍贯!")
return false
}
//
if (null == this.fileList || 0 === this.fileList.length) {
this.$message.error("请先上传文件!")
@ -120,7 +356,11 @@
formData.append("buNo",this.pageData.buNo)
formData.append("username",this.$store.state.user.name)
formData.append("file", this.fileList[0].raw)
// formData.append("createBy", this.pageData.createBy)
formData.append("customerName", this.pageData.customerName)
formData.append("localShipAddress", this.pageData.localShipAddress)
formData.append("overseasShipper", this.pageData.overseasShipper)
formData.append("overseasAddress", this.pageData.overseasAddress)
formData.append("cnative", this.pageData.cnative)
saveEcssCoDelNotifyByExcel(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg)

4
src/views/modules/ecss/pallet_upload_excel.vue

@ -151,6 +151,8 @@
buNo: this.pageData.buNo,
delNo: this.pageData.delNo,
cmcInvoice: this.pageData.cmcInvoice,
shippingMode: this.pageData.shippingMode,
destination : this.pageData.destination,
createBy: this.$store.state.user.name,
}
excel.exportTable({
@ -181,6 +183,8 @@
buNo: inData.buNo,
delNo: inData.delNo,
cmcInvoice: inData.cmcInvoice,
shippingMode: inData.shippingMode,
destination : inData.destination,
walMartOrderFlag: inData.walMartOrderFlag,
createBy: this.$store.state.user.name,
}

Loading…
Cancel
Save