opt:优化子卷装箱校验逻辑
This commit is contained in:
@@ -43,7 +43,6 @@
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column show-overflow-tooltip prop="box_group" label="木箱组" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="quanlity_in_box" label="箱内子卷数" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="package_box_sn" label="木箱号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="container_name" label="子卷号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="paper_tube_description" label="子卷规格" align="center" />
|
||||
</el-table>
|
||||
@@ -75,6 +74,19 @@
|
||||
清空
|
||||
</el-button>
|
||||
</span>
|
||||
<span class="crud-opts-right2" style="margin-left: 15px;">
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="isButtonDisabled1"
|
||||
@click="transferBoxPackageToMes()"
|
||||
>
|
||||
回传mes
|
||||
</el-button>
|
||||
</span>
|
||||
<span class="crud-opts-right2" style="margin-left: 15px;">
|
||||
<el-button
|
||||
slot="left"
|
||||
@@ -107,14 +119,20 @@
|
||||
<el-table-column show-overflow-tooltip prop="paper_tube_description" label="子卷规格" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<MaterDiv ref="child" :dialog-show.sync="structShow" :paper-tube-description="paperTubeDescription" :sect-prop="sectProp" @tableChanged="tableChanged" />
|
||||
<MaterDiv
|
||||
ref="child"
|
||||
:dialog-show.sync="structShow"
|
||||
:paper-tube-description="paperTubeDescription"
|
||||
:sect-prop="sectProp"
|
||||
@tableChanged="tableChanged"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import MaterDiv from '@/views/wms/pdm/sub/MaterDialog.vue'
|
||||
import crudPackagerelation from '@/views/wms/pdm/sub/packagerelation'
|
||||
import crudPackagerelation, { transferBoxPackageToMes } from '@/views/wms/pdm/sub/packagerelation'
|
||||
import crudSubpackagerelation from '@/views/wms/pdm/sub/packagerelation'
|
||||
|
||||
export default {
|
||||
@@ -152,6 +170,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
isButtonDisabled: false, // 木箱规格分配按钮
|
||||
isButtonDisabled1: true, // 手动同步MES按钮
|
||||
searchText: '',
|
||||
// 存储搜索前的选中状态
|
||||
previousSelection: [],
|
||||
@@ -210,20 +229,6 @@ export default {
|
||||
})
|
||||
this.currentSelection = [...this.$refs.dis_table.selection]
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
if (selection.length > 0) {
|
||||
this.currentSelection = selection
|
||||
if (!this.searchText) {
|
||||
this.previousSelection = selection
|
||||
}
|
||||
} else {
|
||||
if (!this.searchText) {
|
||||
this.cancelSelection = []
|
||||
this.cancelSelection = [...this.currentSelection]
|
||||
this.table2RowStyle({ row: this.currentSelection })
|
||||
}
|
||||
}
|
||||
},
|
||||
// 处理清除搜索条件事件
|
||||
clearSearch() {
|
||||
this.searchText = ''
|
||||
@@ -303,6 +308,7 @@ export default {
|
||||
handleRowClick(scope) {
|
||||
debugger
|
||||
this.isButtonDisabled = !!(scope.status !== '99' || scope.box_group !== '0')
|
||||
this.isButtonDisabled1 = scope.status === '99'
|
||||
const table2 = this.$refs.dis_table
|
||||
const table2Data = Array.from(this.openParam)
|
||||
const groupValue = scope.box_group === '0' ? scope.container_name : scope.box_group
|
||||
@@ -310,6 +316,24 @@ export default {
|
||||
table2.clearSelection()
|
||||
selectedRows.forEach(row => table2.toggleRowSelection(row))
|
||||
},
|
||||
// 表格2的行点击事件
|
||||
handleSelectionChange(selection) {
|
||||
debugger
|
||||
if (selection.length > 0) {
|
||||
this.isButtonDisabled = !selection.every(item => item.status === '99' && item.box_group === '0')
|
||||
this.isButtonDisabled1 = selection.some(item => item.status === '99')
|
||||
this.currentSelection = selection
|
||||
if (!this.searchText) {
|
||||
this.previousSelection = selection
|
||||
}
|
||||
} else {
|
||||
if (!this.searchText) {
|
||||
this.cancelSelection = []
|
||||
this.cancelSelection = [...this.currentSelection]
|
||||
this.table2RowStyle({ row: this.currentSelection })
|
||||
}
|
||||
}
|
||||
},
|
||||
toDelete(data) {
|
||||
this.$set(data, 'pop', true)
|
||||
// data.pop = true
|
||||
@@ -336,7 +360,12 @@ export default {
|
||||
async tableChanged(row) {
|
||||
debugger
|
||||
this.form.tableMater = this.currentSelection
|
||||
if (this.currentSelection.length > row.num) {
|
||||
this.crud.notify('子卷数量超过木箱的最大装卷数!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
return
|
||||
}
|
||||
this.form.checked = row.material_code
|
||||
this.form.box_weight = row.box_weight
|
||||
this.form.sale_order_name = this.saleOrderName
|
||||
await crudPackagerelation.updateEntityList(this.form)
|
||||
const res = crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.saleOrderName })
|
||||
@@ -350,17 +379,28 @@ export default {
|
||||
debugger
|
||||
if (this.currentSelection.length > 0 && this.$refs.dis_table.selection.length > 0) {
|
||||
debugger
|
||||
const paper_description = this.currentSelection.filter(item => item.paper_tube_description !== null && item.paper_tube_description !== '')
|
||||
this.paperTubeDescription = paper_description[0].paper_tube_description
|
||||
this.structShow = true
|
||||
this.$refs.child.getMsg(false)
|
||||
const descriptionList = this.currentSelection.filter(item => item.paper_tube_description !== null && item.paper_tube_description !== '')
|
||||
const paper_tube_description = descriptionList[0].paper_tube_description
|
||||
const descriptionsAreSame = this.currentSelection.every(item => item.paper_tube_description === paper_tube_description)
|
||||
if (descriptionsAreSame) {
|
||||
this.paperTubeDescription = paper_tube_description
|
||||
this.structShow = true
|
||||
this.$refs.child.getMsg(false)
|
||||
} else {
|
||||
this.crud.notify('子卷规格不一致!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
} else {
|
||||
this.crud.notify('请确认并勾选子卷信息!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify('请选中子卷信息!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
},
|
||||
transferBoxPackageToMes() {
|
||||
this.form.tableMater = this.currentSelection
|
||||
crudPackagerelation.transferBoxPackageToMes(this.form).then(r => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
doCancel(data) {
|
||||
this.$set(data, 'pop', false)
|
||||
// data.pop = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
width="1100px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
@@ -38,9 +38,9 @@
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="box_no" label="木箱号" />
|
||||
<el-table-column prop="material_code" label="木箱规格" />
|
||||
<el-table-column prop="material_name" label="物料名称" />
|
||||
<!-- <el-table-column prop="box_no" label="木箱号" :min-width="flexWidth('box_no',crud.data,'木箱号')" />-->
|
||||
<el-table-column prop="material_code" label="木箱规格" :min-width="flexWidth('material_code',crud.data,'木箱规格')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="box_length" label="木箱长度" />
|
||||
<el-table-column prop="box_width" label="木箱宽度" />
|
||||
<el-table-column prop="box_high" label="木箱高度" />
|
||||
@@ -54,7 +54,7 @@
|
||||
</span>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible1"
|
||||
width="28%"
|
||||
width="35%"
|
||||
append-to-body
|
||||
@close="dialogVisible1 = false"
|
||||
>
|
||||
@@ -67,13 +67,13 @@
|
||||
请仔细核对子卷与木箱规格是否匹配,
|
||||
<br>
|
||||
<br>
|
||||
<span class="red-text">木箱规格为:{{ this.boxLength }}</span>,
|
||||
<span class="red-text">木箱规格为:{{ this.materialName }}</span>,
|
||||
<br>
|
||||
<br>
|
||||
<span class="red-text">子卷规格为:{{ this.paperTubeDescription }}</span>,
|
||||
<br>
|
||||
<br>
|
||||
点击确定后将立即生成木箱出库任务,无法更改!
|
||||
点击确定后将立即生成空木箱出库任务,无法更改!
|
||||
</span>
|
||||
<br>
|
||||
<br>
|
||||
@@ -121,7 +121,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
boxLength: '',
|
||||
materialName: '',
|
||||
classes: [],
|
||||
dialogVisible: false,
|
||||
dialogVisible1: false,
|
||||
@@ -211,14 +211,15 @@ export default {
|
||||
submit() {
|
||||
debugger
|
||||
this.rows = this.$refs.table.selection
|
||||
this.boxLength = this.rows[0].material_code
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先选择木箱信息')
|
||||
this.crud.notify('请选择木箱信息!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
return
|
||||
}
|
||||
this.materialName = this.rows[0].material_name
|
||||
this.dialogVisible1 = true
|
||||
},
|
||||
confirmSubmit() {
|
||||
debugger
|
||||
this.dialogVisible1 = false
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.checkrow)
|
||||
|
||||
@@ -40,4 +40,12 @@ export function updateEntityList(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryContainerization, updateEntityList }
|
||||
export function transferBoxPackageToMes(data) {
|
||||
return request({
|
||||
url: '/api/pdmBiSubpackagerelation/transferBoxPackageToMes',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryContainerization, updateEntityList, transferBoxPackageToMes }
|
||||
|
||||
Reference in New Issue
Block a user