Commit 803cfc7c authored by jingnan's avatar jingnan 👀

ERP相关_材料领用开发

parent 3585b4e6
...@@ -61,13 +61,17 @@ export default { ...@@ -61,13 +61,17 @@ export default {
data() { data() {
const that = this const that = this
return { return {
typeName: that.basicData.typeName || 'useAO', typeName: that.basicData.typeName || 'OutStorageMaterialUse',
options: [ options: [
{
label: '材料领用',
value: 'OutStorageMaterialUse'
}
], ],
showCmp: true, showCmp: true,
cmpOptions: { cmpOptions: {
typeName: 'OutStorageUse', typeName: 'OutStorageUse',
layKey: 'outStorageUseApplyAdd_useAO' layKey: 'outStorageUseApplyAdd_OutStorageMaterialUse'
}, },
bindForm: {}, bindForm: {},
outStorageUseId: ''// outStorageUseId: ''//
...@@ -102,22 +106,23 @@ export default { ...@@ -102,22 +106,23 @@ export default {
}) })
}, },
mounted() { mounted() {
this.getUseRequestTypes() // this.getUseRequestTypes()
}, },
// 组件方法 // 组件方法
methods: { methods: {
async getUseRequestTypes() { async getUseRequestTypes() {
const user = localStorage.getItem('user') // const user = localStorage.getItem('user')
const userId = localStorage.getItem('userId') // const userId = localStorage.getItem('userId')
const dicData = await this.$utils.getDicListByCode('UseRequestType') const dicData = await this.$utils.getDicListByCode('UseRequestType')
// 当前登陆人为孙瑶雪 和dexadmin的时候下拉可以看到试验领用,其他人看不到 // 当前登陆人为孙瑶雪 和dexadmin的时候下拉可以看到试验领用,其他人看不到
if (user === '孙瑶雪' || user === 'dexadmin') { // if (user === '孙瑶雪' || user === 'dexadmin') {
this.options = dicData.filter(item => item.label !== '无指令领用') // this.options = dicData.filter(item => item.label !== '无指令领用')
} else if (user === '李晓倩' || user === '刘瑞' && Number(userId) === 1626782725550) { // } else if (user === '李晓倩' || user === '刘瑞' && Number(userId) === 1626782725550) {
this.options = dicData.filter(item => item.label !== '无指令领用' && item.label !== '试验领用') // this.options = dicData.filter(item => item.label !== '无指令领用' && item.label !== '试验领用')
} else { // } else {
this.options = dicData.filter(item => item.label !== '试验领用' && item.label !== '无指令领用' && item.label !== '紧急领用') // this.options = dicData.filter(item => item.label !== '试验领用' && item.label !== '无指令领用' && item.label !== '紧急领用')
} // }
this.options = dicData.filter(item => item.label === '材料领用')
}, },
dataChangeHandler(val) { dataChangeHandler(val) {
if (val) { if (val) {
......
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
handler(val) { handler(val) {
switch (val) { switch (val) {
case 'useAO' : case 'useAO' :
case 'materialUse': case 'OutStorageMaterialUse':
case 'NoMachineMaterialUse': case 'NoMachineMaterialUse':
case 'UrgentUse': case 'UrgentUse':
this.amountItemLabel = '申领数量' this.amountItemLabel = '申领数量'
...@@ -107,19 +107,14 @@ export default { ...@@ -107,19 +107,14 @@ export default {
this.$refs['applyForm'].validate((valid) => { this.$refs['applyForm'].validate((valid) => {
if (valid && this.selection) { if (valid && this.selection) {
const typeName = this.basicData.useRequestType const typeName = this.basicData.useRequestType
// const maxAmount = typeName === 'scrapUse' ? this.selection.reqAmountOri : typeName === 'materialUse' ? Math.min(this.selection.unableAmount, this.selection.applyAmount) : this.selection.unableAmount
// const maxWarning = typeName === 'scrapUse' ? '出库数量' : typeName === 'materialUse' ? '可用数量及可申领数量' : '可用数量'
// if (this.applyForm.reqAmount > maxAmount) return this.$utils.showMessageWarning(`申领数量不能大于当前选中物料的${maxWarning}!`)
const data = [{ const data = [{
'subTypeName': 'OutStorageUseItem', 'subTypeName': `${typeName}Item`,
'extMaterial': this.selection.extMaterial, 'extMaterial': this.selection.extMaterial,
'extMaterialId': this.selection.extMaterialId, 'extMaterialId': this.selection.extMaterialId,
// 'extSupportingItemId': this.selection.id, 'erpInventoryId': this.selection.id,
// 'extSupportingItemIdType': this.selection.subTypeName,
'takeAmount': this.selection.takeAmount, 'takeAmount': this.selection.takeAmount,
'unableAmount': this.selection.unableAmount, 'unableAmount': this.selection.unableAmount,
'reqAmount': this.applyForm.reqAmount, 'reqAmount': this.applyForm.reqAmount
'parExtWorkCenterName': this.basicData.extWorkCenter ? this.basicData.extWorkCenter.extname : '' // 用于编辑时删除数据后重新添加占用,调整占用时拿不到库房
}] }]
if (typeName === 'swapUse') { if (typeName === 'swapUse') {
data[0].extSupportingItemVO = this.selectDatas[0].extSupportingItemVO data[0].extSupportingItemVO = this.selectDatas[0].extSupportingItemVO
......
...@@ -119,8 +119,8 @@ export default { ...@@ -119,8 +119,8 @@ export default {
if (val && val.useRequestType) { if (val && val.useRequestType) {
if (val.useRequestType === 'noAO' || val.useRequestType === 'testUse' || val.useRequestType === 'FOUse') { if (val.useRequestType === 'noAO' || val.useRequestType === 'testUse' || val.useRequestType === 'FOUse') {
this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_noAO`) this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_noAO`)
} else if (val.useRequestType === 'materialUse' || val.useRequestType === 'NoMachineMaterialUse') { } else if (val.useRequestType === 'OutStorageMaterialUse' || val.useRequestType === 'NoMachineMaterialUse') {
this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_materialUse`) this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_OutStorageMaterialUse`)
} else { } else {
this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_${val.useRequestType}`) this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_${val.useRequestType}`)
} }
...@@ -335,7 +335,7 @@ export default { ...@@ -335,7 +335,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
post(`InStorageRequestItem/outStorageOutItem/delete?requestItemIds=${this.selectionRows.map(item => item.id).join(',')}`).then(res => { post(`/InStorageRequestItem/outStorageOutItem/delete?requestItemIds=${this.selectionRows.map(item => item.id).join(',')}`).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
......
<template>
<div class="proPreConfirmLeft" style="padding-right: 15px; height: 100%; overflow: scroll;">
<!-- 搜索 -->
<dee-as-com
:lay-config="{
typeName: 'OutStorageMaterialUse',
layKey: 'defaultQuery'
}"
@searchEvent="searchEvent"
/>
<!-- 分类展示 -->
<el-collapse
v-model="collapse.active"
v-loading="loading"
accordion
>
<el-collapse-item
v-for="(request, index) in requests"
:key="index"
:name="(index + 1).toString()"
>
<template slot="title">
<section class="collapse-title">| {{ request.name }}{{ request.lists.length }}</section>
</template>
<ul v-if="request.lists.length">
<template>
<el-checkbox
v-model="checkedAll"
:indeterminate="isIndeterminate"
@change="v => handleCheckAllChange(v)"
>全选</el-checkbox>
<el-checkbox-group v-model="checkedLists" @change="handleCheckedCitiesChange">
<el-checkbox v-for="(item) in request.lists" :key="item.id" :label="item">
<i class="el-icon-document" />
{{ item.reqNo }},
{{ item.creator.userName || '' }},
{{ item.createTime }},
{{ item.startTime }}</el-checkbox>
</el-checkbox-group>
</template>
</ul>
<span v-else class="empty">暂无数据</span>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'MatchConfirmLeft',
components: {
},
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {
loading: false,
// 搜索表单
form: {
reqNo: '',
reqBill: '',
ao: '',
resCode: '',
modelNo: ''
},
// 手风琴默认高亮
active: 0,
// 手风琴组件
collapse: {
active: ['1']
},
// 申请列表
requests: [
{ name: '领用出库', lists: [] }
],
searchItems: [],
checkedAll: false,
isIndeterminate: false,
checkedLists: []
}
},
computed: {},
watch: {
checkedLists: {
deep: true,
handler(val) {
this.$emit('currentLeftData:click', val)
}
}
},
mounted() {
this.init()
this.$bus.$on('refreshMaterialUseConfirm', (hasFlag) => {
this.$nextTick(() => {
this.init()
})
})
},
methods: {
searchEvent(data) {
this.searchItems = data && data.items || []
this.init()
},
// 加载左侧申请表
init() {
const params = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'OutStorageMaterialUse'
},
{
'fieldName': 'state',
'operator': 'EQ',
'value': 'Pending_Verify'
},
...this.searchItems
],
'operator': 'AND'
},
'openProps': [
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
this.loading = true
this.checkedAll = false
this.isIndeterminate = false
this.checkedLists = []
post(`/OutStorageRequest/materialUse/findTask`, params).then(res => {
const data = res.items
this.requests[0].lists = data || []
}).catch(err => console.log(err)).finally(() => {
this.loading = false
})
},
handleCheckAllChange(val) {
this.checkedLists = val ? this.requests[0].lists : []
this.isIndeterminate = false
},
handleCheckedCitiesChange(value) {
const checkedCount = value.length
this.checkedAll = checkedCount === this.requests[0].lists.length
this.isIndeterminate = checkedCount > 0 && checkedCount < this.requests[0].lists.length
}
}
}
</script>
<style lang="scss" scoped>
ul {
margin: -10px 0;
padding: 5px 0 0 0;
li {
margin-top: 5px;
padding: 0 5px 0 8px;
height: 25px;
line-height: 25px;
list-style: none;
cursor: pointer;
font-size: 14px;
color: #606266;
opacity: .85;
white-space: nowrap;
&.black{
color: black;
}
&.active-background{background-color: #67C23A;}
&.blue { color: blue; }
&.red { color: red; }
i { font-size: 14px; }
&:hover, &.active {
opacity: 1;
font-weight: 500;
background-color: #edf0f5;
}
}
}
.empty { margin-left: 10px; color: #666; }
.el-date-editor { width: 100%; }
.collapse-title { font-size: 14px; color: #666; }
.is-active .collapse-title { font-size: 15px; font-weight: 600; color: #222; }
</style>
<template>
<div class="materialUseConfirmRight">
<dee-as-com
ref="requestCom"
table-height="auto"
:basic-data=" { selectData,selectionRows }"
:lay-config="{ typeName: 'OutStorageMaterialUse', layKey: 'defaultResult'}"
@selectionChange="selectionChange"
/>
<dee-as-com
ref="itemCom"
:lay-config="{ typeName: 'OutStorageMaterialUseItem', layKey: 'defaultResult'}"
table-height="auto"
/>
</div>
</template>
<script>
export default {
name: 'MaterialUseConfirmRight',
components: {},
props: {
selectData: {
type: Object,
default: () => {}
},
currentLeftData: {
type: Array,
default: () => []
}
},
data() {
return {
selectionRows: [],
selectionItemRows: [],
selectionJobResRows: []
}
},
computed: {},
watch: {},
created() {},
mounted() {
},
// 组件方法
methods: {
selectionChange(val) {
this.selectionRows = val
const requestIds = val && val.map(item => item.id)
this.$refs.itemCom && this.$refs.itemCom.$refs.asCom.getData(requestIds)
},
selectionChange_jobRes(val) {
this.selectionJobResRows = val
},
init(checkList) {
const aoIds = checkList && checkList.map(item => item.id)
if (aoIds && aoIds.length) {
debugger
this.$refs.requestCom && this.$refs.requestCom.$refs.asCom.getData({
'fieldName': 'id',
'operator': 'IN',
'value': aoIds
})
} else {
setTimeout(() => {
const requestComRef = this.$refs.requestCom && (this.$refs.requestCom.$refs.asCom) || null
const itemComRef = this.$refs.itemCom && (this.$refs.itemCom.$refs.asCom) || {}
requestComRef && (requestComRef.pagination.total = 0)
itemComRef && (itemComRef.pagination.total = 0)
requestComRef && (requestComRef.showData = [])
itemComRef && (itemComRef.showData = [])
}, 800)
}
}
}
}
</script>
<style lang='scss'>
.materialUseConfirmRight{
overflow: auto;
width: 100%;
height: 100%;
box-sizing: border-box;
padding-left: 8px;
.sub-title{
padding-top: 0px!important;
}
.dee-table{
.dee-tools {
margin: 2px 0!important;
}
.dee-table-config-bar{
margin: 2px 0!important;
}
.dee-table-pagination {
margin-top: 12px!important;
}
}
}
</style>
<!--
* @LastEditTime: 2024-08-06 09:54:07
* @Description:ERP_领用出库确认
-->
<template>
<div class="ERPOutStorageOutConfirm">
<dee-fold-pane
:min-percent="18"
:default-percent="18"
split="vertical"
class="detail-pane"
>
<template slot="paneL">
<Left
ref="left"
:select-data="selectData"
@currentLeftData:click="currentLeftDataClick"
/>
</template>
<template slot="paneR">
<Right
v-show="subTypeName === '1'"
ref="right"
:select-data="selectData"
:current-left-data="currentLeftData"
@left:init="() => this.$refs.left.init()"
/>
<!-- empty -->
<section v-if="!subTypeName" style="padding-left: 15px;">
请先选择左侧请求单
</section>
</template>
</dee-fold-pane>
</div>
</template>
<script>
import Left from './components/left.vue'
import Right from './components/right.vue'
export default {
componentName: 'ERP_领用出库确认',
name: 'ERPOutStorageOutConfirm',
components: { Left, Right },
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {
subTypeName: '',
currentLeftData: null
}
},
computed: {},
watch: {},
created() {},
mounted() {},
// 组件方法
methods: {
currentLeftDataClick(data) {
this.subTypeName = '1'
this.currentLeftData = data
this.$refs.right && this.$refs.right.init(data)
}
}
}
</script>
<style lang='scss'>
.ERPOutStorageOutConfirm{
width: 100%;
height: 103%;
box-sizing: border-box;
padding:0 4px;
}
</style>
...@@ -69,7 +69,8 @@ export default { ...@@ -69,7 +69,8 @@ export default {
// this.maxNum = maxAmount // this.maxNum = maxAmount
// } // }
this.$emit('input', this.reqAmount) this.$emit('input', this.reqAmount)
if (this.form.id && this.parentType_Inject !== '退库入库' && !this.form.subTypeName.includes('BackItem')) { if (this.form.id && this.parentType_Inject !== '退库入库' && !this.form.subTypeName.includes('BackItem') && this.parentType_Inject !== 'OutStorageMaterialUse') {
debugger
this.changeAmount() this.changeAmount()
} }
}, },
......
...@@ -120,6 +120,11 @@ export default { ...@@ -120,6 +120,11 @@ export default {
type: 'ERP_SortAdjust', type: 'ERP_SortAdjust',
appId: 1626782774851 appId: 1626782774851
}, },
{
taskType: '领用出库确认',
type: 'ERP_materialUseConfirm',
appId: 1626782774851
},
{ {
taskType: '配套自动退库确认', taskType: '配套自动退库确认',
type: 'ERP_MatchAutoReturnConfirm', type: 'ERP_MatchAutoReturnConfirm',
...@@ -220,15 +225,32 @@ export default { ...@@ -220,15 +225,32 @@ export default {
get(`/indexTask/task/ProdTask`, {}).then(res => { get(`/indexTask/task/ProdTask`, {}).then(res => {
this.$set(this.quickAccessList[index], 'taskCount', res.items.count) this.$set(this.quickAccessList[index], 'taskCount', res.items.count)
}) })
} else if (item.type === 'ERP_SortAdjust' || item.type === 'ERP_operatorConfirm' || item.type === 'ERP_MatchAutoReturnConfirm') { } else if (item.taskType === '准备工出库调整' || item.taskType === '操作工确认' || item.taskType === '配套自动退库确认') {
post(`/ErpSorting/currentUserSortingTaskCount`, {}).then(res => { post(`/ErpSorting/currentUserSortingTaskCount`, {}).then(res => {
const resKey = item.type === 'ERP_SortAdjust' ? '准备工任务数量' : item.type === 'ERP_operatorConfirm' ? '操作工任务数量' : '自动配套退库任务' let resKey = ''
switch (item.taskType) {
case '准备工出库调整':
resKey = '准备工任务数量'
break
case '操作工确认':
resKey = '操作工任务数量'
break
case '配套自动退库确认':
resKey = '自动配套退库任务'
break
default:
break
}
this.$set(this.quickAccessList[index], 'taskCount', res.items[resKey]) this.$set(this.quickAccessList[index], 'taskCount', res.items[resKey])
}) })
} else if (item.type === 'ERP_StockBackConfirm') { } else if (item.taskType === '库内退库确认') {
post(`/ErpRetirementRequest/searchBackTaskCount`, {}).then(res => { post(`/ErpRetirementRequest/searchBackTaskCount`, {}).then(res => {
this.$set(this.quickAccessList[index], 'taskCount', res.items) this.$set(this.quickAccessList[index], 'taskCount', res.items)
}) })
} else if (item.taskType === '领用出库确认') {
post(`/OutStorageRequest/materialUse/countTask`, {}).then(res => {
this.$set(this.quickAccessList[index], 'taskCount', res.items)
})
} else { } else {
const params = { const params = {
type: this.quickAccessList[index].type type: this.quickAccessList[index].type
...@@ -266,7 +288,7 @@ export default { ...@@ -266,7 +288,7 @@ export default {
} }
}) })
this.$store.dispatch('app/closeSideBar', false) this.$store.dispatch('app/closeSideBar', false)
} else if (item.taskType === '准备工出库调整' || item.taskType === '操作工确认' || item.taskType === '配套自动退库确认' || item.taskType === '库内退库确认') { } else if (item.taskType === '准备工出库调整' || item.taskType === '操作工确认' || item.taskType === '配套自动退库确认' || item.taskType === '库内退库确认' || item.taskType === '领用出库确认') {
let pageNo = '' let pageNo = ''
switch (item.taskType) { switch (item.taskType) {
case '准备工出库调整': case '准备工出库调整':
...@@ -281,6 +303,10 @@ export default { ...@@ -281,6 +303,10 @@ export default {
case '库内退库确认': case '库内退库确认':
pageNo = '219cf48e-020a-4048-85d7-d5c2b83537f4' pageNo = '219cf48e-020a-4048-85d7-d5c2b83537f4'
break break
case '领用出库确认':
pageNo = '1d4c589d-16cd-45e5-900f-78c1fabf86f6'
break
default: default:
break break
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment