|
|
|
@ -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; |
|
|
|
|