| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" :inline="true"> |
| | | <el-form-item label="ç份"> |
| | | <el-select |
| | | v-model="searchForm.provinceId" |
| | | placeholder="è¯·éæ©ç份" |
| | | clearable |
| | | filterable |
| | | style="width: 180px" |
| | | @change="handleSearchProvinceChange" |
| | | > |
| | | <el-option |
| | | v-for="item in provinceOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åå¸"> |
| | | <el-select |
| | | v-model="searchForm.cityId" |
| | | placeholder="è¯·éæ©åå¸" |
| | | clearable |
| | | filterable |
| | | style="width: 180px" |
| | | @change="handleQuery" |
| | | > |
| | | <el-option |
| | | v-for="item in searchCityOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·åç§°"> |
| | | <el-select |
| | | v-model="searchForm.customerName" |
| | | placeholder="è¯·éæ©å®¢æ·åç§°" |
| | | clearable |
| | | filterable |
| | | style="width: 200px" |
| | | @change="handleQuery" |
| | | > |
| | | <el-option |
| | | v-for="item in customerOptions" |
| | | :key="item.id || item.customerName" |
| | | :label="item.customerName" |
| | | :value="item.customerName" |
| | | > |
| | | {{ item.customerName }}{{ item.taxpayerIdentificationNumber ? ` - ${item.taxpayerIdentificationNumber}` : "" }} |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å½å
¥äºº"> |
| | | <el-input |
| | | v-model="searchForm.entryPerson" |
| | | placeholder="请è¾å
¥å½å
¥äºº" |
| | | clearable |
| | | style="width: 180px" |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å½å
¥æ¥æ"> |
| | | <el-date-picker |
| | | v-model="searchForm.entryDateRange" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | clearable |
| | | @change="changeDateRange" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">æç´¢</el-button> |
| | | <el-button @click="resetQuery">éç½®</el-button> |
| | | <el-button type="primary" @click="handleAdd">æ°å¢</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table_list"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | stripe |
| | | v-loading="tableLoading" |
| | | height="calc(100vh - 18.5em)" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" fixed="left" /> |
| | | <el-table-column type="index" label="åºå·" width="60" align="center" fixed="left" /> |
| | | <el-table-column prop="province" label="ç份" min-width="120" /> |
| | | <el-table-column prop="city" label="åå¸" min-width="120" /> |
| | | <el-table-column prop="customerName" label="客æ·åç§°" min-width="220" show-overflow-tooltip /> |
| | | <el-table-column prop="contractAmount" label="䏿 éé¢" min-width="130" /> |
| | | <el-table-column prop="bidBond" label="ææ ä¿è¯é" min-width="130" /> |
| | | <el-table-column prop="winningServiceFee" label="䏿 æå¡è´¹" min-width="130" /> |
| | | <el-table-column prop="remark" label="夿³¨" min-width="180" show-overflow-tooltip /> |
| | | <el-table-column prop="entryPerson" label="å½å
¥äºº" min-width="100" /> |
| | | <el-table-column prop="entryDate" label="å½å
¥æ¥æ" min-width="120" /> |
| | | <el-table-column prop="updateTime" label="ä¿®æ¹æ¶é´" min-width="170" /> |
| | | <el-table-column fixed="right" label="æä½" width="180" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button link type="primary" size="small" @click="handleEdit(row)"> |
| | | ç¼è¾ |
| | | </el-button> |
| | | <el-button link type="primary" size="small" @click="handleDetail(row)"> |
| | | 详æ
|
| | | </el-button> |
| | | <el-button link type="danger" size="small" @click="handleDelete(row)"> |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationChange" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | :title="dialogTitle" |
| | | width="900px" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form |
| | | ref="formRef" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="100px" |
| | | :disabled="dialogMode === 'detail'" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="客æ·åç§°" prop="customerName"> |
| | | <el-select |
| | | v-model="form.customerName" |
| | | placeholder="è¯·éæ©å®¢æ·åç§°" |
| | | clearable |
| | | filterable |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in customerOptions" |
| | | :key="item.id || item.customerName" |
| | | :label="item.customerName" |
| | | :value="item.customerName" |
| | | > |
| | | {{ item.customerName }}{{ item.taxpayerIdentificationNumber ? ` - ${item.taxpayerIdentificationNumber}` : "" }} |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç份" prop="provinceId"> |
| | | <el-select |
| | | v-model="form.provinceId" |
| | | placeholder="è¯·éæ©ç份" |
| | | filterable |
| | | style="width: 100%" |
| | | @change="handleFormProvinceChange" |
| | | > |
| | | <el-option |
| | | v-for="item in provinceOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åå¸" prop="cityId"> |
| | | <el-select |
| | | v-model="form.cityId" |
| | | placeholder="è¯·éæ©åå¸" |
| | | filterable |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in cityOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="䏿 éé¢" prop="contractAmount"> |
| | | <el-input-number |
| | | v-model="form.contractAmount" |
| | | :min="0" |
| | | :precision="2" |
| | | style="width: 100%" |
| | | controls-position="right" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ææ ä¿è¯é" prop="bidBond"> |
| | | <el-input-number |
| | | v-model="form.bidBond" |
| | | :min="0" |
| | | :precision="2" |
| | | style="width: 100%" |
| | | controls-position="right" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="䏿 æå¡è´¹" prop="winningServiceFee"> |
| | | <el-input-number |
| | | v-model="form.winningServiceFee" |
| | | :min="0" |
| | | :precision="2" |
| | | style="width: 100%" |
| | | controls-position="right" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½å
¥äºº" prop="entryPerson"> |
| | | <el-select |
| | | v-model="form.entryPerson" |
| | | placeholder="è¯·éæ©å½å
¥äºº" |
| | | filterable |
| | | allow-create |
| | | default-first-option |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in userOptions" |
| | | :key="item.userId || item.nickName" |
| | | :label="item.nickName" |
| | | :value="item.nickName" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½å
¥æ¥æ" prop="entryDate"> |
| | | <el-date-picker |
| | | v-model="form.entryDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | placeholder="è¯·éæ©å½å
¥æ¥æ" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | type="textarea" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å¤æ³¨" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="éä»¶" v-if="dialogMode !== 'detail'"> |
| | | <el-upload |
| | | ref="fileUploadRef" |
| | | v-model:file-list="fileList" |
| | | :action="upload.url" |
| | | :headers="upload.headers" |
| | | :data="upload.data" |
| | | multiple |
| | | auto-upload |
| | | :before-upload="handleBeforeUpload" |
| | | :on-success="handleUploadSuccess" |
| | | :on-error="handleUploadError" |
| | | :on-remove="handleRemove" |
| | | > |
| | | <el-button type="primary">ä¸ä¼ éä»¶</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">æ¯æå¸¸è§åå
¬ææ¡£ä¸å¾çæ ¼å¼</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | |
| | | <div v-if="dialogMode === 'detail'"> |
| | | <el-divider content-position="left">éä»¶</el-divider> |
| | | <el-table :data="form.commonFiles || []" border stripe empty-text="ææ éä»¶"> |
| | | <el-table-column prop="name" label="éä»¶åç§°" min-width="300" show-overflow-tooltip /> |
| | | <el-table-column label="æä½" width="160" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button link type="primary" size="small" @click="downloadFile(row)"> |
| | | ä¸è½½ |
| | | </el-button> |
| | | <el-button link type="primary" size="small" @click="previewFile(row)"> |
| | | é¢è§ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <filePreview ref="filePreviewRef" /> |
| | | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="closeDialog">åæ¶</el-button> |
| | | <el-button type="primary" v-if="dialogMode !== 'detail'" @click="submitForm"> |
| | | ç¡®å® |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, getCurrentInstance, onMounted, reactive, ref } from "vue"; |
| | | import dayjs from "dayjs"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import filePreview from "@/components/filePreview/index.vue"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { userListNoPage } from "@/api/system/user"; |
| | | import { customerList } from "@/api/salesManagement/salesLedger"; |
| | | import { |
| | | bidWinningLedgerAdd, |
| | | bidWinningLedgerDelete, |
| | | bidWinningLedgerDetail, |
| | | bidWinningLedgerListPage, |
| | | bidWinningLedgerUpdate, |
| | | getCityList, |
| | | getProvinceList, |
| | | } from "@/api/salesManagement/bidWinningLedger"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const selectedRows = ref([]); |
| | | const total = ref(0); |
| | | const userOptions = ref([]); |
| | | const customerOptions = ref([]); |
| | | const provinceOptions = ref([]); |
| | | const cityOptions = ref([]); |
| | | const searchCityOptions = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const dialogMode = ref("add"); |
| | | const formRef = ref(); |
| | | const fileUploadRef = ref(); |
| | | const filePreviewRef = ref(); |
| | | const fileList = ref([]); |
| | | |
| | | const upload = reactive({ |
| | | url: `${import.meta.env.VITE_APP_BASE_API}/file/upload`, |
| | | headers: { |
| | | Authorization: `Bearer ${getToken()}`, |
| | | }, |
| | | data: { |
| | | type: 10, |
| | | }, |
| | | }); |
| | | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 20, |
| | | }); |
| | | |
| | | const createSearchForm = () => ({ |
| | | provinceId: "", |
| | | cityId: "", |
| | | customerName: "", |
| | | entryPerson: "", |
| | | entryDateRange: [], |
| | | entryDateStart: "", |
| | | entryDateEnd: "", |
| | | }); |
| | | |
| | | const createFormData = () => ({ |
| | | id: undefined, |
| | | province: "", |
| | | city: "", |
| | | provinceId: "", |
| | | cityId: "", |
| | | customerName: "", |
| | | contractAmount: undefined, |
| | | bidBond: undefined, |
| | | winningServiceFee: undefined, |
| | | remark: "", |
| | | entryPerson: userStore.nickName || "", |
| | | entryDate: dayjs().format("YYYY-MM-DD"), |
| | | commonFiles: [], |
| | | tempFileIds: [], |
| | | }); |
| | | |
| | | const searchForm = reactive(createSearchForm()); |
| | | const form = reactive(createFormData()); |
| | | |
| | | const rules = reactive({ |
| | | provinceId: [{ required: true, message: "è¯·éæ©ç份", trigger: "change" }], |
| | | cityId: [{ required: true, message: "è¯·éæ©åå¸", trigger: "change" }], |
| | | customerName: [{ required: true, message: "è¯·éæ©å®¢æ·åç§°", trigger: "change" }], |
| | | entryPerson: [{ required: true, message: "è¯·éæ©å½å
¥äºº", trigger: "change" }], |
| | | entryDate: [{ required: true, message: "è¯·éæ©å½å
¥æ¥æ", trigger: "change" }], |
| | | }); |
| | | |
| | | const dialogTitle = computed(() => { |
| | | if (dialogMode.value === "add") return "æ°å¢ä¸æ å°è´¦"; |
| | | if (dialogMode.value === "edit") return "ç¼è¾ä¸æ å°è´¦"; |
| | | return "䏿 å°è´¦è¯¦æ
"; |
| | | }); |
| | | |
| | | const getOptionName = (options, id) => { |
| | | const target = options.find((item) => String(item.id) === String(id)); |
| | | return target?.name || ""; |
| | | }; |
| | | |
| | | const buildQueryParams = () => { |
| | | const params = { |
| | | current: page.current, |
| | | size: page.size, |
| | | customerName: searchForm.customerName, |
| | | entryPerson: searchForm.entryPerson, |
| | | province: getOptionName(provinceOptions.value, searchForm.provinceId), |
| | | city: getOptionName(searchCityOptions.value, searchForm.cityId), |
| | | }; |
| | | |
| | | if (searchForm.entryDateStart) { |
| | | params.entryDateStart = searchForm.entryDateStart; |
| | | } |
| | | if (searchForm.entryDateEnd) { |
| | | params.entryDateEnd = searchForm.entryDateEnd; |
| | | } |
| | | |
| | | Object.keys(params).forEach((key) => { |
| | | if (params[key] === "" || params[key] === undefined || params[key] === null) { |
| | | delete params[key]; |
| | | } |
| | | }); |
| | | |
| | | return params; |
| | | }; |
| | | |
| | | const getList = async () => { |
| | | tableLoading.value = true; |
| | | try { |
| | | const res = await bidWinningLedgerListPage(buildQueryParams()); |
| | | tableData.value = res?.data?.records || []; |
| | | total.value = res?.data?.total || 0; |
| | | } finally { |
| | | tableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | const loadProvinceOptions = async () => { |
| | | const res = await getProvinceList(); |
| | | provinceOptions.value = res?.data || []; |
| | | }; |
| | | |
| | | const loadCityOptions = async (provinceId, target = "form") => { |
| | | if (!provinceId) { |
| | | if (target === "form") { |
| | | cityOptions.value = []; |
| | | } else { |
| | | searchCityOptions.value = []; |
| | | } |
| | | return []; |
| | | } |
| | | const res = await getCityList({ provinceId }); |
| | | const list = res?.data || []; |
| | | if (target === "form") { |
| | | cityOptions.value = list; |
| | | } else { |
| | | searchCityOptions.value = list; |
| | | } |
| | | return list; |
| | | }; |
| | | |
| | | const loadUserOptions = async () => { |
| | | const res = await userListNoPage(); |
| | | userOptions.value = res?.data || []; |
| | | }; |
| | | |
| | | const loadCustomerOptions = async () => { |
| | | const res = await customerList(); |
| | | customerOptions.value = res || []; |
| | | }; |
| | | |
| | | const changeDateRange = (value) => { |
| | | if (value?.length === 2) { |
| | | searchForm.entryDateStart = value[0]; |
| | | searchForm.entryDateEnd = value[1]; |
| | | } else { |
| | | searchForm.entryDateStart = ""; |
| | | searchForm.entryDateEnd = ""; |
| | | } |
| | | handleQuery(); |
| | | }; |
| | | |
| | | const handleSearchProvinceChange = async () => { |
| | | searchForm.cityId = ""; |
| | | await loadCityOptions(searchForm.provinceId, "search"); |
| | | handleQuery(); |
| | | }; |
| | | |
| | | const handleFormProvinceChange = async () => { |
| | | form.cityId = ""; |
| | | await loadCityOptions(form.provinceId, "form"); |
| | | }; |
| | | |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const resetQuery = async () => { |
| | | Object.assign(searchForm, createSearchForm()); |
| | | searchCityOptions.value = []; |
| | | page.current = 1; |
| | | await getList(); |
| | | }; |
| | | |
| | | const paginationChange = ({ page: current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | | getList(); |
| | | }; |
| | | |
| | | const handleSelectionChange = (rows) => { |
| | | selectedRows.value = rows; |
| | | }; |
| | | |
| | | const resetFormState = () => { |
| | | Object.assign(form, createFormData()); |
| | | cityOptions.value = []; |
| | | fileList.value = []; |
| | | formRef.value?.clearValidate(); |
| | | }; |
| | | |
| | | const mapNameToId = (options, name) => { |
| | | const target = options.find((item) => item.name === name); |
| | | return target?.id || ""; |
| | | }; |
| | | |
| | | const openDialog = async (mode, row) => { |
| | | dialogMode.value = mode; |
| | | resetFormState(); |
| | | await Promise.all([loadUserOptions(), loadProvinceOptions(), loadCustomerOptions()]); |
| | | |
| | | if (mode === "add") { |
| | | dialogVisible.value = true; |
| | | return; |
| | | } |
| | | |
| | | const res = await bidWinningLedgerDetail({ id: row.id }); |
| | | const detail = res?.data || {}; |
| | | |
| | | Object.assign(form, detail, { |
| | | entryDate: detail.entryDate ? dayjs(detail.entryDate).format("YYYY-MM-DD") : "", |
| | | commonFiles: detail.commonFiles || [], |
| | | }); |
| | | |
| | | form.provinceId = mapNameToId(provinceOptions.value, detail.province); |
| | | await loadCityOptions(form.provinceId, "form"); |
| | | form.cityId = mapNameToId(cityOptions.value, detail.city); |
| | | fileList.value = (detail.commonFiles || []).map((item) => ({ |
| | | name: item.name, |
| | | url: item.url, |
| | | id: item.id, |
| | | })); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleAdd = () => { |
| | | openDialog("add"); |
| | | }; |
| | | |
| | | const handleEdit = (row) => { |
| | | openDialog("edit", row); |
| | | }; |
| | | |
| | | const handleDetail = (row) => { |
| | | openDialog("detail", row); |
| | | }; |
| | | |
| | | const buildSubmitData = () => { |
| | | const tempFileIds = fileList.value |
| | | .map((item) => item.tempId) |
| | | .filter((item) => item !== undefined && item !== null && item !== ""); |
| | | |
| | | return { |
| | | id: form.id, |
| | | province: getOptionName(provinceOptions.value, form.provinceId), |
| | | city: getOptionName(cityOptions.value, form.cityId), |
| | | customerName: form.customerName, |
| | | contractAmount: form.contractAmount, |
| | | bidBond: form.bidBond, |
| | | winningServiceFee: form.winningServiceFee, |
| | | remark: form.remark, |
| | | entryPerson: form.entryPerson, |
| | | entryDate: form.entryDate, |
| | | tempFileIds, |
| | | }; |
| | | }; |
| | | |
| | | const submitForm = () => { |
| | | formRef.value.validate(async (valid) => { |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | |
| | | const api = dialogMode.value === "edit" ? bidWinningLedgerUpdate : bidWinningLedgerAdd; |
| | | await api(buildSubmitData()); |
| | | proxy.$modal.msgSuccess(dialogMode.value === "edit" ? "ä¿®æ¹æå" : "æ°å¢æå"); |
| | | closeDialog(); |
| | | getList(); |
| | | }); |
| | | }; |
| | | |
| | | const handleDelete = (row) => { |
| | | const ids = row ? [row.id] : selectedRows.value.map((item) => item.id); |
| | | if (!ids.length) { |
| | | proxy.$modal.msgWarning("è¯·éæ©è¦å é¤ç䏿 å°è´¦"); |
| | | return; |
| | | } |
| | | |
| | | ElMessageBox.confirm("确认å é¤éä¸ç䏿 å°è´¦åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | await bidWinningLedgerDelete(ids); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false; |
| | | resetFormState(); |
| | | }; |
| | | |
| | | const handleBeforeUpload = () => { |
| | | proxy.$modal.loading("æ£å¨ä¸ä¼ æä»¶ï¼è¯·ç¨å..."); |
| | | return true; |
| | | }; |
| | | |
| | | const handleUploadSuccess = (res, file) => { |
| | | proxy.$modal.closeLoading(); |
| | | if (res.code === 200) { |
| | | file.tempId = res.data?.tempId; |
| | | proxy.$modal.msgSuccess("ä¸ä¼ æå"); |
| | | } else { |
| | | proxy.$modal.msgError(res.msg || "ä¸ä¼ 失败"); |
| | | fileUploadRef.value?.handleRemove(file); |
| | | } |
| | | }; |
| | | |
| | | const handleUploadError = () => { |
| | | proxy.$modal.closeLoading(); |
| | | proxy.$modal.msgError("ä¸ä¼ 失败"); |
| | | }; |
| | | |
| | | const handleRemove = () => {}; |
| | | |
| | | const downloadFile = (row) => { |
| | | if (row?.url) { |
| | | proxy.$download.name(row.url); |
| | | } |
| | | }; |
| | | |
| | | const previewFile = (row) => { |
| | | if (row?.url) { |
| | | filePreviewRef.value.open(row.url); |
| | | } |
| | | }; |
| | | |
| | | onMounted(async () => { |
| | | await Promise.all([loadProvinceOptions(), loadUserOptions(), loadCustomerOptions()]); |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | |
| | | .dialog-footer { |
| | | text-align: right; |
| | | } |
| | | |
| | | :deep(.el-input-number) { |
| | | width: 100%; |
| | | } |
| | | </style> |