rev:出入库流程兼容

This commit is contained in:
zhangzq
2024-06-03 10:09:04 +08:00
parent e446f8b743
commit a243c910ce
85 changed files with 741 additions and 301 deletions

View File

@@ -0,0 +1,33 @@
import Vue from 'vue'
import { tableEnum as getEnumDetail } from '@/views/system/dict/enumDetail'
export default class TableEnum {
constructor(tableEnum) {
this.tableEnum = tableEnum
}
async init(names, completeCallback) {
if (names === undefined || name === null) {
throw new Error('need TableEnum names')
}
const ps = []
names.forEach(n => {
let split = n.split('#');
let code = split[0];
let label = split[1];
let value = split[2];
Vue.set(this.tableEnum.tableEnum, code, {})
Vue.set(this.tableEnum.label, code, {})
Vue.set(this.tableEnum, code, [])
ps.push(getEnumDetail({'code':code,'label':label,'value':value}).then(data => {
this.tableEnum[code].splice(0, 0, ...data)
data.forEach(d => {
Vue.set(this.tableEnum.tableEnum[code], d.value, d)
Vue.set(this.tableEnum.label[code], d.value, d.label)
})
}))
})
await Promise.all(ps)
completeCallback()
}
}

View File

@@ -0,0 +1,29 @@
import TableEnum from './TableEnum'
const install = function(Vue) {
Vue.mixin({
data() {
if (this.$options.tableEnums instanceof Array) {
const tableEnum = {
tableEnum: {},
label: {}
}
return {
tableEnum
}
}
return {}
},
created() {
if (this.$options.tableEnums instanceof Array) {
new TableEnum(this.tableEnum).init(this.$options.tableEnums, () => {
this.$nextTick(() => {
this.$emit('dictReady')
})
})
}
}
})
}
export default { install }

View File

@@ -16,6 +16,7 @@ import 'mavon-editor/dist/css/index.css'
import dict from './components/Dict'
// 数据字典
import statusEnum from './components/StatusEnum'
import tableEnum from './components/TableEnum'
import scroll from 'vue-seamless-scroll'
// 权限指令
@@ -57,6 +58,7 @@ Vue.use(mavonEditor)
Vue.use(permission)
Vue.use(dict)
Vue.use(statusEnum)
Vue.use(tableEnum)
Vue.use(VueBus)
// 全局设置控件样式https://codeantenna.com/a/0IN5FMJk5h

View File

@@ -11,4 +11,12 @@ export function get(code) {
})
}
export default { get }
export function tableEnum(params) {
return request({
url: 'api/dict/getTableEnum',
method: 'get',
params
})
}
export default { get,tableEnum }

View File

@@ -19,10 +19,10 @@
@change="crud.toQuery"
>
<el-option
v-for="item in stors"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
v-for="item in tableEnum.st_ivt_bsrealstorattr"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
@@ -71,17 +71,17 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属仓库" prop="stor_id">
<el-form-item label="归属仓库" prop="id">
<el-select
v-model="form.stor_id"
v-model="form.id"
placeholder=""
style="width: 200px"
>
<el-option
v-for="item in stors"
:key="item.stor_id"
v-for="item in tableEnum.st_ivt_bsrealstorattr"
:key="item.id"
:label="item.stor_name"
:value="item.stor_id"
:value="item.id"
/>
</el-select>
</el-form-item>
@@ -201,7 +201,7 @@ const defaultForm = {
sect_name: null,
simple_name: null,
sect_type_attr: null,
stor_id: null,
id: null,
stor_type: null,
capacity: null,
width: null,
@@ -231,6 +231,7 @@ const defaultForm = {
export default {
name: 'Sectattr',
dicts: ['st_sect_type', 'is_used'],
tableEnums: [ 'st_ivt_bsrealstorattr#stor_name#id' ],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
@@ -265,7 +266,6 @@ export default {
}
}
return {
stors: [],
permission: {
add: ['admin', 'user:add'],
edit: ['admin', 'user:edit'],
@@ -281,7 +281,7 @@ export default {
sect_type_attr: [
{ required: true, message: '库区类型不能为空', trigger: 'blur' }
],
stor_id: [
id: [
{ required: true, message: '仓库标识不能为空', trigger: 'blur' }
],
capacity: [
@@ -294,11 +294,6 @@ export default {
}
}
},
created() {
crudStorattr.getStor({}).then(res => {
this.stors = res
})
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {

View File

@@ -186,7 +186,7 @@ import { getDepts, getDeptSuperior } from '@/views/system/dept/dept'
import { isvalidPhone } from '@/utils/validate'
const defaultForm = {
stor_id: null,
id: null,
stor_code: null,
stor_name: null,
simple_name: null,
@@ -231,8 +231,8 @@ export default {
title: '仓库',
optShow: { add: true, reset: true },
url: 'api/stIvtBsrealstorattr',
idField: 'stor_id',
sort: 'stor_id,desc',
idField: 'id',
sort: 'id,desc',
crudMethod: { ...crudStorattr }
})
},

View File

@@ -9,15 +9,21 @@
label-width="80px"
label-suffix=":"
>
<el-form-item label="所属库">
<el-cascader
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
<el-form-item label="所属库">
<el-select
v-model="query.stor_id"
clearable
class="filter-item"
@change="sectQueryChange"
/>
placeholder="所属仓库"
@change="crud.toQuery"
>
<el-option
v-for="item in tableEnum.st_ivt_bsrealstorattr"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="锁定类型">
<el-select
@@ -106,7 +112,7 @@
<el-col :span="12">
<el-form-item label="载具号">
<label slot="label">载&nbsp;&nbsp;具&nbsp;号:</label>
<el-input v-model="form.storagevehicle_code" style="width: 200px;" />
<el-input v-model="form.vehicle_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -201,7 +207,7 @@
<el-table-column prop="struct_name" label="仓位名称" :min-width="flexWidth('struct_name',crud.data,'仓位名称')" />
<el-table-column prop="sect_name" label="所属库区" width="150" />
<el-table-column prop="stor_name" label="所属仓库" width="150" />
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
<el-table-column prop="vehicle_code" label="载具号" :min-width="flexWidth('vehicle_code',crud.data,'载具号')" />
<el-table-column prop="is_temp" label="是否临时" width="150" >
<template slot-scope="scope">
{{ scope.row.is_temp ? '是' : '否' }}
@@ -272,7 +278,7 @@ const defaultForm = {
sect_id: null,
sect_code: null,
sect_name: null,
stor_id: null,
id: null,
stor_code: null,
stor_name: null,
stor_type: null,
@@ -311,6 +317,7 @@ const defaultForm = {
export default {
name: 'Structattr',
dicts: ['ST_HEIGHT_TYPE', 'is_used', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'placement_type'],
tableEnums: [ 'st_ivt_bsrealstorattr#stor_name#id' ],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
@@ -363,7 +370,7 @@ export default {
sect_id: [
{ required: true, message: '库区标识不能为空', trigger: 'blur' }
],
stor_id: [
id: [
{ required: true, message: '仓库标识不能为空', trigger: 'blur' }
],
capacity: [
@@ -392,11 +399,6 @@ export default {
}
}
},
created() {
crudSectattr.getSect().then(res => {
this.sects = res.content
})
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {

View File

@@ -54,7 +54,7 @@
</el-form-item>
<el-form-item label="任务状态">
<el-select
v-model="query.task_status"
v-model="query.status"
multiple
style="width: 360px"
placeholder="任务状态"
@@ -84,7 +84,7 @@
<el-input v-model="form.task_code" style="width: 240px;"/>
</el-form-item>
<el-form-item label="任务状态">
<el-input v-model="form.task_status" style="width: 240px;"/>
<el-input v-model="form.status" style="width: 240px;"/>
</el-form-item>
<el-form-item label="点位1">
<el-input v-model="form.point_code1" style="width: 240px;"/>
@@ -127,9 +127,9 @@
<el-table-column prop="task_code" show-overflow-tooltip show-tooltip-when-overflow label="任务编码"/>
<el-table-column prop="task_type" show-overflow-tooltip show-tooltip-when-overflow label="任务类型"/>
<el-table-column prop="acs_type" show-overflow-tooltip show-tooltip-when-overflow width="130" label="ACS任务类型"/>
<el-table-column prop="task_status" show-overflow-tooltip show-tooltip-when-overflow label="任务状态">
<el-table-column prop="status" show-overflow-tooltip show-tooltip-when-overflow label="任务状态">
<template slot-scope="scope">
{{ getStatusName(scope.row.task_status) }}
{{ getStatusName(scope.row.status) }}
</template>
</el-table-column>
<el-table-column prop="task_step" show-overflow-tooltip show-tooltip-when-overflow width="130" label="任务执行步骤"/>
@@ -157,14 +157,14 @@
type="text"
icon="el-icon-success"
@click="doOperate(scope.row, 'a')"
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
:disabled="scope.row.status==='5' || scope.row.status==='6'"
>完成
</el-button>
<el-button
type="text"
icon="el-icon-error"
@click="doOperate(scope.row, 'b')"
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
:disabled="scope.row.status==='5' || scope.row.status==='6'"
>取消
</el-button>
</template>
@@ -193,7 +193,7 @@ const defaultForm = {
task_code: null,
task_type: null,
acs_type: null,
task_status: null,
status: null,
task_step: null,
group_code: null,
point_code1: null,
@@ -250,9 +250,9 @@ export default {
this.crud.toQuery()
},
handTaskStatus(value) {
this.crud.query.more_task_status = null
this.crud.query.more_status = null
if (value) {
this.crud.query.more_task_status = value.toString()
this.crud.query.more_status = value.toString()
}
this.crud.toQuery()
},

View File

@@ -39,7 +39,7 @@
style="width: 185px;">
<el-option
v-for="item in storList"
:key="item.stor_id"
:key="item.id"
:label="item.stor_code"
:value="item.stor_code">
</el-option>

View File

@@ -25,7 +25,7 @@
style="width: 185px;">
<el-option
v-for="item in storList"
:key="item.stor_id"
:key="item.id"
:label="item.stor_code"
:value="item.stor_code">
</el-option>
@@ -68,7 +68,7 @@
<el-select v-model="form.stor_code" placeholder="请选择" style="width: 150px;">
<el-option
v-for="item in storList"
:key="item.stor_id"
:key="item.id"
:label="item.stor_code"
:value="item.stor_code">
</el-option>

View File

@@ -17,7 +17,7 @@
<el-form-item label="完结单据" prop="finish">
<el-select multiple clearable v-model="formData.finish" placeholder="请选择" style="width: 370px;">
<el-option
v-for="item in formTypes"
v-for="item in tableEnum.bm_form_struc"
:key="item.value"
:label="item.label"
:value="item.value">
@@ -36,6 +36,7 @@
<script>
export default {
name: '',
tableEnums: [ 'bm_form_struc#form_type#form_type' ],
props: {
nodeData: Object,
lf: Object || String,

View File

@@ -116,7 +116,7 @@ export default {
name: 'ViewDialog',
components: {formstruc},
mixins: [crud()],
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'task_status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
dicts: ['ST_INV_CP_IN_TYPE', 'product_area', 'IO_BILL_STATUS', 'status', 'SCH_TASK_TYPE_DTL', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
@@ -186,8 +186,8 @@ export default {
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
statusFormat(row) {
return this.dict.label.status[row.status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
@@ -227,7 +227,7 @@ export default {
}
},
formatStatus(row) {
return this.dict.label.task_status[row.task_status]
return this.dict.label.status[row.status]
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]

View File

@@ -46,10 +46,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<el-form-item label="仓库" prop="id">
<label slot="label">仓库</label>
<el-select
v-model="form.stor_id"
v-model="form.id"
clearable
class="filter-item"
style="width: 210px"
@@ -57,9 +57,9 @@
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:key="item.id"
:label="item.stor_name"
:value="item.stor_id"
:value="item.id"
/>
</el-select>
</el-form-item>
@@ -278,7 +278,7 @@ const defaultForm = {
bill_type: '',
remark: '',
workshop_id: '',
stor_id: '',
id: '',
biz_date: new Date(),
create_mode: '',
tableData: [],

View File

@@ -289,7 +289,7 @@ export default {
data() {
return {
dialogVisible: false,
stor_id: '1528627995269533696',
id: '1528627995269533696',
sect_id: '1528631043496742912',
sectProp: null,
structShow: false,
@@ -305,7 +305,7 @@ export default {
dtl_row: null,
storage_qty: '',
sect_id: '',
stor_id: '',
id: '',
point_code: null,
vehicle_code: '',
bucketunique: '',
@@ -335,7 +335,7 @@ export default {
}
},
open() {
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
crudSectattr.getSect({ 'id': this.storId }).then(res => {
this.sects = res.content
})
const area_type = 'A1_CPRK01'
@@ -548,21 +548,21 @@ export default {
this.sectProp = val
if (val.length === 1) {
this.stor_id = val[0]
this.id = val[0]
this.sect_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.stor_id = ''
this.id = ''
}
if (val.length === 2) {
this.stor_id = val[0]
this.id = val[0]
this.sect_id = val[1]
}
},
tableChanged(row) {
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
this.form.id = this.id
this.dis_row.struct_id = row.struct_id
this.divBtn = true
crudProductIn.divStruct(this.dis_row).then(res => {
@@ -595,7 +595,7 @@ export default {
}
this.divBtn = true
this.dis_row.stor_id = this.stor_id.toString()
this.dis_row.id = this.id.toString()
this.dis_row.sect_id = this.sect_id.toString()
this.dis_row.vehicle_overstruct_type = this.form.vehicle_overstruct_type
crudProductIn.divStruct(this.dis_row).then(res => {
@@ -609,7 +609,7 @@ export default {
this.divBtn = false
})
} else {
if (!this.stor_id) {
if (!this.id) {
this.crud.notify('请先选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
return
}

View File

@@ -243,7 +243,7 @@ export default {
dialogVisible: false,
GroupShow: false,
click_Row: {},
stor_id: '1528627995269533696',
id: '1528627995269533696',
sect_id: '1528631043496742912',
sectProp: null,
structShow: false,

View File

@@ -150,7 +150,7 @@
<el-table-column prop="point_code1" label="起始位置" align="center" width="120"/>
<el-table-column prop="point_code2" label="目的位置" align="center" width="120"/>
<el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="task_status" label="任务状态" align="center" :formatter="formatStatus"/>
<el-table-column prop="status" label="任务状态" align="center" :formatter="formatStatus"/>
<el-table-column prop="source_form_type" label="源单类型" align="center" width="150"/>
<el-table-column show-overflow-tooltip prop="source_form_id" label="源单id" align="center" width="150"/>
</el-table>
@@ -260,7 +260,7 @@ export default {
}
},
formatStatus(row) {
return this.dict.label.FORM_STATUS[row.task_status]
return this.dict.label.FORM_STATUS[row.status]
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]

View File

@@ -285,7 +285,7 @@ export default {
divOpen() {
crudProductIn.getIosInvDtl({ 'bill_code': this.currentRow.bill_code }).then(res => {
this.openParam = res
this.storId = this.currentRow.stor_id
this.storId = this.currentRow.id
this.billType = this.currentRow.bill_type
this.divShow = true
})

View File

@@ -243,7 +243,7 @@ export default {
dialogVisible: false,
GroupShow: false,
click_Row: {},
stor_id: '1528627995269533696',
id: '1528627995269533696',
sect_id: '1528631043496742912',
sectProp: null,
structShow: false,

View File

@@ -147,7 +147,7 @@
<el-table-column prop="point_code1" label="任务起始位置" align="center" width="120"/>
<el-table-column prop="point_code2" label="任务目的位置" align="center" width="120"/>
<el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="task_status" label="任务状态" align="center" :formatter="formatStatus"/>
<el-table-column prop="status" label="任务状态" align="center" :formatter="formatStatus"/>
<el-table-column prop="source_form_type" label="源单类型" align="center" width="150"/>
<el-table-column show-overflow-tooltip prop="source_form_id" label="源单id" align="center" width="150"/>
</el-table>
@@ -277,7 +277,7 @@ export default {
data.pop = true
},
formatStatus(row) {
return this.statusEnum.label.FORM_STATUS[row.task_status]
return this.statusEnum.label.FORM_STATUS[row.status]
},
close() {
this.form.tableMater = []
@@ -460,21 +460,21 @@ export default {
this.sectProp = val
if (val.length === 1) {
this.stor_id = val[0]
this.id = val[0]
this.sect_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.stor_id = ''
this.id = ''
}
if (val.length === 2) {
this.stor_id = val[0]
this.id = val[0]
this.sect_id = val[1]
}
},
tableChanged(row) {
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
this.form.id = this.id
this.dis_row.struct_id = row.struct_id
this.divBtn = true
},

View File

@@ -131,9 +131,9 @@
<el-table-column prop="point_code1" label="任务起始位置" align="center" width="120"/>
<el-table-column prop="point_code2" label="任务目的位置" align="center" width="120"/>
<el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="task_status" label="任务状态">
<el-table-column prop="status" label="任务状态">
<template slot-scope="scope">
{{ statusEnum.label.FORM_STATUS[scope.row.task_status] }}
{{ statusEnum.label.FORM_STATUS[scope.row.status] }}
</template>
</el-table-column>
<el-table-column prop="source_form_type" label="源单类型" align="center" width="150"/>