Browse Source

无订单修改

master
shenzhouyu 2 months ago
parent
commit
5a0602d600
  1. 4
      src/api/orderIssure/noOrderIssueNotify.js
  2. 92
      src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue
  3. 1
      src/views/modules/noOrderIssue/noOrderNotification.vue
  4. 184
      src/views/modules/noOrderIssue/noorder_upload_excel.vue

4
src/api/orderIssure/noOrderIssueNotify.js

@ -9,4 +9,6 @@ export const getNoOrderMaterialList = data => createAPI(`/orderIssure/issureNoti
export const saveNoOrderMaterialDetail = data => createAPI(`/orderIssure/issureNotify/saveNoOrderMaterialDetail`,'post',data)
export const searchNoOrderNotifyHeader = data => createAPI(`/orderIssure/issureNotify/searchNoOrderNotifyHeader`,'post',data)
export const getNotifyNoOrderDetailByType = data => createAPI(`/orderIssure/issureNotify/getNotifyNoOrderDetailByType`,'post',data)
export const getNotifyNoOrderDetailByType = data => createAPI(`/orderIssure/issureNotify/getNotifyNoOrderDetailByType`,'post',data)
export const queryPartAttributeData = data => createAPI(`/factory/partAttribute/queryPartAttributeData`,'post',data)
export const uploadNoorderNotifyExcel = data => createAPI(`/orderIssure/issureNotify/uploadNoorderNotifyExcel`,'post',data)

92
src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue

@ -108,8 +108,19 @@
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-button type="primary" @click="openSelectMaterialModal()" style="margin-top: 5px"
class="">添加</el-button>
<el-form-item label="物料号">
<el-input v-model="partNo" @keyup.enter.native="addRowFromQuery"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" ">
<el-button type="primary" @click="addRowFromQuery()" :loading="addLineLoading"
class="">添加行</el-button>
<el-button type="primary" @click="openSelectMaterialModal()"
class="">添加</el-button>
<!-- <el-button type="primary" @click="importModel()"
class="">导入</el-button> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -343,6 +354,7 @@
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<noorderUploadExcel ref="noorderUploadExcel" @refreshTable="searchTable" v-drag></noorderUploadExcel>
</div>
</template>
@ -354,8 +366,10 @@ import {
saveNoOrderNotify,
getNotifyNoOrderDetail,
getNoOrderMaterialList,
saveNoOrderMaterialDetail
saveNoOrderMaterialDetail,
queryPartAttributeData,
} from '@/api/orderIssure/noOrderIssueNotify.js'
import noorderUploadExcel from './noorder_upload_excel.vue'
import {
deleteNotify,
getAllNotifyStatus,
@ -378,6 +392,7 @@ export default {
name: 'newSoIssueNotify',
components: {
Chooselist,
noorderUploadExcel,
},
watch: {
// notifyOrderData: {
@ -1071,6 +1086,8 @@ export default {
//
isMaterialDetailModal: false, //
clickrow:{},
partNo:'',
addLineLoading:false,
}
},
@ -1590,6 +1607,65 @@ export default {
this.seqNoData.releaseNo = ''
this.seqNoData.sequenceNo = ''
},
//
addRowFromQuery() {
if(!this.partNo){
this.$message.warning('请输入物料号!')
return
}
// seqNoList
if (!this.seqNoList) {
this.seqNoList = []
}
//
const queryParams = {
site: this.$store.state.user.site,
componentPartNo: this.partNo || '', // 使
orderType: this.orderType, // 使
}
this.addLineLoading = true
queryPartAttributeData(queryParams)
.then(({ data }) => {
if (data.code === 0 && data.rows ) {
// partNo
const existingPartNos = this.seqNoList.map((item) => item.partNo)
const newRows = existingPartNos.includes(data.rows.partNo)
if (newRows) {
this.$message.warning('查询到的物料已存在于列表中!')
return
}
//
const newRow = {
partNo: data.rows.partNo || '',
height: data.rows.height || '',
isInWh: data.rows.isInWh || '',
componentPartNo: data.rows.partNo || '',
orderNo: '',
releaseNo: '',
sequenceNo: '',
lineItemNo: '',
materialLineStatus: '',
componentPartDesc: '',
uom: '',
startDate: '',
finishDate: '',
needDate: '',
}
this.seqNoList.push(newRow)
this.$set(this, 'partNo', '') //
} else {
this.$message.warning(data.msg || '查询无数据')
}
})
.catch((error) => {
this.$message.error(error.msg || '查询失败,请稍后重试')
}).finally(() => {
this.addLineLoading = false
})
},
deleteSeqNoByOrderNo() {
if (this.seqNoData.orderNo == null || this.seqNoData.orderNo == '') {
this.$message.warning('请输入OrderNo!')
@ -2175,7 +2251,15 @@ export default {
}
})
},
importModel() {
let data = {
site: this.$store.state.user.site,
notifyNo: this.notifyData.notifyNo,
}
this.$nextTick(() => {
this.$refs.noorderUploadExcel.init(data)
})
},
// tableDefault
async getColumnList(tableId, columnId) {
let queryTable = {

1
src/views/modules/noOrderIssue/noOrderNotification.vue

@ -1390,6 +1390,7 @@ export default {
columnWidth: 80,
},
],
columnDetailList2:[],
rules: {
bu: [
{

184
src/views/modules/noOrderIssue/noorder_upload_excel.vue

@ -0,0 +1,184 @@
<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="handleDialogClose" :show-close="!uploading">
<el-form :inline="true" label-position="top" label-width="80px">
<el-row>
<el-form-item label=" ">
<!-- <el-button type="primary" @click="downloadFile()" :disabled="uploading">下载文件模板</el-button>-->
<a href="/static/downLoad/NotifyUploadModel.xlsx" download="领料申请单导入模板.xlsx">
下载 Excel 模板
</a>
</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" :disabled="uploading" style="text-align: left;">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
{{ uploading ? '正在上传中,请稍候...' : '将文件拖到此处,或点击上传' }}
</div>
</el-upload>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveUploadFile" :loading="uploading" :disabled="uploading">
{{ uploading ? '上传中...' : '保存' }}
</el-button>
<el-button type="primary" @click="closeDialog" :disabled="uploading">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { uploadNoorderNotifyExcel } from '@/api/orderIssure/noOrderIssueNotify.js'
export default {
name: 'bomComponentUpload',
data() {
return {
buList: [],
titleCon: '文件导入',
visible: false,
fileList: [],
pageData: {
site: '',
buNo: '',
createBy: this.$store.state.user.name,
},
notifyData:{
site: '',
notifyNo: '',
},
uploading: false, //
}
},
methods: {
//
init (data) {
this.fileList = []
this.uploading = false //
//
this.visible = true
this.notifyData=JSON.parse(JSON.stringify(data))
},
//
beforeUploadHandle (file) {
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (!(extName === '.xlsx' || extName === '.xls')) {
this.$message.error('数据导入失败,请选择正确的xlsx或xls格式的Excel文件')
return false
}
return true
},
//
onChange (file) {
//
this.fileList = []
this.fileList.push(file)
},
// modal
closeDialog () {
//
if (this.uploading) {
this.$message.warning('正在上传中,请稍候...')
return false
}
this.deleteFile()
//
this.visible = false
},
// X
handleDialogClose () {
if (this.uploading) {
this.$message.warning('正在上传中,请稍候...')
return
}
this.deleteFile()
},
deleteFile(){
this.fileList = []
this.uploading = false //
//
this.$refs.uploadFile.clearFiles()
//
this.$emit('refreshTable')
},
//
saveUploadFile () {
//
if (null == this.fileList || 0 === this.fileList.length) {
this.$message.error("请先上传文件!")
return false
}
//
const file = this.fileList[0].raw
const fileName = file.name
const fileExtension = fileName.substring(fileName.lastIndexOf('.')).toLowerCase()
if (!('.xls' === fileExtension || '.xlsx' === fileExtension)) {
this.$message.error('文件格式不正确,只支持.xls和.xlsx格式的Excel文件')
return false
}
//
this.uploading = true
// FormData
const formData = new FormData()
formData.append("file", file)
formData.append("site", this.notifyData.site)
formData.append("notifyNo", this.notifyData.notifyNo)
//
uploadNoorderNotifyExcel(formData).then(({ data }) => {
if (data.code === 0) {
this.$message.success(data.msg || 'Excel文件上传成功')
//
this.closeDialog()
} else {
this.$message.error(data.msg || 'Excel文件上传失败')
}
}).catch(error => {
console.error('Excel上传异常:', error)
this.$message.error('Excel文件上传异常,请检查文件格式和内容')
}).finally(() => {
//
this.uploading = false
})
},
//
async downloadFile () {
//
//
this.$alert(
'模板格式说明:\n' +
'第1列:工厂编码(site)\n' +
'第2列:订单号(orderNo)\n' +
'第3列:发布号(releaseNo)\n' +
'第4列:序列号(sequenceNo)\n' +
'第5列:BOM行号(bomLineNo,必须为正整数)\n' +
'第6列:物料编码(materialPartNo)\n' +
'第7列:需求日期(needDate,格式:YYYY-MM-DD)\n' +
'第8列:数量(qty,必须为数字)',
'模板格式说明',
{
confirmButtonText: '确定',
type: 'info'
}
)
},
}
}
</script>
Loading…
Cancel
Save