Commit 81faf490 authored by qhr's avatar qhr

退库单相应组件

parent b59a723f
<template>
<div class="addTkdInStorageBackItemDialog">
<dee-as-com
v-if="subTypeName==='InStorageMatchBack'"
ref="topTable"
:lay-config="{ typeName: 'OutStorageMatchItem', layKey: 'addInStorageBackMatchItem_top' }"
:basic-data="basicData"
table-height="400px"
@row-click="handleRowClickTop"
/>
<dee-as-com
ref="bottomTable"
:table-height="subTypeName==='InStorageMatchBack'?'300px':'500px'"
:lay-config="cmpOptions"
:basic-data="basicData"
@row-click="handleRowClickBottom"
/>
<el-form ref="applyForm" :rules="rules" :model="applyForm" class="applyForm">
<el-form-item :label="amountItemLabel" prop="reqAmount" label-width="100px">
<el-input-number v-model="applyForm.reqAmount" :placeholder="amountItemLabel" :min="0" size="small" />
</el-form-item>
<el-form-item class="foot-btn-box">
<el-button type="primary" @click="submitEvent(true)">添加</el-button>
<el-button type="primary" @click="submitEvent(false)">确认</el-button>
<el-button @click="cancelEvent">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
// componentName: '退库入库添加明细',
name: 'AddTkdInStorageBackItemDialog',
components: {},
props: {
basicData: {
type: Object,
default: () => {}
},
selectDatas: {
type: Array,
default: () => []
}
},
data() {
return {
selection: null,
defaultData: {},
applyForm: {},
amountItemLabel: '退库数量',
rules: {
reqAmount: [
{ required: true, message: '该项必填', trigger: 'blur' }
]
},
cmpOptions: { typeName: 'JobResponseOutStorageMatch', layKey: '83978022-409f-463d-ad67-dc0c49e9eb77' }
}
},
computed: {},
// watch: {
// 'subTypeName': {
// immediate: true,
// handler(val) {
// if (val === 'InStorageMatchBack') {
// this.$set(this.cmpOptions, 'layKey', 'add_InStorageBackMatchItem_bottom')
// } else if (val === 'InStorageOutBack' || val === 'InStorageUseBack') {
// this.$set(this.cmpOptions, 'layKey', 'add_InStorageBackItem_Use&Out')
// } else if (val === 'InStorageTestFlyBack') {
// this.$set(this.cmpOptions, 'layKey', 'add_InStorageBackItem_testFlight')
// } else {
// this.$set(this.cmpOptions, 'layKey', '')
// }
// }
// }
// },
created() {
},
methods: {
handleRowClickTop({ row }) {
if (row.id) {
this.$refs.bottomTable.$refs.asCom.getData(row.id)
}
},
handleRowClickBottom(val) {
this.selection = val.row
},
submitEvent(addContinue) {
this.$refs['applyForm'].validate((valid) => {
if (valid && this.selection) {
const maxAmount = this.$utils.subNum(this.selection.outsideAmount, -this.selection.backedAmount, -this.selection.backAmount, -this.selection.scrapCount)
if (this.applyForm.reqAmount > maxAmount) return this.$utils.showMessageWarning(`当前选中物料的退库数量不足!`)
const inventoryData = this.selection.inventory
const data = [{
'subTypeName': `InStorageTkdBackItem`,
'extMaterial': inventoryData.extMaterial,
'extMaterialId': inventoryData.extMaterialId,
'testNo': inventoryData.testNo,
'suppname': inventoryData.suppname,
'serialNo': inventoryData.serno,
'outStorageId': this.selection.id,
'outStorageIdType': this.selection.subTypeName,
'backAmount': this.selection.backAmount || 0,
'backedAmount': this.selection.backedAmount || 0,
'scrapCount': this.selection.scrapCount || 0,
'outsideAmount': this.selection.outsideAmount || 0,
'reqAmount': this.applyForm.reqAmount,
'reqNo': this.selection.jobOrder && this.selection.jobOrder.outStorageRequest && this.selection.jobOrder.outStorageRequest.reqNo || ''
}]
this.$emit('submitEvent', { formData: data, addContinue })
addContinue && this.cleanAddForm()
} else {
this.$utils.showMessageWarning(`至少选择一条物料并且${this.amountItemLabel}必填!`)
return false
}
})
},
cleanAddForm() {
this.$refs.bottomTable.$refs.asCom.getData()
this.applyForm = {}
},
cancelEvent() {
this.$emit('cancel')
}
}
}
</script>
<style lang='scss'>
.addTkdInStorageBackItemDialog{
.applyForm{
margin-top: 30px;
.el-input-number{
width: 180px;
}
}
.foot-btn-box{
display: flex;
margin-top: 10px;
justify-content: center;
align-content: center;
}
}
</style>
<!--
* @Author: gjn
* @Date: 2023-09-09 153:07:44
* @Description:退库入库申请明细
-->
<template>
<div :style="layoutStyle" class="addTkdInStorageBackItem">
<dee-as-com
ref="table"
:im-show-table-data="imShowTableData"
:basic-data="{...form,...basicData}"
:lay-config="cmpOptions"
table-height="auto"
:dis-business="true"
:result-data="tableData"
@tableToolHandler="tableToolHandler"
@selectionChange="selectionChange"
/>
<dee-dialog
:title="dialogTitle"
width="84%"
:dialog-visible="dialogShow"
@handleClose="dialogShow = false"
>
<component
:is="componentName"
:basic-data="{...form,...basicData}"
:select-datas="selectionRows"
:form="form"
@submitEvent="submitEvent"
@cancel="dialogShow = false"
/>
</dee-dialog>
</div>
</template>
<script>
import AddTkdInStorageBackItemDialog from './components/AddTkdInStorageBackItemDialog'
import { post } from '@/utils/http'
export default {
componentName: '退库单退库入库添加明细',
name: 'AddTkdInStorageBackItem',
components: { AddTkdInStorageBackItemDialog },
props: {
basicData: {
type: Object,
default: () => {}
},
form: {
type: Object,
default: () => {
return {}
}
},
imShowTableData: {
type: Array,
default: () => {
return []
}
},
layoutStyle: {
type: Object,
default: () => {
return {}
}
},
showBtn: {
type: Boolean,
default: true
}
},
data() {
return {
dialogShow: false,
selectionRows: [],
tableData: [],
dialogTitle: '',
componentName: '',
cmpOptions: {
typeName: 'InStorageBackItem',
layKey: 'InStorageMatchBack_details'
}
}
},
computed: {
},
watch: {
tableData: {
immediate: true,
deep: true,
handler(data) {
this.$emit('input', data)
}
},
'form.billType': {
immediate: true,
deep: true,
handler(val) {
if (val && !this.basicData.id) {
this.tableData = []
}
}
},
basicData: {
immediate: true,
deep: true,
handler(val) {
if (val && val.id) {
if (this.basicData.inStorageRequestItems) {
this.tableData = this.basicData.inStorageRequestItems.map(item => {
if (item.outStorage) {
item.backAmount = item.outStorage.backAmount
item.backedAmount = item.outStorage.backedAmount
item.outsideAmount = item.outStorage.outsideAmount
item.scrapCount = item.outStorage.scrapCount
if (item.outStorage.inventory) {
item.testNo = item.outStorage.inventory.testNo
item.suppname = item.outStorage.inventory.suppname
}
if (item.outStorage.jobOrder && item.outStorage.jobOrder.outStorageRequest) {
item.reqNo = item.outStorage.jobOrder.outStorageRequest.reqNo || ''
}
}
return item
})
}
}
}
}
},
created() {
},
provide() {
return {
parentType_Inject: '退库入库'
}
},
methods: {
tableToolHandler(val) {
const btnValue = val.key.btnValue
switch (btnValue) {
case 'add':
this.addHandle()
break
case 'remove':
this.remove()
break
default:
break
}
},
selectionChange(val) {
this.selectionRows = val
},
addHandle() {
this.$utils.findForm(this).validate((valid) => {
if (valid) {
this.openDialog('添加退库明细', 'AddTkdInStorageBackItemDialog')
} else {
this.$utils.showMessageWarning('请填写基本信息!')
}
})
},
openDialog(dialogTitle, componentName) {
this.dialogTitle = dialogTitle
this.componentName = componentName
this.dialogShow = true
},
remove() {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
post(`/InStorageRequestItem/inStorageBackItem/delete?itemIds=${this.selectionRows.map(item => item.id).join(',')}`).then(res => {
this.$message({
type: 'success',
message: '删除成功!'
})
this.tableData = this.tableData.filter(item => !this.selectionRows.map(item => item.outStorageId).includes(item.outStorageId))
}).catch((err) => {
console.log(err)
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
submitEvent({ formData, addContinue }) {
const onlyFlag = this.tableData.find(item => item.reqNo !== formData[0].reqNo)
if (onlyFlag) return this.$utils.showMessageWarning('只能添加同一单据下的数据,请重新选择!')
const extMaterialIds = this.tableData.map(item => item.outStorageId).includes(formData[0].outStorageId)
if (extMaterialIds) return this.$utils.showMessageWarning('相同数据不能重复添加,请重新选择!')
this.tableData.push(...formData)
this.dialogShow = addContinue || false
}
}
}
</script>
<style>
</style>
<!--
* @Author: gjn
* @Date: 2023-11-02 09:29:39
* @Description:配套退库入库申请
-->
<template>
<div class="inStorageTkdBackApply">
<dee-as-com
ref="applyTable"
class="list-table"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'InStorageBackItem', layKey: 'batchSign_InStorageMatchBackApply'}"
/>
</div>
</template>
<script>
export default {
name: 'inStorageTkdBackApply',
components: {},
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {},
mounted() {},
// 组件方法
methods: {}
}
</script>
<style lang='scss'>
.inStorageMatchBackApply{
width: 100%;
height: 100%;
box-sizing: border-box;
padding:0 4px;
}
</style>
<!--
* @Author: gjn
* @Date: 2023-11-02 09:29:39
* @Description:配套退库入库申请
-->
<template>
<div class="InStorageTkdBackConfirm">
<dee-as-com
ref="applyTable"
class="list-table"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'InStorageBackItem', layKey: 'batchSign_InStorageMatchBackConfirm'}"
/>
</div>
</template>
<script>
export default {
name: 'InStorageTkdBackConfirm',
components: {},
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {},
mounted() {},
// 组件方法
methods: {}
}
</script>
<style lang='scss'>
.inStorageMatchBackApply{
width: 100%;
height: 100%;
box-sizing: border-box;
padding:0 4px;
}
</style>
<!--
* @Author: gjn
* @Date: 2023-11-02 09:29:39
* @Description:配套退库入库申请
-->
<template>
<div class="InStorageTkdBackCraftsmenExamin">
<dee-as-com
ref="applyTable"
class="list-table"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'InStorageBackItem', layKey: 'e6e40243-8be1-4d38-a978-ed1ce3a6ceda'}"
/>
</div>
</template>
<script>
export default {
name: 'InStorageTkdBackCraftsmenExamin',
components: {},
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {},
mounted() {},
// 组件方法
methods: {}
}
</script>
<style lang='scss'>
.inStorageMatchBackApply{
width: 100%;
height: 100%;
box-sizing: border-box;
padding:0 4px;
}
</style>
<!--
* @Author: gjn
* @Date: 2023-11-02 09:29:39
* @Description:配套退库入库申请
-->
<template>
<div class="InStorageTkdBackDesignerExamin">
<dee-as-com
ref="applyTable"
class="list-table"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'InStorageBackItem', layKey: '8ef52f63-266c-4d66-9ee7-a6be91d9d610'}"
/>
</div>
</template>
<script>
export default {
name: 'InStorageTkdBackDesignerExamin',
components: {},
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {},
mounted() {},
// 组件方法
methods: {}
}
</script>
<style lang='scss'>
.inStorageMatchBackApply{
width: 100%;
height: 100%;
box-sizing: border-box;
padding:0 4px;
}
</style>
<!--
* @Author: gjn
* @Date: 2023-11-02 09:29:39
* @Description:配套退库入库申请
-->
<template>
<div class="InStorageTkdBackInTest">
<dee-as-com
ref="applyTable"
class="list-table"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'InStorageBackItem', layKey: 'batchSign_InStorageMatchBackInTest'}"
/>
</div>
</template>
<script>
export default {
name: 'InStorageTkdBackInTest',
components: {},
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {},
mounted() {},
// 组件方法
methods: {}
}
</script>
<style lang='scss'>
.inStorageMatchBackApply{
width: 100%;
height: 100%;
box-sizing: border-box;
padding:0 4px;
}
</style>
...@@ -44,8 +44,12 @@ export default { ...@@ -44,8 +44,12 @@ export default {
InstructionIdentificationBatch: () => import('./instructionIdentificationBatch'), // 指令标识 InstructionIdentificationBatch: () => import('./instructionIdentificationBatch'), // 指令标识
InstructionIdentificationBatchInfo: () => import('./instructionIdentificationBatch'), // 指令标识不编辑 InstructionIdentificationBatchInfo: () => import('./instructionIdentificationBatch'), // 指令标识不编辑
ReturnToFactoryBatch: () => import('./returnToFactoryBatch'), // 返厂处理 ReturnToFactoryBatch: () => import('./returnToFactoryBatch'), // 返厂处理
InStorageMoveExamine: () => import('./inStorageMoveExamine') // 移库入库库房审核 InStorageMoveExamine: () => import('./inStorageMoveExamine'), // 移库入库库房审核
InStorageTkdBackApply: () => import('./InStorageTkdBackApply'), //退库单退库申请
InStorageTkdBackCraftsmenExamin: () => import('./InStorageTkdBackCraftsmenExamin'), // 退库单退库工艺审核
InStorageTkdBackDesignerExamin: () => import('./InStorageTkdBackDesignerExamin'), // 退库单退库设计审核
InStorageTkdBackInTest: () => import('./InStorageTkdBackInTest'), // 退库单退库检验
InStorageTkdBackConfirm: () => import('./InStorageTkdBackConfirm') // 退库单退库确认
}, },
props: { props: {
selectData: { selectData: {
......
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