8 changed files with 1857 additions and 61 deletions
-
16src/api/ecss/ecss.js
-
43src/views/modules/ecss/codelnotify.vue
-
156src/views/modules/ecss/codelnotifyConfirm.vue
-
397src/views/modules/ecss/declaration.vue
-
608src/views/modules/ecss/ecssTemplate.vue
-
500src/views/modules/ecss/ecssWalMartOrder.vue
-
35src/views/modules/ecss/hsCode.vue
-
163src/views/modules/ecss/walmart_upload_excel.vue
@ -0,0 +1,608 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item :label="'BU:'"> |
|||
<el-select v-model="searchData.buNo" placeholder="请选择" > |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for = "i in buList" |
|||
:key = "i.buNo" |
|||
:label = "i.buDesc" |
|||
:value = "i.buNo"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="'模版名称:'"> |
|||
<el-input v-model="searchData.name" ></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'模版类型:'"> |
|||
<el-select filterable v-model="searchData.type" clearable style="width: 140px;"> |
|||
<el-option :label="item" :value="item" v-for="(item,index) in types " |
|||
:key="index"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="' '" > |
|||
<el-button @click="searchTable()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'查询'}}</el-button> |
|||
<el-button @click="addModelOpen()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'新增'}}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-table |
|||
@row-click="changeData" |
|||
highlight-current-row |
|||
:height="height" |
|||
:data="dataList" |
|||
ref="mainTable" |
|||
border |
|||
v-loading="dataListLoading" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
header-align="center" |
|||
align="center" |
|||
width="100" |
|||
fixed="left" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" @click="updateModelOpen(scope.row)">编辑</a> |
|||
<a type="text" size="small" @click="deleteEcssTemplate(scope.row)">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList1" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|||
style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 1000]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
<el-dialog title="维护模版信息" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="500px"> |
|||
<el-form label-position="top" style="margin-left: 2px;margin-top: -5px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'BU:'"> |
|||
<el-select v-model="addModel.buNo" placeholder="请选择" :disabled="addModel.addFlag!==0" 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="'模版类型'" > |
|||
<el-select filterable v-model="addModel.type" placeholder="请选择" :disabled="addModel.addFlag!==0" style="width:100%;"> |
|||
<el-option :label="item" :value="item" v-for="(item,index) in types " |
|||
:key="index"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'模版名称'" > |
|||
<el-input v-model="addModel.name"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'品名类型'" > |
|||
<el-radio v-model="addModel.hsCodeDescType" label="Y">中文</el-radio> |
|||
<el-radio v-model="addModel.hsCodeDescType" label="N">英文</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='发票'"> |
|||
<el-form-item :label="''" > |
|||
<el-checkbox v-model="addModel.hsCodeDesc">品名</el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='发票'"> |
|||
<el-form-item :label="''" > |
|||
<el-checkbox v-model="addModel.contractFlag">合同</el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='箱单'"> |
|||
<el-form-item :label="''" > |
|||
<el-checkbox v-model="addModel.upc">UPC</el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='箱单'"> |
|||
<el-form-item :label="''" > |
|||
<el-checkbox v-model="addModel.so">SO</el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='箱单'"> |
|||
<el-form-item :label="''" > |
|||
<el-checkbox v-model="addModel.boxChange">显示箱数零头</el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" > |
|||
<el-form-item :label="''" > |
|||
<el-checkbox v-model="addModel.goodsLabel">货物明细</el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='箱单'"> |
|||
<el-form-item :label="'序号类型'" > |
|||
<el-radio v-model="addModel.itemNo" label="Y">序号</el-radio> |
|||
<el-radio v-model="addModel.itemNo" label="N">栈板号</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='箱单'"> |
|||
<el-form-item :label="'Shipping Mark'" > |
|||
<el-input v-model="addModel.shippingMark"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12" v-show="addModel.type=='箱单'"> |
|||
<el-form-item :label="'栈板重量参数'" > |
|||
<el-input v-model="addModel.palletWeight"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'制造地'" > |
|||
<el-input v-model="addModel.origin"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'RFID Base Material'" > |
|||
<el-checkbox v-model="addModel.material"></el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'HS Code'" > |
|||
<el-input :disabled="!addModel.material" v-model="addModel.hsCode"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'Non-reusable plastic packaging'" > |
|||
<el-checkbox v-model="addModel.packaging"></el-checkbox> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'plastic packaging'" > |
|||
<el-input :disabled="!addModel.packaging" v-model="addModel.kgs"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="saveEcssTemplate()">保存</el-button> |
|||
<el-button type="primary" @click="addModelFlag=false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
|
|||
<!--列表的组件--> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|||
import {} from "@/api/sysLanguage.js" |
|||
import { |
|||
searchEcssTemplateData, |
|||
saveEcssTemplateData, |
|||
deleteEcssTemplate, |
|||
}from "@/api/ecss/ecss.js" |
|||
import {getBuList}from '@/api/factory/site.js' |
|||
export default { |
|||
name: "null", |
|||
components:{ |
|||
Chooselist, |
|||
}, |
|||
data() { |
|||
return { |
|||
types: [ '发票', '箱单'], |
|||
pageIndex: 1, |
|||
pageSize: 100, |
|||
totalPage: 0, |
|||
height: 200, |
|||
buList:[], |
|||
dataList:[], |
|||
dataList2:[], |
|||
dataListLoading: false, |
|||
searchData: { |
|||
page: 1, |
|||
limit: 100, |
|||
buNo:'', |
|||
type:'', |
|||
name:'', |
|||
username:this.$store.state.user.name, |
|||
}, |
|||
buttons:{ |
|||
search:'查询', |
|||
}, |
|||
addModelFlag:false, |
|||
addModel:{ |
|||
addFlag:0, |
|||
site:'', |
|||
buNo:'', |
|||
name:'', |
|||
type:'', |
|||
upc:'', |
|||
so:'', |
|||
origin:'', |
|||
packaging:'', |
|||
kgs:'', |
|||
shippingMark:'', |
|||
hsCode:'', |
|||
palletWeight:'', |
|||
material:'', |
|||
hsCodeDesc:'', |
|||
contractFlag:'', |
|||
hsCodeDescType:'', |
|||
goodsLabel:'', |
|||
remark:'', |
|||
boxChange:'' |
|||
}, |
|||
addDisabledFlag:true, |
|||
activeName:'attribute', |
|||
columnList1: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801007, |
|||
serialNumber: '801007Table1BuDesc', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "buDesc", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "BU", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1EcssTemplateNo', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "name", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "模版名称", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 160 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1EcssTemplateType', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "type", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "模版类型", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1CreateBy', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "createBy", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "创建人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1CreateDate', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "createDate", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "创建日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1UpdateBy', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "updateBy", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "修改人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1UpdateDate', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "updateDate", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "修改日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1Remark', |
|||
tableId: "801007Table1", |
|||
tableName: "EcssTemplate基础信息", |
|||
columnProp: "remark", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "备注", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 300 |
|||
}, |
|||
], |
|||
currentRow:{}, |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = (window.innerHeight - 200); |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList(val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 33) { |
|||
strVal = this.addModel.codeNo |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
|
|||
/* 列表方法的回调 */ |
|||
getBaseData(val) { |
|||
if (this.tagNo === 33) { |
|||
this.addModel.codeNo = val.Code_No |
|||
} |
|||
}, |
|||
// 每页数 |
|||
sizeChangeHandle (val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.searchTable() |
|||
}, |
|||
// 当前页 |
|||
currentChangeHandle (val) { |
|||
this.pageIndex = val |
|||
this.searchTable() |
|||
}, |
|||
searchTable(){ |
|||
this.searchData.limit = this.pageSize |
|||
this.searchData.page = this.pageIndex |
|||
searchEcssTemplateData(this.searchData).then(({data}) => { |
|||
//区分请求成功和失败的状况 |
|||
if (data && data.code == 0) { |
|||
this.dataList = data.page.list |
|||
this.pageIndex = data.page.currPage |
|||
this.pageSize = data.page.pageSize |
|||
this.totalPage = data.page.totalCount |
|||
if(this.dataList.length>0){ |
|||
this.$refs.mainTable.setCurrentRow(this.dataList[0]); |
|||
this.changeData(this.dataList[0]) |
|||
}else { |
|||
this.changeData(null) |
|||
} |
|||
} else { |
|||
this.dataList = []; |
|||
} |
|||
}); |
|||
}, |
|||
changeData(row){ |
|||
this.currentRow = JSON.parse(JSON.stringify(row)); |
|||
this.headerData=row; |
|||
this.refreshCurrentTabTable (); |
|||
}, |
|||
refreshCurrentTabTable(){ |
|||
if(this.currentRow===''||this.currentRow===null){ |
|||
this.currentRow={site:'',hsCode:'',buNo:'',recordType:'',codeNo:''} |
|||
} |
|||
}, |
|||
tabClick (tab, event) { |
|||
// 刷新列表数据 |
|||
this.refreshCurrentTabTable() |
|||
}, |
|||
|
|||
getBu () { |
|||
let tempData = { |
|||
username: this.$store.state.user.name, |
|||
} |
|||
getBuList(tempData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.buList = data.row2 |
|||
} |
|||
}) |
|||
}, |
|||
addModelOpen(){ |
|||
this.addDisabledFlag=true |
|||
this.addModel={ |
|||
addFlag:0, |
|||
site:'', |
|||
buNo:'', |
|||
name:'', |
|||
type:'', |
|||
upc:'', |
|||
so:'', |
|||
origin:'', |
|||
packaging:'', |
|||
kgs:'', |
|||
shippingMark:'', |
|||
hsCode:'', |
|||
palletWeight:'', |
|||
material:'', |
|||
hsCodeDesc:'', |
|||
contractFlag:'', |
|||
hsCodeDescType:'', |
|||
goodsLabel:'', |
|||
remark:'', |
|||
boxChange:'' |
|||
} |
|||
this.addModelFlag=true |
|||
}, |
|||
updateModelOpen(row){ |
|||
this.addDisabledFlag=false |
|||
this.addModel={ |
|||
addFlag:1, |
|||
site:row.site, |
|||
buNo:row.buNo, |
|||
name:row.name, |
|||
nameNative:row.name, |
|||
type:row.type, |
|||
upc:row.upc, |
|||
so:row.so, |
|||
origin:row.origin, |
|||
packaging:row.packaging, |
|||
itemNo:row.itemNo, |
|||
kgs:row.kgs, |
|||
shippingMark:row.shippingMark, |
|||
hsCode:row.hsCode, |
|||
palletWeight:row.palletWeight, |
|||
material:row.material, |
|||
hsCodeDesc:row.hsCodeDesc, |
|||
contractFlag:row.contractFlag, |
|||
hsCodeDescType:row.hsCodeDescType, |
|||
goodsLabel:row.goodsLabel, |
|||
remark:row.remark, |
|||
boxChange:row.boxChange |
|||
} |
|||
this.addModelFlag=true |
|||
}, |
|||
deleteEcssTemplate(row){ |
|||
this.$confirm('确认删除?', '提示').then(() => { |
|||
deleteEcssTemplate(row).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.searchTable() |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => {} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
saveEcssTemplate(){ |
|||
if(this.addModel.buNo==null||this.addModel.buNo===''){ |
|||
this.$alert('请选择BU!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.addModel.type==null||this.addModel.type===''){ |
|||
this.$alert('请选择模版类型!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.addModel.name==null||this.addModel.name===''){ |
|||
this.$alert('请输入模版名称!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
saveEcssTemplateData(this.addModel).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.searchTable() |
|||
this.addModelFlag = false |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => {} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
}, |
|||
activated() { |
|||
this.searchTable() |
|||
}, |
|||
created() { |
|||
this.getBu () |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,500 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item :label="'SKU:'"> |
|||
<el-input v-model="searchData.sku" ></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'SO:'"> |
|||
<el-input v-model="searchData.so" ></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="' '" > |
|||
<el-button @click="searchTable()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'查询'}}</el-button> |
|||
<el-button @click="importModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入'}}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-table |
|||
@row-click="changeData" |
|||
highlight-current-row |
|||
:height="height" |
|||
:data="dataList" |
|||
ref="mainTable" |
|||
border |
|||
v-loading="dataListLoading" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
header-align="center" |
|||
align="center" |
|||
width="100" |
|||
fixed="left" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" @click="updateModelOpen(scope.row)">编辑</a> |
|||
<a type="text" size="small" @click="deleteWalMartOrder(scope.row)">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList1" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|||
style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 1000]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
<el-dialog title="编辑" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="500px"> |
|||
<el-form label-position="top" style="margin-left: 2px;margin-top: -5px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'SKU'" > |
|||
<el-input v-model="addModel.sku"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'SO'" > |
|||
<el-input v-model="addModel.so"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'数量'" > |
|||
<el-input v-model="addModel.qty"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'卷数'" > |
|||
<el-input v-model="addModel.rolls"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'重量'" > |
|||
<el-input v-model="addModel.grossWeight"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'核销单号'" > |
|||
<el-input v-model="addModel.verificationSheet"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="saveWalMartOrder()">保存</el-button> |
|||
<el-button type="primary" @click="addModelFlag=false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
<!-- 导入 --> |
|||
<wal-upload-excel ref="walUploadExcel" @refreshTable="searchTable" v-drag></wal-upload-excel> |
|||
<!--列表的组件--> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import walUploadExcel from "./walmart_upload_excel.vue"; |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|||
import {} from "@/api/sysLanguage.js" |
|||
import { |
|||
searchWalMartOrderData, |
|||
saveWalMartOrderData, |
|||
deleteWalMartOrder, |
|||
}from "@/api/ecss/ecss.js" |
|||
export default { |
|||
name: "null", |
|||
components:{ |
|||
walUploadExcel, |
|||
Chooselist, |
|||
}, |
|||
data() { |
|||
return { |
|||
pageIndex: 1, |
|||
pageSize: 100, |
|||
totalPage: 0, |
|||
height: 200, |
|||
buList:[], |
|||
dataList:[], |
|||
dataListLoading: false, |
|||
searchData: { |
|||
page: 1, |
|||
limit: 100, |
|||
buNo:'', |
|||
sku:'', |
|||
so:'', |
|||
}, |
|||
buttons:{ |
|||
search:'查询', |
|||
}, |
|||
addModelFlag:false, |
|||
addModel:{ |
|||
addFlag:0, |
|||
site:'', |
|||
buNo:'', |
|||
sku:'', |
|||
so:'', |
|||
qty:'', |
|||
rolls:'', |
|||
grossWeight:'', |
|||
verificationSheet:'', |
|||
}, |
|||
addDisabledFlag:true, |
|||
activeName:'attribute', |
|||
columnList1: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801007, |
|||
serialNumber: '801007Table1BuDesc', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "sku", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "SKU", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1WalMartOrderNo', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "so", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "SO", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 160 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1WalMartOrderType', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "qty", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "数量", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1WalMartOrderType', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "rolls", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "卷数", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1WalMartOrderType', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "grossWeight", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "重量", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1WalMartOrderType', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "verificationSheet", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "核销单号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1CreateBy', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "createBy", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "创建人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1CreateDate', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "createDate", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "创建日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1UpdateBy', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "updateBy", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "修改人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 801003, |
|||
serialNumber: '801007Table1UpdateDate', |
|||
tableId: "801007Table1", |
|||
tableName: "WalMartOrder基础信息", |
|||
columnProp: "updateDate", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "修改日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
}, |
|||
], |
|||
currentRow:{}, |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = (window.innerHeight - 200); |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList(val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 33) { |
|||
strVal = this.addModel.codeNo |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
|
|||
/* 列表方法的回调 */ |
|||
getBaseData(val) { |
|||
if (this.tagNo === 33) { |
|||
this.addModel.codeNo = val.Code_No |
|||
} |
|||
}, |
|||
// 每页数 |
|||
sizeChangeHandle (val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.searchTable() |
|||
}, |
|||
// 当前页 |
|||
currentChangeHandle (val) { |
|||
this.pageIndex = val |
|||
this.searchTable() |
|||
}, |
|||
searchTable(){ |
|||
this.searchData.limit = this.pageSize |
|||
this.searchData.page = this.pageIndex |
|||
searchWalMartOrderData(this.searchData).then(({data}) => { |
|||
//区分请求成功和失败的状况 |
|||
if (data && data.code == 0) { |
|||
this.dataList = data.page.list |
|||
this.pageIndex = data.page.currPage |
|||
this.pageSize = data.page.pageSize |
|||
this.totalPage = data.page.totalCount |
|||
if(this.dataList.length>0){ |
|||
this.$refs.mainTable.setCurrentRow(this.dataList[0]); |
|||
this.changeData(this.dataList[0]) |
|||
}else { |
|||
this.changeData(null) |
|||
} |
|||
} else { |
|||
this.dataList = []; |
|||
} |
|||
}); |
|||
}, |
|||
changeData(row){ |
|||
this.currentRow = JSON.parse(JSON.stringify(row)); |
|||
this.headerData=row; |
|||
this.refreshCurrentTabTable (); |
|||
}, |
|||
refreshCurrentTabTable(){ |
|||
if(this.currentRow===''||this.currentRow===null){ |
|||
this.currentRow={site:'',hsCode:'',buNo:'',recordType:'',codeNo:''} |
|||
} |
|||
}, |
|||
tabClick (tab, event) { |
|||
// 刷新列表数据 |
|||
this.refreshCurrentTabTable() |
|||
}, |
|||
|
|||
getBu () { |
|||
let tempData = { |
|||
username: this.$store.state.user.name, |
|||
} |
|||
getBuList(tempData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.buList = data.row2 |
|||
} |
|||
}) |
|||
}, |
|||
updateModelOpen(row){ |
|||
this.addDisabledFlag=false |
|||
this.addModel={ |
|||
addFlag:1, |
|||
site:row.site, |
|||
buNo:row.buNo, |
|||
sku:row.sku, |
|||
so:row.so, |
|||
qty:row.qty, |
|||
rolls:row.rolls, |
|||
grossWeight:row.grossWeight, |
|||
verificationSheet:row.verificationSheet, |
|||
} |
|||
this.addModelFlag=true |
|||
}, |
|||
deleteWalMartOrder(row){ |
|||
this.$confirm('确认删除?', '提示').then(() => { |
|||
deleteWalMartOrder(row).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.searchTable() |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => {} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
saveWalMartOrder(){ |
|||
if(this.addModel.sku==null||this.addModel.sku===''){ |
|||
this.$alert('请输入SKU!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
saveWalMartOrderData(this.addModel).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.searchTable() |
|||
this.addModelFlag = false |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => {} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
importModel(){ |
|||
this.$nextTick(() => { |
|||
this.$refs.walUploadExcel.init() |
|||
}) |
|||
}, |
|||
}, |
|||
activated() { |
|||
this.searchTable() |
|||
}, |
|||
created() { |
|||
this.getBu () |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,163 @@ |
|||
<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 {saveWalMartOrderByExcel} 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 () { |
|||
this.fileList = [] |
|||
let tempData = { |
|||
username: this.$store.state.user.name, |
|||
} |
|||
getBuList(tempData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.buList = data.row2 |
|||
if(data.row2.length>0){ |
|||
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",'03-RFID') |
|||
formData.append("username",this.$store.state.user.name) |
|||
formData.append("file", this.fileList[0].raw) |
|||
saveWalMartOrderByExcel(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') |
|||
// a标签的download属性规定下载文件的名称 |
|||
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> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue