Compare commits
2 Commits
910536645c
...
adb5adf201
| Author | SHA1 | Date |
|---|---|---|
|
|
adb5adf201 | |
|
|
16db7130c1 |
|
|
@ -63,6 +63,18 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'medicationId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '物料上限',
|
||||
align: "center",
|
||||
dataIndex: 'upperLimit',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '物料下限',
|
||||
align: "center",
|
||||
dataIndex: 'lowerLimit',
|
||||
width:'100px'
|
||||
},
|
||||
// {
|
||||
// title: '物料图片',
|
||||
// align: "center",
|
||||
|
|
|
|||
|
|
@ -62,13 +62,13 @@
|
|||
<a-menu style="width: 100%;" mode="inline" >
|
||||
<template v-for="item in treeData">
|
||||
<!-- 第一层判断是否有下级 -->
|
||||
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.key" @titleClick="handleSearch(item)">
|
||||
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.key" @titleClick="handleSearch(item)" @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">
|
||||
<template #icon>
|
||||
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
|
||||
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
||||
</template>
|
||||
<template #title>
|
||||
<span @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">{{ item?.title }}
|
||||
<span >{{ item?.title }}
|
||||
<span v-if="item?.izEnabled == '1'" style="color:red;">(已停用)</span>
|
||||
<span v-show="item.showContent">
|
||||
<!-- 下拉菜单 -->
|
||||
|
|
@ -86,13 +86,13 @@
|
|||
</template>
|
||||
<!-- 第二级 -->
|
||||
<template v-for="child in item.children">
|
||||
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0" @titleClick="handleSearch(child)">
|
||||
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0" @titleClick="handleSearch(child)" @mouseenter="child.showContent = true" @mouseleave="child.showContent = false" >
|
||||
<template #icon >
|
||||
<Icon :icon="child.icon" :size="20" v-if="child.icon" />
|
||||
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
||||
</template>
|
||||
<template #title >
|
||||
<span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false" >{{ child?.title }}
|
||||
<span >{{ child?.title }}
|
||||
<span v-if="child?.izEnabled == '1'" style="color:red;">(已停用)</span>
|
||||
<span v-show="child.showContent">
|
||||
<!-- 下拉菜单 -->
|
||||
|
|
@ -109,12 +109,12 @@
|
|||
</span>
|
||||
</template>
|
||||
<!-- 第三层 -->
|
||||
<a-menu-item :key="childThree.key" v-for="childThree in child.children" @click="handleSearch(childThree)">
|
||||
<a-menu-item :key="childThree.key" v-for="childThree in child.children" @click="handleSearch(childThree)" @mouseenter="childThree.showContent = true" @mouseleave="childThree.showContent = false">
|
||||
<template #icon>
|
||||
<Icon :icon="childThree.icon" :size="20" v-if="childThree.icon" />
|
||||
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
||||
</template>
|
||||
<span @mouseenter="childThree.showContent = true" @mouseleave="childThree.showContent = false">{{ childThree?.title }}
|
||||
<span >{{ childThree?.title }}
|
||||
<span v-if="childThree?.izEnabled == '1'" style="color:red;">(已停用)</span>
|
||||
<span v-show="childThree.showContent">
|
||||
<a-dropdown >
|
||||
|
|
@ -129,12 +129,12 @@
|
|||
</span>
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-menu-item :key="child.key" v-if="!child.children || child.children.length < 1" @click="handleSearch(child)">
|
||||
<a-menu-item :key="child.key" v-if="!child.children || child.children.length < 1" @click="handleSearch(child)" @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">
|
||||
<template #icon>
|
||||
<Icon :icon="child.icon" :size="20" v-if="child.icon" />
|
||||
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
||||
</template>
|
||||
<span @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">{{ child?.title }}
|
||||
<span>{{ child?.title }}
|
||||
<span v-if="child?.izEnabled == '1'" style="color:red;">(已停用)</span>
|
||||
<span v-show="child.showContent">
|
||||
<!-- 下拉菜单 -->
|
||||
|
|
@ -152,12 +152,12 @@
|
|||
</a-menu-item>
|
||||
</template>
|
||||
</a-sub-menu>
|
||||
<a-menu-item :key="item.key" v-if="!item.children || item.children.length < 1" @click="handleSearch(item)">
|
||||
<a-menu-item :key="item.key" v-if="!item.children || item.children.length < 1" @click="handleSearch(item)" @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">
|
||||
<template #icon>
|
||||
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
|
||||
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
||||
</template>
|
||||
<span @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">{{ item?.title }}
|
||||
<span>{{ item?.title }}
|
||||
<span v-if="item?.izEnabled == '1'" style="color:red;">(已停用)</span>
|
||||
<span v-show="item.showContent">
|
||||
<!-- 下拉菜单 -->
|
||||
|
|
|
|||
|
|
@ -99,12 +99,12 @@
|
|||
<a-input v-model:value="formData.referenceUnitPrice" placeholder="请输入参考单价" maxlength="10" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8" hidden>
|
||||
<a-col :span="8" >
|
||||
<a-form-item label="物料上限" v-bind="validateInfos.upperLimit" id="ConfigMaterialInfoForm-upperLimit" name="upperLimit">
|
||||
<a-input v-model:value="formData.upperLimit" maxlength="10" placeholder="请输入物料上限" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8" hidden>
|
||||
<a-col :span="8" >
|
||||
<a-form-item label="物料下限" v-bind="validateInfos.lowerLimit" id="ConfigMaterialInfoForm-lowerLimit" name="lowerLimit">
|
||||
<a-input v-model:value="formData.lowerLimit" maxlength="10" placeholder="请输入物料下限" style="width: 100%" />
|
||||
</a-form-item>
|
||||
|
|
@ -193,8 +193,8 @@
|
|||
referenceUnitPrice: [{ required: true, message: '请输入参考单价!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||
materialUnits: [{ required: true, message: '请输入物料单位!'}],
|
||||
suppliers: [{ required: true, message: '请选择供应商!'},],
|
||||
upperLimit: [{ required: false, message: '请输入物料上限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||
lowerLimit: [{ required: false, message: '请输入物料下限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||
upperLimit: [{ required: true, message: '请输入物料上限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||
lowerLimit: [{ required: true, message: '请输入物料下限!'},{ pattern: /^\d+(\.\d+)?$/, message: '只能输入数字(可包含小数点)!' }],
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ const { createConfirm } = useMessage();
|
|||
|
||||
enum Api {
|
||||
list = '/invoicing/blWarehouseMaterialInfo/list',
|
||||
cklist = '/nuBaseInfo/nuBaseInfo/list',
|
||||
save='/invoicing/blWarehouseMaterialInfo/add',
|
||||
edit='/invoicing/blWarehouseMaterialInfo/edit',
|
||||
editFzr='/nuBaseInfo/nuBaseInfo/edit',
|
||||
deleteOne = '/invoicing/blWarehouseMaterialInfo/delete',
|
||||
deleteBatch = '/invoicing/blWarehouseMaterialInfo/deleteBatch',
|
||||
importExcel = '/invoicing/blWarehouseMaterialInfo/importExcel',
|
||||
|
|
@ -30,6 +32,12 @@ export const getImportUrl = Api.importExcel;
|
|||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 仓库列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const cklist = (params) => defHttp.get({ url: Api.cklist, params });
|
||||
/**
|
||||
* 获取配置列表接口
|
||||
* @param params
|
||||
|
|
@ -76,3 +84,13 @@ export const saveOrUpdate = (params, isUpdate) => {
|
|||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const editFzr = (params, isUpdate) => {
|
||||
return defHttp.post({ url: Api.editFzr, params }, { isTransformResponse: false });
|
||||
}
|
||||
|
|
@ -131,6 +131,54 @@ export const columns3: BasicColumn[] = [
|
|||
align: "center",
|
||||
dataIndex: 'medicationId_dictText'
|
||||
},
|
||||
{
|
||||
title: '物料上限',
|
||||
align: "center",
|
||||
dataIndex: 'upperLimit'
|
||||
},
|
||||
{
|
||||
title: '物料下限',
|
||||
align: "center",
|
||||
dataIndex: 'lowerLimit'
|
||||
},
|
||||
];
|
||||
|
||||
//列表数据
|
||||
export const ckcolumns: BasicColumn[] = [
|
||||
{
|
||||
title: 'NUID',
|
||||
align: "center",
|
||||
dataIndex: 'nuId'
|
||||
},
|
||||
{
|
||||
title: '库房',
|
||||
align: "center",
|
||||
dataIndex: 'nuName'
|
||||
},
|
||||
{
|
||||
title: '负责人',
|
||||
align: "center",
|
||||
dataIndex: 'fzr'
|
||||
},
|
||||
{
|
||||
title: '负责人电话',
|
||||
align: "center",
|
||||
dataIndex: 'fzrTel'
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
align: "center",
|
||||
dataIndex: 'status',
|
||||
customRender: ({ text }) => {
|
||||
if (text == 5) {
|
||||
return '停用';
|
||||
} else {
|
||||
return '启用';
|
||||
}
|
||||
},
|
||||
width: 100,
|
||||
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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-col :lg="6" hidden>
|
||||
<a-form-item name="nuId">
|
||||
<template #label><span title="库房">库房</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择库房" v-model:value="queryParam.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3'" allow-clear />
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<BasicTable @register="registerTable" >
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'warehouseMaterialInfo:bl_warehouse_material_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'warehouseMaterialInfo:bl_warehouse_material_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 选择物料</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
|
|
@ -42,7 +42,8 @@
|
|||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<BlWarehouseMaterialInfoModal ref="registerModal" @success="handleSuccess"></BlWarehouseMaterialInfoModal>
|
||||
<BlWarehouseMaterialInfoAddModal ref="registerAddModal" @success="handleSuccess"></BlWarehouseMaterialInfoAddModal>
|
||||
<!-- 选择物料 -->
|
||||
<CheckWuliaoModal ref="registerAddModal" @success="handleSuccess"></CheckWuliaoModal>
|
||||
<!-- 出入库详情 -->
|
||||
<NuWarehouseMaterialCrkInfoListModal ref="registerCrkModal" @success="handleSuccess"></NuWarehouseMaterialCrkInfoListModal>
|
||||
</div>
|
||||
|
|
@ -56,7 +57,7 @@
|
|||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlWarehouseMaterialInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import BlWarehouseMaterialInfoModal from './components/BlWarehouseMaterialInfoModal.vue'
|
||||
import BlWarehouseMaterialInfoAddModal from './components/BlWarehouseMaterialInfoAddModal.vue'
|
||||
import CheckWuliaoModal from './components/CheckWuliaoModal.vue'
|
||||
import NuWarehouseMaterialCrkInfoListModal from '/@/views/invoicing/warehouseMaterialInfo/NuWarehouseMaterialCrkInfoListModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
|
|
@ -79,6 +80,7 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
immediate: false,
|
||||
actionColumn: {
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
|
|
@ -102,11 +104,11 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
xxl:6
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
sm: 18,
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
|
|
@ -126,8 +128,9 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
var params = {nuId:queryParam.nuId}
|
||||
registerAddModal.value.disableSubmit = false;
|
||||
registerAddModal.value.add();
|
||||
registerAddModal.value.edit(params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -177,15 +180,15 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit'
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
// {
|
||||
// label: '编辑',
|
||||
// onClick: handleEdit.bind(null, record),
|
||||
// auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit'
|
||||
// },
|
||||
// {
|
||||
// label: '详情',
|
||||
// onClick: handleDetail.bind(null, record),
|
||||
// },
|
||||
{
|
||||
label: '启用',
|
||||
onClick: handleQyty.bind(null, record,'0'),
|
||||
|
|
@ -229,7 +232,14 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
}
|
||||
|
||||
|
||||
function init(record){
|
||||
queryParam.nuId = record.nuId;
|
||||
reload();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
<template>
|
||||
|
||||
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<BlWarehouseMaterialInfoList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BlWarehouseMaterialInfoList>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import BlWarehouseMaterialInfoList from './BlWarehouseMaterialInfoList.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<string>('80%');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function init(record) {
|
||||
title.value = '物料';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.init(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
<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="nuId">
|
||||
<template #label><span title="库房">库房</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择库房" v-model:value="queryParam.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3'" 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>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<CkfzrModal ref="registerModal" @success="handleSuccess" />
|
||||
<!-- 出入库详情 -->
|
||||
<BlWarehouseMaterialInfoListModal ref="registerCrkModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="warehouseMaterialInfo-blWarehouseMaterialInfo" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { ckcolumns, superQuerySchema } from './BlWarehouseMaterialInfo.data';
|
||||
import { cklist, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlWarehouseMaterialInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import CkfzrModal from './components/CkfzrModal.vue'
|
||||
import BlWarehouseMaterialInfoListModal from '/@/views/invoicing/warehouseMaterialInfo/BlWarehouseMaterialInfoListModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({areaFlag:'3'});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const registerCrkModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '库房信息',
|
||||
api: cklist,
|
||||
columns:ckcolumns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
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:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
//物料列表
|
||||
function handleWuliao(record: Recordable) {
|
||||
registerCrkModal.value.disableSubmit = true;
|
||||
registerCrkModal.value.init(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit'
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '启用',
|
||||
onClick: handleQyty.bind(null, record,'2'),
|
||||
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
|
||||
ifShow: record.status == '5'
|
||||
},
|
||||
{
|
||||
label: '停用',
|
||||
onClick: handleQyty.bind(null, record,'5'),
|
||||
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
|
||||
ifShow: record.status != '5'
|
||||
},
|
||||
{
|
||||
label: '物料',
|
||||
onClick: handleWuliao.bind(null, record,'1'),
|
||||
},
|
||||
];
|
||||
}
|
||||
function handleQyty(record,izEnabled) {
|
||||
defHttp.put({ url: '/nuBaseInfo/nuBaseInfo/edit', params: { id: record.id,status:izEnabled} }).then(res => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</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%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlWarehouseMaterialInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-col :span="8" hidden>
|
||||
<a-form-item label="库房" v-bind="validateInfos.nuId" id="BlWarehouseMaterialInfoForm-nuId" name="nuId" >
|
||||
<j-dict-select-tag v-model:value="formData.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3' and status != '5'" placeholder="请选择库房" :disabled="formData.id != ''" />
|
||||
</a-form-item>
|
||||
|
|
@ -23,12 +23,12 @@
|
|||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ column, text ,record }">
|
||||
<template v-if="column.dataIndex === 'upperLimit'">
|
||||
<!-- <template v-if="column.dataIndex === 'upperLimit'">
|
||||
<a-input-number :value="text" placeholder="物料上限" min="0" max="999" @change="(value) => handleInputChange(record, 'upperLimit', value)" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'lowerLimit'">
|
||||
<a-input-number :value="text" placeholder="物料上限" min="0" max="999" @change="(value) => handleInputChange(record, 'lowerLimit', value)" />
|
||||
</template>
|
||||
</template> -->
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a @click="deleteWlxx(record)">删除</a>
|
||||
</template>
|
||||
|
|
@ -128,8 +128,8 @@ function deleteWlxx(record){
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
function add(params) {
|
||||
edit(params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
function add(params) {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
registerForm.value.add(params);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="materialInfo-nuConfigMaterialInfo" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns3 } from '../BlWarehouseMaterialInfo.data';
|
||||
|
|
@ -45,13 +45,21 @@
|
|||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
|
|
@ -72,6 +80,14 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
nuId: '',
|
||||
wlId: '',
|
||||
upperLimit: '',
|
||||
lowerLimit: '',
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
|
|
@ -136,20 +152,63 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
console.log("🚀 ~ edit ~ record:", record)
|
||||
selectedRowKeys.value = [];
|
||||
selectedRows.value = [];
|
||||
|
||||
var checkId = "";
|
||||
for(let item of record){
|
||||
checkId += item.id + ",";
|
||||
}
|
||||
if(checkId.length > 0){
|
||||
checkId = checkId.substring(0,checkId.length - 1);
|
||||
}
|
||||
queryParam.checkId = checkId;
|
||||
nextTick(() => {
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
// var checkId = "";
|
||||
// for(let item of record){
|
||||
// checkId += item.id + ",";
|
||||
// }
|
||||
// if(checkId.length > 0){
|
||||
// checkId = checkId.substring(0,checkId.length - 1);
|
||||
// }
|
||||
// queryParam.checkId = checkId;
|
||||
reload();
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
emit('ok',selectedRows.value);
|
||||
|
||||
var list = selectedRows.value;
|
||||
if(list.length == 0){
|
||||
createMessage.warning('请选择物料!');
|
||||
return;
|
||||
}
|
||||
var list2 = [];
|
||||
var sfjx = "0";
|
||||
for(let item of list){
|
||||
if(!item.upperLimit){
|
||||
createMessage.error('有物料未填写上限,请检查后提交!');
|
||||
sfjx = "1";
|
||||
break;
|
||||
}
|
||||
if(!item.lowerLimit){
|
||||
createMessage.error('有物料未填写下限,请检查后提交!');
|
||||
sfjx = "1";
|
||||
break;
|
||||
}
|
||||
var insParams = {}
|
||||
insParams.nuId = formData.nuId;
|
||||
insParams.wlId = item.id;
|
||||
insParams.upperLimit = item.upperLimit;
|
||||
insParams.lowerLimit = item.lowerLimit;
|
||||
insParams.kcsl = '0';
|
||||
list2.push(insParams);
|
||||
}
|
||||
if(sfjx == "1"){
|
||||
return;
|
||||
}
|
||||
defHttp.post({url:'/invoicing/blWarehouseMaterialInfo/addBatch',params:list2}).then(res=>{
|
||||
console.log("🚀 ~ submitForm ~ res:", res)
|
||||
emit('ok');
|
||||
})
|
||||
// emit('ok',selectedRows.value);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,168 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlWarehouseMaterialInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="库房" v-bind="validateInfos.nuName" id="BlWarehouseMaterialInfoForm-nuName" name="nuName" >
|
||||
<a-input v-model:value="formData.nuName" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="负责人" v-bind="validateInfos.fzr" id="BlWarehouseMaterialInfoForm-nuId" name="nuId" >
|
||||
<a-input v-model:value="formData.fzr" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="负责人电话" v-bind="validateInfos.fzrTel" id="BlWarehouseMaterialInfoForm-wlId" name="wlId" >
|
||||
<a-input v-model:value="formData.fzrTel" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="负责人头像" v-bind="validateInfos.fzrHeadPath" id="BlWarehouseMaterialInfoForm-upperLimit" name="upperLimit">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.fzrHeadPath"></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { editFzr } from '../BlWarehouseMaterialInfo.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
nuId: '',
|
||||
nuName: '',
|
||||
fzr: '',
|
||||
fzrTel: '',
|
||||
fzrHeadPath:'',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
nuName: [{ required: true, message: '请输入库房名称!' },],
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await editFzr(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<CkfzrForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></CkfzrForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import CkfzrForm from './CkfzrForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
Loading…
Reference in New Issue