Browse Source

2025-11-25

领料申请管理
1、状态增加:待确认,下拉筛选中也需要
  1.1 草稿状态点击"提交"后,将状态改为待确认
  1.2 待确认状态点击"下达"后,将状态改为待出库
2、主表SOIssueNotifyHeader增加车间选项,保存到work_center_no字段,查询和列表中展示该字段,非必填
3、主页面的排序按照单号倒排desc
master
fengyuan_yang 2 months ago
parent
commit
d741a10af8
  1. 1
      src/api/orderIssure/soIssueNotify.js
  2. 169
      src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue

1
src/api/orderIssure/soIssueNotify.js

@ -56,3 +56,4 @@ export const updateNotifyDetail = data => createAPI(`/orderIssure/issureNotify/u
export const saveSOIssueNotifyOrderMateria = data => createAPI(`/orderIssure/issureNotify/saveSOIssueNotifyOrderMateria`,'post',data)
export const getBomAlternativeParts = data => createAPI(`/orderIssure/issureNotify/getBomAlternativeParts`,'post',data)
export const getWorkCenterList = data => createAPI(`/orderIssure/issureNotify/getWorkCenterList`,'post',data)

169
src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue

@ -11,6 +11,7 @@
<el-form-item label="状态" >
<el-select v-model="searchData.status" clearable placeholder="请选择" style="width: 120px">
<el-option label="草稿" value="草稿"></el-option>
<el-option label="待确认" value="待确认"></el-option>
<el-option label="待检验" value="待检验"></el-option>
<el-option label="编辑中" value="编辑中"></el-option>
<el-option label="待出库" value="待出库"></el-option>
@ -104,13 +105,16 @@
<el-table-column
header-align="center"
align="center"
width="100"
width="140"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" v-if="scope.row.status==='草稿' || scope.row.status==='编辑中'" @click="xiadaNotifyModel(scope.row)">下达</a>
<a type="text" size="small" v-if="scope.row.status==='待出库'" @click="editNotifyMaterialFun(scope.row)">编辑</a>
<a type="text" size="small" v-if="scope.row.status!=='已完成' && scope.row.status!=='已关闭' && scope.row.status!=='待出库'" @click="closeNotifyModel(scope.row)">关闭</a>
<a type="text" size="small" v-if="scope.row.status==='草稿' " @click="deleteNotifyConfirm(scope.row)">删除</a>
<el-link style="cursor: pointer" v-if="scope.row.status==='草稿'" @click="submitNotifyModel(scope.row)">提交</el-link>
<span v-if="scope.row.status==='草稿'"> | </span>
<el-link style="cursor: pointer" v-if="scope.row.status==='待确认' || scope.row.status==='编辑中'" @click="xiadaNotifyModel(scope.row)">下达</el-link>
<el-link style="cursor: pointer" v-if="scope.row.status==='待出库'" @click="editNotifyMaterialFun(scope.row)">编辑</el-link>
<el-link style="cursor: pointer" v-if="scope.row.status!=='已完成' && scope.row.status!=='已关闭' && scope.row.status!=='待出库'" @click="closeNotifyModel(scope.row)">关闭</el-link>
<span v-if="scope.row.status==='草稿'"> | </span>
<el-link style="cursor: pointer" v-if="scope.row.status==='草稿' " @click="deleteNotifyConfirm(scope.row)">删除</el-link>
<!-- <a type="text" size="small" v-if="scope.row.status==='已关闭'" @click="openNotify(scope.row)">开启</a>-->
</template>
</el-table-column>
@ -129,7 +133,7 @@
<el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
<el-tab-pane label="申请单明细" name="detail">
<el-form :inline="true" label-position="top" label-width="100px">
<el-button @click="createOrderDetail()" type="primary" style="margin-left: 10px" :disabled="(currentRow.status !== '草稿' && currentRow.status !== '编辑中')">{{'新增'}}</el-button>
<el-button @click="createOrderDetail()" type="primary" style="margin-left: 10px" :disabled="(currentRow.status !== '草稿' && currentRow.status !== '编辑中' && currentRow.status !== '待确认')">{{'新增'}}</el-button>
</el-form>
<el-table
:data="dataList2"
@ -143,7 +147,7 @@
width="60"
label="操作">
<template slot-scope="scope">
<el-link style="cursor: pointer" @click="deleteNotifySOSPlus(scope.row)" :class="{ 'disabled-link': currentRow.status !== '草稿' && currentRow.status !== '编辑中' }">删除</el-link>
<el-link style="cursor: pointer" @click="deleteNotifySOSPlus(scope.row)" :class="{ 'disabled-link': currentRow.status !== '草稿' && currentRow.status !== '编辑中' && currentRow.status !== '待确认' }">删除</el-link>
</template>
</el-table-column>
<el-table-column
@ -405,12 +409,11 @@
</el-footer>
</el-dialog>
<el-dialog title="新建领料申请单" :close-on-click-modal="false" v-drag :visible.sync="createNotifyFlag" width="300px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item :label="'工厂_BU'" style="width: 97%" >
<el-col :span="12">
<el-form-item :label="'工厂_BU'" style="width: 97%">
<el-select v-model="notifyData.bu" placeholder="请选择" style="width: 100%">
<el-option
v-for = "i in userBuList"
@ -425,16 +428,34 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'车间'">
<el-select v-model="notifyData.workCenterNo" clearable placeholder="请选择" style="width: 100%">
<el-option
v-for = "i in workCenterList"
:key = "i.workCenterNo"
:label = "i.workCenterDesc"
:value = "i.workCenterNo">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item :label="'备注'" style="width: 97%">
<el-input v-model="notifyData.remark" style="width: 100%"></el-input>
<el-input
type="textarea"
:rows="3"
v-model="notifyData.remark"
style="width: 100%;">
</el-input>
<!-- <el-input type="textarea" v-model="notifyData.remark" style="width: 100%"></el-input>-->
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-footer style="height:35px;margin-top: 55px;text-align:center">
<el-button type="primary" @click="saveNotify()">保存</el-button>
<el-button type="primary" @click="createNotifyFlag=false">关闭</el-button>
</el-footer>
@ -1060,7 +1081,8 @@
, deleteNotify,
updateNotifyDetail,
saveSOIssueNotifyOrderMateria,
getBomAlternativeParts
getBomAlternativeParts,
getWorkCenterList
} from "@/api/orderIssure/soIssueNotify.js"
import {
searchShopOrderByPaging
@ -1096,6 +1118,7 @@
dataList5: [],
dataList6: [],
userBuList:[],
workCenterList: [],
createNotifyFlag: false,
saveOrderDetailFlag: false,
closeData:{
@ -1148,6 +1171,7 @@
userDisplay: '',
remark: '',
planIssueDate: '',
workCenterNo: ''
},
pageIndex: 1,
pageSize: 100,
@ -2556,7 +2580,7 @@
if (!this.currentRow || !this.currentRow.status) {
return false;
}
return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中';
return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中' || this.currentRow.status === '待确认';
}
},
mounted () {
@ -2566,6 +2590,7 @@
},
created () {
this.getSiteAndBuByUserName()
this.searchTable()
},
@ -2573,7 +2598,7 @@
//
editBatchModel() {
if (this.currentRow.status !== '草稿' && this.currentRow.status !== '编辑中') {
if (this.currentRow.status !== '草稿' && this.currentRow.status !== '编辑中' && this.currentRow.status !== '待确认') {
this.$message.warning('该类型单据不能编辑!')
return
}
@ -2927,7 +2952,7 @@
deleteNotifySOSPlus(row){
//
if (!this.isEditableStatusComputed) {
this.$alert('当前状态不允许编辑!只有草稿或编辑中状态才能删除明细。', '提示', {
this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能删除明细。', '提示', {
confirmButtonText: '确定'
})
return false
@ -2956,34 +2981,62 @@
})
},
//
//
createNotifyModal(){
let inData={
username:this.$store.state.user.name
this.notifyData = {
site: '',
bu: this.userBuList[0].buNo,
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: this.$store.state.user.name,
userDisplay: '',
remark: '',
planIssueDate: '',
workCenterNo: ''
}
this.createNotifyFlag = true
},
getSiteAndBuByUserName() {
let inData = {
username: this.$store.state.user.name
}
getSiteAndBuByUserName(inData).then(({data}) =>{
if (data && data.code === 0) {
this.userBuList=data.rows
this.userBuList = data.rows
if (this.userBuList.length > 0) {
this.notifyData.bu = this.userBuList[0].buNo
this.getWorkCenterList()
}
}
})
},
//
getWorkCenterList() {
let inData = {
site: this.userBuList[0].buNo.split('_')[0],
buNo: this.userBuList[0].buNo.split('_')[1]
}
getWorkCenterList(inData).then(({data}) =>{
if (data && data.code === 0) {
this.workCenterList = data.rows
}
})
this.createNotifyFlag=true
},
//
saveNotify(){
saveNotify() {
let buValue = this.notifyData.bu
let site = buValue.split('_')[0]
let bu = buValue.split('_')[1]
let inData={
let inData = {
site: site,
bu: bu,
userName:this.$store.state.user.name,
remark: this.notifyData.remark
userName: this.$store.state.user.name,
remark: this.notifyData.remark,
workCenterNo: this.notifyData.workCenterNo,
}
createNotify(inData).then(({data})=>{
if (data.code === 0) {
@ -2996,18 +3049,6 @@
this.createNotifyFlag = false
//
this.searchTable()
//
this.notifyData = {
site: '',
bu: '',
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: this.$store.state.user.name,
userDisplay: '',
remark: '',
planIssueDate: '',
}
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@ -3028,7 +3069,7 @@
//
if (!this.isEditableStatusComputed) {
this.$alert('当前状态不允许编辑!只有草稿或编辑中状态才能新增明细。', '提示', {
this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能新增明细。', '提示', {
confirmButtonText: '确定'
})
return false
@ -3596,6 +3637,50 @@
this.$message.success('选择物料成功,数据已填入表单');
},
//
async submitNotifyModel(row){
//
this.currentRow = JSON.parse(JSON.stringify(row));
//
await this.refreshAllSubTables();
console.log('申请单明细数据:', this.dataList2);
console.log('材料明细数据:', this.dataList3);
if(this.dataList2.length==0 || this.dataList3.length==0){
this.$alert('没有明细记录无法提交!', '提示', {
confirmButtonText: '确定'
})
return false
}
// ""
let inData = {
site: row.site,
notifyNo: row.notifyNo,
status: '待确认',
}
updateNotifyStatus(inData).then(({data})=>{
if (data.code === 0) {
//
this.searchTable().then(() => { //
const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo);
if (foundRow) {
this.currentRow = JSON.parse(JSON.stringify(foundRow));
this.$nextTick(() => {
this.$refs.mainTable.setCurrentRow(foundRow);
});
}
});
this.$message.success('提交成功')
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
//
async xiadaNotifyModel(row){
//
@ -3698,7 +3783,7 @@
if (!this.currentRow || !this.currentRow.status) {
return false;
}
return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中';
return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中' || this.currentRow.status === '待确认';
},
//
@ -3728,7 +3813,7 @@
}
if (!this.isEditableStatus()) {
this.$alert('当前状态不允许编辑!只有草稿或编辑中状态才能新增材料。', '提示', {
this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能新增材料。', '提示', {
confirmButtonText: '确定'
});
return false;

Loading…
Cancel
Save