| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button v-if="!formDisabled" type="text" icon="Edit" @click="handleUpdates(scope.row)">编辑 |
| | | <el-button v-if="!formDisabled" type="text" icon="Edit" @click="handleUpdates(scope.row,scope.$index)">编辑 |
| | | </el-button> |
| | | <el-button v-if="!formDisabled" type="text" @click="handleDelte(scope.row)">删除 |
| | | <el-button v-if="!formDisabled" type="text" @click="handleDelte(scope.row,scope.$index)">删除 |
| | | </el-button> |
| | | |
| | | <el-button v-if="formDisabled" type="text" @click="handleExamine(scope.row)">查看 |
| | |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button v-if="!formDisabled" type="text" icon="Edit" |
| | | @click="handleBankUpdates(scope.row)">编辑 |
| | | @click="handleBankUpdates(scope.row, scope.$index)">编辑 |
| | | </el-button> |
| | | <el-button v-if="!formDisabled" type="text" @click="handleBankDelte(scope.row)">删除 |
| | | <el-button v-if="!formDisabled" type="text" @click="handleBankDelte(scope.row, scope.$index)">删除 |
| | | </el-button> |
| | | <el-button v-if="formDisabled" type="text" @click="handleExamine(scope.row)">查看 |
| | | </el-button> |
| | |
| | | </el-tabs> |
| | | |
| | | </div> |
| | | <CommonDialogForm :visible="isDialogVisible" title="企业发票抬头信息" :initial-data="initialFormData" |
| | | <CommonDialogForm :mode="formMode" :visible="isDialogVisible" title="企业发票抬头信息" :initial-data="initialFormData" |
| | | @close="isDialogVisible = false" @submit="handleFormSubmit" /> |
| | | |
| | | <bankAccount :visible="isDialogVisibleBank" title="客户银行账号配置" :initial-data="bankFormData" |
| | | <bankAccount :mode="formBankeMode" :visible="isDialogVisibleBank" title="客户银行账号配置" :initial-data="bankFormData" |
| | | @close="isDialogVisibleBank = false" @submit="handleBankFormSubmit" /> |
| | | |
| | | <!-- 详情弹窗:仅展示描述列表,无输入框 --> |
| | |
| | | const activeName = ref('first') |
| | | |
| | | const handleClick = (tab: TabsPaneContext, event: Event) => { |
| | | |
| | | if (router.currentRoute.value.query.formDisabled == 'true') { |
| | | if (tab.props.name == 'first') { |
| | | // 开票资料 |
| | | queryParams.value.customerId = router.currentRoute.value.query.id |
| | |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | const goToList = () => { |
| | | router.push('/customer/tmsCustomerInfo'); |
| | |
| | | // router.push({ path: '/cwgl/dzInventory' }); |
| | | } |
| | | /* 开票资料 */ |
| | | const formMode = ref<'add' | 'edit'>('add'); |
| | | const formBankeMode = ref<'add' | 'edit'>('add'); |
| | | |
| | | |
| | | const handleAdd = () => { |
| | | if (!form.value.customerFullName || form.value.customerFullName.trim() == '') { |
| | | proxy.$message.error("客户全称不能为空"); |
| | | return; |
| | | } |
| | | |
| | | formMode.value = 'add'; |
| | | isDialogVisible.value = true; |
| | | initialFormData.value = { |
| | | relatedCustomerName: form.value.customerFullName, |
| | | }; |
| | | }; |
| | | const handleUpdates = (row: any) => { |
| | | const editingIndex = ref() |
| | | const handleUpdates = (row: any,index:any) => { |
| | | // 编辑行数据 |
| | | console.log(row); |
| | | formMode.value = 'edit'; |
| | | isDialogVisible.value = true; |
| | | initialFormData.value = row; |
| | | editingIndex.value = index; // 记录索引 |
| | | } |
| | | const handleDelte = (row: any) => { |
| | | const index = invoiceInfoList.value.findIndex((item: any) => item === row); |
| | | const handleDelte = (row: any,index:any) => { |
| | | // const index = invoiceInfoList.value.findIndex((item: any) => item === row); |
| | | if (index > -1) { |
| | | invoiceInfoList.value.splice(index, 1); |
| | | } |
| | | } |
| | | const handleFormSubmit = (data: any) => { |
| | | const handleFormSubmit = (data: any,mode:any) => { |
| | | if (formMode.value === 'edit' && editingIndex.value !== null) { |
| | | // 模式1:基于索引修改(最推荐,支持未保存的新数据) |
| | | invoiceInfoList.value.splice(editingIndex.value, 1, data); |
| | | } else { |
| | | // 新增模式 |
| | | invoiceInfoList.value.push(data); |
| | | } |
| | | // 重置状态 |
| | | editingIndex.value = null; |
| | | isDialogVisible.value = false; |
| | | }; |
| | | const getList = () => { |
| | | // 获取列表数据 |
| | |
| | | const bankFormData = ref({ |
| | | |
| | | }); |
| | | |
| | | /* 银行 */ |
| | | const handleBankAdd = () => { |
| | | if (!form.value.customerFullName || form.value.customerFullName.trim() == '') { |
| | | proxy.$message.error("客户全称不能为空"); |
| | | return; |
| | | } |
| | | formBankeMode.value = 'add'; |
| | | isDialogVisibleBank.value = true; |
| | | bankFormData.value = { |
| | | relatedCustomerName: form.value.customerFullName, |
| | | }; |
| | | }; |
| | | const handleBankUpdates = (row: any) => { |
| | | const bankIndex = ref() |
| | | const handleBankUpdates = (row: any, index: any) => { |
| | | // 编辑行数据 |
| | | formBankeMode.value = 'edit'; |
| | | bankIndex.value = index; |
| | | isDialogVisibleBank.value = true; |
| | | bankFormData.value = row; |
| | | }; |
| | | const handleBankDelte = (row: any) => { |
| | | console.log(row); |
| | | const index = bankAccountConfigList.value.findIndex((item: any) => item === row); |
| | | const handleBankDelte = (row: any, index: any) => { |
| | | // const index = bankAccountConfigList.value.findIndex((item: any) => item === row); |
| | | if (index > -1) { |
| | | bankAccountConfigList.value.splice(index, 1); |
| | | } |
| | | } |
| | | const handleBankFormSubmit = (data: any) => { |
| | | console.log(data); |
| | | |
| | | if (formBankeMode.value === 'edit' && bankIndex.value !== null) { |
| | | // 模式1:基于索引修改(最推荐,支持未保存的新数据) |
| | | bankAccountConfigList.value.splice(bankIndex.value, 1, data); |
| | | } else { |
| | | // 新增模式 |
| | | bankAccountConfigList.value.push(data); |
| | | } |
| | | // 重置状态 |
| | | bankIndex.value = null; |
| | | isDialogVisibleBank.value = false; |
| | | |
| | | }; |
| | | const getDataFormat = () => { |
| | | console.log(router.currentRoute.value.query.id); |