diff --git a/src/api/system/SdbElectricityDevice/type.ts b/src/api/system/SdbElectricityDevice/type.ts index d44d3c3..c08eb31 100644 --- a/src/api/system/SdbElectricityDevice/type.ts +++ b/src/api/system/SdbElectricityDevice/type.ts @@ -2,7 +2,7 @@ export interface ElectricityDeviceVO { /** * id */ - id: string | number; + id: string; /** * 设备编码 @@ -29,14 +29,14 @@ export interface ElectricityDeviceVO { /** * */ - openid: string | number; + openid: string; } export interface ElectricityDeviceForm extends BaseEntity { /** * id */ - id?: string | number; + id?: string; /** * 设备编码 diff --git a/src/api/system/SdbPayRecordMain/index.ts b/src/api/system/SdbPayRecordMain/index.ts new file mode 100644 index 0000000..e46afb9 --- /dev/null +++ b/src/api/system/SdbPayRecordMain/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { PayRecordListVO, PayRecordListForm, PayRecordListQuery } from './type'; + +/** + * 查询抄表周期明细列表 + * @param query + * @returns {*} + */ + +export const listPayRecordList = (query?: PayRecordListQuery): AxiosPromise => { + return request({ + url: '/payRecordList/payRecordList/list', + method: 'get', + params: query + }); +}; + +/** + * 查询抄表周期明细详细 + * @param id + */ +export const getPayRecordList = (id: string | number): AxiosPromise => { + return request({ + url: '/payRecordList/payRecordList/' + id, + method: 'get' + }); +}; + +/** + * 新增抄表周期明细 + * @param data + */ +export const addPayRecordList = (data: PayRecordListForm) => { + return request({ + url: '/payRecordList', + method: 'post', + data: data + }); +}; + +/** + * 修改抄表周期明细 + * @param data + */ +export const updatePayRecordList = (data: PayRecordListForm) => { + return request({ + url: '/payRecordList', + method: 'put', + data: data + }); +}; + +/** + * 删除抄表周期明细 + * @param id + */ +export const delPayRecordList = (id: string | number | Array) => { + return request({ + url: '/payRecordList/payRecordList/' + id, + method: 'delete' + }); +}; diff --git a/src/api/system/SdbPayRecordMain/type.ts b/src/api/system/SdbPayRecordMain/type.ts new file mode 100644 index 0000000..bfc4870 --- /dev/null +++ b/src/api/system/SdbPayRecordMain/type.ts @@ -0,0 +1,181 @@ +export interface PayRecordListVO { + /** + * 抄表周期明细id + */ + id: string | number; + + /** + * 抄表周期id + */ + recordId: string | number; + + /** + * 房间号 + */ + housenumname: string; + + /** + * 收费项目 0电费 1水费 + */ + payType: string; + + /** + * 抄表月份 + */ + recordMonth: string; + + /** + * 开始时间 + */ + startTime: string; + + /** + * 结束时间 + */ + endTime: string; + + /** + * 本期用度 + */ + currentCost: number; + + /** + * 费用合计 + */ + totalCost: number; + + /** + * 设备编号 + */ + deviceCode: string; + + /** + * 设备类型 0电表 1水表 + */ + deviceType: string; +} + +export interface PayRecordListForm extends BaseEntity { + villageName: string; + houseName: string; + residentName: string; + residentCode: string; + gender: string; + phone: string; + startRead: string; + endRead: string; + price: string; + + /** + * 抄表周期明细id + */ + id?: string | number; + + /** + * 抄表周期id + */ + recordId?: string | number; + + /** + * 房间号 + */ + housenumname?: string; + + /** + * 收费项目 0电费 1水费 + */ + payType?: string; + + /** + * 抄表月份 + */ + recordMonth?: string; + + /** + * 开始时间 + */ + startTime?: string; + + /** + * 结束时间 + */ + endTime?: string; + + /** + * 本期用度 + */ + currentCost?: number; + + /** + * 费用合计 + */ + totalCost?: number; + + /** + * 设备编号 + */ + deviceCode?: string; + + /** + * 设备类型 0电表 1水表 + */ + deviceType?: string; +} + +export interface PayRecordListQuery extends PageQuery { + /** + * 抄表周期id + */ + recordId?: string | number; + + /** + * 房间号 + */ + houseName?: string; + residentName?: string; + paycordName?: string; + /** + * 收费项目 0电费 1水费 + */ + payType?: string; + + /** + * 抄表月份 + */ + recordMonth?: string; + + /** + * 开始时间 + */ + startTime?: string; + + /** + * 结束时间 + */ + endTime?: string; + + /** + * 本期用度 + */ + currentCost?: number; + + /** + * 费用合计 + */ + totalCost?: number; + + /** + * 设备编号 + */ + deviceCode?: string; + + /** + * 设备类型 0电表 1水表 + */ + deviceType?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/SdbWaterDevice/type.ts b/src/api/system/SdbWaterDevice/type.ts index 839fe52..3b779a0 100644 --- a/src/api/system/SdbWaterDevice/type.ts +++ b/src/api/system/SdbWaterDevice/type.ts @@ -18,6 +18,7 @@ export interface WaterDeviceVO { * 状态 */ deleted: number; + houseName: string; /** * diff --git a/src/api/system/Tstock/index.ts b/src/api/system/Tstock/index.ts index eeddd1b..52fad0b 100644 --- a/src/api/system/Tstock/index.ts +++ b/src/api/system/Tstock/index.ts @@ -14,3 +14,43 @@ export const listStock = (query?: any): AxiosPromise => { params: query }); }; + +/** + * 查询 库存查询 详情 + * @param query + * @returns {*} + */ + +export const listStockMain = (id?: string): AxiosPromise => { + return request({ + url: '/stock/detail/' + id, + method: 'get' + }); +}; + +export type StockUpdate = { + materialId: string; // 物料id + materialName: string; // 物料名称 + brand: string; // 型号 + model: string; // 品牌 + unit: string; // 单位 + costPrice: string; // 成本价 + stockNum: string; // 库存数量 +}; +type StockUpdateForm = { + materialId: string; // 物料id + costPrice: string; // 成本价 + stockNum: string; // 库存数量 +}; + +/** + * 更新库存信息 + * @param data - 库存更新表单数据,可选参数 + * @returns 返回一个 Axios Promise,解析为任意类型的数组 + */ +export const listStockUpdate = (data?: StockUpdateForm): AxiosPromise => { + return request({ + url: '/stock/update?materialId=' + data?.materialId + '&stockNum=' + data?.stockNum, + method: 'PUT' + }); +}; diff --git a/src/utils/print.ts b/src/utils/print.ts index 35cf6f9..3d49e5c 100644 --- a/src/utils/print.ts +++ b/src/utils/print.ts @@ -8,7 +8,6 @@ export function printVueDiv(elementId: string, title: string = '打印') { console.error('未找到打印元素'); return; } - const win = window.open('', '_blank', 'width=1000,height=800'); if (!win) return; diff --git a/src/views/system/Sdb/PayRecord/add.vue b/src/views/system/Sdb/PayRecord/add.vue new file mode 100644 index 0000000..ab8b3ae --- /dev/null +++ b/src/views/system/Sdb/PayRecord/add.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/src/views/system/Sdb/PayRecord/index.vue b/src/views/system/Sdb/PayRecord/index.vue index cad3020..b143b92 100644 --- a/src/views/system/Sdb/PayRecord/index.vue +++ b/src/views/system/Sdb/PayRecord/index.vue @@ -1,11 +1,12 @@ @@ -153,13 +121,10 @@ const data = reactive>({ startTime: undefined, endTime: undefined, params: {} - }, - rules: { - id: [{ required: true, message: '抄表周期管理表id不能为空', trigger: 'blur' }] } }); -const { queryParams, form, rules } = toRefs(data); +const { queryParams, form } = toRefs(data); /** 查询 抄表周期管理列表 */ const getList = async () => { @@ -170,18 +135,6 @@ const getList = async () => { loading.value = false; }; -/** 取消按钮 */ -const cancel = () => { - reset(); - dialog.visible = false; -}; - -/** 表单重置 */ -const reset = () => { - form.value = { ...initFormData }; - payRecordFormRef.value?.resetFields(); -}; - /** 搜索按钮操作 */ const handleQuery = () => { queryParams.value.pageNum = 1; @@ -201,61 +154,40 @@ const handleSelectionChange = (selection: PayRecordVO[]) => { multiple.value = !selection.length; }; +const router = useRouter(); /** 新增按钮操作 */ const handleAdd = () => { - reset(); - dialog.visible = true; - dialog.title = '添加 抄表周期管理'; -}; - -/** 修改按钮操作 */ -const handleUpdate = async (row?: PayRecordVO) => { - reset(); - const _id = row?.id || ids.value[0]; - const res = await getPayRecord(_id); - Object.assign(form.value, res.data); - dialog.visible = true; - dialog.title = '修改 抄表周期管理'; -}; - -/** 提交按钮 */ -const submitForm = () => { - payRecordFormRef.value?.validate(async (valid: boolean) => { - if (valid) { - buttonLoading.value = true; - if (form.value.id) { - await updatePayRecord(form.value).finally(() => (buttonLoading.value = false)); - } else { - await addPayRecord(form.value).finally(() => (buttonLoading.value = false)); - } - proxy?.$modal.msgSuccess('操作成功'); - dialog.visible = false; - await getList(); - } + router.push({ + path: '/sdb/addPayRecord' }); }; +/** 修改按钮操作 */ +const handleMain = async (row?: PayRecordVO) => { + router.push({ + path: '/sdb/PayRecordMain', + query: { + id: row?.id + } + }); +}; +// TODO 抄表名称 /** 删除按钮操作 */ const handleDelete = async (row?: PayRecordVO) => { const _ids = row?.id || ids.value; - await proxy?.$modal.confirm('是否确认删除 抄表周期管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false)); + await proxy?.$modal.confirm('是否确认删除该抄表周期?').finally(() => (loading.value = false)); await delPayRecord(_ids); proxy?.$modal.msgSuccess('删除成功'); await getList(); }; -/** 导出按钮操作 */ -const handleExport = () => { - proxy?.download( - 'payRecord/payRecord/export', - { - ...queryParams.value - }, - `payRecord_${new Date().getTime()}.xlsx` - ); -}; - onMounted(() => { getList(); }); + + diff --git a/src/views/system/Sdb/PayRecord/main.vue b/src/views/system/Sdb/PayRecord/main.vue new file mode 100644 index 0000000..5ca5d84 --- /dev/null +++ b/src/views/system/Sdb/PayRecord/main.vue @@ -0,0 +1,303 @@ + + + + + diff --git a/src/views/system/Sdb/SdbBill/index.vue b/src/views/system/Sdb/SdbBill/index.vue index e9e64ae..d2b1f59 100644 --- a/src/views/system/Sdb/SdbBill/index.vue +++ b/src/views/system/Sdb/SdbBill/index.vue @@ -29,7 +29,7 @@ - + + + @@ -110,7 +140,7 @@ - {{ UsedWaterform.deviceCode }} + {{ UsedWaterform.deviceCode }} - 取消 + 取消 更新到设备 @@ -168,7 +198,7 @@ - 取消 + 取消 更新到设备 @@ -258,6 +288,7 @@ const UsedWaterInfo = ref({ // ? 上传固件 ============================================================================================== const UploadFileformRef = ref(null); +const uploadRef = ref(null); const UploadFileform = ref({ id: '', deviceCode: '', @@ -336,6 +367,7 @@ const handleSelectionChange = (selection: ElectricityDeviceVO[]) => { multiple.value = !selection.length; }; +// TODO 生成条码 /** 生成二维码 */ const handleQrCode = (row: ElectricityDeviceVO) => { // 1.电表 2.电表 @@ -392,15 +424,9 @@ function getTree() { } /** 电表 启停*/ +// TODO 修改水电表 启停 const handleChangeWater = (val: string, row: ElectricityDeviceVO) => {}; - -/** 编辑房屋 按钮操作 */ -const handleUpdate = async (row?: ElectricityDeviceVO) => { - reset(); - dialog.visible = true; - dialog.title = '编辑房屋'; -}; - +// TODO 修改电表户号 /** 提交按钮 */ const submitForm = () => { if (dialogType.value === 'usedWater') { @@ -434,6 +460,7 @@ const unSubmit = () => { reset(); dialog.visible = false; dialog.title = ''; + uploadRef?.value.clearFiles(); }; /** 表单重置 */ const reset = () => { @@ -449,8 +476,11 @@ const reset = () => { endTime: '' }; EditHouseform.value = { - houseid: '' + houseId: '', + deviceCode: '', + id: '' }; + UploadFileform.value.file = ''; // 上传 清空 UploadFileformRef.value?.resetFields(); // 使用电量 清空 @@ -472,6 +502,8 @@ const resetQuery = () => { }; const router = useRouter(); + +// TODO 充值记录 查询 /** 充值记录 */ const handleRecode = (row: ElectricityDeviceVO) => { // 1.电表 2.电表 @@ -480,6 +512,7 @@ const handleRecode = (row: ElectricityDeviceVO) => { query: { type: '2', houseName: row.houseName, + deviceCode: row.deviceCode, id: row.id } }); diff --git a/src/views/system/Sdb/SdbWaterDevice/index.vue b/src/views/system/Sdb/SdbWaterDevice/index.vue index 3f3794d..9f71f15 100644 --- a/src/views/system/Sdb/SdbWaterDevice/index.vue +++ b/src/views/system/Sdb/SdbWaterDevice/index.vue @@ -136,7 +136,7 @@ - {{ UsedWaterform.deviceCode }} + {{ UsedWaterform.deviceCode }} - + - 取消 + 取消 更新到设备 @@ -195,7 +195,7 @@ - 取消 + 取消 更新到设备 diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 702bc58..4750b82 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -1,5 +1,5 @@