Browse Source

备品备件

java8
ruanqi 11 months ago
parent
commit
d4320a606a
  1. 3
      src/api/ecss/ecss.js
  2. 336
      src/views/modules/ecss/codelnotifyConfirm.vue
  3. 2
      src/views/modules/ecss/hsCode.vue
  4. 186
      src/views/modules/ecss/pallet_upload_excel.vue

3
src/api/ecss/ecss.js

@ -39,3 +39,6 @@ export const deleteSubPropertiesValueForAlone= data => createAPI(`/ecss/coDel/de
export const deleteHsCode= data => createAPI(`/ecss/coDel/deleteHsCode`,'post',data)
export const searchCoDelPalletData= data => createAPI(`/ecss/coDel/searchCoDelPalletData`,'post',data)
export const saveCoDelPalletDataByExcel= data => createAPI(`/ecss/coDel/saveCoDelPalletDataByExcel`,'post',data)

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

@ -132,7 +132,43 @@
<!-- </el-table-column>-->
</el-table>
</el-tab-pane>
<el-tab-pane label="装修清单" name="pallet">
<el-button @click="upLoadPallet()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入装箱单'}}</el-button>
<el-table
:data="dataList3"
:height="height"
border
v-loading="dataListLoading"
style="width: 100%; ">
<!-- <el-table-column-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="80"-->
<!-- label="操作">-->
<!-- <template slot-scope="scope">-->
<!-- <a type="text" size="small" @click="deleteNotifySOSPlus(scope.row)">编辑</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
v-for="(item,index) in columnList3" :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-tab-pane>
</el-tabs>
<el-dialog title="仓库确认" :close-on-click-modal="false" v-drag :visible.sync="confirmModelFlag" width="400px">
@ -168,23 +204,27 @@
</el-footer>
</el-dialog>
<!-- 导入 -->
<pallet-upload-excel ref="palletUploadExcel" @refreshTable="searchPalletTable" v-drag></pallet-upload-excel>
</div>
</template>
<script>
import {} from "@/api/sysLanguage.js"
import palletUploadExcel from "./pallet_upload_excel.vue";
import {
searchEcssCoDelNotifyHeaderForCK,
searchEcssCoDelNotifyDetail,
confirmEcssDel,
cancerConfirmEcssDel,
searchCoDelPalletData,
}from "@/api/ecss/ecss.js"
import {getAllBuList}from '@/api/factory/site.js'
export default {
name: "null",
components:{
palletUploadExcel,
},
data() {
return {
@ -195,6 +235,7 @@
buList:[],
dataList:[],
dataList2:[],
dataList3:[],
dataListLoading: false,
searchData: {
page: 1,
@ -912,12 +953,266 @@
columnWidth: 300
},
],
columnList3:[
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3ItemNo',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "itemNo",
headerAlign: "center",
align: "right",
columnLabel: "序号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 40
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3PalletRemark',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "palletRemark",
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: 801002,
serialNumber: '801002Table3PalletQty',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "palletQty",
headerAlign: "center",
align: "right",
columnLabel: "托数",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 40
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3PoNo',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "poNo",
headerAlign: "center",
align: "left",
columnLabel: "PO",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3PN',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "partNo",
headerAlign: "center",
align: "left",
columnLabel: "PN",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3Qty',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "qty",
headerAlign: "center",
align: "right",
columnLabel: "数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3BoxQty',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "boxQty",
headerAlign: "center",
align: "right",
columnLabel: "箱数",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3Rolls',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "rolls",
headerAlign: "center",
align: "right",
columnLabel: "Rolls",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3Length',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "length",
headerAlign: "center",
align: "right",
columnLabel: "长(M)",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3Width',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "width",
headerAlign: "center",
align: "right",
columnLabel: "宽(M)",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3Height',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "height",
headerAlign: "center",
align: "right",
columnLabel: "高(M)",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table3Volume',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "volume",
headerAlign: "center",
align: "right",
columnLabel: "体积",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002TableGrossWeight',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "grossWeight",
headerAlign: "center",
align: "right",
columnLabel: "毛重",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002TableNetWeight',
tableId: "801002Table3",
tableName: "装箱明细",
columnProp: "netWeight",
headerAlign: "center",
align: "right",
columnLabel: "净重",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
],
currentRow:{},
}
},
mounted() {
this.$nextTick(() => {
this.height = (window.innerHeight - 240)/2;
this.height = (window.innerHeight - 260)/2;
})
},
methods: {
@ -973,6 +1268,17 @@
}
});
}
if(this.activeName==='pallet'){
searchCoDelPalletData(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList3 = data.rows
} else {
this.dataList3 = [];
}
});
}
},
tabClick (tab, event) {
//
@ -1030,6 +1336,32 @@
this.confirmModel=JSON.parse(JSON.stringify(row));
this.confirmModelFlag=true
},
upLoadPallet(){
if(this.currentRow.site===''||this.currentRow.site==null){
this.$alert('请先选择发货通知单!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.currentRow.notifyStatus!=='仓库已确认'){
this.$alert('仓库未确认无法导入装箱清单!', '错误', {
confirmButtonText: '确定'
})
return false
}
let inData={
site:this.currentRow.site,
buNo:this.currentRow.buNo,
delNo:this.currentRow.delNo,
cmcInvoice:this.currentRow.cmcInvoice,
}
this.$nextTick(() => {
this.$refs.palletUploadExcel.init(inData)
})
},
searchPalletTable(){
this.refreshCurrentTabTable();
},
},
created() {
this.getBu ()

2
src/views/modules/ecss/hsCode.vue

@ -72,7 +72,6 @@
<el-tab-pane label="基本信息" name="attribute">
<order-attribute ref="dialogAttribute" :site="currentRow.site" :buNo="currentRow.buNo" :order-no="currentRow.hsCode" :code-no="currentRow.codeNo" :function-type="'ECSS'"></order-attribute>
</el-tab-pane>
</el-tabs>
<el-dialog title="维护HSCode" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="500px">
@ -132,7 +131,6 @@
name: "null",
components:{
orderAttribute,
},
data() {
return {

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

@ -0,0 +1,186 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="400px" style="height: 520px;" class="customer-dialog" @close="deleteFile">
<el-form :inline="true" label-position="top" label-width="80px">
<el-row>
<el-form-item label="BU">
<el-select v-model="pageData.buNo" placeholder="请选择" disabled style="width: 120px">
<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="'CMC Invoice:'">
<el-input v-model="pageData.cmcInvoice" disabled style="width: 120px"></el-input>
</el-form-item>
<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 {saveCoDelPalletDataByExcel} from '@/api/ecss/ecss.js'
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {getAllBuList}from '@/api/factory/site.js'
export default {
name: 'bomComponentUpload',
data() {
return {
buList: [],
titleCon: '文件导入',
visible: false,
fileList: [],
pageData: {
site: '',
buNo: '',
delNo:'',
cmcInvoice:'',
createBy: this.$store.state.user.name,
},
}
},
methods: {
//
init (inData) {
this.fileList = []
let tempData = {
username: this.$store.state.user.name,
}
getAllBuList(tempData).then(({data}) => {
if (data.code === 0) {
this.buList = data.rows
}
})
console.log(inData)
this.pageData={
site: inData.site,
buNo: inData.buNo,
delNo: inData.delNo,
cmcInvoice: inData.cmcInvoice,
createBy: this.$store.state.user.name,
}
//
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("site",this.pageData.site)
formData.append("delNo",this.pageData.delNo)
formData.append("username",this.$store.state.user.name)
formData.append("file", this.fileList[0].raw)
// formData.append("createBy", this.pageData.createBy)
saveCoDelPalletDataByExcel(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg)
//
this.closeDialog()
} else {
this.$message.warning(data.msg)
}
})
},
//
async downloadFile () {
let file = {
id: 0,
fileName: ''
}
let tempData = {
orderRef1: 'ecss',
orderRef2: 'upLoadPallet'
}
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>
Loading…
Cancel
Save