302 lines
8.6 KiB
Vue
302 lines
8.6 KiB
Vue
<template>
|
|
<div class="p-2">
|
|
<!--查询区域-->
|
|
<div class="jeecg-basic-table-form-container">
|
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
<a-row :gutter="24">
|
|
<a-col :lg="6">
|
|
<a-form-item name="materialName">
|
|
<template #label><span title="货品名称">货品名称</span></template>
|
|
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear ></j-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :lg="6">
|
|
<a-form-item name="materialNo">
|
|
<template #label><span title="货品编码">货品编码</span></template>
|
|
<j-input placeholder="请输入货品编码" v-model:value="queryParam.materialNo" allow-clear ></j-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :lg="6">
|
|
<a-form-item name="pinyin">
|
|
<template #label><span title="拼音检索">拼音检索</span></template>
|
|
<j-input placeholder="请输入拼音" v-model:value="queryParam.pinyin" allow-clear ></j-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :lg="6">
|
|
<a-form-item name="izEnabled">
|
|
<template #label><span title="是否启用">是否启用</span></template>
|
|
<j-dict-select-tag type='list' placeholder="请选择是否启用" v-model:value="queryParam.izEnabled" dictCode="iz_enabled" allow-clear />
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
|
<a-col :lg="6">
|
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
|
</a-col>
|
|
</span>
|
|
</a-col>
|
|
</a-row>
|
|
</a-form>
|
|
</div>
|
|
<!--引用表格-->
|
|
<BasicTable @register="registerTable" >
|
|
<!--插槽:table标题-->
|
|
<template #tableTitle>
|
|
<div style="padding:10px 0 0 0;">
|
|
<a-badge :count="count" style="z-index: 9;" offset="-1">
|
|
<a-button type="primary" @click="handleQgc"> 请购车</a-button>
|
|
</a-badge>
|
|
</div>
|
|
</template>
|
|
<!--操作栏-->
|
|
<template #action="{ record }">
|
|
<TableAction :actions="getTableAction(record)" />
|
|
</template>
|
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
|
</template>
|
|
</BasicTable>
|
|
|
|
|
|
<!-- 表单区域 -->
|
|
<QgdInfoModal ref="registerModal" @success="handleSuccess"></QgdInfoModal>
|
|
|
|
<a-drawer title="请购车" width="60vw" :open="qgcOpen" @close="onQgcClose">
|
|
<template #footer>
|
|
<a-button type="primary" @click="onQgcClose" style="float: right;">关闭</a-button>
|
|
<a-button type="primary" @click="onQgcCaigou" style="float: right;margin-right:10px;">提交采购</a-button>
|
|
</template>
|
|
<QgcList v-if="qgcOpen"></QgcList>
|
|
</a-drawer>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" name="configMaterialInfo-configMaterialInfo" setup>
|
|
import { ref, reactive,onMounted } from 'vue';
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
|
import { columns, superQuerySchema } from './JxcInfo.data';
|
|
import { list, deleteOne, batchDelete, queryListByUser} from './JxcInfo.api';
|
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
|
import QgdInfoModal from '/@/views/invoicing/jxc/components/QgdInfoModal.vue'
|
|
import QgcList from '/@/views/invoicing/jxc/components/QgcList.vue'
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
|
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
|
|
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
|
import { JInput } from '/@/components/Form';
|
|
import type { TreeProps } from 'ant-design-vue';
|
|
import { DownOutlined } from '@ant-design/icons-vue';
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
import type { CollapseProps } from 'ant-design-vue';
|
|
|
|
|
|
const formRef = ref();
|
|
const queryParam = reactive<any>({});
|
|
const toggleSearchStatus = ref<boolean>(false);
|
|
const registerModal = ref();
|
|
const qgcOpen = ref(false)//请购车抽屉
|
|
const userStore = useUserStore();
|
|
const count = ref<number>(5);
|
|
//注册table数据
|
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|
tableProps: {
|
|
title: '物料信息',
|
|
api: list,
|
|
columns,
|
|
canResize:false,
|
|
useSearchForm: false,
|
|
showIndexColumn: true,
|
|
actionColumn: {
|
|
width: 100,
|
|
fixed: 'right',
|
|
},
|
|
beforeFetch: async (params) => {
|
|
return Object.assign(params, queryParam);
|
|
},
|
|
},
|
|
});
|
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
const labelCol = reactive({
|
|
xs:24,
|
|
sm:6,
|
|
xl:6,
|
|
xxl:6
|
|
});
|
|
const wrapperCol = reactive({
|
|
xs: 24,
|
|
sm: 20,
|
|
});
|
|
|
|
|
|
/**
|
|
* 新增事件
|
|
*/
|
|
function handleQgc() {
|
|
qgcOpen.value = true
|
|
handleSuccess()
|
|
}
|
|
|
|
//服务类别抽屉关闭
|
|
function onQgcClose() {
|
|
qgcOpen.value = false
|
|
}
|
|
|
|
/**
|
|
* 请购事件
|
|
*/
|
|
function handleAddQg(record: Recordable) {
|
|
registerModal.value.disableSubmit = false;
|
|
registerModal.value.edit(record);
|
|
}
|
|
|
|
function onQgcCaigou() {
|
|
qgcOpen.value = false
|
|
}
|
|
|
|
/**
|
|
* 成功回调
|
|
*/
|
|
function handleSuccess() {
|
|
(selectedRowKeys.value = []) && reload();
|
|
getQgcSize();
|
|
}
|
|
|
|
/**
|
|
* 操作栏
|
|
*/
|
|
function getTableAction(record) {
|
|
return [
|
|
{
|
|
label: '请购',
|
|
onClick: handleAddQg.bind(null, record),
|
|
},
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* 查询
|
|
*/
|
|
function searchQuery() {
|
|
reload();
|
|
}
|
|
|
|
/**
|
|
* 重置
|
|
*/
|
|
function searchReset() {
|
|
formRef.value.resetFields();
|
|
selectedRowKeys.value = [];
|
|
queryParam.treeId = null;
|
|
//刷新数据
|
|
reload();
|
|
}
|
|
|
|
//获取请购车有多少条数据
|
|
function getQgcSize(){
|
|
var params = {}
|
|
count.value = 0;
|
|
queryListByUser(params).then((res) => {
|
|
console.log('getQgcSize--->',res);
|
|
count.value = res.total;
|
|
}) ;
|
|
}
|
|
|
|
// 自动请求并暴露内部方法
|
|
onMounted(() => {
|
|
getQgcSize();
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.jeecg-basic-table-form-container {
|
|
padding: 0;
|
|
.table-page-search-submitButtons {
|
|
display: block;
|
|
margin-bottom: 24px;
|
|
white-space: nowrap;
|
|
}
|
|
.query-group-cust{
|
|
min-width: 100px !important;
|
|
}
|
|
.query-group-split-cust{
|
|
width: 30px;
|
|
display: inline-block;
|
|
text-align: center
|
|
}
|
|
.ant-form-item:not(.ant-form-item-with-help){
|
|
margin-bottom: 16px;
|
|
height: 32px;
|
|
}
|
|
:deep(.ant-picker),:deep(.ant-input-number){
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
.all-card {
|
|
width: 80px;
|
|
height: 730px;
|
|
// background-color: rgb(217, 230, 239);
|
|
// display: flex;
|
|
/* justify-content: flex-end; */
|
|
align-items: flex-end;
|
|
flex-direction: column;
|
|
// padding-top: 10px;
|
|
}
|
|
|
|
.card {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
width: 80px;
|
|
height: 120px;
|
|
flex-direction: column;
|
|
background-color: rgb(243, 248, 251);
|
|
/* border-radius: 25px; */
|
|
}
|
|
|
|
.card-target {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
width: 80px;
|
|
height: 120px;
|
|
flex-direction: column;
|
|
background-color: #fff;
|
|
border-top-left-radius: 30px;
|
|
border-bottom-left-radius: 30px;
|
|
/* position: relative; */
|
|
/* border-radius: 10px; */
|
|
}
|
|
|
|
.sanjiao-down {
|
|
position: absolute;
|
|
bottom: -26px;
|
|
left: 17px;
|
|
width: 64px;
|
|
/* 上边长度 */
|
|
height: 27px;
|
|
/* 右边长度 */
|
|
background-color: #fff;
|
|
/* 三角形填充色 */
|
|
/* 三点依次为:右上 (100% 0),右下 (100% 100%),左上 (0 0) */
|
|
clip-path: polygon(100% 0, 100% 100%, 0 0);
|
|
z-index: 999;
|
|
}
|
|
|
|
.sanjiao-up {
|
|
position: absolute;
|
|
top: -26px;
|
|
left: 17px;
|
|
width: 64px;
|
|
height: 27px;
|
|
background-color: #fff;
|
|
/* 三点依次为:右下 (100% 100%),左下 (0 100%),右上 (100% 0) */
|
|
clip-path: polygon(100% 100%, 0 100%, 100% 0);
|
|
z-index: 999;
|
|
}
|
|
</style>
|