no message

main
HUOJIN\92525 2025-09-25 12:29:46 +08:00
parent bf360febbe
commit df31755799
4 changed files with 268 additions and 220 deletions

View File

@ -130,15 +130,21 @@ export default {
props: { props: {
permission: { permission: {
type: Object, type: Object,
default: () => { return {} } default: () => {
return {}
}
}, },
ignoreColumns: { ignoreColumns: {
type: Array, type: Array,
default: () => { return [] } default: () => {
return []
}
}, },
tableKey: { tableKey: {
type: String, type: String,
default: () => { return '' } default: () => {
return ''
}
} }
}, },
data() { data() {
@ -180,83 +186,57 @@ export default {
}, },
methods: { methods: {
initcolumn() { initcolumn() {
this.updateTableColumns() this.updateTableColumns()
const strHidden = sessionStorage.getItem(this.tableKey) const strHidden = sessionStorage.getItem(this.tableKey)
this.hiddenColumns = JSON.parse(strHidden);
// sessionStorage if (this.hiddenColumns) {
if (!strHidden) {
this.hiddenColumns = []
return
}
// JSON
try {
this.hiddenColumns = JSON.parse(strHidden) || []
} catch (error) {
this.hiddenColumns = []
return
}
if (this.hiddenColumns.length > 0) {
const table = this.crud.props.table const table = this.crud.props.table
// label column
const labelToColumnMap = {}
if (table && table.$children) {
table.$children.forEach(child => {
if (child.label) {
labelToColumnMap[child.label] = child
}
})
}
this.table_configs_xs.forEach((column, index) => { this.table_configs_xs.forEach((column, index) => {
const vm = labelToColumnMap[column.label] const vm = table.$children.find(e => e.label === column.label)
//
if (!vm) {
return
}
const columnConfig = vm.columnConfig const columnConfig = vm.columnConfig
// columnConfig
if (!columnConfig) {
return
}
if (vm.owner && vm.owner.store) {
vm.owner.store.commit('removeColumn', columnConfig, null) vm.owner.store.commit('removeColumn', columnConfig, null)
}
}) })
this.ignoreNextTableColumnsChange = false this.ignoreNextTableColumnsChange = false
setTimeout(() => { setTimeout(() => {
// //
this.showcolumn() this.showcolumn();
}, 200) }, 200)
} }
}, },
showcolumn() { showcolumn() {
console.log("------显示列------") try {
// sessionStoragehiddenColumns
const strHidden = sessionStorage.getItem(this.tableKey) const strHidden = sessionStorage.getItem(this.tableKey)
if (strHidden) {
this.hiddenColumns = JSON.parse(strHidden); this.hiddenColumns = JSON.parse(strHidden);
const table = this.crud.props.table } else {
this.hiddenColumns.forEach((column,index) => { //
this.hiddenColumns = [];
const vm = table.$children.find(e => e.prop === column.property)
const columnConfig = vm.columnConfig
console.log(columnConfig.label)
if(column.visible){
columnConfig.width=column.width
columnConfig.visible=column.visible
vm.owner.store.commit('insertColumn', columnConfig, index+1 , null)
} }
})
console.log("------显示列完成------") const table = this.crud.props.table
//
this.hiddenColumns.forEach((column, index) => {
const vm = table.$children.find(e => e && e.prop === column.property)
if (vm) {
const columnConfig = vm.columnConfig;
// columnConfig
if (columnConfig) {
if (column.visible) {
//
columnConfig.width = column.width;
columnConfig.visible = column.visible;
vm.owner.store.commit('insertColumn', columnConfig, index + 1, null);
}
}
}
});
this.updateTableColumns(); this.updateTableColumns();
} catch (error) {
console.error("处理列配置时发生错误:", error);
}
}, },
// //
columnDrop() { columnDrop() {
@ -460,9 +440,11 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.crud-opts .crud-opts-right { .crud-opts .crud-opts-right {
margin-left: auto; margin-left: auto;
} }
.crud-opts .crud-opts-right span { .crud-opts .crud-opts-right span {
float: left; float: left;
} }

View File

@ -6,8 +6,10 @@
<el-form ref="form" :inline="true" :model="form" label-width="70px"> <el-form ref="form" :inline="true" :model="form" label-width="70px">
<el-input v-model="query.itemCode" clearable placeholder="品番" style="width: 140px;" class="filter-item" <el-input v-model="query.itemCode" clearable placeholder="品番" style="width: 140px;" class="filter-item"
@keyup.enter.native="crud.toQuery"/> @keyup.enter.native="crud.toQuery"
<el-select v-model="query.status" clearable placeholder="状态" value-key="id" class="filter-item" style="width: 150px" />
<el-select v-model="query.status" clearable placeholder="状态" value-key="id" class="filter-item"
style="width: 150px"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
> >
<el-option <el-option
@ -19,10 +21,14 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<AreaSelect v-model="query.area" /> <AreaSelect v-model="query.ckAreaCode" :return-type="'value'" :return-value-key="'code'" :bexb="false"
<PointCodeSelect :value-key="'id'" :point_type="'CH'" v-model="query.itemCode2" /> class="filter-item" placeholder="拣货库区" style="width: 155px;"
<AreaCodeSelect v-model="query.ckAreaCode" :bexb="false" class="filter-item" filterable placeholder="拣货库区" style="width: 155px;"/>
<AreaCodeSelect v-model="query.rkAreaCode" @keyup.enter.native="crud.toQuery" :bexb="true" class="filter-item" filterable placeholder="叫料库区" style="width: 155px;"/> />
<AreaSelect v-model="query.rkAreaCode" :return-type="'value'" :return-value-key="'code'" :bexb="true"
class="filter-item" placeholder="叫料库区" style="width: 155px;"
/>
<date-range-picker v-model="query.createTime" class="date-item" style="width: 100px"/> <date-range-picker v-model="query.createTime" class="date-item" style="width: 100px"/>
<!-- 搜索--> <!-- 搜索-->
<rrOperation :crud="crud"/> <rrOperation :crud="crud"/>
@ -92,7 +98,8 @@
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small"
style="width: 100%;" style="width: 100%;"
height="58vh" height="58vh"
@selection-change="selectionChangeHandlerTwo" border> @selection-change="selectionChangeHandlerTwo" border
>
<el-table-column type="selection" width="50"/> <el-table-column type="selection" width="50"/>
<el-table-column prop="id" label="序号"/> <el-table-column prop="id" label="序号"/>
<!-- <el-table-column prop="shArea.gcCode" label="工厂" width="150px"/>--> <!-- <el-table-column prop="shArea.gcCode" label="工厂" width="150px"/>-->
@ -113,26 +120,25 @@
<el-table-column prop="xdPf" label="箱单品番" width="100px"/> <el-table-column prop="xdPf" label="箱单品番" width="100px"/>
<el-table-column prop="orderQty" label="订单数量"/> <el-table-column prop="orderQty" label="订单数量"/>
<el-table-column prop="allocatedQty" label="分配数量"/> <el-table-column prop="allocatedQty" label="分配数量"/>
<el-table-column prop="pickedQty" label="拣货数量"/>
<el-table-column prop="pickedQty" label="拣货数量"/>
<el-table-column prop="remark" label="备注"/> <el-table-column prop="remark" label="备注"/>
<el-table-column prop="createBy" label="创建人"/> <el-table-column prop="createBy" label="创建人"/>
<el-table-column prop="createTime" width="150px" label="创建时间"/> <el-table-column prop="createTime" width="150px" label="创建时间"/>
<el-table-column label="操作" width="150px" align="center"> <el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" :disabled="scope.row.status!='OPEN'" type="primary" icon="el-icon-edit" <el-button size="mini" :disabled="scope.row.status!='OPEN'" type="primary" icon="el-icon-edit"
@click="editPick(scope.row)"/> @click="editPick(scope.row)"
/>
<template> <template>
<el-popconfirm <el-popconfirm
title="确定删除吗?" title="确定删除吗?"
icon='el-icon-delete' icon="el-icon-delete"
icon-color='red' icon-color="red"
@confirm="deletePick(scope.row)" @confirm="deletePick(scope.row)"
> >
<el-button slot="reference" :disabled="scope.row.status!='OPEN'" size="mini" type="danger" <el-button slot="reference" :disabled="scope.row.status!='OPEN'" size="mini" type="danger"
icon="el-icon-delete"/> icon="el-icon-delete"
/>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -193,18 +199,18 @@ import rrOperation from '@crud/RR.operation.vue'
import crudOperation from '@crud/CRUD.operation.vue' import crudOperation from '@crud/CRUD.operation.vue'
import udOperation from '@crud/UD.operation.vue' import udOperation from '@crud/UD.operation.vue'
import pagination from '@crud/Pagination.vue' import pagination from '@crud/Pagination.vue'
import {queryBomAccountPoints} from "@/api/bomAccount" import { queryBomAccountPoints } from '@/api/bomAccount'
import {getItems} from "@/api/item" import { getItems } from '@/api/item'
import PickTask from "@/views/business-pick/pickDetail/pickTicketTask.vue" import PickTask from '@/views/business-pick/pickDetail/pickTicketTask.vue'
import XdTask from "@/views/business-pick/pickDetail/xdTask.vue" import XdTask from '@/views/business-pick/pickDetail/xdTask.vue'
import DateRangePicker from "@/components/DateRangePicker/index.vue"; import DateRangePicker from '@/components/DateRangePicker/index.vue'
import { formatDate } from '@/utils/commonUtils' import { formatDate } from '@/utils/commonUtils'
import ItemSelect from "@/views/generic-component/ItemSelect.vue"; import ItemSelect from '@/views/generic-component/ItemSelect.vue'
import BomAccountPointSelect from "@/views/generic-component/BomAccountPointSelect.vue"; import BomAccountPointSelect from '@/views/generic-component/BomAccountPointSelect.vue'
import {queryPickDetailXd} from "@/api/inventory"; import { queryPickDetailXd } from '@/api/inventory'
import AreaCodeSelect from "@/views/generic-component/AreaCodeSelect.vue"; import AreaCodeSelect from '@/views/generic-component/AreaCodeSelect.vue'
import AreaSelect from "@/views/generic-component/AreaSelect.vue"; import AreaSelect from '@/views/generic-component/AreaSelect.vue'
import PointCodeSelect from "@/views/generic-component/PointCodeSelect.vue"; import PointCodeSelect from '@/views/generic-component/PointCodeSelect.vue'
const defaultForm = { const defaultForm = {
id: null, id: null,
@ -218,7 +224,8 @@ export default {
AreaCodeSelect, AreaCodeSelect,
XdTask, XdTask,
BomAccountPointSelect, BomAccountPointSelect,
ItemSelect, DateRangePicker, PickTask,pagination, crudOperation, rrOperation, udOperation}, ItemSelect, DateRangePicker, PickTask, pagination, crudOperation, rrOperation, udOperation
},
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['pick_status'], dicts: ['pick_status'],
cruds() { cruds() {
@ -235,7 +242,7 @@ export default {
reset: false, reset: false,
download: true download: true
} }
},) })
}, },
data() { data() {
return { return {
@ -245,10 +252,22 @@ export default {
radio3: '未拣货', radio3: '未拣货',
items: [], items: [],
cxjlFromFlag: false, cxjlFromFlag: false,
cxjlFrom: { bom_account_id: null,order_qty:0, item_code:null, item_name:null, zzkw_id:null, bonded:null,zzkw_code:null, gw_code:null, gw_name:null, status:null, remark:null,srs:0,beXdPf:false }, cxjlFrom: {
permission: { bom_account_id: null,
order_qty: 0,
item_code: null,
item_name: null,
zzkw_id: null,
bonded: null,
zzkw_code: null,
gw_code: null,
gw_name: null,
status: null,
remark: null,
srs: 0,
beXdPf: false
}, },
permission: {},
rules: { rules: {
item: [ item: [
{ required: true, message: '品番必填', trigger: 'blur' } { required: true, message: '品番必填', trigger: 'blur' }
@ -267,7 +286,7 @@ export default {
}, },
mounted() { mounted() {
// //
this.getItem(); this.getItem()
}, },
methods: { methods: {
// false // false
@ -292,39 +311,38 @@ export default {
selectionChangeHandlerTwo(val) { selectionChangeHandlerTwo(val) {
this.crud.selections = val this.crud.selections = val
if (this.crud.selections.length == 0) { if (this.crud.selections.length == 0) {
this.show_jh = true; this.show_jh = true
this.show_fp = true; this.show_fp = true
this.show_cancelfp = true; this.show_cancelfp = true
return; return
} }
const status = []; const status = []
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
status.push(this.crud.selections[i].status) status.push(this.crud.selections[i].status)
} }
if (this.isAllEqual(status) && status[0] == "OPEN") { if (this.isAllEqual(status) && status[0] == 'OPEN') {
this.show_jh = true; this.show_jh = true
this.show_fp = false; this.show_fp = false
return; return
} }
if (this.isAllEqual(status) && status[0] == "ALLOCATE") { if (this.isAllEqual(status) && status[0] == 'ALLOCATE') {
this.show_jh = true; this.show_jh = true
this.show_fp = false; this.show_fp = false
this.show_cancelfp = false; this.show_cancelfp = false
} }
// //
if (this.crud.selections.length == 1 && this.crud.selections[0].orderQty == this.crud.selections[0].allocatedQty) { if (this.crud.selections.length == 1 && this.crud.selections[0].orderQty == this.crud.selections[0].allocatedQty) {
this.show_jh = false; this.show_jh = false
this.show_fp = true; this.show_fp = true
return; return
} }
}, },
btnAllocate(datas) { btnAllocate(datas) {
const ids = []; const ids = []
for (let i = 0; i < datas.length; i++) { for (let i = 0; i < datas.length; i++) {
ids.push(datas[i].id) ids.push(datas[i].id)
} }
@ -334,7 +352,7 @@ export default {
}) })
}, },
btnCancelAllocate(datas) { btnCancelAllocate(datas) {
const ids = []; const ids = []
for (let i = 0; i < datas.length; i++) { for (let i = 0; i < datas.length; i++) {
ids.push(datas[i].id) ids.push(datas[i].id)
} }
@ -353,25 +371,25 @@ export default {
this.$refs.xdTask.queryPickDetailXd(id) this.$refs.xdTask.queryPickDetailXd(id)
}, },
shuaxin() { shuaxin() {
this.crud.toQuery(); this.crud.toQuery()
}, },
clickChange(lab) { clickChange(lab) {
if (lab === "全部") { if (lab === '全部') {
this.crud.resetQuery(); this.crud.resetQuery()
this.crud.toQuery(); this.crud.toQuery()
} else if (lab === "未拣货") { } else if (lab === '未拣货') {
this.query.status = 'OPEN' this.query.status = 'OPEN'
this.crud.toQuery(); this.crud.toQuery()
} else if (lab === "已拣未发") { } else if (lab === '已拣未发') {
this.query.status = 'PICK_ALL' this.query.status = 'PICK_ALL'
this.crud.toQuery(); this.crud.toQuery()
} else if (lab === "已发未收") { } else if (lab === '已发未收') {
this.query.status = 'SHIP_ALL' this.query.status = 'SHIP_ALL'
this.crud.toQuery(); this.crud.toQuery()
} }
}, },
resetQuery() { resetQuery() {
this.radio3 = '未拣货'; this.radio3 = '未拣货'
this.crud.resetQuery() this.crud.resetQuery()
}, },
editPick(data) { editPick(data) {
@ -382,23 +400,23 @@ export default {
}, isAllEqual(array) { }, isAllEqual(array) {
if (array.length > 0) { if (array.length > 0) {
return !array.some(function(value, index) { return !array.some(function(value, index) {
return value !== array[0]; return value !== array[0]
}); })
} else { } else {
return true; return true
} }
}, },
getChangeVule(dben) { getChangeVule(dben) {
this.cxjlFrom.order_qty=dben.srs; this.cxjlFrom.order_qty = dben.srs
this.cxjlFrom.item_code=dben.item_code; this.cxjlFrom.item_code = dben.item_code
this.cxjlFrom.item_name=dben.item_name; this.cxjlFrom.item_name = dben.item_name
this.cxjlFrom.gw_code=dben.gw_code; this.cxjlFrom.gw_code = dben.gw_code
this.cxjlFrom.gw_name=dben.gw_name; this.cxjlFrom.gw_name = dben.gw_name
this.cxjlFrom.bom_account_id = dben.bom_account_id this.cxjlFrom.bom_account_id = dben.bom_account_id
this.cxjlFrom.item_id=dben.item_id; this.cxjlFrom.item_id = dben.item_id
this.cxjlFrom.zzkw_id=dben.zzkw_id; this.cxjlFrom.zzkw_id = dben.zzkw_id
this.cxjlFrom.rk_id=dben.rk_id; this.cxjlFrom.rk_id = dben.rk_id
this.cxjlFrom.bonded=dben.bonded; this.cxjlFrom.bonded = dben.bonded
}, },
btnZzjl() { btnZzjl() {
@ -415,13 +433,13 @@ export default {
}, },
// //
getFormatDate(data) { getFormatDate(data) {
return formatDate(data); return formatDate(data)
}, },
// //
resetForm() { resetForm() {
this.$refs['cxjlFrom'].resetFields() this.$refs['cxjlFrom'].resetFields()
this.$data.cxjlFrom = JSON.parse(JSON.stringify(this.$options.data().cxjlFrom)) this.$data.cxjlFrom = JSON.parse(JSON.stringify(this.$options.data().cxjlFrom))
}, }
} }
} }
</script> </script>

View File

@ -91,7 +91,8 @@ export default {
{key: 'true', display_name: '成功'}, {key: 'true', display_name: '成功'},
{key: 'false', display_name: '失败'} {key: 'false', display_name: '失败'}
], ],
tsakSelectData: [] tsakSelectData: [],
dialogTableHight: 0
} }
}, },
methods: { methods: {

View File

@ -16,55 +16,48 @@
v-for="item in items" v-for="item in items"
:key="item.id" :key="item.id"
:label="item.code" :label="item.code"
:value="item" :value="returnType === 'object' ? item : item[returnValueKey]"
> >
<span>{{ item.code }}</span> <span>{{ item.code }}</span>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
<script> <script>
import curdArea from '@/api/area' import curdArea from '@/api/area'
import CRUD from '@crud/crud'
export default { export default {
name: 'AreaSelect', name: 'AreaSelect',
props: { props: {
// v-model
value: { value: {
type: [String, Number, Boolean, Array], type: [String, Number, Boolean, Array, Object],
default: '' default: ''
}, },
width: { width: {
type: String, type: String,
default: '200px' default: '200px'
}, },
//
placeholder: { placeholder: {
type: String, type: String,
default: '请选择' default: '请选择'
}, },
//
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false default: false
}, },
//
clearable: { clearable: {
type: Boolean, type: Boolean,
default: false default: true
}, },
//
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false default: false
}, },
//
filterable: { filterable: {
type: Boolean, type: Boolean,
default: false default: true
}, },
valueKey: { valueKey: {
type: String, type: String,
@ -78,6 +71,19 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
//
returnType: {
type: String,
default: 'object', // 'object' | 'value'
validator: function(value) {
return ['object', 'value'].includes(value)
}
},
// returnType'value'
returnValueKey: {
type: String,
default: 'id'
}
}, },
data() { data() {
return { return {
@ -86,7 +92,6 @@ export default {
} }
}, },
computed: { computed: {
// v-model
selectedValue: { selectedValue: {
get() { get() {
return this.value return this.value
@ -96,12 +101,19 @@ export default {
} }
} }
}, },
// watch: {
// returnType
returnType: {
handler() {
this.handleReturnTypeChange()
},
immediate: true
}
},
created() { created() {
this.initData() this.initData()
}, },
methods: { methods: {
//
async initData() { async initData() {
this.loading = true this.loading = true
try { try {
@ -115,17 +127,52 @@ export default {
this.loading = false this.loading = false
} }
}, },
//
handleChange(val) { handleChange(val) {
this.$emit('change', val) let emitValue = val
//
if (this.returnType === 'value' && val) {
if (this.multiple) {
//
emitValue = Array.isArray(val) ? val.map(item =>
typeof item === 'object' ? item[this.returnValueKey] : item
) : []
} else {
//
emitValue = typeof val === 'object' ? val[this.returnValueKey] : val
}
}
this.$emit('change', emitValue)
}, },
//
handleClear() { handleClear() {
this.$emit('clear') this.$emit('clear')
},
//
handleReturnTypeChange() {
if (this.returnType === 'value') {
//
if (this.multiple) {
const values = Array.isArray(this.value) ? this.value.map(item => typeof item === 'object' ? item[this.returnValueKey] : item) : []
this.$emit('input', values)
} else {
const value = typeof this.value === 'object' ? this.value[this.returnValueKey] : this.value
this.$emit('input', value)
}
} else {
//
if (this.multiple) {
const objects = Array.isArray(this.value) ? this.value.map(val => this.items.find(item => item[this.returnValueKey] === val) || val) : []
this.$emit('input', objects)
} else {
const object = this.items.find(item => item[this.returnValueKey] === this.value) || this.value
this.$emit('input', object)
}
}
} }
} }
} }
</script> </script>
<style scoped>
/* 可根据需要添加组件样式 */
</style>