添加基础费用功能

This commit is contained in:
yangjun 2026-04-24 14:07:25 +08:00
parent f48589bdc9
commit 0888b7e949
6 changed files with 399 additions and 156 deletions

View File

@ -95,6 +95,8 @@
<IotDevicesTyModall ref="iotDevicesTyModal" @success="handleTingyong"></IotDevicesTyModall>
<!-- 区域规划 -->
<QyghListModal ref="qyghModal" @success="handleTingyong"></QyghListModal>
<!-- 基础费用 -->
<NuBaseInfoJcfyModal ref="jcfyModal" @success="handleSuccess"></NuBaseInfoJcfyModal>
</div>
</template>
@ -102,6 +104,7 @@
import { ref, reactive, onMounted } from 'vue';
import { saveOrUpdate, hldyQyty } from './NuBaseInfo.api';
import NuBaseInfoModal from './components/NuBaseInfoModal.vue'
import NuBaseInfoJcfyModal from './components/NuBaseInfoJcfyModal.vue'
import NuBaseInfoAddModal from './components/NuBaseInfoAddModal.vue'
// import BaseWlsbListModal from './components/BaseWlsbListModal.vue'
import BaseWlsbListModal from '/@/views/biz/nuBaseInfo/devicesBind/DevicesModal.vue'
@ -138,6 +141,7 @@ const { createMessage } = useMessage();
const registerModal = ref();
const registerAddModal = ref();
const qyghModal = ref();
const jcfyModal = ref();
const labelCol = reactive({
xs:24,
sm:6,
@ -172,7 +176,8 @@ const { createMessage } = useMessage();
}
function handleJcfy(record) {
alert("开发中");
jcfyModal.value.disableSubmit = false;
jcfyModal.value.edit(record);
}
//

View File

@ -0,0 +1,163 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuBaseInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="基础费用" v-bind="validateInfos.jcfy" id="NuBaseInfoForm-jcfy" name="jcfy">
<a-input-number v-model:value="formData.jcfy" placeholder="请输入基础费用" max="99999" allow-clear style="width:100%"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="说明" >
<p>计费周期基础服务费按自然月核算每月统一按照 30 天标准计算执行月度固定收费标准</p>
<p>计费起算自长者实际入住当日起正式开始计费</p>
<p>时长核算计费最小单位为小时入住时长不足半小时免收当期时段费用入住时长超过半小时且不足一小时统一按照 1 小时标准计费</p>
<p>基础费用仅对长者入住区域护理单元有效</p>
</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 { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuBaseInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.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: '',
jcfy: undefined,
});
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({
jcfy: [{ 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);
if(formData.jcfy == null){
formData.jcfy = 0
}
});
}
/**
* 提交数据
*/
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(',');
}
}
}
if (!model.id) {
model.status = "0";
}
await saveOrUpdate(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: 0px;
}
</style>

View File

@ -0,0 +1,84 @@
<template>
<!-- <j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"> -->
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true" bodyStyle="padding:14px;"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<NuBaseInfoJcfyForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBaseInfoJcfyForm>
<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>
<!-- </j-modal> -->
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuBaseInfoJcfyForm from './NuBaseInfoJcfyForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(600);
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>

View File

@ -16,6 +16,7 @@ enum Api {
getConfiguredList = '/invoicing/configMaterialInfo/getConfiguredList',
getCkWlList = '/api/pad/invoicing/getCkWlList',
editXsjg='/api/pad/invoicing/editXsjg',
savePddInfo='/api/pad/invoicing/savePddInfo',
}
/**
@ -99,4 +100,7 @@ export const editFzr = (params, isUpdate) => {
}
export const editXsjg = (params, isUpdate) => {
return defHttp.post({ url: Api.editXsjg, params }, { isTransformResponse: false });
}
export const savePddInfo = (params, isUpdate) => {
return defHttp.post({ url: Api.savePddInfo, params }, { isTransformResponse: false });
}

View File

@ -19,35 +19,6 @@
</a-form-item>
</a-col>
<!-- <a-col :lg="6">
<a-form-item name="categoryId">
<template #label><span title="一级分类">一级分类</span></template>
<j-dict-select-tag v-model:value="queryParam.categoryId"
:dictCode="`nu_config_material_category,category_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
placeholder="请选择一级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 1, 'key': queryParam.categoryId }, false)" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="typeId">
<template #label><span title="二级分类">二级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
:dictCode="`nu_config_material_type,type_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' `"
placeholder="请选择二级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 2, 'categoryId': queryParam.categoryId, 'key': queryParam.typeId }, false)" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="medicationId">
<template #label><span title="三级分类">三级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.medicationId"
:dictCode="`nu_config_material_medication,medication_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' and type_id = '${queryParam.typeId || ''}' `"
placeholder="请选择三级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 3, 'categoryId': queryParam.categoryId, 'typeId': queryParam.typeId, 'key': queryParam.medicationId }, false)" />
</a-form-item>
</a-col> -->
<a-col :xl="2" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
@ -65,10 +36,6 @@
<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="handleDel"
preIcon="ant-design:plus-outlined"> 移除物料</a-button> -->
</template>
<!--操作栏-->
<template #action="{ record }">
@ -77,12 +44,6 @@
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<BlWarehouseMaterialInfoModal ref="registerModal" @success="handleSuccess"></BlWarehouseMaterialInfoModal>
<!-- 添加物料 -->
<CheckWuliaoModal ref="registerAddModal" @success="handleSuccess"></CheckWuliaoModal>
<!-- 移除物料 -->
<DelWuliaoModal ref="registerDelModal" @success="handleSuccess"></DelWuliaoModal>
@ -90,6 +51,8 @@
<NuWarehouseMaterialCrkInfoListModal ref="registerCrkModal" @success="handleSuccess"></NuWarehouseMaterialCrkInfoListModal>
<!-- 销售价格 -->
<BlWarehouseXsjgModal ref="xsjgModal" @success="handleSuccess"></BlWarehouseXsjgModal>
<!-- 盘点单 -->
<BlWarehouseMaterialInfoModal ref="pddModal" @success="handleSuccess"></BlWarehouseMaterialInfoModal>
</div>
</template>
@ -97,18 +60,13 @@
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './BlWarehouseMaterialInfo.data';
import { getCkWlList, deleteOne, batchDelete } from './BlWarehouseMaterialInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import BlWarehouseMaterialInfoModal from './components/BlWarehouseMaterialInfoModal.vue'
import CheckWuliaoModal from './components/CheckWuliaoModal.vue'
import DelWuliaoModal from './components/DelWuliaoModal.vue'
import { columns } from './BlWarehouseMaterialInfo.data';
import { getCkWlList } from './BlWarehouseMaterialInfo.api';
import NuWarehouseMaterialCrkInfoListModal from '/@/views/invoicing/warehouseMaterialInfo/NuWarehouseMaterialCrkInfoListModal.vue'
import BlWarehouseXsjgModal from '/@/views/invoicing/warehouseMaterialInfo/components/BlWarehouseXsjgModal.vue'
import BlWarehouseMaterialInfoModal from '/@/views/invoicing/warehouseMaterialInfo/components/BlWarehouseMaterialInfoModal.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';
import { useMessage } from "/@/hooks/web/useMessage";
@ -116,12 +74,9 @@ import { useMessage } from "/@/hooks/web/useMessage";
const formRef = ref();
const queryParam = reactive<any>({});
const nuId = ref<string>('');
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerAddModal = ref();
const registerDelModal = ref();
const registerCrkModal = ref();
const xsjgModal = ref();
const pddModal = ref();
const userStore = useUserStore();
const { createConfirm, createMessage} = useMessage();
//table
@ -154,17 +109,6 @@ const wrapperCol = reactive({
sm: 18,
});
//
function handleCrkjl(record: Recordable) {
registerCrkModal.value.disableSubmit = true;
registerCrkModal.value.init(record);
}
function handleXsjg(record: Recordable) {
xsjgModal.value.disableSubmit = false;
xsjgModal.value.edit(record);
}
/**
* 成功回调
*/
@ -179,7 +123,7 @@ function getTableAction(record) {
return [
{
label: '盘点',
onClick: handleCrkjl.bind(null, record),
onClick: handlePdd.bind(null, record),
},
{
label: '出入库',
@ -191,47 +135,23 @@ function getTableAction(record) {
},
];
}
async function handleQyty(record, izEnabled) {
var kcsl = record.kcsl;
var sfjx = "0";
if(parseInt(kcsl) > 0 && izEnabled == 'N'){
createMessage.error("此物料有库存,请先清空库存后再停用");
return;
}else if(parseInt(kcsl) == 0){
//
await defHttp.get({ url: '/invoicing/blWarehouseMaterialInfo/queryWlsfzy', params: { wlId: record.wlId,nuId:record.nuId } }).then(res => {
console.log("🚀 ~ handleQyty ~ res:", res)
if(!res.success){
createMessage.error(res.message);
sfjx = "1";
}
});
}
if(sfjx == '1'){
return;
}
var title = "是否启用";
var content = "是否启用此物料";
if(izEnabled == 'N'){
title = "是否停用";
content = "是否停用此物料";
}
createConfirm({
iconType: 'warning',
title: title,
content: content,
okText: '确认',
cancelText: '取消',
onOk: () => {
defHttp.put({ url: '/invoicing/blWarehouseMaterialInfo/edit', params: { id: record.id, izEnabled: izEnabled } }).then(res => {
handleSuccess();
});
}
});
//
function handlePdd(record) {
pddModal.value.disableSubmit = false;
pddModal.value.edit(record);
}
//
function handleCrkjl(record: Recordable) {
registerCrkModal.value.disableSubmit = true;
registerCrkModal.value.init(record);
}
//
function handleXsjg(record: Recordable) {
xsjgModal.value.disableSubmit = false;
xsjgModal.value.edit(record);
}
/**
* 查询
@ -258,27 +178,6 @@ function init(record) {
reload();
}
function handleSearch(data, izReload = true) {
console.log("🚀 ~ handleSearch ~ data:", data)
var levle = parseInt(data.levle)
if (levle == 1) {
queryParam.categoryId = data.key
queryParam.typeId = ''
queryParam.medicationId = ''
} else if (levle == 2) {
queryParam.categoryId = data.categoryId
queryParam.typeId = data.key
queryParam.medicationId = ''
} else if (levle == 3) {
queryParam.categoryId = data.categoryId
queryParam.typeId = data.typeId
queryParam.medicationId = data.key
}
if (izReload) {
reload();
}
}
defineExpose({
init,
});

View File

@ -4,24 +4,88 @@
<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.nuId" id="BlWarehouseMaterialInfoForm-nuId" name="nuId" >
<a-input v-model:value="formData.nuId_dictText" :disabled="formData.id != ''" ></a-input>
<a-col :span="12">
<a-form-item label="物料名称" v-bind="validateInfos.materialName" id="BlWarehouseMaterialInfoForm-materialName" name="materialName" >
<a-input v-model:value="formData.materialName" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料" v-bind="validateInfos.wlId" id="BlWarehouseMaterialInfoForm-wlId" name="wlId" >
<a-input v-model:value="formData.wlId_dictText" :disabled="formData.id != ''" ></a-input>
<a-col :span="12">
<a-form-item label="物料编码" v-bind="validateInfos.materialNo" id="BlWarehouseMaterialInfoForm-materialNo" name="materialNo" >
<a-input v-model:value="formData.materialNo" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料上限" v-bind="validateInfos.upperLimit" id="BlWarehouseMaterialInfoForm-upperLimit" name="upperLimit">
<a-input v-model:value="formData.upperLimit" placeholder="请输入物料上限" ></a-input>
<a-col :span="12">
<a-form-item label="规格型号" v-bind="validateInfos.specificationModel" id="BlWarehouseMaterialInfoForm-specificationModel" name="specificationModel" >
<a-input v-model:value="formData.specificationModel" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料下限" v-bind="validateInfos.lowerLimit" id="BlWarehouseMaterialInfoForm-lowerLimit" name="lowerLimit">
<a-input v-model:value="formData.lowerLimit" placeholder="请输入物料下限" ></a-input>
<a-col :span="12">
<a-form-item label="品牌" v-bind="validateInfos.brandType" id="BlWarehouseMaterialInfoForm-brandType" name="brandType" >
<a-input v-model:value="formData.brandType" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="生产厂家" v-bind="validateInfos.manufacturer" id="BlWarehouseMaterialInfoForm-manufacturer" name="manufacturer" >
<a-input v-model:value="formData.manufacturer" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="供应商" v-bind="validateInfos.suppliersName" id="BlWarehouseMaterialInfoForm-suppliersName" name="suppliersName" >
<a-input v-model:value="formData.suppliersName" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="物料图片" v-bind="validateInfos.materialImg" id="BlWarehouseMaterialInfoForm-materialImg" name="materialImg" >
<a-input v-model:value="formData.materialImg" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="物料分类" v-bind="validateInfos.categoryName" id="BlWarehouseMaterialInfoForm-wlId" name="categoryName" >
<a-input v-model:value="formData.categoryName" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="物料类型" v-bind="validateInfos.typeName" id="BlWarehouseMaterialInfoForm-wlId" name="typeName" >
<a-input v-model:value="formData.typeName" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="库存数量" v-bind="validateInfos.dqkcsl" id="BlWarehouseMaterialInfoForm-dqkcsl" name="dqkcsl" >
<a-input v-model:value="formData.dqkcsl" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="盘点状态" v-bind="validateInfos.pdType" id="BlWarehouseMaterialInfoForm-pdType" name="pdType" >
<a-select v-model:value="formData.pdType" disabled >
<a-select-option value="">正常</a-select-option>
<a-select-option value="1">盘盈</a-select-option>
<a-select-option value="2">盘亏</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="差额" v-bind="validateInfos.cesl" id="BlWarehouseMaterialInfoForm-cesl" name="cesl" >
<a-input v-model:value="formData.cesl" readonly ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="盘点数量" v-bind="validateInfos.pdsl" id="BlWarehouseMaterialInfoForm-pdsl" name="pdsl" >
<a-input-number v-model:value="formData.pdsl" style="width:100%" @change="handlePdslChange" ></a-input-number>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="备注" v-bind="validateInfos.content" id="BlWarehouseMaterialInfoForm-content" name="content">
<a-input v-model:value="formData.content" placeholder="请输入物料上限" ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="拍照" v-bind="validateInfos.picPath" id="BlWarehouseMaterialInfoForm-picPath" name="picPath">
<a-input v-model:value="formData.picPath" placeholder="请输入物料下限" ></a-input>
</a-form-item>
</a-col>
</a-row>
@ -35,10 +99,8 @@
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 { saveOrUpdate } from '../BlWarehouseMaterialInfo.api';
import { savePddInfo } from '../BlWarehouseMaterialInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
@ -52,11 +114,25 @@
const formData = reactive<Record<string, any>>({
id: '',
nuId: '',
wlId: '',
upperLimit: '',
lowerLimit: '',
wlId_dictText:'',
nuId_dictText:'',
wlId: '',
materialName: '',
materialNo: '',
specificationModel: '',
brandType: '',
manufacturer: '',
suppliersId: '',
suppliersName: '',
dqkcsl: '',
materialImg: '',
categoryName: '',
typeName: '',
cesl: '',
pdsl: '',
content: '',
picPath: '',
pdType: '',
xsjg: '',
ckId: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
@ -64,8 +140,7 @@
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
upperLimit: [{ required: true, message: '请输入物料上限!' },],
lowerLimit: [{ required: true, message: '请输入物料下限!' },],
pdsl: [{ required: true, message: '请输入盘点数量' },],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
@ -92,20 +167,33 @@
/**
* 编辑
*/
function edit(record) {
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
defHttp.get({ url: '/api/pad/invoicing/generatedPddInfo', params: { id: record.id } }).then((res) => {
//
Object.assign(formData, res);
})
//
Object.assign(formData, tmpData);
});
}
function handlePdslChange(e){
console.log("🚀 ~ handlePdslChange ~ e:", e)
if(e == null || e == '' || e == undefined){
formData.pdType = ''
formData.cesl = ''
return;
}
formData.cesl = e - formData.dqkcsl;
if(formData.cesl>0){
formData.pdType = '1'
}else if(formData.cesl<0){
formData.pdType = '2'
}else{
formData.pdType = ''
}
}
/**
* 提交数据
*/
@ -140,10 +228,10 @@
}
}
}
await saveOrUpdate(model, isUpdate.value)
await savePddInfo(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
createMessage.success("操作成功");
emit('ok');
} else {
createMessage.warning(res.message);