更新采购订单、发货、合同查询、盘点、入库和配置文件,新增零改单和文档

This commit is contained in:
Developer
2026-06-26 08:13:30 +08:00
parent 0c8c6587bd
commit bb30ba76d0
21 changed files with 3290 additions and 50 deletions

View File

@@ -28,19 +28,36 @@
<el-table
v-loading="loading"
:data="tableData"
:show-header="false"
:row-style="{height:'70px'}"
border
stripe
size="mini"
height="750">
<el-table-column type="index" width="50" label="号" align="center"/>
<el-table-column label="状态" prop="状态" align="center" show-overflow-tooltip width="100"/>
<el-table-column label="订单号" prop="订单编号" align="center" show-overflow-tooltip width="150"/>
<el-table-column label="物料编码" prop="物料编码" align="center" show-overflow-tooltip width="150"/>
<el-table-column label="物料名称" prop="物料名称" align="center" show-overflow-tooltip min-width="100"/>
<el-table-column label="图号" prop="图号或型号" align="center" show-overflow-tooltip width="260"/>
<el-table-column label="采购数" prop="数量" align="center" show-overflow-tooltip width="100"/>
<el-table-column label="已入库数量" prop="已到货数量" align="center" show-overflow-tooltip width="100"/>
<el-table-column label="采购合同" prop="采购合同编号" align="center" show-overflow-tooltip min-width="150"/>
<el-table-column align="center" label="订单号" width="170px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column align="center" width="150px" label="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="采购进度" width="770px">
<template slot-scope="scope">
<div class="steps-container">
<div v-for="(item, index) in scope.row.names" :key="index" :class="stepClass(item, index, scope.row.进度)">
<div style="margin-left: 40px;">{{ item.item }}</div>
<div :class="triangleClass(item, index, scope.row.进度)"/>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="80px">
<template slot-scope="scope">
<el-button type="text" size="small" @click="details(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
@@ -54,12 +71,59 @@
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog title="采购进度详情" :visible.sync="dialogFormVisible" center width="650px" custom-class="detail-dialog">
<div class="detail-table-wrapper">
<table class="detail-table" cellspacing="0" cellpadding="0">
<tr>
<td class="detail-label">状态</td>
<td class="detail-value">
<el-tag :type="statusTagType(detailRow.状态)" size="small" effect="dark">{{ detailRow.状态 }}</el-tag>
</td>
<td class="detail-label">订单号</td>
<td class="detail-value">{{ detailRow.订单编号 }}</td>
</tr>
<tr>
<td class="detail-label">物料编码</td>
<td class="detail-value">{{ detailRow.物料编码 }}</td>
<td class="detail-label">物料名称</td>
<td class="detail-value">{{ detailRow.物料名称 }}</td>
</tr>
<tr>
<td class="detail-label">图号或型号</td>
<td class="detail-value" colspan="3">{{ detailRow.图号或型号 }}</td>
</tr>
<tr>
<td class="detail-label">采购数</td>
<td class="detail-value">{{ detailRow.数量 }}</td>
<td class="detail-label">已入库数量</td>
<td class="detail-value">{{ detailRow.已到货数量 }}</td>
</tr>
<tr>
<td class="detail-label">采购合同</td>
<td class="detail-value" colspan="3">{{ detailRow.采购合同编号 }}</td>
</tr>
</table>
</div>
</el-dialog>
</div>
</template>
<script>
import { getMaterialPurchaseProgress } from '@/api/PurchasingManagement/MaterialPurchaseProgress'
const STATUS_MAP = { '未提交': 1, '未到货': 2, '已到货': 3, '质检中': 3, '部分到': 4, '已入库': 4 }
function getStepNames(status) {
var step3 = (status === '质检中') ? '质检中' : '已到货'
var step4 = (status === '部分到') ? '部分到' : '已入库'
return [
{ item: '未提交', value: 1 },
{ item: '未到货', value: 2 },
{ item: step3, value: 3 },
{ item: step4, value: 4 }
]
}
export default {
data() {
return {
@@ -70,7 +134,9 @@ export default {
tableData: [],
total: 0,
pageCurrent: 1,
pageSize: 50
pageSize: 50,
dialogFormVisible: false,
detailRow: {}
}
},
created() {
@@ -85,13 +151,42 @@ export default {
param[2] = ['图号', this.drawingNo]
var requestData = this.CreateData('11', '物料_采购进度_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(requestData).then(response => {
this.tableData = response.data.rows || []
var rows = response.data.rows || []
this.tableData = rows.map(function(row) {
var progress = STATUS_MAP[row.状态] || 1
var names = getStepNames(row.状态)
return Object.assign({}, row, { 进度: progress, names: names })
})
this.total = response.data.total || 0
this.loading = false
}).catch(() => {
this.loading = false
})
},
stepClass(item, index, progress) {
var cls = 'title' + item.value
if (progress > index) {
cls = 'active' + item.value
}
return cls
},
triangleClass(item, index, progress) {
if (progress > index) {
return 'triangle-active' + item.value
}
if (progress === index + 1) {
return 'arrow-active' + item.value
}
return 'triangle' + item.value
},
details(row) {
this.detailRow = row
this.dialogFormVisible = true
},
statusTagType(status) {
var map = { '未提交': 'info', '未到货': 'warning', '质检中': '', '已到货': '', '部分到': 'success', '已入库': 'success' }
return map[status] || 'info'
},
search() {
this.pageCurrent = 1
this.fetchData()
@@ -108,3 +203,231 @@ export default {
}
}
</script>
<style scoped>
.el-card {
margin: 0px;
}
.detail-table-wrapper {
padding: 0 10px;
}
.detail-table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}
.detail-table td {
border: 1px solid #dcdfe6;
padding: 12px 16px;
height: 44px;
}
.detail-label {
background: #f5f7fa;
color: #606266;
font-weight: 500;
width: 110px;
text-align: center;
}
.detail-value {
color: #303133;
width: 195px;
}
</style>
<style scoped lang="scss">
/deep/ .el-table__row {
height: 94px !important;
}
/deep/ .el-table__row > td {
border: none;
}
/deep/ .el-table th.is-leaf {
border: none;
}
/deep/ .el-table::before {
height: 0px;
}
/deep/ .el-table--border {
border: none;
}
</style>
<style scoped lang="stylus">
.steps-container
display flex
overflow hidden
.title1
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active1
width 140px
height 85px
display flex
justify-content center
align-items center
background #E9F0FA
font-size 14px
font-weight 500
color black
position relative
.title2
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active2
width 140px
height 85px
display flex
justify-content center
align-items center
background #B7D7F0
font-size 14px
font-weight 500
color black
position relative
.title3
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active3
width 140px
height 85px
display flex
justify-content center
align-items center
background #6EABE1
font-size 14px
font-weight 500
color black
position relative
.title4
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active4
width 140px
height 85px
display flex
justify-content center
align-items center
background #2682D5
font-size 14px
font-weight 500
color black
position relative
.triangle1
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff
.triangle1::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active1
border-color transparent transparent transparent #ffffff
.triangle-active1::after
border-color transparent transparent transparent #E9F0FA
.triangle2
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff
.triangle2::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active2
border-color transparent transparent transparent #ffffff
.triangle-active2::after
border-color transparent transparent transparent #B7D7F0
.triangle3
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff
.triangle3::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active3
border-color transparent transparent transparent #ffffff
.triangle-active3::after
border-color transparent transparent transparent #6EABE1
.triangle4
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff
.triangle4::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active4
border-color transparent transparent transparent #ffffff
.triangle-active4::after
border-color transparent transparent transparent #2682D5
</style>

View File

@@ -681,7 +681,7 @@
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible2 = false">取消</el-button>
<el-button type="primary" style="width: 70px" @click="submitPicture()">确定</el-button>
<el-button :loading="uploadSaving" type="primary" style="width: 70px" @click="submitPicture()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" width="350px">
@@ -880,6 +880,10 @@ export default {
limit: 100,
Data: {},
upload: url,
uploadSaving: false,
uploadFileTotal: 0,
uploadFileFinished: 0,
uploadFileFailed: 0,
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
pageCurrent1: 1, // 分页当前页
@@ -1324,20 +1328,39 @@ export default {
if (response.data && response.data[0] && response.data[0].result === '1') {
console.log('文件保存成功:', savePath)
} else {
this.uploadFileFailed++
console.error('文件保存失败:', response.data)
}
}).catch(err => {
this.uploadFileFailed++
console.error('文件保存异常:', err)
}).finally(() => {
this.uploadFileFinished++
if (this.uploadFileFinished >= this.uploadFileTotal) {
this.uploadSaving = false
if (this.uploadFileFailed === 0) {
this.$message.success('图片上传成功')
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
} else {
this.$message.error('部分图片上传失败,请重新上传失败图片')
}
}
})
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
},
updatePicture(row) {
this.dialogFormVisible2 = true
this.purchaseContractID = row.采购合同流水号
},
submitPicture() {
if (!this.$refs.upload || this.$refs.upload.uploadFiles.length === 0) {
this.$message.warning('请选择图片')
return
}
this.uploadSaving = true
this.uploadFileTotal = this.$refs.upload.uploadFiles.length
this.uploadFileFinished = 0
this.uploadFileFailed = 0
var param = []
param[0] = ['采购合同流水号', this.purchaseContractID]
param[1] = ['文件名称', '']
@@ -1346,7 +1369,6 @@ export default {
var Data1 = this.CreateData('15', '采购合同查询_上传图片', param)
this.Data.param = Data1
this.$refs.upload.submit()
this.dialogFormVisible2 = false
},
getData() {
if (this.PartType === '物料采购') {

View File

@@ -1207,7 +1207,8 @@
<script>
import { mapGetters } from 'vuex'
import { MESDownloadFile, MESUploadFileProject, url } from '@/utils/request'
import { MESDownloadFile, MESDownloadFileNew, MESUploadFileProject, url } from '@/utils/request'
import axios from 'axios'
import $ from 'jquery'
export default {
@@ -1472,8 +1473,19 @@ export default {
var Data = this.CreateData('11', '发货单_图片_批量查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls2.push('data:image/png;base64,' + response.data[i].文件内容)
const item = response.data[i]
if (item.文件路径) {
axios.get(MESDownloadFileNew, {
params: { filePath: item.文件路径 }
}).then(res => {
if (res.data && res.data[0] && res.data[0].文件内容) {
this.urls2.push('data:image/png;base64,' + res.data[0].文件内容)
}
}).catch(err => {
console.error('图片加载失败:', err)
})
} else if (item.文件内容 !== null) {
this.urls2.push('data:image/png;base64,' + item.文件内容)
}
}
})
@@ -2968,4 +2980,3 @@ a {
color: #999;
}
</style>

View File

@@ -188,7 +188,7 @@
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible2=false">取消</el-button>
<el-button type="distribution" size="small" @click="submit2('form')">确定</el-button>
<el-button :loading="uploadSaving" type="distribution" size="small" @click="submit2('form')">确定</el-button>
</div>
</el-dialog>
</div>
@@ -204,6 +204,10 @@ export default {
Data: {},
limit: 1000,
upload: url,
uploadSaving: false,
uploadFileTotal: 0,
uploadFileFinished: 0,
uploadFileFailed: 0,
dialogFormVisible1: false,
dialogFormVisible2: false,
listValue: '',
@@ -319,16 +323,36 @@ export default {
if (response.data && response.data[0] && response.data[0].result === '1') {
console.log('文件保存成功:', savePath)
} else {
this.uploadFileFailed++
console.error('文件保存失败:', response.data)
}
}).catch(err => {
this.uploadFileFailed++
console.error('文件保存异常:', err)
}).finally(() => {
this.uploadFileFinished++
if (this.uploadFileFinished >= this.uploadFileTotal) {
this.uploadSaving = false
if (this.uploadFileFailed === 0) {
this.$message.success('图片上传成功')
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
this.searchTable()
} else {
this.$message.error('部分图片上传失败,请重新上传失败图片')
}
}
})
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
},
submit2() {
if (!this.$refs.upload || this.$refs.upload.uploadFiles.length === 0) {
this.$message.warning('请选择图片')
return
}
this.uploadSaving = true
this.uploadFileTotal = this.$refs.upload.uploadFiles.length
this.uploadFileFinished = 0
this.uploadFileFailed = 0
var param = []
param[0] = ['发货单流水号', this.listValue]
param[1] = ['文件名称', '']
@@ -337,10 +361,6 @@ export default {
var Data1 = this.CreateData('15', '发货管理_发货单_上传图片', param)
this.Data.param = Data1
this.$refs.upload.submit()
this.dialogFormVisible2 = false
this.$nextTick(() => {
this.searchTable()
})
},
uploadPicture(row) {
this.dialogFormVisible2 = true

View File

@@ -479,7 +479,7 @@
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible1 = false">取消</el-button>
<el-button size="small" type="distribution" @click="submit2('form')">确定</el-button>
<el-button :loading="uploadSaving" size="small" type="distribution" @click="submit2('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleCreatePickingList" center width="740px">
@@ -581,6 +581,10 @@ export default {
upload: url,
limit: 20,
Data: {},
uploadSaving: false,
uploadFileTotal: 0,
uploadFileFinished: 0,
uploadFileFailed: 0,
form: {
发货单号: '',
发货日期: '',
@@ -1256,6 +1260,14 @@ export default {
this.listValue = row.发货单流水号
},
submit2() {
if (!this.$refs.upload || this.$refs.upload.uploadFiles.length === 0) {
this.$message.warning('请选择图片')
return
}
this.uploadSaving = true
this.uploadFileTotal = this.$refs.upload.uploadFiles.length
this.uploadFileFinished = 0
this.uploadFileFailed = 0
var param = []
param[0] = ['发货单流水号', this.listValue]
param[1] = ['文件名称', '']
@@ -1264,10 +1276,6 @@ export default {
var Data1 = this.CreateData('15', '发货管理_发货单_上传图片', param)
this.Data.param = Data1
this.$refs.upload.submit()
this.dialogFormVisible1 = false
this.$nextTick(() => {
this.searchTable()
})
},
uploadSuccess(res, file) { // 上传成功回调
// 生成文件保存路径: 基础路径/DeliveryRecord/年月日时分秒毫秒-流水号.后缀
@@ -1302,14 +1310,26 @@ export default {
if (response.data && response.data[0] && response.data[0].result === '1') {
console.log('文件保存成功:', savePath)
} else {
this.uploadFileFailed++
console.error('文件保存失败:', response.data)
}
}).catch(err => {
this.uploadFileFailed++
console.error('文件保存异常:', err)
}).finally(() => {
this.uploadFileFinished++
if (this.uploadFileFinished >= this.uploadFileTotal) {
this.uploadSaving = false
if (this.uploadFileFailed === 0) {
this.$message.success('图片上传成功')
this.dialogFormVisible1 = false
this.$refs.upload.clearFiles()
this.searchTable()
} else {
this.$message.error('部分图片上传失败,请重新上传失败图片')
}
}
})
this.dialogFormVisible1 = false
this.$refs.upload.clearFiles()
},
beforeUpload(file) { // 上传前检测
const isJPG = /^image\/.*/.test(file.type)

View File

@@ -84,7 +84,7 @@
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" prop="订单号" sortable="订单号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
{{ scope.row.订单号1 }}
</template>
</el-table-column>
<!-- <el-table-column :width="setColumnWidth('姓名')" label="收货人" align="center" show-overflow-tooltip>

View File

@@ -0,0 +1,628 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row :gutter="10">
<el-col :span="10">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="orderValue"
:remote-method="getOrderOptions"
style="width: 180px"
placeholder="订单编号"
size="small"
filterable
clearable
remote
@change="pageCurrent = 1; getOrderList()">
<el-option
v-for="item in orderOptions"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="productKeyword"
style="width: 180px"
size="small"
placeholder="产品名称"
clearable
@keyup.enter.native="pageCurrent = 1; getOrderList()"/>
<el-button
type="primary"
plain
icon="el-icon-search"
size="small"
style="margin-left: 10px"
@click="pageCurrent = 1; getOrderList()">查询
</el-button>
</div>
<el-table
v-loading="loadingOrder"
ref="orderTable"
:data="orderTableData"
highlight-current-row
border
stripe
size="mini"
height="740px"
style="width: 100%"
@row-click="handleOrderClick">
<el-table-column width="55px" label="序号" type="index" align="center"/>
<el-table-column width="130px" label="订单编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column width="90px" label="类型" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
<el-col :span="14">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input
v-model="partKeyword"
:disabled="!currentOrderId"
style="width: 180px"
size="small"
placeholder="零件名称"
clearable
@keyup.enter.native="getPartList()"/>
<el-input
v-model="drawingNo"
:disabled="!currentOrderId"
style="width: 160px"
size="small"
placeholder="图号"
clearable
@keyup.enter.native="getPartList()"/>
<span style="font-size: 13px; color: black; margin-left: 12px">
当前产品{{ currentProductName || '未选择' }}
</span>
<el-button
:disabled="!currentOrderId"
type="primary"
plain
icon="el-icon-search"
size="small"
style="margin-left: 10px"
@click="getPartList()">刷新零件
</el-button>
</div>
<el-table
v-loading="loadingPart"
ref="partTable"
:data="partTableData"
highlight-current-row
border
stripe
size="mini"
height="780px"
style="width: auto">
<el-table-column width="55px" label="序号" type="index" align="center"/>
<el-table-column width="130px" label="产品/部件" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column width="200px" label="零件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column width="200px" label="零件图号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column width="70px" label="数量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column width="110px" label="操作" align="center">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="查看图纸" placement="top">
<el-button
type="text"
icon="el-icon-picture-outline"
size="mini"
@click="getNum(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="改制" placement="top">
<el-button
type="text"
icon="el-icon-edit"
size="mini"
@click="openDialog(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-card>
<el-dialog
v-el-drag-dialog
:visible.sync="dialogFormVisible"
title="发起零件改制"
center
width="900px">
<el-form
ref="form"
:model="form"
:rules="rules"
label-position="right"
label-width="110px"
class="demo-ruleForm">
<div class="dialog-block">
<div class="dialog-block-title">原零件信息</div>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="原订单编号">
<el-input v-model="form.原订单编号" size="small" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原零件名称">
<el-input v-model="form.原零件名称" size="small" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原零件图号">
<el-input v-model="form.原零件图号" size="small" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原数量">
<el-input v-model="form.原数量" size="small" disabled/>
</el-form-item>
</el-col>
</el-row>
</div>
<div class="dialog-block">
<div class="dialog-block-title">改制目标</div>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="改制零件名称" prop="改制零件名称">
<el-input v-model="form.改制零件名称" size="small" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="改制零件图号" prop="改制零件图号">
<el-input v-model="form.改制零件图号" size="small" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="改制数量" prop="改制数量">
<el-input-number
v-model="form.改制数量"
:min="1"
:max="Number(form.原数量 || 1)"
size="small"
style="width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="精工期限" prop="精工期限">
<el-date-picker
v-model="form.精工期限"
size="small"
type="date"
style="width: 100%"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="submitForm('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" width="350px">
<div v-for="(file, key) in hadFile" :key="key">
<div class="wrapper">
<div class="content">
<div v-if="file.suffix === 'pdf'" class="icon"><svg-icon icon-class="pdf"/></div>
<div v-else-if="file.suffix === 'docx' || file.suffix === 'doc'" class="icon"><svg-icon icon-class="doc"/></div>
<div v-else-if="file.suffix === 'xlsx' || file.suffix === 'xls'" class="icon"><svg-icon icon-class="excel"/></div>
<div v-else-if="file.suffix === 'pptx' || file.suffix === 'ppt'" class="icon"><svg-icon icon-class="ppt"/></div>
<div v-else-if="file.suffix === 'jpg' || file.suffix === 'jpeg' || file.suffix === 'png'" class="icon"><svg-icon icon-class="pic"/></div>
<div v-else class="icon"><svg-icon icon-class="file"/></div>
<a id="appUrl" :href="file.url" target="view_window"><div class="info">{{ file.name }}</div></a>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import request, { MESDownloadFile } from '@/utils/request'
export default {
data() {
var validateMaterial = (rule, value, callback) => {
if (this.form.改制目标 === '非毛坯物料改制' && !value) {
callback(new Error('请选择物料'))
} else {
callback()
}
}
return {
loadingOrder: false,
loadingPart: false,
dialogFormVisible: false,
dialogVisible: false,
hadFile: [],
total: 0,
pageCurrent: 1,
pageSize: 100,
orderValue: '',
orderOptions: [],
productKeyword: '',
orderTableData: [],
currentOrderId: '',
currentOrderNo: '',
currentProductId: '',
currentProductName: '',
partKeyword: '',
drawingNo: '',
partTableData: [],
targetList: [
{ value: '原现自制订单改制', label: '原现自制订单改制' },
{ value: '毛坯改制', label: '毛坯改制' },
{ value: '非毛坯物料改制', label: '非毛坯物料改制' }
],
materialName: '',
materialSpec: '',
materialNew: '',
materialNewValue: '',
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
form: {
原订单流水号: '',
原组件流水号: '',
原基本件流水号: '',
原工艺计划流水号: '',
原订单编号: '',
原零件名称: '',
原零件图号: '',
原数量: '',
改制目标: '',
改制零件名称: '',
改制零件图号: '',
改制数量: 1,
是否毛坯: '',
物料编号: '',
物料名称: '',
改制原因: '',
改制要求: '',
技术备注: '',
精工期限: ''
},
rules: {
改制目标: [{ required: true, message: '请选择改制目标', trigger: 'change' }],
改制零件名称: [{ required: true, message: '请输入改制零件名称', trigger: 'blur' }],
改制零件图号: [{ required: true, message: '请输入改制零件图号', trigger: 'blur' }],
改制数量: [{ required: true, message: '请输入改制数量', trigger: 'change' }],
是否毛坯: [{ required: true, message: '请选择是否毛坯', trigger: 'change' }],
物料编号: [{ validator: validateMaterial, trigger: 'change' }],
改制原因: [{ required: true, message: '请输入改制原因', trigger: 'blur' }],
改制要求: [{ required: true, message: '请输入改制要求', trigger: 'blur' }],
精工期限: [{ required: true, message: '请选择精工期限', trigger: 'change' }]
}
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
if (this.$refs.orderTable) {
this.$refs.orderTable.doLayout()
}
if (this.$refs.partTable) {
this.$refs.partTable.doLayout()
}
})
},
created() {
this.getOrderOptions()
this.getOrderList()
},
methods: {
handleOrderClick(row) {
this.currentOrderId = row.订单流水号 || ''
this.currentOrderNo = row.订单编号 || ''
this.currentProductId = row.组件流水号 || ''
this.currentProductName = row.产品名称 || ''
this.getPartList()
},
resetMaterialSelect() {
this.materialName = ''
this.materialSpec = ''
this.materialNew = ''
this.materialNewValue = ''
this.tableData1 = []
this.pageCurrent1 = 1
this.pageSize1 = 10
this.total1 = 0
this.form.物料编号 = ''
this.form.物料名称 = ''
},
targetChange(value) {
this.resetMaterialSelect()
if (value === '原现自制订单改制') {
this.form.是否毛坯 = 0
} else if (value === '毛坯改制') {
this.form.是否毛坯 = 1
} else if (value === '非毛坯物料改制') {
this.form.是否毛坯 = 0
this.searchMaterial()
} else {
this.form.是否毛坯 = ''
}
},
openDialog(row) {
this.form = {
原订单流水号: this.currentOrderId,
原组件流水号: row.组件流水号 || '',
原基本件流水号: row.基本件流水号 || '',
原工艺计划流水号: row.工艺计划流水号 || '',
原订单编号: this.currentOrderNo,
原零件名称: row.零件名称 || '',
原零件图号: row.零件图号 || row.图号或型号 || '',
原数量: row.数量 || '',
改制目标: '',
改制零件名称: row.零件名称 || '',
改制零件图号: row.零件图号 || row.图号或型号 || '',
改制数量: row.数量 ? Number(row.数量) : 1,
是否毛坯: '',
物料编号: '',
物料名称: '',
改制原因: '',
改制要求: '',
技术备注: '',
精工期限: row.精工期限 || ''
}
this.resetMaterialSelect()
this.dialogFormVisible = true
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate()
}
})
},
selectNewMaterial(row) {
this.materialNewValue = row.物料流水号 || ''
this.materialNew = (row.名称 || '') + ' ' + (row.代号 || '')
this.form.物料编号 = row.编码 || row.代号 || ''
this.form.物料名称 = row.名称 || ''
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.validateField('物料编号')
}
})
},
searchMaterial() {
var param = []
param[0] = ['名称', this.materialName]
param[1] = ['图号型号', this.materialSpec]
var Data = this.CreateData('11', '物料信息_查询', param, this.pageSize1, this.pageCurrent1)
this.ExecDatabase(Data).then(response => {
if (response.data.rows) {
this.tableData1 = response.data.rows
this.total1 = response.data.total
} else {
this.tableData1 = response.data
this.total1 = response.data.length
}
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchMaterial()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchMaterial()
},
submitForm(formName) {
var oldDrawingNo = (this.form.原零件图号 || '').toString().trim()
var newDrawingNo = (this.form.改制零件图号 || '').toString().trim()
if (oldDrawingNo && newDrawingNo && oldDrawingNo === newDrawingNo) {
this.$message.warning('改制零件图号不能与原零件图号相同')
return
}
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['原订单流水号', this.form.原订单流水号]
param[1] = ['原组件流水号', this.form.原组件流水号]
param[2] = ['改制零件名称', this.form.改制零件名称]
param[3] = ['改制零件图号', this.form.改制零件图号]
param[4] = ['改制数量', this.form.改制数量]
param[5] = ['精工期限', this.form.精工期限]
param[6] = ['发起人', this.id]
param[7] = ['原零件名称', this.form.原零件名称]
param[8] = ['原零件图号', this.form.原零件图号]
var Data = this.CreateData('12', '技术中心_改制订单_发起改制', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('改制订单发起成功')
this.dialogFormVisible = false
this.getOrderList()
this.getPartList()
} else {
this.$message.error(response.data[0].msg || '改制订单发起失败')
}
})
} else {
return false
}
})
},
getOrderOptions(query) {
this.orderOptions = []
var param = []
param[0] = ['客户名称', '']
param[1] = ['订单编号', query || '']
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (var i = 0; i < response.data.length; i++) {
this.orderOptions.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getOrderList() {
var param = []
param[0] = ['订单流水号', this.orderValue]
param[1] = ['产品名称', this.productKeyword]
this.loadingOrder = true
var Data = this.CreateData('11', '技术中心_改制订单_订单_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.loadingOrder = false
if (response.data.rows) {
this.orderTableData = response.data.rows
this.total = response.data.total
} else {
this.orderTableData = response.data
this.total = response.data.length
}
this.currentOrderId = ''
this.currentOrderNo = ''
this.currentProductId = ''
this.currentProductName = ''
this.partTableData = []
}).catch(() => {
this.loadingOrder = false
})
},
getPartList() {
var param = []
param[0] = ['组件流水号', this.currentProductId]
this.loadingPart = true
var Data = this.CreateData('11', '技术中心_改制订单_零件_查询', param)
this.ExecDatabase(Data).then(response => {
this.loadingPart = false
this.partTableData = response.data
}).catch(() => {
this.loadingPart = false
})
},
getNum(row) {
this.dialogVisible = true
this.getFileList(row.零件图号 || row.图号或型号)
},
getFileList(value) {
this.hadFile = []
if (value) {
request({
url: '',
method: 'post',
data: {
type: '3',
name: "select * from 机加工MES_零件图纸PDF表 where 是否启用 = 1 and name = '" + value + "'"
}
}).then(data => {
if (data.data.length > 0) {
var server = ('' + MESDownloadFile).split('/')
data.data.map(item => {
this.hadFile.push({
url: 'http://' + server[2] + '/webpage/part/' + item.uid + '.' + item.suffix,
name: item.name + '.' + item.suffix,
suffix: item.suffix,
id: item.uid
})
})
}
})
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.getOrderList()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.getOrderList()
}
}
}
</script>
<style scoped>
.el-form-item {
margin-bottom: 15px;
}
.dialog-block {
padding: 12px 14px 4px 14px;
margin-bottom: 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.dialog-block-title {
margin-bottom: 12px;
font-size: 14px;
font-weight: 600;
color: #303133;
}
.material-summary {
font-size: 16px;
color: red;
}
.wrapper {
width: 90%;
height: 50px;
overflow: hidden;
border: 1px solid #b8c7d9;
margin: 10px;
}
.content {
position: relative;
padding: 8px 8px 0 8px;
}
</style>

View File

@@ -7,6 +7,7 @@
<el-input v-model="specificationsModel" style="width: 150px " size="small" clearable placeholder="图号或型号"/>
<el-input v-model="LocationName" style="width: 100px " size="small" clearable placeholder="库位"/>
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="pageCurrent=1;searchTable()">查询</el-button>
<el-button v-if="Number(token) === 2" type="success" plain icon="el-icon-download" size="small" style="margin-left: 7px" @click="exportExcel()">导出</el-button>
<el-button type="distribution" size="small" @click="addMaterial()">增加物料存货</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 20px" plain size="small" @click="Pronters()">批量打印</el-button>
<!--<el-button type="distribution" size="small" @click="addProduct()">增加通用存货</el-button>-->
@@ -56,7 +57,22 @@
</el-table-column>
<el-table-column width="90" label="库位" align="center" sortable="货位名称" prop="货位名称">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
<el-select
v-if="scope.row.edit"
v-model="scope.row.货位流水号"
size="mini"
style="width: 100%"
clearable
filterable
placeholder="请选择库位"
@change="handleLocationChange(scope.row)">
<el-option
v-for="item in storageLocation"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span v-else>{{ scope.row.货位名称 }}</span>
</template>
</el-table-column>
<el-table-column label="批次编号" align="center" sortable="批次" prop="批次">
@@ -346,6 +362,27 @@ export default {
}
})
},
exportExcel() {
if (this.tableData.length === 0) {
this.$message.warning('暂无数据')
return
}
let materialName_check, specificationsModel_check, LocationName_check
this.materialName ? materialName_check = 1 : materialName_check = 0
this.specificationsModel ? specificationsModel_check = 1 : specificationsModel_check = 0
this.LocationName ? LocationName_check = 1 : LocationName_check = 0
var param = []
param[0] = ['物料名称_check', materialName_check]
param[1] = ['物料名称', this.materialName]
param[2] = ['图号或型号_check', specificationsModel_check]
param[3] = ['图号或型号', this.specificationsModel]
param[4] = ['库位_check', LocationName_check]
param[5] = ['库位', this.LocationName]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', this.order]
var Data = this.CreateData('2001', '仓储管理_库存盘点_查询', param)
this.exportExcel_NPOI(Data)
},
searchTable() {
this.loading = true
this.tableData = []
@@ -376,11 +413,14 @@ export default {
类型: response.data.rows[i].类型,
单位: response.data.rows[i].单位,
库存: response.data.rows[i].库存,
货位流水号: response.data.rows[i].货位流水号,
货位名称: response.data.rows[i].货位名称,
批次编号: response.data.rows[i].批次编号,
编辑人: response.data.rows[i].编辑人,
编辑时间: response.data.rows[i].编辑时间,
库存_before: response.data.rows[i].库存,
货位流水号_before: response.data.rows[i].货位流水号,
货位名称_before: response.data.rows[i].货位名称,
打印条码数: 1,
edit: false
})
@@ -502,12 +542,17 @@ export default {
})
},
confirmEdit(row) {
if (!row.货位流水号) {
this.$message.warning('请选择库位')
return
}
var param = []
param[0] = ['物料与货位流水号', row.物料与货位流水号]
param[1] = ['原数量', row.库存_before]
param[2] = ['更改后数量', row.库存]
param[3] = ['操作者', this.id]
param[4] = ['类型', row.类型]
param[5] = ['货位流水号', row.货位流水号]
var Data = this.CreateData('12', '仓储管理_库存盘点_货位数量_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
@@ -518,10 +563,21 @@ export default {
}
})
},
handleLocationChange(row) {
for (let i = 0; i < this.storageLocation.length; i++) {
if (this.storageLocation[i].value === row.货位流水号) {
row.货位名称 = this.storageLocation[i].label
return
}
}
row.货位名称 = ''
},
// 取消编辑
cancelEdit(index, row) {
row.edit = false
row.库存 = row.库存_before
row.货位流水号 = row.货位流水号_before
row.货位名称 = row.货位名称_before
this.$message('取消修改')
},
handleSizeChanges(val) {
@@ -545,4 +601,3 @@ export default {
}
}
</script>

