Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Important changes: optimized front-end warning code and known bugs #294

Merged
merged 17 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ data class AdvanceChargeDetailVO (
var files: List<FileDataBO>? = null,

var remark: String? = null,

var status: Int? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public Response<String> addOrUpdateOtherShipments(OtherShipmentDTO otherShipment
if(!otherShipmentsDTO.getTableData().isEmpty()) {
for (StorageShipmentStockBO stockBO : otherShipmentsDTO.getTableData()) {
totalProductNumber += stockBO.getProductNumber();
totalAmount = totalAmount.add(stockBO.getAmount());
totalAmount = totalAmount.add(Optional.ofNullable(stockBO.getAmount()).orElse(BigDecimal.ZERO));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public Response<String> addOrUpdateOtherStorage(OtherStorageDTO otherStorageDTO)
if(!otherStorageDTO.getTableData().isEmpty()) {
for (StorageShipmentStockBO stockBO : otherStorageDTO.getTableData()) {
totalProductNumber += stockBO.getProductNumber();
totalAmount = totalAmount.add(stockBO.getAmount());
totalAmount = totalAmount.add(Optional.ofNullable(stockBO.getAmount()).orElse(BigDecimal.ZERO));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ open class CustomerServiceImpl(
queryCustomerDTO?.phoneNumber?.let { like(Customer::getPhoneNumber, it) }
queryCustomerDTO?.startDate?.let { ge(Customer::getCreateTime, it) }
queryCustomerDTO?.endDate?.let { le(Customer::getCreateTime, it) }
eq(Customer::getStatus, CommonConstants.STATUS_NORMAL)
eq(Customer::getDeleteFlag, CommonConstants.NOT_DELETED)
.orderByAsc(Customer::getSort)
}
val list = customerMapper.selectList(wrapper)
val listVo = list.map { customer ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ open class MemberServiceImpl(
.eq(StringUtils.hasLength(memberDTO?.phoneNumber), Member::getPhoneNumber, memberDTO?.phoneNumber)
.ge(StringUtils.hasLength(memberDTO?.startDate), Member::getCreateTime, memberDTO?.startDate)
.le(StringUtils.hasLength(memberDTO?.endDate), Member::getCreateTime, memberDTO?.endDate)
.eq(Member::getStatus, CommonConstants.STATUS_NORMAL)
.eq(Member::getDeleteFlag, CommonConstants.NOT_DELETED)
.orderByAsc(Member::getSort)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ open class SupplierServiceImpl(
supplier?.phoneNumber?.let { like(Supplier::getPhoneNumber, it) }
supplier?.startDate?.let { ge(Supplier::getCreateTime, it) }
supplier?.endDate?.let { le(Supplier::getCreateTime, it) }
eq(Supplier::getStatus, CommonConstants.STATUS_NORMAL)
eq(Supplier::getDeleteFlag, CommonConstants.NOT_DELETED)
orderByAsc(Supplier::getSort)
}
val list = supplierMapper.selectList(wrapper)
val listVo = list.map { supplier ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ open class AdvanceChargeServiceImpl(
val financialPerson = operatorService.getOperatorById(financialMain.operatorId)
val subData = financialSubService.lambdaQuery()
.eq(FinancialSub::getFinancialMainId, id)
.eq(FinancialSub::getDeleteFlag, CommonConstants.NOT_DELETED)
.list()

val tableData = ArrayList<AdvanceChargeDataBO>()
Expand Down Expand Up @@ -288,7 +289,8 @@ open class AdvanceChargeServiceImpl(
collectedAmount = financialMain.changeAmount,
tableData = tableData,
remark = financialMain.remark,
files = filesData
files = filesData,
status = financialMain.status
)
return Response.responseData(resultVO);
}
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
"vue-router": "^4.2.3",
"vue-types": "^5.1.0",
"vuedraggable": "^4.1.0",
"vxe-table": "^4.4.5",
"vxe-table-plugin-export-xlsx": "^3.0.4",
"vxe-table": "^4.5.14",
"vxe-table-plugin-export-xlsx": "3.1.0",
"xe-utils": "^3.5.11",
"xlsx": "^0.18.5"
},
Expand Down
36 changes: 18 additions & 18 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/src/api/financial/model/advanceModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface FileData {
fileSize: number;
}

interface AdvanceChargeData {
export interface AdvanceChargeData {
accountId: number | string;
accountName: string;
amount: number;
Expand Down
2 changes: 2 additions & 0 deletions web/src/components/SimpleMenu/src/SimpleSubMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@
import SubMenu from './components/SubMenuItem.vue';
import { propTypes } from '/@/utils/propTypes';
import { useI18n } from '/@/hooks/web/useI18n';
import SimpleMenuTag from "@/components/SimpleMenu/src/SimpleMenuTag.vue";

export default defineComponent({
name: 'SimpleSubMenu',
components: {
SimpleMenuTag,
SubMenu,
MenuItem,
Icon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
</template>
</Dropdown>
<LockAction @register="register" />
<AccountSetting/>
</template>
<script lang="ts">
// components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { addOrUpdateIncomeExpense } from '@/api/basic/incomeExpense';
const rowId = ref('');
const isUpdate = ref(true);
const getTitle = computed(() => (!unref(isUpdate) ? '新增收支项目' : '编辑收支项目'));
const emitSuccess = defineEmits(['success']);
const emitSuccess = defineEmits(['success', 'register']);

const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
labelWidth: 100,
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/basic/member/components/MemberModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { addOrUpdateMember } from '@/api/basic/member';
const rowId = ref('');
const isUpdate = ref(true);
const getTitle = computed(() => (!unref(isUpdate) ? '新增会员信息' : '编辑会员信息'));
const emitSuccess = defineEmits(['success']);
const emitSuccess = defineEmits(['success','register']);

const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
labelWidth: 100,
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/basic/operator/components/OperatorModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { addOrUpdateOperator } from '@/api/basic/operator';
const rowId = ref('');
const isUpdate = ref(true);
const getTitle = computed(() => (!unref(isUpdate) ? '新增操作员' : '编辑操作员'));
const emitSuccess = defineEmits(['success']);
const emitSuccess = defineEmits(['success', 'register']);

const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
labelWidth: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { addOrUpdateAccount } from '@/api/financial/account';
const rowId = ref('');
const isUpdate = ref(true);
const getTitle = computed(() => (!unref(isUpdate) ? '新增结算账户' : '编辑结算账户'));
const emitSuccess = defineEmits(['success']);
const emitSuccess = defineEmits(['success','register']);

const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
labelWidth: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { addOrUpdateWarehouse } from '@/api/basic/warehouse';
const rowId = ref('');
const isUpdate = ref(true);
const getTitle = computed(() => (!unref(isUpdate) ? '新增仓库' : '编辑仓库'));
const emitSuccess = defineEmits(['success']);
const emitSuccess = defineEmits(['success', 'register']);

const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
labelWidth: 100,
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/financial/advance-charge/advance.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const tableColumns = [
]

interface FormState {
id: string;
id: string | undefined;
memberId: string;
receiptNumber: string;
financialPersonnelId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:confirm-loading="confirmLoading"
v-bind:prefixNo="prefixNo"
:id="prefixNo"
:keyboard="false"
:keyboard="true"
:forceRender="true"
switchHelp
switchFullscreen
Expand Down Expand Up @@ -39,7 +39,7 @@
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="单据编号" data-step="2"
data-title="单据编号">
<a-input placeholder="请输入单据编号" v-model:value="formState.receiptNumber" :readOnly="true"/>
<a-input placeholder="请输入单据编号" v-model:value="formState.receiptNumber" readOnly/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
Expand Down Expand Up @@ -78,7 +78,7 @@
v-model:value="editableData[record.key][column.key]"
style="width: 100%"
placeholder="请选择账户名称"
@change="handleAccountChange(record.key, column.key, $event)">
@change="handleAccountChange(record.key, column.key, $event)" >
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.accountName }}
</a-select-option>
Expand All @@ -87,7 +87,7 @@
<template v-else>
<template v-if="column.key !== 'accountId'">
<a-input v-model:value="editableData[record.key][column.key]"
:placeholder="`请输入${getColumnTitle(column)}`" @change="valueChange"/>
:placeholder="`请输入${getColumnTitle(column)}`" @change="valueChange" :rules="[{ required: true}]"/>
</template>
<template v-else>
{{ record[column.key] }}
Expand Down Expand Up @@ -177,6 +177,10 @@ import {AccountResp} from "@/api/financial/model/accountModel";
import {useMessage} from "@/hooks/web/useMessage";
import {addOrUpdateAdvance, getAdvanceDetail} from "@/api/financial/advance";
import {AddOrUpdateAdvanceReq, AdvanceChargeData} from "@/api/financial/model/advanceModel";
import weekday from "dayjs/plugin/weekday";
import localeData from "dayjs/plugin/localeData";
dayjs.extend(weekday);
dayjs.extend(localeData);
dayjs.locale('zh-cn');
export default defineComponent({
name: 'AdvanceChargeModal',
Expand Down Expand Up @@ -241,7 +245,6 @@ export default defineComponent({
const totalPrice = ref<number>(0.00);

function handleCancelModal() {
close();
open.value = false;
context.emit('cancel');
clearData();
Expand Down Expand Up @@ -340,17 +343,30 @@ export default defineComponent({

async function handleOk(review: number) {
if (!formState.memberId) {
createMessage.error('请选择付款会员');
createMessage.warn('请选择付款会员');
return;
}
if (!formState.receiptDate) {
createMessage.error('请选择单据日期');
createMessage.warn('请选择单据日期');
return;
}
if (tableData.value.length === 0) {
createMessage.error('请插入一行数据,录入收预付款信息');
createMessage.warn('请插入一行数据,录入收预付款信息');
return;
}
console.info(editableData)
for (const key in editableData) {
console.info(editableData[key])
if (!editableData[key].accountId) {
createMessage.warn('请选择账户名称');
return;
}
if (!editableData[key].amount) {
createMessage.warn('请输入金额');
return;
}
}


const files = [];
if (fileList && fileList.value) {
Expand Down Expand Up @@ -397,6 +413,7 @@ export default defineComponent({

const clearData = () => {
formRef.value.resetFields();
formState.id = undefined;
formState.receiptNumber = '';
formState.receiptDate = undefined;
formState.memberId = '';
Expand All @@ -407,6 +424,9 @@ export default defineComponent({
tableData.value = [];
fileList.value = [];
totalPrice.value = 0.00;
for (const key in editableData) {
delete editableData[key];
}
};

const editableData = reactive({});
Expand Down Expand Up @@ -477,7 +497,7 @@ export default defineComponent({
function beforeUpload(file: any) {
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
createMessage.error(`${file.name},该文件超过2MB大小限制`);
createMessage.warn(`${file.name},该文件超过2MB大小限制`);
return isLt2M || Upload.LIST_IGNORE
}
}
Expand Down
6 changes: 0 additions & 6 deletions web/src/views/financial/collection/addEditCollection.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,9 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
slots: {
buttons: 'toolbar_buttons'
},
export: true,
zoom: true,
custom: true
},
proxyConfig: {
sort: false,
filter: false,
form: true,
},
columns: [
{ type: 'checkbox', field:'id', title: 'ID', width: 180},
{ field: 'saleReceiptNumber',
Expand Down
Loading