|
@@ -16,6 +16,33 @@
|
|
flat
|
|
flat
|
|
bordered
|
|
bordered
|
|
>
|
|
>
|
|
|
|
+ <template v-slot:header-cell="props">
|
|
|
|
+ <q-th :props="props" @dblclick="handleHeaderDblClick(props.col)">
|
|
|
|
+ <!-- 为特定列添加下拉选择器 -->
|
|
|
|
+ <template v-if="['bound_department'].includes(props.col.name)">
|
|
|
|
+ <q-select
|
|
|
|
+ dense
|
|
|
|
+ outlined
|
|
|
|
+ v-model="filterModels[props.col.name]"
|
|
|
|
+ :options="getFilterOptions(props.col.name)"
|
|
|
|
+ option-label="label"
|
|
|
|
+ option-value="value"
|
|
|
|
+ emit-value
|
|
|
|
+ map-options
|
|
|
|
+ clearable
|
|
|
|
+ @input="handleFilterChange"
|
|
|
|
+ style="min-width: 120px"
|
|
|
|
+ >
|
|
|
|
+ <template v-slot:prepend>
|
|
|
|
+ <span class="text-caption">{{ props.col.label }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </q-select>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ {{ props.col.label }}
|
|
|
|
+ </template>
|
|
|
|
+ </q-th>
|
|
|
|
+ </template>
|
|
<template v-slot:top>
|
|
<template v-slot:top>
|
|
<q-btn-group push>
|
|
<q-btn-group push>
|
|
<q-btn
|
|
<q-btn
|
|
@@ -124,7 +151,7 @@
|
|
}}</q-td>
|
|
}}</q-td>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <template v-if="props.row.id === editid">
|
|
|
|
|
|
+ <!-- <template v-if="props.row.id === editid">
|
|
<q-td key="bound_code_type" :props="props">
|
|
<q-td key="bound_code_type" :props="props">
|
|
<q-select
|
|
<q-select
|
|
dense
|
|
dense
|
|
@@ -179,7 +206,7 @@
|
|
props.row.bound_bs_type
|
|
props.row.bound_bs_type
|
|
}}</q-td
|
|
}}</q-td
|
|
>
|
|
>
|
|
- </template>
|
|
|
|
|
|
+ </template> -->
|
|
|
|
|
|
<template v-if="props.row.id === editid">
|
|
<template v-if="props.row.id === editid">
|
|
<q-td key="bound_desc" :props="props">
|
|
<q-td key="bound_desc" :props="props">
|
|
@@ -286,7 +313,7 @@
|
|
>一键分拣</q-tooltip
|
|
>一键分拣</q-tooltip
|
|
>
|
|
>
|
|
</q-btn>
|
|
</q-btn>
|
|
- <q-btn
|
|
|
|
|
|
+ <q-btn
|
|
round
|
|
round
|
|
flat
|
|
flat
|
|
push
|
|
push
|
|
@@ -792,7 +819,7 @@
|
|
class="my-sticky-table scrollable-table"
|
|
class="my-sticky-table scrollable-table"
|
|
:style="{ 'max-height': '400px' }"
|
|
:style="{ 'max-height': '400px' }"
|
|
:container-style="{ height: 'auto' }"
|
|
:container-style="{ height: 'auto' }"
|
|
- :pagination="{ rowsPerPage: 0 }"
|
|
|
|
|
|
+ :pagination="{ rowsPerPage: 0 }"
|
|
>
|
|
>
|
|
<template v-slot:body-cell-actions="props">
|
|
<template v-slot:body-cell-actions="props">
|
|
<q-td :props="props">
|
|
<q-td :props="props">
|
|
@@ -890,7 +917,18 @@ export default {
|
|
batch_number_year: '',
|
|
batch_number_year: '',
|
|
batch_number_month: '',
|
|
batch_number_month: '',
|
|
batch_number_batch: '',
|
|
batch_number_batch: '',
|
|
-
|
|
|
|
|
|
+ // {
|
|
|
|
+ // name: 'bound_code_type',
|
|
|
|
+ // label: '单据类型',
|
|
|
|
+ // field: 'bound_code_type',
|
|
|
|
+ // align: 'center'
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // name: 'bound_bs_type',
|
|
|
|
+ // label: '业务类型',
|
|
|
|
+ // field: 'bound_bs_type',
|
|
|
|
+ // align: 'center'
|
|
|
|
+ // },
|
|
columns: [
|
|
columns: [
|
|
{ name: 'detail', label: '详情', field: 'detail', align: 'center' },
|
|
{ name: 'detail', label: '详情', field: 'detail', align: 'center' },
|
|
{
|
|
{
|
|
@@ -905,18 +943,7 @@ export default {
|
|
field: 'bound_code',
|
|
field: 'bound_code',
|
|
align: 'center'
|
|
align: 'center'
|
|
},
|
|
},
|
|
- {
|
|
|
|
- name: 'bound_code_type',
|
|
|
|
- label: '单据类型',
|
|
|
|
- field: 'bound_code_type',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: 'bound_bs_type',
|
|
|
|
- label: '业务类型',
|
|
|
|
- field: 'bound_bs_type',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
{
|
|
{
|
|
name: 'bound_desc',
|
|
name: 'bound_desc',
|
|
label: '出入库类别',
|
|
label: '出入库类别',
|
|
@@ -1024,7 +1051,13 @@ export default {
|
|
},
|
|
},
|
|
currentBarcode: null,
|
|
currentBarcode: null,
|
|
|
|
|
|
- currentgoods: {}
|
|
|
|
|
|
+ currentgoods: {},
|
|
|
|
+ filterModels: {
|
|
|
|
+ bound_department: null
|
|
|
|
+ },
|
|
|
|
+ filterdata: {},
|
|
|
|
+ activeSearchField: '',
|
|
|
|
+ activeSearchLabel: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -1037,6 +1070,110 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 处理过滤变化
|
|
|
|
+ handleFilterChange () {
|
|
|
|
+ this.pagination.page = 1
|
|
|
|
+ this.getSearchList(1)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getFilterOptions (columnName) {
|
|
|
|
+ switch (columnName) {
|
|
|
|
+ case 'type':
|
|
|
|
+ return [
|
|
|
|
+ { label: '生产入库', value: 1 },
|
|
|
|
+ { label: '采购入库', value: 2 },
|
|
|
|
+ { label: '其他入库', value: 3 },
|
|
|
|
+ { label: '调拨入库', value: 4 }
|
|
|
|
+ ]
|
|
|
|
+ case 'bound_status':
|
|
|
|
+ return [
|
|
|
|
+ { label: '待审核', value: 0 },
|
|
|
|
+ { label: '确认无误', value: 1 }
|
|
|
|
+ ]
|
|
|
|
+ case 'bound_department':
|
|
|
|
+ return this.bound_department_list
|
|
|
|
+ default:
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleHeaderDblClick (column) {
|
|
|
|
+ // 排除不需要搜索的列
|
|
|
|
+ if (['detail', 'action'].includes(column.name)) return
|
|
|
|
+
|
|
|
|
+ this.activeSearchField = column.field
|
|
|
|
+ this.activeSearchLabel = column.label
|
|
|
|
+
|
|
|
|
+ // 弹出搜索对话框
|
|
|
|
+ this.$q
|
|
|
|
+ .dialog({
|
|
|
|
+ title: `搜索${column.label}`,
|
|
|
|
+ message: `请输入${column.label}的搜索条件`,
|
|
|
|
+ prompt: {
|
|
|
|
+ model: '',
|
|
|
|
+ type: 'text'
|
|
|
|
+ },
|
|
|
|
+ cancel: true,
|
|
|
|
+ persistent: true
|
|
|
|
+ })
|
|
|
|
+ .onOk((data) => {
|
|
|
|
+ // 执行搜索
|
|
|
|
+ this.executeColumnSearch(column.field, data)
|
|
|
|
+ })
|
|
|
|
+ .onCancel(() => {
|
|
|
|
+ this.activeSearchField = ''
|
|
|
|
+ this.activeSearchLabel = ''
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 执行列搜索
|
|
|
|
+ executeColumnSearch (field, value) {
|
|
|
|
+ // 构建搜索参数
|
|
|
|
+ if (
|
|
|
|
+ field === 'type' ||
|
|
|
|
+ field === 'audit_status' ||
|
|
|
|
+ field === 'save_status' ||
|
|
|
|
+ field === 'bound_status'
|
|
|
|
+ ) {
|
|
|
|
+ const searchParams = {
|
|
|
|
+ [field]: value
|
|
|
|
+ }
|
|
|
|
+ // 清除其他搜索条件
|
|
|
|
+ this.filter = ''
|
|
|
|
+ this.date_range = ''
|
|
|
|
+
|
|
|
|
+ // 执行搜索
|
|
|
|
+ this.getList({
|
|
|
|
+ ...searchParams,
|
|
|
|
+ page: 1
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // 重置激活的搜索字段
|
|
|
|
+ this.activeSearchField = ''
|
|
|
|
+ this.activeSearchLabel = ''
|
|
|
|
+ } else {
|
|
|
|
+ const searchParams = {
|
|
|
|
+ [field + '__icontains']: value
|
|
|
|
+ }
|
|
|
|
+ // 清除其他搜索条件
|
|
|
|
+ this.filter = ''
|
|
|
|
+ this.date_range = ''
|
|
|
|
+
|
|
|
|
+ // 执行搜索
|
|
|
|
+ this.getList({
|
|
|
|
+ ...searchParams,
|
|
|
|
+ page: 1
|
|
|
|
+ })
|
|
|
|
+ this.filterdata = searchParams
|
|
|
|
+ this.$q.notify({
|
|
|
|
+ message: `已搜索 ${this.activeSearchLabel} 含有 "${value}" 的结果`,
|
|
|
|
+ icon: 'search',
|
|
|
|
+ color: 'positive'
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // // 重置激活的搜索字段
|
|
|
|
+ this.activeSearchField = ''
|
|
|
|
+ this.activeSearchLabel = ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
assignGoodsCode () {
|
|
assignGoodsCode () {
|
|
console.log('data', this.newBatchFormData.goods_code)
|
|
console.log('data', this.newBatchFormData.goods_code)
|
|
console.log(
|
|
console.log(
|
|
@@ -1181,12 +1318,23 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
// 带搜索条件加载
|
|
// 带搜索条件加载
|
|
|
|
+ // 修改搜索方法以包含过滤条件
|
|
getSearchList (page = 1) {
|
|
getSearchList (page = 1) {
|
|
this.current = page
|
|
this.current = page
|
|
this.paginationIpt = page
|
|
this.paginationIpt = page
|
|
|
|
+
|
|
|
|
+ // 构建过滤参数
|
|
|
|
+ const filterParams = {}
|
|
|
|
+ for (const [key, value] of Object.entries(this.filterModels)) {
|
|
|
|
+ if (value !== null && value !== '') {
|
|
|
|
+ filterParams[key] = value
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.getList({
|
|
this.getList({
|
|
- goods_desc__icontains: this.filter,
|
|
|
|
- document_date__range: this.date_range
|
|
|
|
|
|
+ number__icontains: this.filter,
|
|
|
|
+ document_date__range: this.date_range,
|
|
|
|
+ ...filterParams ,// 添加过滤条件
|
|
|
|
+ ...this.filterdata, // 添加其他过滤条件
|
|
})
|
|
})
|
|
},
|
|
},
|
|
downloadlistData () {
|
|
downloadlistData () {
|
|
@@ -1279,6 +1427,10 @@ export default {
|
|
},
|
|
},
|
|
reFresh () {
|
|
reFresh () {
|
|
var _this = this
|
|
var _this = this
|
|
|
|
+ this.filterdata = {}
|
|
|
|
+ this.filterModels = {
|
|
|
|
+ bound_department: null
|
|
|
|
+ }
|
|
_this.getSearchList()
|
|
_this.getSearchList()
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1686,7 +1838,9 @@ export default {
|
|
batch_number_batch: function (val) {
|
|
batch_number_batch: function (val) {
|
|
console.log(val)
|
|
console.log(val)
|
|
this.newBatchFormData.bound_batch_order =
|
|
this.newBatchFormData.bound_batch_order =
|
|
- this.batch_number_year * 100000 + this.batch_number_month * 1000 + Number(val)
|
|
|
|
|
|
+ this.batch_number_year * 100000 +
|
|
|
|
+ this.batch_number_month * 1000 +
|
|
|
|
+ Number(val)
|
|
},
|
|
},
|
|
createDate1 (val) {
|
|
createDate1 (val) {
|
|
if (val) {
|
|
if (val) {
|