add:拣选页面机功能

This commit is contained in:
zhangzq
2024-06-18 17:15:30 +08:00
parent cb853ec851
commit 9f776a45c9
28 changed files with 898 additions and 182 deletions

View File

@@ -31,7 +31,6 @@ const user = {
const rememberMe = userInfo.rememberMe
return new Promise((resolve, reject) => {
login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => {
debugger
setToken(res.token, rememberMe)
commit('SET_TOKEN', res.token)
setUserInfo(res.user, commit)

View File

@@ -319,7 +319,7 @@ export default {
this.vehicledis.push({ vehicle_code: '', qty: 0 })
},
subRow(index,row){
this.vehicledis.slice(index,1)
this.vehicledis.splice(index,1)
},
handleDtlCurrentChange(current) {
if (current !== null) {

View File

@@ -1,24 +1,26 @@
<!--suppress ALL -->
<template>
<el-dialog
append-to-body
title="拣选作业"
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
@open="open"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
<el-button icon="el-icon-check" size="mini" type="primary" @click="savePickMst">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="closeDialog">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
:model="form" size="mini" label-width="100px" label-suffix=":">
<el-form-item label="单据编号" prop="code">
@@ -58,12 +60,12 @@
disabled
>
<el-option
v-for="item in formStatus"
v-for="item in statusEnum.FORM_STATUS"
:label="item.label"
:value="item.value"
/>
</el-select>
<!-- <el-input v-model="form.status" disabled clearable style="width: 210px"/>-->
<!-- <el-input v-model="form.status" disabled clearable style="width: 210px"/>-->
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<!-- <el-date-picker v-model="form.create_time" type="date" placeholder="选择日期" style="width: 210px"-->
@@ -78,7 +80,7 @@
</template>
</el-form>
<div class="crud-opts2">
<span class="role-span2">作业明细</span>
<span class="role-span">拣选明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
@@ -94,19 +96,29 @@
@current-change="handleDtlCurrentChange"
>
<el-table-column prop="form_type" label="单据类型" show-overflow-tooltip width="120"/>
<el-table-column prop="material_id" label="物料id" show-overflow-tooltip width="120"/>
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip/>
<el-table-column prop="assign_qty" label="拣选数量" show-overflow-tooltip/>
<el-table-column prop="assign_qty" label="拣选数量" show-overflow-tooltip width="120"/>
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="120">
<template slot-scope="scope">
<el-select disabled v-model="tableDtl[scope.$index].unit_id"
class="filter-item" placeholder="单位" size="small" style="width: 90px">
<el-option
v-for="item in unitDict"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="vehicle_code" label="拣选载具" show-overflow-tooltip width="120"/>
<el-table-column prop="status" label="单据状态" show-overflow-tooltip width="120">
<template slot-scope="scope">
<template v-for="item in formStatus">
<span v-if="item.value === scope.row.status">{{ item.label }}</span>
</template>
{{ statusEnum.label.FORM_STATUS[scope.row.status] }}
</template>
</el-table-column>
<el-table-column prop="source_form_id" label="业务单据id" show-overflow-tooltip width="120"/>
@@ -121,73 +133,190 @@
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">作业明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="right"/>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="addPickTask()"
>
新增一行
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="savePickTask()"
>
保存
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tabledis"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="90"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip width="150">
<template slot-scope="scope">
<el-input-number v-model="tabledis[scope.$index].qty" clearable style="width: 120px"/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="120">
<template slot-scope="scope">
<el-select v-model="tabledis[scope.$index].unit_id"
class="filter-item" placeholder="单位" size="small" style="width: 90px">
<el-option
v-for="item in unitDict"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="vehicle_code" label="周转载具" show-overflow-tooltip width="120" >
<template slot-scope="scope">
<el-input v-model="tabledis[scope.$index].vehicle_code" clearable />
</template>
</el-table-column>
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in disCols" :key="item.value"
:label="item.lable">
<template slot-scope="scope">
<el-switch v-if="item.value == 'is_artificiality'"
v-model="tabledis[scope.$index].form_data[item.value]"
active-color="#409EFF"
inactive-color="#F56C6C"
:active-value=true
:inactive-valu=false
/>
<el-select v-if="item.value == 'task_type'"
v-model="tabledis[scope.$index].form_data[item.value]"
clearable
size="mini"
placeholder="任务类型"
class="filter-item"
style="width: 120px"
@change="changeTaskType(scope.$index,tabledis[scope.$index].form_data[item.value])"
>
<el-option
v-for="item in PickTaskType"
:key="item.key"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-if="item.value == 'outbound'"
v-model="tabledis[scope.$index].form_data[item.value]"
clearable
size="mini"
placeholder="出库口"
class="filter-item"
style="width: 120px"
>
<el-option
v-for="item in outboundList"
:key="item.key"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="subRow(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import {crud} from '@crud/crud'
import crudFormData, {getSonFormData} from './formData'
import CRUD, { crud } from '@crud/crud'
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
import crudFormData, {inDecision} from "./formData";
import pick from "./pick";
import measureunit from '@/views/wms/base_manage/measure/measureunit'
export default {
name: 'ViewDialog',
components: {formstruc},
name: 'TaskDialog',
components: { },
mixins: [crud()],
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
dicts: ['IO_BILL_STATUS', 'VEHICLE_OVER_TYPE', 'PCS_SAL_TYPE'],
statusEnums: [ 'IOBILL_TYPE_OUT','FORM_STATUS' ],
tableEnums: [ 'st_ivt_bsrealstorattr#stor_name#stor_code' ],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
openParam: {
type: Array,
default: () => {
return []
}
},
storId: {
type: String,
default: null
}
},
data() {
return {
dialogVisible: false,
divflag: false,
cols: [],
dtlCols: [],
dialogVisible: false,
unitDict: [],
disCols: [],
disFormData: [],
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
vehicledis: [],
vehicleform:{},
un_assign_qty:0,
currentDtl: null,
PickTaskType:[
{"label":"拣选回库","value":"13"},{"label":"拣选出库","value":"23"}
],
outboundList:[
{"label":"一楼出库口","value":"1101"},{"label":"二楼出库口","value":"2114"}
],
form: {},
formStatus: [
{
value: '10',
label: '生成'
},
{
value: '20',
label: '执行中'
},
{
value: '99',
label: '完成'
}
]
rules: {}
}
},
watch: {
dialogShow: {
handler(newValue) {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
methods: {
open() {
},
setForm(row) {
this.dialogVisible = true
this.form = row
@@ -198,62 +327,103 @@ export default {
formstruc.getHeader(dtl_form_type).then(res => {
this.dtlCols = res
})
formstruc.getHeader("Picking_Task").then(res => {
this.disCols = res
res.forEach(a => {
this.disFormData[a.value,'']
})
}),
measureunit.getSelect().then(res => {
this.unitDict = res.content
})
this.queryTableDtl(row.id)
},
close() {
this.dialogVisible = false
addPickTask(){
let dis_assign_qty = 0;
this.tabledis.forEach(a=>{
dis_assign_qty = dis_assign_qty+a.qty
})
if (!this.currentDtl) {
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
let dtl = {};
dtl.material_id = this.currentDtl.material_id
dtl.material_name = this.currentDtl.material_name
dtl.material_spec = this.currentDtl.material_spec
dtl.material_pcsn = this.currentDtl.material_pcsn
dtl.qty = this.currentDtl.assign_qty-dis_assign_qty
dtl.pcsn = this.currentDtl.pcsn
dtl.unit_id = this.currentDtl.unit_id
dtl.form_type = 'Picking_Task'
dtl.source_form_type = this.currentDtl.source_form_type
dtl.source_form_id = this.currentDtl.id
dtl.source_form_date = this.currentDtl.create_time
dtl.parent_id = this.currentDtl.id
dtl.form_data = {}
this.disFormData.forEach(a => {
dtl.form_data[a.value,'']
})
this.tabledis.push(dtl)
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
statusFormat(row) {
return this.dict.label.status[row.status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
subRow(index){
this.tabledis.splice(this.tabledis.indexOf(index),1)
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
this.currentDtl = current
this.queryTableDis()
} else {
this.tabledis = []
this.currentdtl = {}
this.currentDtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
changeTaskType(index,taskType) {
if (taskType == "13"){
let dis_assign_qty = 0;
this.tabledis.forEach(a=>{
dis_assign_qty = dis_assign_qty+a.qty
})
this.tabledis[index].qty = this.currentDtl.qty-dis_assign_qty
}
},
handleDisCurrentChange(current) {
this.currentDis = current
savePickTask() {
pick.savePickTask(this.tabledis).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
queryTableDtl(id) {
crudFormData.getSonFormData(id).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getVehicleTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
queryTableDis() {
if (this.currentDtl !== null) {
crudFormData.getSonFormData(this.currentDtl.id).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
},
formatStatus(row) {
return this.dict.label.status[row.status]
closeDialog(){
this.dialogVisible = false
this.tabledis = []
this.tableDtl = []
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
savePickMst(){
pick.updateStatus({"status":"13","id":this.form.id})
this.closeDialog()
},
close() {
this.form.tableMater = []
this.form.dtl_row = null
this.form.bucketunique = null
this.sectProp = null
this.$emit('update:dialogShow', false)
this.$emit('AddChanged')
this.crud.refresh()
this.$refs['form2'].resetFields()
}
}
}
@@ -273,12 +443,18 @@ export default {
color: #303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.crud-opts-right2 {
padding-left: 77%;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -109,8 +109,87 @@
<el-table-column prop="proc_inst_id" label="对应流程实例id" show-overflow-tooltip width="120"/>
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">作业明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tabledis"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120"/>
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="120"/>
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="90"/>
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip width="150"/>
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="120">
<template slot-scope="scope">
<el-select disabled v-model="tabledis[scope.$index].unit_id"
class="filter-item" placeholder="单位" size="small" style="width: 90px">
<el-option
v-for="item in unitDict"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column disabled prop="vehicle_code" label="周转载具" show-overflow-tooltip width="120" />
<el-table-column show-overflow-tooltip v-for="(item, index) in disCols" :key="item.value"
:label="item.lable">
<template slot-scope="scope">
<el-switch disabled v-if="item.value == 'is_artificiality'"
v-model="tabledis[scope.$index].form_data[item.value]"
active-color="#409EFF"
inactive-color="#F56C6C"
:active-value=true
:inactive-valu=false
/>
<el-select disabled v-if="item.value == 'task_type'"
v-model="tabledis[scope.$index].form_data[item.value]"
clearable
size="mini"
placeholder="任务类型"
class="filter-item"
style="width: 120px"
@change="changeTaskType(scope.$index,tabledis[scope.$index].form_data[item.value])"
>
<el-option
v-for="item in PickTaskType"
:key="item.key"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select disabled v-if="item.value == 'outbound'"
v-model="tabledis[scope.$index].form_data[item.value]"
clearable
size="mini"
placeholder="出库口"
class="filter-item"
style="width: 120px"
>
<el-option
v-for="item in outboundList"
:key="item.key"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</el-table>
</el-card>
</el-dialog>
</template>
</template>
<script>
@@ -136,14 +215,22 @@ export default {
return {
cols: [],
dtlCols: [],
disCols: [],
dialogVisible: false,
tableDtl: [],
tabledis: [],
disFormData: {},
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {},
PickTaskType:[
{"label":"拣选回库","value":"13"},{"label":"拣选出库","value":"23"}
],
outboundList:[
{"label":"一楼出库口","value":"1101"},{"label":"二楼出库口","value":"2114"}
],
formStatus: [
{
value: '10',
@@ -186,6 +273,12 @@ export default {
formstruc.getHeader(dtl_form_type).then(res => {
this.dtlCols = res
})
formstruc.getHeader("Picking_Task").then(res => {
this.disCols = res
res.forEach(a => {
this.disFormData[a.value,'']
})
}),
this.queryTableDtl(row.id)
},
close() {
@@ -204,10 +297,10 @@ export default {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
debugger
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
this.queryTableDis(this.currentdtl.id)
} else {
this.tabledis = []
this.currentdtl = {}
@@ -228,14 +321,10 @@ export default {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getVehicleTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
queryTableDis(id) {
crudFormData.getSonFormData(id).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
},
formatStatus(row) {
return this.dict.label.status[row.status]

View File

@@ -69,14 +69,17 @@
>
拣选作业
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- icon="el-icon-view"-->
<!-- size="mini"-->
<!-- @click="hideShow"-->
<!-- >-->
<!-- </el-button>-->
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="task_flag"
@click="taskOpen"
>
作业下发
</el-button>
<el-button
slot="right"
class="filter-item"
@@ -90,7 +93,7 @@
<el-table
ref="table"
v-loading="crud.loading"
@select="handleCurrentChange"
@select="handleSelectionChange"
:data="crud.data"
>
<el-table-column type="selection" width="55" />
@@ -169,6 +172,7 @@ import pagination from '@crud/Pagination'
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
import ViewDialog from './ViewDialog'
import TaskDialog from './TaskDialog'
import crudPick from './pick'
// import UploadDialog from './UploadDialog'
@@ -217,6 +221,7 @@ export default {
return {
cols: [],
classes: [],
task_flag: true,
currentRow: null,
uploadShow: false,
dis_flag: true,
@@ -268,20 +273,32 @@ export default {
this.$refs.viewDialog.setForm(row)
}
},
handleCurrentChange(val, row) {
if (val.length > 1) {
this.dis_flag = true
this.currentRow = {}
} else if (val.length === 1) {
handleSelectionChange(val, row) {
if (val.length === 1) {
this.task_flag = false
this.dis_flag = false
this.currentRow = row
} else {
this.task_flag = true
this.dis_flag = true
this.currentRow = null
}
},
disOpen(row) {
if (this.currentRow !== null) {
this.$refs.taskDis.setForm(this.currentRow)
}
}
},
taskOpen(row) {
if (this.currentRow !== null) {
crudPick.taskopen(this.currentRow).then(res => {
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
}
},
}
}

View File

@@ -0,0 +1,49 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/picking',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/picking',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/picking',
method: 'post',
data
})
}
export function updateStatus(data) {
return request({
url: '/api/picking/updateStatus',
method: 'post',
data
})
}
export function savePickTask(data) {
return request({
url: 'api/picking/savePickTask',
method: 'post',
data
})
}
export function taskopen(data) {
return request({
url: '/api/picking/taskOpen',
method: 'post',
data
})
}
export default {add, edit, del, savePickTask, updateStatus, taskopen}