#
Junjie
2024-09-25 f7a5fb8c05a7ed70ee96043481fc074cdd9b0e51
#
1个文件已修改
15 ■■■■■ 已修改文件
zy-asrs-admin/src/components/orderDetl/edit.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/components/orderDetl/edit.vue
@@ -6,6 +6,7 @@
import { logout } from '@/config.js';
import { formatMessage } from '@/utils/localeUtils.js';
import useTableSearch from '@/utils/tableUtils.jsx';
import { debounce } from 'lodash-es';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
@@ -127,6 +128,7 @@
const openAddDetl = ref(false);
const matChecked = ref([]);
const matQueryList = ref(null);
const matFetching = ref(false);
const matSelectList = ref([]);
const addDetl = () => {
    openAddDetl.value = true;
@@ -163,9 +165,9 @@
    matChecked.value = [];
}
const handleSearch = val => {
const handleSearch = debounce(val => {
    matQuery(val);
}
}, 600)
const handleSelect = (value, option) => {
    let flag = true;
@@ -193,9 +195,10 @@
matQuery(null);
function matQuery(condition) {
    matFetching.value = true;
    post('/api/mat/page', {
        current: 1,
        pageSize: 100,
        pageSize: 10,
        condition: condition
    }).then((resp) => {
        let result = resp.data;
@@ -203,11 +206,12 @@
        result.data.records.forEach((item) => {
            tmp.push({
                value: item.matnr,
                label: item.matnr,
                label: item.matnr + '_' + item.maktx,
                data: item
            })
        })
        matQueryList.value = tmp;
        matFetching.value = false;
    })
}
@@ -305,7 +309,8 @@
            @ok="handleAddDetlOk" @cancel="handleAddDetlCancel">
            <a-select v-model:value="matChecked" :options="matQueryList" mode="multiple"
                :placeholder="formatMessage('component.orderDetl.edit.selectMat', '请选择物料')" @search="handleSearch"
                @select="handleSelect" @deselect="handleDeselect"></a-select>
                :filter-option="false" :not-found-content="matFetching ? undefined : null" @select="handleSelect"
                @deselect="handleDeselect"></a-select>
        </a-modal>
    </div>
</template>