| | |
| | | </el-tabs> |
| | | <!-- 操作按钮区 --> |
| | | <el-space> |
| | | <el-button type="primary" @click="openForm('add')">新增应收</el-button> |
| | | <el-button type="primary" :icon="Plus" @click="openDia(undefined, 'add')">新建</el-button> |
| | | <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button> |
| | | <el-button type="info" plain :icon="Download" @click="handleExport">导出</el-button> |
| | |
| | | /> |
| | | </el-card> |
| | | <form-dia ref="formDia" @closeDia="handleQuery"></form-dia> |
| | | |
| | | <!-- 新增应收弹窗 --> |
| | | <el-dialog |
| | | v-model="dialogFormVisible" |
| | | title="新增应收" |
| | | width="70%" |
| | | @close="closeDia" |
| | | > |
| | | <el-form |
| | | :model="former" |
| | | label-width="140px" |
| | | label-position="top" |
| | | :rules="rules" |
| | | ref="formRef" |
| | | > |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户名称:" prop="customer"> |
| | | <el-input |
| | | v-model="former.customer" |
| | | placeholder="自动填充" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="煤种:" prop="coal"> |
| | | <el-input |
| | | v-model="former.coal" |
| | | placeholder="自动填充" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售总金额(元):" prop="totalAmount"> |
| | | <el-input |
| | | type="number" |
| | | v-model="former.totalAmount" |
| | | placeholder="自动填充" |
| | | :step="0.01" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="本次应收金额:" prop="receiptPaymentAmount"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | :precision="2" |
| | | v-model="former.receiptPaymentAmount" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="回款形式:" prop="receiptPaymentType"> |
| | | <el-select |
| | | v-model="former.receiptPaymentType" |
| | | placeholder="请选择" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in receipt_payment_type" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="登记人:" prop="registrant"> |
| | | <el-input |
| | | v-model="former.registrant" |
| | | placeholder="请输入" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="来款日期:" prop="receiptPaymentDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="former.receiptPaymentDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="请选择" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, reactive, onMounted} from "vue"; |
| | | import {ref, reactive, onMounted, nextTick} from "vue"; |
| | | const { proxy } = getCurrentInstance() |
| | | const { receipt_payment_type } = proxy.useDict("receipt_payment_type"); |
| | | import {Delete, Download, Plus} from "@element-plus/icons-vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import ETable from "@/components/Table/ETable.vue"; |
| | | import Pagination from "@/components/Pagination/index.vue"; |
| | | import FormDia from "@/views/salesOutbound/components/formDia.vue"; |
| | | import {delSalesRecord, salesRecordList} from "@/api/salesOutbound/index.js"; |
| | | import { |
| | | receiptPaymentSaveOrUpdate, |
| | | bindInvoiceNoRegPage, |
| | | invoiceInfo, |
| | | receiptPaymentHistoryListNoPage, |
| | | receiptPaymentDel, |
| | | } from "@/api/salesManagement/receiptPayment.js"; |
| | | |
| | | |
| | | const formDia = ref() |
| | | const activeTab = ref("out"); |
| | |
| | | // 表格数据 |
| | | const operationsArr = ref(['edit', 'viewRow']); |
| | | const tableLoading = ref(false); |
| | | const dialogFormVisible = ref(false); |
| | | const tableData = ref([]); |
| | | const columns = ref([ |
| | | { prop: "saleDate", label: "销售日期", minWidth: 160 }, |
| | |
| | | const total = ref(0); |
| | | const pageNum = ref(1); |
| | | const pageSize = ref(10); |
| | | const former = ref({}) |
| | | |
| | | // 查询参数 |
| | | const queryParams = reactive({ |
| | | saleDate: "", |
| | |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | // 打开弹框 |
| | | const openForm = () => { |
| | | if (selectedRows.value.length !== 1) { |
| | | proxy.$modal.msgError("请选择一条数据"); |
| | | return; |
| | | } |
| | | invoiceInfo({ id: selectedRows.value[0].id }).then((res) => { |
| | | console.log(res.data) |
| | | former.value = { ...res.data }; |
| | | former.value.salesRecordId = former.value.id; |
| | | former.value.id = ""; |
| | | // form.value.registrant = userStore.nickName; |
| | | }); |
| | | dialogFormVisible.value = true; |
| | | }; |
| | | // 提交表单 |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate((valid) => { |
| | | if (valid) { |
| | | receiptPaymentSaveOrUpdate(former.value).then((res) => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeDia(); |
| | | getList(); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | // 关闭弹框 |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |