Merge remote-tracking branch 'origin/yagwly_fa_master' into yagwly_fa_master
| | |
| | | |
| | | |
| | | <template #menu-left> |
| | | <el-button type="success" icon="Edit" :disabled="pageF.single" v-hasPermi="['cwgl:estimatedReceivable:edit']" |
| | | <el-button type="success" icon="Edit" :disabled="editIshow" v-hasPermi="['cwgl:estimatedReceivable:edit']" |
| | | @click="handleUpdate">修改 |
| | | </el-button> |
| | | <el-button type="danger" icon="Delete" :disabled="pageF.multiple" @click="handleDelete" |
| | | <el-button type="danger" icon="Delete" :disabled="removeIshow" @click="handleDelete" |
| | | v-hasPermi="['cwgl:estimatedReceivable:remove']">删除 |
| | | </el-button> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" |
| | |
| | | |
| | | |
| | | <template #menu="{ size, row, index }"> |
| | | <el-link class="link-btn" type="primary" :underline="false" plain :size="size" |
| | | <el-link class="link-btn" type="primary" :underline="false" plain :size="size" |
| | | @click="handleEditBtn(row, index)" v-if="[0, 1].includes(row.relatedBillStatus) && row.isConfirmed != 2" |
| | | v-hasPermi="['cwgl:estimatedReceivable:cancel']"> 编辑 |
| | | </el-link> |
| | | <el-link class="link-btn" type="primary" v-if="row.isConfirmed == 1" |
| | | :underline="false" plain :size="size" @click="handleCancel(row)" |
| | | v-hasPermi="['cwgl:estimatedReceivable:cancel']"> 取消确认 |
| | | <el-link class="link-btn" type="primary" v-if="row.isConfirmed == 1" :underline="false" plain :size="size" |
| | | @click="handleCancel(row)" v-hasPermi="['cwgl:estimatedReceivable:cancel']"> 取消确认 |
| | | </el-link> |
| | | <el-link class="link-btn" type="primary" v-if="row.isConfirmed == 0" :underline="false" plain |
| | | @click="handleAffirm(row)" v-hasPermi="['cwgl:estimatedReceivable:confirm']"> 确认 |
| | | <el-link class="link-btn" type="primary" v-if="row.isConfirmed == 0 && ![2, 3].includes(row.relatedBillStatus)" |
| | | :underline="false" plain @click="handleAffirm(row)" v-hasPermi="['cwgl:estimatedReceivable:confirm']"> 确认 |
| | | </el-link> |
| | | <el-link class="link-btn" type="primary" v-if="row.isConfirmed == 1" :underline="false" plain |
| | | @click="handleInvalid(row)" v-hasPermi="['cwgl:estimatedReceivable:invalid']"> 作废 |
| | |
| | | import { listEstimatedReceivableLog } from "@/api/cwgl/estimatedReceivableLog"; |
| | | import { listEstimatedReceivableBillLog } from "@/api/cwgl/estimatedReceivableBillLog"; |
| | | import { |
| | | getSelectCustomNam, |
| | | } from "@/api/cwgl/pendingSettlementBusiness"; |
| | | import { |
| | | listPendingSettlementBusiness, |
| | | } from "@/api/cwgl/pendingSettlementBusiness"; |
| | | import useCurrentInstance from "@/utils/useCurrentInstance"; |
| | |
| | | const data = reactive({ |
| | | form: <EstimatedReceivableI>{}, |
| | | newTableData: [], |
| | | removeIshow: true, |
| | | editIshow: true, |
| | | newForm: <EstimatedReceivableI>{ |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | |
| | | itemTableLoading1: false, |
| | | itemTableLoading2: false, |
| | | }) |
| | | const { queryParams, form, page, selectionList, newForm, newTableData, newSelectionList, itemTableLoading1, itemTableLoading2 } = toRefs(data); |
| | | const { queryParams, form, page, selectionList, newForm, newTableData, newSelectionList, itemTableLoading1, itemTableLoading2, removeIshow, editIshow } = toRefs(data); |
| | | const option = ref({ |
| | | pageKey: 'EstimatedReceivable', |
| | | rowKey: 'id', |
| | |
| | | ], |
| | | search: true, |
| | | }, |
| | | // customerName: { |
| | | // label: '客户名称', |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "客户名称不能为空", trigger: "blur" |
| | | // } |
| | | // ], |
| | | // search: true, |
| | | // disabled: true, |
| | | // }, |
| | | customerName: { |
| | | label: '客户名称', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "客户名称不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | search: true, |
| | | disabled: true, |
| | | minWidth: 220, |
| | | |
| | | type: 'select', // 设置为下拉框类型 |
| | | dicData: [], // 使用 selectCustomName 作为数据源 |
| | | disabled: false // 根据需要设置是否禁用 |
| | | }, |
| | | projectName: { |
| | | label: '项目名称', |
| | |
| | | }, |
| | | handleSelectionChangeFunc: (selection: any) => { |
| | | selectionList.value = selection; |
| | | console.log(selection); |
| | | |
| | | // 根据选中项数量和状态设置编辑按钮是否可用 |
| | | if (selection.length === 1 && [0, 1].includes(selection[0].relatedBillStatus)) { |
| | | editIshow.value = false; |
| | | } else { |
| | | editIshow.value = true; |
| | | } |
| | | |
| | | if (selection.length === 1 && [0].includes(selection[0].isConfirmed)) { |
| | | removeIshow.value = false; |
| | | } else { |
| | | removeIshow.value = true; |
| | | } |
| | | |
| | | }, |
| | | getBeginListFunc: (params = {}) => { |
| | | params.feeType = 0; |
| | |
| | | crudRef.value.rowEdit(row, index) |
| | | // option.value.editBtn = true; |
| | | } |
| | | |
| | | /* */ |
| | | const selectCustomName = ref([]); |
| | | const getSelectCustomName = () => { |
| | | getSelectCustomNam().then((res) => { |
| | | if (res.code === 200) { |
| | | // selectCustomName.value = res.data; |
| | | selectCustomName.value = res.data.map(item => ({ |
| | | dictLabel: item, |
| | | dictValue: item |
| | | })); |
| | | option.value.column.customerName.dicData = selectCustomName.value || []; |
| | | } |
| | | }) |
| | | } |
| | | getSelectCustomName() |
| | | </script> |
| | |
| | | } from "@/api/cwgl/estimatedReceivableBill"; |
| | | import useCurrentInstance from "@/utils/useCurrentInstance"; |
| | | import { computed, reactive, ref, toRefs } from "vue"; |
| | | import { |
| | | getSelectCustomNam, |
| | | } from "@/api/cwgl/pendingSettlementBusiness"; |
| | | import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface"; |
| | | import { usePagePlus } from "@/hooks/usePagePlus"; |
| | | import { hasPermission } from "@/utils/permissionUtils"; |
| | |
| | | } |
| | | ], |
| | | }, |
| | | |
| | | customerName: { |
| | | label: '客户名称', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "客户名称不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | search: true, |
| | | minWidth: 220, |
| | | search: true, |
| | | type: 'select', // 设置为下拉框类型 |
| | | dicData: [], // 使用 selectCustomName 作为数据源 |
| | | disabled: false // 根据需要设置是否禁用 |
| | | }, |
| | | |
| | | dispatchCount: { |
| | |
| | | }, |
| | | handleSelectionChangeFunc: (selection: any) => { |
| | | selectionList.value = selection; |
| | | }, |
| | | |
| | | |
| | | }, |
| | | |
| | | |
| | | }) |
| | | const dialog = reactive({ |
| | | visible: false, |
| | |
| | | } |
| | | const newFormRef = ref(); |
| | | const submitForm = () => { |
| | | if(newTableData.value.length == 0) { |
| | | if (newTableData.value.length == 0) { |
| | | proxy.$message.error('无关联明细,无法结算'); |
| | | }else { |
| | | return; // 添加 return 中断执行 |
| | | } else { |
| | | newFormRef.value!.validate(valid => { |
| | | if (valid) { |
| | | // 添加校验逻辑:本次结算金额不能大于应结算金额 |
| | | const settlementAmount = parseFloat(newForm.value.settlementAmount); |
| | | const totalAmount = parseFloat(importForm.value.totalAmount); |
| | | |
| | | // 检查输入是否为有效数字 |
| | | if (isNaN(settlementAmount) || isNaN(totalAmount)) { |
| | | proxy.$message.error('金额格式不正确'); |
| | | return; |
| | | } |
| | | |
| | | if (settlementAmount > totalAmount) { |
| | | proxy.$message.error('本次结算金额不能大于应结算金额'); |
| | | return; // 关键:在这里添加 return 中断后续执行 |
| | | } |
| | | |
| | | let data = { |
| | | billId: newForm.value.id, |
| | | fileName: newForm.value.attachment |
| | |
| | | proxy.$message.success('操作成功'); |
| | | dialog.visible = false; |
| | | newForm.value = {}; |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // 表单验证失败 |
| | | return false; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | const submitFormTow = () => { |
| | | proxy.$modal.confirm(`是否确认修改账单名称?`).then(function () { |
| | | return updateEstimatedReceivableBillNmae(importForm.value); |
| | | }).then((res) => { |
| | | onLoad(page.value); |
| | | onLoad(page.value); |
| | | proxy.$modal.msgSuccess(res.msg); |
| | | }) |
| | | |
| | |
| | | |
| | | }) |
| | | } |
| | | |
| | | const selectCustomName = ref([]); |
| | | const getSelectCustomName = () => { |
| | | getSelectCustomNam().then((res) => { |
| | | if (res.code === 200) { |
| | | // selectCustomName.value = res.data; |
| | | selectCustomName.value = res.data.map(item => ({ |
| | | dictLabel: item, |
| | | dictValue: item |
| | | })); |
| | | option.value.column.customerName.dicData = selectCustomName.value || []; |
| | | } |
| | | }) |
| | | } |
| | | getSelectCustomName() |
| | | </script> |
| | | <style scoped> |
| | | ::v-deep .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell { |
| | |
| | | minWidth: 200, |
| | | |
| | | }, |
| | | isCreate: { |
| | | label: '是否已入账', dataType: 'string', |
| | | type: 'select', |
| | | minWidth: 120, |
| | | dicUrl: '/system/dict/data/type/sys_whether_type', |
| | | }, |
| | | |
| | | // vehicleId: { |
| | | // label: '运输工具ID',hide: true, |
| | | // }, |
| | |
| | | }, |
| | | businessContact: { |
| | | label: '业务联系人', |
| | | minWidth: 120, |
| | | minWidth: 120, |
| | | }, |
| | | estimatedTotalIncome: { |
| | | label: '预估总收入', |
| | | minWidth: 120, |
| | | minWidth: 120, |
| | | |
| | | }, |
| | | estimatedTotalCost: { |
| | | label: '预估总成本', |
| | | minWidth: 120, |
| | | minWidth: 120, |
| | | |
| | | }, |
| | | estimatedProfit: { |
| | | label: '预估利润', |
| | | minWidth: 120, |
| | | minWidth: 120, |
| | | |
| | | }, |
| | | |
| | | confirmedTotalIncome: { |
| | | label: '确认总收入', |
| | | minWidth: 120, |
| | | minWidth: 120, |
| | | |
| | | }, |
| | | confirmedTotalCost: { |
| | | label: '确认总成本', |
| | | minWidth: 120, |
| | | minWidth: 120, |
| | | |
| | | }, |
| | | relatedBillName: { |
| | | label: '关联联账单名称', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | |
| | | }, |
| | | isIncomeMatched: { |
| | | label: '是否匹配收入', |
| | | |
| | | type: 'select', |
| | | dataType: 'string', |
| | | minWidth: 120, |
| | | dicUrl: '/system/dict/data/type/sys_matching_status', |
| | | }, |
| | | isCostMatched: { |
| | | label: '是否匹配成本', |
| | | type: 'select', |
| | | dataType: 'string', |
| | | minWidth: 120, |
| | | dicUrl: '/system/dict/data/type/sys_matching_status', |
| | | }, |
| | | |
| | | isCreate: { |
| | | label: '是否已入账', dataType: 'string', |
| | | type: 'select', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | dicUrl: '/system/dict/data/type/sys_whether_type', |
| | | }, |
| | | relatedBillStatus: { |
| | | minWidth: 120, |
| | | label: '关联账单状态', |
| | | dataType: 'string', |
| | | type: 'select', |
| | | dicUrl: '/system/dict/data/type/sys_related_status', |
| | | // formatter: (row, value) => { |
| | | // // 自定义格式化逻辑(如果需要) |
| | | // return value; |
| | | // } |
| | | }, |
| | | // electronicLock: { |
| | | // label: '电子锁', |
| | | // }, |