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

@ -2,7 +2,7 @@
<div class="crud-opts"> <div class="crud-opts">
<span class="crud-opts-left"> <span class="crud-opts-left">
<!--左侧插槽--> <!--左侧插槽-->
<slot name="left" /> <slot name="left"/>
<el-button <el-button
v-if="crud.optShow.add" v-if="crud.optShow.add"
v-permission="permission.add" v-permission="permission.add"
@ -51,7 +51,7 @@
@click="crud.doExport" @click="crud.doExport"
>导出</el-button> >导出</el-button>
<!--右侧--> <!--右侧-->
<slot name="right" /> <slot name="right"/>
</span> </span>
<el-button-group class="crud-opts-right"> <el-button-group class="crud-opts-right">
<el-button <el-button
@ -106,7 +106,7 @@
</div> </div>
</template> </template>
<script> <script>
import CRUD, { crud } from '@crud/crud' import CRUD, {crud} from '@crud/crud'
import crudTableConfig from '@/api/tableConfig' import crudTableConfig from '@/api/tableConfig'
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
@ -130,22 +130,28 @@ 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() {
return { return {
hiddenColumns:[], hiddenColumns: [],
table_configs:[], table_configs: [],
table_configs_xs:[], table_configs_xs: [],
tableColumns: [], tableColumns: [],
allColumnsSelected: true, allColumnsSelected: true,
allColumnsSelectedIndeterminate: false, allColumnsSelectedIndeterminate: false,
@ -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
vm.owner.store.commit('removeColumn', columnConfig, null)
// columnConfig
if (!columnConfig) {
return
}
if (vm.owner && vm.owner.store) {
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 {
const strHidden=sessionStorage.getItem(this.tableKey) // sessionStoragehiddenColumns
this.hiddenColumns= JSON.parse(strHidden); const strHidden = sessionStorage.getItem(this.tableKey)
const table = this.crud.props.table if (strHidden) {
this.hiddenColumns.forEach((column,index) => { this.hiddenColumns = JSON.parse(strHidden);
} else {
const vm = table.$children.find(e => e.prop === column.property) //
const columnConfig = vm.columnConfig this.hiddenColumns = [];
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. updateTableColumns(); //
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();
} catch (error) {
console.error("处理列配置时发生错误:", error);
}
}, },
// //
columnDrop() { columnDrop() {
@ -266,51 +246,51 @@ export default {
delay: 0, delay: 0,
onEnd: evt => { onEnd: evt => {
// label // label
this.ColumnsDrop(evt.item.innerText,evt.newIndex) this.ColumnsDrop(evt.item.innerText, evt.newIndex)
} }
}) })
}, },
// //
ColumnsDrop(oldText,newIndex) { ColumnsDrop(oldText, newIndex) {
const table = this.crud.props.table const table = this.crud.props.table
let myindex = -1 // let myindex = -1 //
let oldIndex1 = 0 let oldIndex1 = 0
let step = -1 let step = -1
let count = 0 let count = 0
// //
this.tableColumns.some((column,index) => { this.tableColumns.some((column, index) => {
if(column.visible) { if (column.visible) {
count++ count++
} }
}) })
// //
this.tableColumns.some((column,index) => { this.tableColumns.some((column, index) => {
if(column.label === oldText) { if (column.label === oldText) {
oldIndex1 = index oldIndex1 = index
return true return true
}else{ } else {
// //
if(step>index){ if (step > index) {
myindex++ myindex++
} }
} }
step++ step++
}) })
if (myindex === -1 ) { if (myindex === -1) {
myindex = 0 myindex = 0
} }
let item= this.tableColumns[oldIndex1] let item = this.tableColumns[oldIndex1]
const vm = table.$children.find(e => e.prop === item.property) const vm = table.$children.find(e => e.prop === item.property)
const columnConfig = vm.columnConfig const columnConfig = vm.columnConfig
/*this.tableColumns.splice(oldIndex1-1, 1) /*this.tableColumns.splice(oldIndex1-1, 1)
this.tableColumns.splice(myindex-1, 0, item)*/ this.tableColumns.splice(myindex-1, 0, item)*/
if(oldIndex1 <newIndex){ // if (oldIndex1 < newIndex) { //
vm.owner.store.commit('insertColumn', columnConfig, newIndex+myindex , null) vm.owner.store.commit('insertColumn', columnConfig, newIndex + myindex, null)
vm.owner.store.commit('removeColumn', columnConfig, null) vm.owner.store.commit('removeColumn', columnConfig, null)
}else { // } else { //
vm.owner.store.commit('removeColumn', columnConfig, null) vm.owner.store.commit('removeColumn', columnConfig, null)
vm.owner.store.commit('insertColumn', columnConfig, newIndex+myindex , null) vm.owner.store.commit('insertColumn', columnConfig, newIndex + myindex, null)
} }
// //
this.ignoreNextTableColumnsChange = false this.ignoreNextTableColumnsChange = false
@ -381,7 +361,7 @@ export default {
}) })
if (selectedCount === 0) { if (selectedCount === 0) {
this.crud.notify('请至少选择一列', CRUD.NOTIFICATION_TYPE.WARNING) this.crud.notify('请至少选择一列', CRUD.NOTIFICATION_TYPE.WARNING)
this.$nextTick(function() { this.$nextTick(function () {
item.visible = true item.visible = true
}) })
return return
@ -404,8 +384,8 @@ export default {
crudTableConfig.add(post_table_config)*/ crudTableConfig.add(post_table_config)*/
//this.postToTableConfig(); //this.postToTableConfig();
}, },
postToTableConfig(){ postToTableConfig() {
this. updateTableColumns(); this.updateTableColumns();
const columns = [] const columns = []
this.tableColumns.forEach(column => { this.tableColumns.forEach(column => {
const table_config = { const table_config = {
@ -421,11 +401,11 @@ export default {
tableType: this.tableKey tableType: this.tableKey
} }
this.crud.loading=true this.crud.loading = true
crudTableConfig.add(post_table_config).then(res => { crudTableConfig.add(post_table_config).then(res => {
setTimeout(() => { setTimeout(() => {
// //
this.crud.loading=false this.crud.loading = false
}, 500) }, 500)
}) })
@ -440,7 +420,7 @@ export default {
if (item.visible) { if (item.visible) {
// //
const columnIndex = this.tableColumns.indexOf(item) const columnIndex = this.tableColumns.indexOf(item)
vm.owner.store.commit('insertColumn', columnConfig, columnIndex+1, null) vm.owner.store.commit('insertColumn', columnConfig, columnIndex + 1, null)
} else { } else {
vm.owner.store.commit('removeColumn', columnConfig, null) vm.owner.store.commit('removeColumn', columnConfig, null)
} }
@ -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

@ -5,9 +5,11 @@
<!-- 查询操作--> <!-- 查询操作-->
<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,11 +21,15 @@
> >
</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;"/> />
<date-range-picker v-model="query.createTime" class="date-item" style="width: 100px" /> <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"/>
<!-- 搜索--> <!-- 搜索-->
<rrOperation :crud="crud"/> <rrOperation :crud="crud"/>
<!-- 重置--> <!-- 重置-->
@ -92,13 +98,14 @@
<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"/>-->
<el-table-column prop="item.code" label="品番" width="150px"/> <el-table-column prop="item.code" label="品番" width="150px"/>
<el-table-column prop="item.name" label="品名"/> <el-table-column prop="item.name" label="品名"/>
<el-table-column prop="status" label="状态"> <el-table-column prop="status" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{ dict.label.pick_status[scope.row.status] }} {{ dict.label.pick_status[scope.row.status] }}
@ -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>
@ -144,25 +150,25 @@
<XdTask ref="xdTask"/> <XdTask ref="xdTask"/>
<!--表单组件--> <!--表单组件-->
<el-dialog title="制造叫料" :visible.sync="cxjlFromFlag" width="500px" > <el-dialog title="制造叫料" :visible.sync="cxjlFromFlag" width="500px">
<el-form ref="cxjlFrom" :model="cxjlFrom" :rules="rules" size="small" label-width="80px"> <el-form ref="cxjlFrom" :model="cxjlFrom" :rules="rules" size="small" label-width="80px">
<el-form-item label="制造库位" prop="zzkwCode"> <el-form-item label="制造库位" prop="zzkwCode">
<BomAccountPointSelect v-model="cxjlFrom.zzkw_code" :value-key="'bom_account_id'" @change="getChangeVule"/> <BomAccountPointSelect v-model="cxjlFrom.zzkw_code" :value-key="'bom_account_id'" @change="getChangeVule"/>
</el-form-item> </el-form-item>
<el-form-item label="品番"> <el-form-item label="品番">
<el-input v-model="cxjlFrom.item_code" /> <el-input v-model="cxjlFrom.item_code"/>
</el-form-item> </el-form-item>
<el-form-item label="品名"> <el-form-item label="品名">
<el-input v-model="cxjlFrom.item_name" /> <el-input v-model="cxjlFrom.item_name"/>
</el-form-item> </el-form-item>
<el-form-item label="数量"> <el-form-item label="数量">
<el-input v-model="cxjlFrom.order_qty" /> <el-input v-model="cxjlFrom.order_qty"/>
</el-form-item> </el-form-item>
<el-form-item label="税别"> <el-form-item label="税别">
<el-input v-model="cxjlFrom.bonded"/> <el-input v-model="cxjlFrom.bonded"/>
</el-form-item> </el-form-item>
<el-form-item label="叫料库区"> <el-form-item label="叫料库区">
<el-input v-model="cxjlFrom.gw_name" /> <el-input v-model="cxjlFrom.gw_name"/>
</el-form-item> </el-form-item>
<el-form-item label="箱单品番"> <el-form-item label="箱单品番">
<el-checkbox v-model="cxjlFrom.beXdPf"/> <el-checkbox v-model="cxjlFrom.beXdPf"/>
@ -187,24 +193,24 @@
</template> </template>
<script> <script>
import crudPickDetail,{zzjl,allocatePickDetail,cancelAllocatePickDetail} from '@/api/pickDetail' import crudPickDetail, { zzjl, allocatePickDetail, cancelAllocatePickDetail } from '@/api/pickDetail'
import CRUD, {presenter, header, form, crud} from '@crud/crud' import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation.vue' 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() {
@ -227,7 +234,7 @@ export default {
url: 'api/pickDetail/queryPickDetailZsc', url: 'api/pickDetail/queryPickDetailZsc',
idField: 'id', idField: 'id',
sort: 'id,desc', sort: 'id,desc',
crudMethod: {...crudPickDetail}, crudMethod: { ...crudPickDetail },
optShow: { optShow: {
add: false, add: false,
edit: false, edit: false,
@ -235,7 +242,7 @@ export default {
reset: false, reset: false,
download: true download: true
} }
},) })
}, },
data() { data() {
return { return {
@ -245,29 +252,41 @@ 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' }
], ],
zzkwCode: [ zzkwCode: [
{required: true, message: '制造库位必填', trigger: 'blur'} { required: true, message: '制造库位必填', trigger: 'blur' }
] ]
}, },
itemListData: [], itemListData: [],
// //
itemOptions: [], itemOptions: [],
zzkwPointOptions: [], zzkwPointOptions: [],
loading_add:false loading_add: false
} }
}, },
mounted() { mounted() {
// //
this.getItem(); this.getItem()
}, },
methods: { methods: {
// false // false
@ -276,7 +295,7 @@ export default {
}, },
getItem() { getItem() {
getItems({}).then(res => { getItems({}).then(res => {
this.items = res.content.map(function (obj) { this.items = res.content.map(function(obj) {
if (obj.hasChildren) { if (obj.hasChildren) {
obj.children = null obj.children = null
} }
@ -292,49 +311,48 @@ 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)
} }
console.log(ids) console.log(ids)
allocatePickDetail(ids).then(res => { allocatePickDetail(ids).then(res => {
this.crud.toQuery() this.crud.toQuery()
}) })
}, },
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) {
@ -381,24 +399,24 @@ export default {
this.crud.doDelete(data) this.crud.doDelete(data)
}, 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() {
@ -414,14 +432,14 @@ 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,
@ -74,10 +67,23 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
bexb:{ bexb: {
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>