View File

@@ -123,7 +123,7 @@
<template slot-scope="scope">
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
<el-option
v-for="item in locateName"
v-for="item in scope.row.locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
@@ -161,9 +161,9 @@
<el-input-number v-model="scope.row.打印条码数" :min="1" size="mini" style="margin: 0;width: 100%"/>
</template>
</el-table-column>
<el-table-column width="80px" label="操作" align="center" show-overflow-tooltip>
<el-table-column width="140px" label="操作" align="center" show-overflow-tooltip fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '编辑' }}</el-button>
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '库位' }}</el-button>
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter(scope.row)"/>
</template>
</el-table-column>
@@ -329,7 +329,7 @@
<template slot-scope="scope">
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
<el-option
v-for="item in locateName"
v-for="item in scope.row.locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
@@ -751,7 +751,6 @@ export default {
}
},
created() {
this.getLocateName()
this.getSupplierSelection()
this.getPeople()
this.getSelectTheOutsourcingManufacturers()
@@ -1058,10 +1057,90 @@ export default {
})
},
onLocateChange(row) {
var obj = this.locateName.find(function(item) {
var locateName = row.locateName || []
var obj = locateName.find(function(item) {
return item.value === row.货位流水号
})
row.货位名称 = obj ? obj.label : ''
this.$set(row, 'selectedLocate', obj || null)
},
confirmLocateChange(row) {
var locate = row.selectedLocate
if (!locate && row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
locate = this.getLocateItemByValue(row.locateName, row.货位流水号)
}
this.$set(row, '货位名称', locate ? locate.name : '')
this.$set(row, '货位流水号', locate ? String(locate.value) : '')
this.updateSelectedLocate(row)
},
getLocateItemByValue(locateName, value) {
var list = locateName || []
for (let i = 0; i < list.length; i++) {
if (String(list[i].value) === String(value)) {
return list[i]
}
}
return null
},
syncLocateValueByName(row) {
var locateName = row.locateName || []
for (let i = 0; i < locateName.length; i++) {
if (locateName[i].name === row.货位名称) {
this.$set(row, '货位流水号', String(locateName[i].value))
return
}
}
},
updateSelectedLocate(row) {
for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i] === row) {
this.multipleSelection[i].货位流水号 = row.货位流水号
this.multipleSelection[i].货位名称 = row.货位名称
}
}
for (let i = 0; i < this.multipleSelection2.length; i++) {
if (this.multipleSelection2[i] === row) {
this.multipleSelection2[i].货位流水号 = row.货位流水号
this.multipleSelection2[i].货位名称 = row.货位名称
}
}
this.refreshReturnsLocate(row)
},
refreshReturnsLocate(row) {
for (let i = 0; i < this.returns.length; i++) {
if (this.returns[i].物料编码 === row.物料编码 && this.returns[i].物料名称 === row.物料名称 && this.returns[i].规格型号 === row.图号或型号) {
this.returns[i].库位 = row.货位名称
}
}
},
getInventoryLocateName(row) {
var materialName = row.物料名称 || row.零件名称 || ''
var specificationsModel = row.图号或型号 || row.零件图号 || ''
let materialName_check, specificationsModel_check
materialName ? materialName_check = 1 : materialName_check = 0
specificationsModel ? specificationsModel_check = 1 : specificationsModel_check = 0
var param = []
param[0] = ['物料名称_check', materialName_check]
param[1] = ['物料名称', materialName]
param[2] = ['图号或型号_check', specificationsModel_check]
param[3] = ['图号或型号', specificationsModel]
param[4] = ['库位_check', 0]
param[5] = ['库位', '']
param[6] = ['排序名称', '']
param[7] = ['排序方式', '']
var Data = this.CreateData('11', '仓储管理_库存盘点_查询', param)
this.ExecDatabase(Data).then(response => {
var locateName = []
var data = response.data.rows || response.data
for (let i = 0; i < data.length; i++) {
var inventory = data[i].库存 || data[i].货位存量 || 0
locateName.push({
label: data[i].货位名称 + '(库存:' + inventory + '',
name: data[i].货位名称,
value: String(data[i].货位流水号)
})
}
this.$set(row, 'locateName', locateName)
})
},
getData() {
if (this.PartType === '采购入库') {
@@ -1119,6 +1198,8 @@ export default {
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
row.货位流水号 = String(row.货位流水号)
}
this.$set(row, 'locateName', [])
this.$set(row, 'selectedLocate', null)
this.$set(row, '_editing', false)
}
if (this.tableData1.length === 0) {
@@ -1141,7 +1222,13 @@ export default {
}.bind(this))
},
toggleRowEdit(row) {
this.$set(row, '_editing', !row._editing)
if (row._editing) {
this.confirmLocateChange(row)
this.$set(row, '_editing', false)
} else {
this.$set(row, '_editing', true)
this.getInventoryLocateName(row)
}
},
submitInStorage() {
// this.exportTable()
@@ -1171,6 +1258,7 @@ export default {
this.multipleSelection_variable = this.multipleSelection
this.multipleSelection = []
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
this.syncLocateValueByName(this.multipleSelection_variable[i])
if (!this.multipleSelection_variable[i].货位流水号 && this.multipleSelection_variable[i].货位流水号 !== 0) {
this.$message.warning('存在未绑定货位的物料')
return
@@ -1285,6 +1373,8 @@ export default {
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
row.货位流水号 = String(row.货位流水号)
}
this.$set(row, 'locateName', [])
this.$set(row, 'selectedLocate', null)
this.$set(row, '_editing', false)
}
})
@@ -1307,6 +1397,7 @@ export default {
this.multipleSelection_variable2 = this.multipleSelection2
this.multipleSelection2 = []
for (let i = 0; i < this.multipleSelection_variable2.length; i++) {
this.syncLocateValueByName(this.multipleSelection_variable2[i])
if (!this.multipleSelection_variable2[i].货位流水号 && this.multipleSelection_variable2[i].货位流水号 !== 0) {
this.$message.warning('存在未绑定货位的物料')
return