| | |
| | | "LC": { |
| | | "env": { |
| | | "VITE_APP_TITLE": "工忰ååMOMç³»ç»", |
| | | "VITE_BASE_API": "http://1.15.17.182:9054", |
| | | "VITE_JAVA_API": "http://1.15.17.182:9055" |
| | | "VITE_BASE_API": "http://1.15.17.182:9055", |
| | | "VITE_JAVA_API": "http://1.15.17.182:9054" |
| | | }, |
| | | "logo": "logo/logo.png", |
| | | "favicon": "favicon/favicon.ico" |
| | |
| | | |
| | | const envFilePath = path.join(process.cwd(), '.env.production.local'); |
| | | |
| | | async function copyFileWithOverwrite(src, dest) { |
| | | await fs.mkdir(path.dirname(dest), { recursive: true }); |
| | | if (fsSync.existsSync(dest)) { |
| | | try { |
| | | await fs.chmod(dest, 0o666); |
| | | } catch { |
| | | // Ignore chmod failure and try delete directly. |
| | | } |
| | | await fs.rm(dest, { force: true }); |
| | | } |
| | | await fs.copyFile(src, dest); |
| | | } |
| | | |
| | | try { |
| | | // 1ï¸â£ çæ .env |
| | | console.log("=======çæ.env======="); |
| | |
| | | const backupFile = path.join(replacePath, config[key]); |
| | | const replaceFile = path.join(resourcePath, companyMap[key]); |
| | | |
| | | await fs.mkdir(path.dirname(backupFile), { recursive: true }); |
| | | await fs.copyFile(originFile, backupFile); |
| | | await fs.copyFile(replaceFile, originFile); |
| | | await copyFileWithOverwrite(originFile, backupFile); |
| | | await copyFileWithOverwrite(replaceFile, originFile); |
| | | } |
| | | |
| | | console.log("=====å¼å§æå
======"); |
| | |
| | | const originFile = path.join(rootPath, config[key]); |
| | | const backupFile = path.join(replacePath, config[key]); |
| | | |
| | | await fs.copyFile(backupFile, originFile); |
| | | await copyFileWithOverwrite(backupFile, originFile); |
| | | } |
| | | await fs.rm(replacePath, { recursive: true, force: true }); |
| | | console.log(`ðï¸ å·²å é¤ ${replacePath}`); |
| | |
| | | }) |
| | | } |
| | | |
| | | // æµå
¥å
¬æµ· |
| | | export function backCustomer(id) { |
| | | return request({ |
| | | url: '/basic/customer/back/' + id, |
| | | method: 'post' |
| | | }) |
| | | } |
| | | |
| | | export function shareCustomer(data) { |
| | | return request({ |
| | | url: '/basic/customer/together', |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | /** éè´å
¥åºå页å表 */ |
| | | export const listPageAccountPurchase = (params) => { |
| | | return request({ |
| | | url: "/accountPurchase/listPageAccountPurchase", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | | |
| | | /** éè´éè´§å页å表 */ |
| | | export const listPageAccountPurchaseReturn = (params) => { |
| | | return request({ |
| | | url: "/accountPurchase/listPageAccountPurchaseReturn", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | /** éå®åºåºå页å表 */ |
| | | export const listPageAccountSales = (params) => { |
| | | return request({ |
| | | url: "/accountSales/listPageAccountSales", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | | |
| | | /** éå®éè´§å页å表 */ |
| | | export const listPageAccountSalesReturn = (params) => { |
| | | return request({ |
| | | url: "/accountSales/listPageAccountSalesReturn", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | |
| | | import purchaseAssistantAvatar from '@/assets/AI/éè´å©æ.png' |
| | | import productionAssistantAvatar from '@/assets/AI/çäº§å©æ.png' |
| | | import financeAssistantAvatar from '@/assets/AI/è´¢å¡å©æ.png' |
| | | import bossAssistantAvatar from '@/assets/AI/èæ¿å©æ.png' |
| | | import bossAssistantAvatar from '@/assets/AI/å¾
å婿.png' |
| | | |
| | | const emit = defineEmits(['header-extra-action']) |
| | | |
| | |
| | | if (visibleValue === undefined || visibleValue === null) return clonePurchasePayloadValue(hiddenValue) |
| | | |
| | | if (Array.isArray(visibleValue) && Array.isArray(hiddenValue)) { |
| | | const maxLength = Math.max(visibleValue.length, hiddenValue.length) |
| | | const merged = [] |
| | | for (let i = 0; i < maxLength; i++) { |
| | | merged[i] = mergePurchasePayloadWithHidden(visibleValue[i], hiddenValue[i]) |
| | | } |
| | | return merged |
| | | return visibleValue.map((item, index) => mergePurchasePayloadWithHidden(item, hiddenValue[index])) |
| | | } |
| | | |
| | | if ( |
| | |
| | | '' |
| | | } |
| | | |
| | | const prunePurchaseProductRecord = (record) => { |
| | | if (!record || typeof record !== 'object' || Array.isArray(record)) return null |
| | | const normalizedRecord = normalizePurchaseProductRecord(record) |
| | | const hasVisibleFieldValue = Object.entries(normalizedRecord).some(([key, value]) => { |
| | | if (shouldHidePurchaseField(key)) return false |
| | | return hasMeaningfulPayloadValue(value) |
| | | }) |
| | | return hasVisibleFieldValue ? normalizedRecord : null |
| | | } |
| | | |
| | | const normalizeAndFilterPurchaseProductData = (value) => { |
| | | if (!Array.isArray(value)) return value |
| | | return value |
| | | .map(item => prunePurchaseProductRecord(item)) |
| | | .filter(Boolean) |
| | | } |
| | | |
| | | const mergeLegacyProductDataIntoLedgers = (payload) => { |
| | | if (!payload || typeof payload !== 'object' || Array.isArray(payload)) return payload |
| | | if (!Array.isArray(payload.purchaseLedgers) || !Array.isArray(payload.productData) || !payload.productData.length) { |
| | |
| | | |
| | | const ledgers = payload.purchaseLedgers.map(ledger => ({ |
| | | ...ledger, |
| | | productData: Array.isArray(ledger.productData) |
| | | ? ledger.productData.map(normalizePurchaseProductRecord) |
| | | : [] |
| | | productData: normalizeAndFilterPurchaseProductData(ledger.productData) || [] |
| | | })) |
| | | const unmatchedProducts = [] |
| | | |
| | | payload.productData.map(normalizePurchaseProductRecord).forEach(product => { |
| | | normalizeAndFilterPurchaseProductData(payload.productData).forEach(product => { |
| | | const productMatchKey = getPurchaseProductMatchKey(product) |
| | | const matchedLedger = ledgers.find(ledger => { |
| | | const ledgerKeys = [ |
| | |
| | | if (!record || typeof record !== 'object' || Array.isArray(record)) return record |
| | | const normalizedRecord = { |
| | | ...record, |
| | | productData: Array.isArray(record.productData) |
| | | ? record.productData.map(normalizePurchaseProductRecord) |
| | | : record.productData |
| | | productData: normalizeAndFilterPurchaseProductData(record.productData) |
| | | } |
| | | return Object.entries(normalizedRecord).reduce((result, [key, value]) => { |
| | | if (purchaseLedgerAllowedFieldKeys.has(key)) { |
| | |
| | | if (Array.isArray(sanitized.purchaseLedgers)) { |
| | | sanitized.purchaseLedgers = sanitized.purchaseLedgers.map(filterPurchaseLedgerRecord) |
| | | } |
| | | if (Array.isArray(sanitized.productData)) { |
| | | sanitized.productData = normalizeAndFilterPurchaseProductData(sanitized.productData) |
| | | } |
| | | if (Array.isArray(sanitized.productData) && !sanitized.productData.length) { |
| | | delete sanitized.productData |
| | | } |
| | | |
| | | purchaseApprovalFieldKeys.forEach(key => { |
| | | if (!Array.isArray(sanitized)) { |
| | |
| | | <el-table-column v-if="showActions" |
| | | fixed="right" |
| | | label="æä½" |
| | | :width="120" |
| | | :width="150" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-button link |
| | | type="primary" |
| | | size="small" |
| | | class="download-link" |
| | | @click="previewFile(scope.row.previewURL)"> |
| | | é¢è§ |
| | | </el-button> |
| | | <el-button link |
| | | type="primary" |
| | | size="small" |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-dialog> |
| | | <filePreview ref="filePreviewRef" /> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ElMessage } from 'element-plus' |
| | | import { ref, computed, getCurrentInstance, onMounted, watch } from "vue"; |
| | | import AttachmentUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | import { |
| | |
| | | deleteAttachment, |
| | | createAttachment, |
| | | } from "@/api/basicData/storageAttachment.js"; |
| | | import filePreview from '@/components/filePreview/index.vue' |
| | | const filePreviewRef = ref() |
| | | |
| | | const props = defineProps({ |
| | | visible: { |
| | |
| | | isShow.value = false; |
| | | }; |
| | | |
| | | // é¢è§æä»¶ |
| | | const previewFile = (url) => { |
| | | if (url) { |
| | | filePreviewRef.value.open(url) |
| | | } else { |
| | | ElMessage.warning('æä»¶å°åæ æï¼æ æ³é¢è§') |
| | | } |
| | | } |
| | | |
| | | const handleUpload = () => { |
| | | uploadDialogVisible.value = true; |
| | | }; |
| | |
| | | const saveUpload = async () => { |
| | | // æ£æ¥æ¯å¦ææ°ä¸ä¼ çæä»¶ |
| | | if (newFileList.value.length > 0) { |
| | | try { |
| | | await createAttachment({ |
| | | application: "file", |
| | | recordType: props.recordType, |
| | | recordId: props.recordId, |
| | | storageBlobDTOs: [...newFileList.value, ...tableData.value], |
| | | }); |
| | | newFileList.value = []; |
| | | // å·æ°å表 |
| | | setList(); |
| | | } catch (error) { |
| | | proxy?.$modal?.msgError("ä¸ä¼ 失败"); |
| | | } |
| | | createAttachment({ |
| | | application: "file", |
| | | recordType: props.recordType, |
| | | recordId: props.recordId, |
| | | storageBlobDTOs: [...newFileList.value, ...tableData.value], |
| | | }).then((res) => { |
| | | if (res && res.code === 200) { |
| | | proxy?.$modal?.msgSuccess("ä¸ä¼ æå"); |
| | | newFileList.value = []; |
| | | // å·æ°å表 |
| | | setList(); |
| | | } |
| | | }).finally(() => { |
| | | uploadDialogVisible.value = false; |
| | | }) |
| | | } |
| | | uploadDialogVisible.value = false; |
| | | }; |
| | | } |
| | | |
| | | const closeUpload = () => { |
| | | newFileList.value = []; |
| | |
| | | }; |
| | | |
| | | const handleDelete = async (row, index) => { |
| | | try { |
| | | await deleteAttachment([row.storageAttachmentId]); |
| | | proxy?.$modal?.msgSuccess("å 餿å"); |
| | | setList(); |
| | | } catch (error) { |
| | | proxy?.$modal?.msgError("å é¤å¤±è´¥"); |
| | | } |
| | | deleteAttachment([row.storageAttachmentId]).then((res) => { |
| | | if (res && res.code === 200) { |
| | | proxy?.$modal?.msgSuccess("å 餿å"); |
| | | setList(); |
| | | } |
| | | }) |
| | | }; |
| | | |
| | | const setList = () => { |
| | |
| | | recordType: props.recordType, |
| | | recordId: props.recordId, |
| | | }).then(res => { |
| | | if (res && res.data) { |
| | | tableData.value = res.data || []; |
| | | } |
| | | tableData.value = (res && res.data) || []; |
| | | }); |
| | | }; |
| | | |
| | |
| | | transformData: (workbookData) => workbookData, |
| | | }); |
| | | |
| | | // 计ç®å±æ§ - 夿æä»¶ç±»å |
| | | // 计ç®å±æ§ - 夿æä»¶ç±»åï¼æ¯æURL带æ¥è¯¢åæ°ï¼ |
| | | const isImage = computed(() => { |
| | | const state = /\.(jpg|jpeg|png|gif)$/i.test(fileUrl.value); |
| | | const state = /\.(jpg|jpeg|png|gif)(\?.*)?$/i.test(fileUrl.value); |
| | | if (state) { |
| | | imgUrl.value = fileUrl.value.replaceAll('word', 'img'); |
| | | } |
| | |
| | | |
| | | const isPdf = computed(() => { |
| | | console.log(fileUrl.value) |
| | | return /\.pdf$/i.test(fileUrl.value); |
| | | return /\.pdf(\?.*)?$/i.test(fileUrl.value); |
| | | }); |
| | | |
| | | const isDoc = computed(() => { |
| | | return /\.(doc|docx)$/i.test(fileUrl.value); |
| | | return /\.(doc|docx)(\?.*)?$/i.test(fileUrl.value); |
| | | }); |
| | | |
| | | const isXls = computed(() => { |
| | | const state = /\.(xls|xlsx)$/i.test(fileUrl.value); |
| | | const state = /\.(xls|xlsx)(\?.*)?$/i.test(fileUrl.value); |
| | | if (state) { |
| | | options.value.xls = /\.(xls)$/i.test(fileUrl.value); |
| | | options.value.xls = /\.(xls)(\?.*)?$/i.test(fileUrl.value); |
| | | } |
| | | return state; |
| | | }); |
| | | |
| | | const isZipOrRar = computed(() => { |
| | | return /\.(zip|rar)$/i.test(fileUrl.value); |
| | | return /\.(zip|rar)(\?.*)?$/i.test(fileUrl.value); |
| | | }); |
| | | |
| | | const isSupported = computed(() => { |
| | |
| | | import axios from "axios";
|
| | | import axios from "axios";
|
| | | import { ElLoading, ElMessage } from "element-plus";
|
| | | import { saveAs } from "file-saver";
|
| | | import { getToken } from "@/utils/auth";
|
| | |
| | | saveAs(text, name, opts) {
|
| | | saveAs(text, name, opts);
|
| | | },
|
| | | byUrl(url, filename) {
|
| | | // å°URLä¸çpreviewæ¿æ¢ædownload
|
| | | const downloadUrl = url.replace(/preview/g, 'download')
|
| | | const link = document.createElement('a')
|
| | | link.href = downloadUrl
|
| | | link.download = filename || ''
|
| | | document.body.appendChild(link)
|
| | | link.click()
|
| | | document.body.removeChild(link)
|
| | | },
|
| | | async printErrMsg(data) {
|
| | | const resText = await data.text();
|
| | | const rspObj = JSON.parse(resText);
|
| | |
| | | name: "DeviceInfo", |
| | | meta: { title: "设å¤ä¿¡æ¯", icon: "monitor" }, |
| | | }, |
| | | // æ·»å 项ç®è¯¦æ
页é¢è·¯ç±é
ç½® |
| | | { |
| | | path: "/oaSystem/projectManagement/projectDetail", |
| | | component: Layout, |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: ":projectId", |
| | | component: () => import("@/views/oaSystem/projectManagement/projectDetail.vue"), |
| | | name: "ProjectDetail", |
| | | meta: { title: "项ç®è¯¦æ
", activeMenu: "/oaSystem/projectManagement" }, |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/projectManagement/Management/detail", |
| | | component: Layout, |
| | |
| | | ], |
| | | }, |
| | | // è´¢å¡ç®¡ç模åè·¯ç± |
| | | { |
| | | path: "/financial", |
| | | component: Layout, |
| | | hidden: false, |
| | | redirect: "/financial/general-ledger", |
| | | alwaysShow: true, |
| | | meta: { title: "è´¢å¡ç®¡ç", icon: "money" }, |
| | | children: [ |
| | | { |
| | | path: "sales-out", |
| | | component: () => import("@/views/financialManagement/receivable/salesOut.vue"), |
| | | name: "SalesOut", |
| | | meta: { title: "éå®åºåº" }, |
| | | }, |
| | | { |
| | | path: "sales-return", |
| | | component: () => import("@/views/financialManagement/receivable/salesReturn.vue"), |
| | | name: "SalesReturn", |
| | | meta: { title: "éå®éè´§" }, |
| | | }, |
| | | |
| | | { |
| | | path: "invoice-apply", |
| | | component: () => import("@/views/financialManagement/receivable/invoiceApply.vue"), |
| | | name: "InvoiceApply", |
| | | meta: { title: "å¼ç¥¨ç³è¯·" }, |
| | | }, |
| | | { |
| | | path: "output-invoice", |
| | | component: () => import("@/views/financialManagement/receivable/outputInvoice.vue"), |
| | | name: "OutputInvoice", |
| | | meta: { title: "é项å票" }, |
| | | }, |
| | | { |
| | | path: "receipt", |
| | | component: () => import("@/views/financialManagement/receivable/receipt.vue"), |
| | | name: "Receipt", |
| | | meta: { title: "æ¶æ¬¾å" }, |
| | | }, |
| | | { |
| | | path: "receivable-reconciliation", |
| | | component: () => import("@/views/financialManagement/receivable/reconciliation.vue"), |
| | | name: "ReceivableReconciliation", |
| | | meta: { title: "åºæ¶å¯¹è´¦" }, |
| | | }, |
| | | { |
| | | path: "purchase-in", |
| | | component: () => import("@/views/financialManagement/payable/purchaseIn.vue"), |
| | | name: "PurchaseIn", |
| | | meta: { title: "éè´å
¥åº" }, |
| | | }, |
| | | |
| | | { |
| | | path: "input-invoice", |
| | | component: () => import("@/views/financialManagement/payable/input-invoice.vue"), |
| | | name: "InputInvoice", |
| | | meta: { title: "è¿é¡¹å票" }, |
| | | }, |
| | | { |
| | | path: "payment-apply", |
| | | component: () => import("@/views/financialManagement/payable/paymentApply.vue"), |
| | | name: "PaymentApply", |
| | | meta: { title: "仿¬¾ç³è¯·" }, |
| | | }, |
| | | |
| | | { |
| | | path: "payment", |
| | | component: () => import("@/views/financialManagement/payable/payment.vue"), |
| | | name: "Payment", |
| | | meta: { title: "仿¬¾å" }, |
| | | }, |
| | | { |
| | | path: "payable-reconciliation", |
| | | component: () => import("@/views/financialManagement/payable/reconciliation.vue"), |
| | | name: "PayableReconciliation", |
| | | meta: { title: "åºä»å¯¹è´¦" }, |
| | | }, |
| | | { |
| | | path: "fixed-assets", |
| | | component: () => import("@/views/financialManagement/assets/fixedAssets.vue"), |
| | | name: "FixedAssets", |
| | | meta: { title: "åºå®èµäº§" }, |
| | | }, |
| | | { |
| | | path: "intangible-assets", |
| | | component: () => import("@/views/financialManagement/assets/intangibleAssets.vue"), |
| | | name: "IntangibleAssets", |
| | | meta: { title: "æ å½¢èµäº§" }, |
| | | }, |
| | | { |
| | | path: "general-ledger", |
| | | component: () => import("@/views/financialManagement/generalLedger/index.vue"), |
| | | name: "GeneralLedger", |
| | | meta: { title: "æ»å¸ç§ç®" }, |
| | | }, |
| | | { |
| | | path: "voucher", |
| | | component: () => import("@/views/financialManagement/voucher/index.vue"), |
| | | name: "Voucher", |
| | | meta: { title: "åè¯" }, |
| | | }, |
| | | { |
| | | path: "voucher-general-ledger", |
| | | component: () => import("@/views/financialManagement/voucher/generalLedger.vue"), |
| | | name: "VoucherGeneralLedger", |
| | | meta: { title: "ç§ç®æ»å¸" }, |
| | | }, |
| | | { |
| | | path: "voucher-detail-ledger", |
| | | component: () => import("@/views/financialManagement/voucher/detailLedger.vue"), |
| | | name: "VoucherDetailLedger", |
| | | meta: { title: "ç§ç®æç»å¸" }, |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // path: "/financial", |
| | | // component: Layout, |
| | | // hidden: false, |
| | | // redirect: "/financial/general-ledger", |
| | | // alwaysShow: true, |
| | | // meta: { title: "è´¢å¡ç®¡ç", icon: "money" }, |
| | | // children: [ |
| | | // { |
| | | // path: "sales-out", |
| | | // component: () => import("@/views/financialManagement/receivable/salesOut.vue"), |
| | | // name: "SalesOut", |
| | | // meta: { title: "éå®åºåº" }, |
| | | // }, |
| | | // { |
| | | // path: "sales-return", |
| | | // component: () => import("@/views/financialManagement/receivable/salesReturn.vue"), |
| | | // name: "SalesReturn", |
| | | // meta: { title: "éå®éè´§" }, |
| | | // }, |
| | | // |
| | | // { |
| | | // path: "invoice-apply", |
| | | // component: () => import("@/views/financialManagement/receivable/invoiceApply.vue"), |
| | | // name: "InvoiceApply", |
| | | // meta: { title: "å¼ç¥¨ç³è¯·" }, |
| | | // }, |
| | | // { |
| | | // path: "output-invoice", |
| | | // component: () => import("@/views/financialManagement/receivable/outputInvoice.vue"), |
| | | // name: "OutputInvoice", |
| | | // meta: { title: "é项å票" }, |
| | | // }, |
| | | // { |
| | | // path: "receipt", |
| | | // component: () => import("@/views/financialManagement/receivable/receipt.vue"), |
| | | // name: "Receipt", |
| | | // meta: { title: "æ¶æ¬¾å" }, |
| | | // }, |
| | | // { |
| | | // path: "receivable-reconciliation", |
| | | // component: () => import("@/views/financialManagement/receivable/reconciliation.vue"), |
| | | // name: "ReceivableReconciliation", |
| | | // meta: { title: "åºæ¶å¯¹è´¦" }, |
| | | // }, |
| | | // { |
| | | // path: "purchase-in", |
| | | // component: () => import("@/views/financialManagement/payable/purchaseIn.vue"), |
| | | // name: "PurchaseIn", |
| | | // meta: { title: "éè´å
¥åº" }, |
| | | // }, |
| | | // |
| | | // { |
| | | // path: "input-invoice", |
| | | // component: () => import("@/views/financialManagement/payable/input-invoice.vue"), |
| | | // name: "InputInvoice", |
| | | // meta: { title: "è¿é¡¹å票" }, |
| | | // }, |
| | | // { |
| | | // path: "payment-apply", |
| | | // component: () => import("@/views/financialManagement/payable/paymentApply.vue"), |
| | | // name: "PaymentApply", |
| | | // meta: { title: "仿¬¾ç³è¯·" }, |
| | | // }, |
| | | // |
| | | // { |
| | | // path: "payment", |
| | | // component: () => import("@/views/financialManagement/payable/payment.vue"), |
| | | // name: "Payment", |
| | | // meta: { title: "仿¬¾å" }, |
| | | // }, |
| | | // { |
| | | // path: "payable-reconciliation", |
| | | // component: () => import("@/views/financialManagement/payable/reconciliation.vue"), |
| | | // name: "PayableReconciliation", |
| | | // meta: { title: "åºä»å¯¹è´¦" }, |
| | | // }, |
| | | // { |
| | | // path: "fixed-assets", |
| | | // component: () => import("@/views/financialManagement/assets/fixedAssets.vue"), |
| | | // name: "FixedAssets", |
| | | // meta: { title: "åºå®èµäº§" }, |
| | | // }, |
| | | // { |
| | | // path: "intangible-assets", |
| | | // component: () => import("@/views/financialManagement/assets/intangibleAssets.vue"), |
| | | // name: "IntangibleAssets", |
| | | // meta: { title: "æ å½¢èµäº§" }, |
| | | // }, |
| | | // { |
| | | // path: "general-ledger", |
| | | // component: () => import("@/views/financialManagement/generalLedger/index.vue"), |
| | | // name: "GeneralLedger", |
| | | // meta: { title: "æ»å¸ç§ç®" }, |
| | | // }, |
| | | // { |
| | | // path: "voucher", |
| | | // component: () => import("@/views/financialManagement/voucher/index.vue"), |
| | | // name: "Voucher", |
| | | // meta: { title: "åè¯" }, |
| | | // }, |
| | | // { |
| | | // path: "voucher-general-ledger", |
| | | // component: () => import("@/views/financialManagement/voucher/generalLedger.vue"), |
| | | // name: "VoucherGeneralLedger", |
| | | // meta: { title: "ç§ç®æ»å¸" }, |
| | | // }, |
| | | // { |
| | | // path: "voucher-detail-ledger", |
| | | // component: () => import("@/views/financialManagement/voucher/detailLedger.vue"), |
| | | // name: "VoucherDetailLedger", |
| | | // meta: { title: "ç§ç®æç»å¸" }, |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ]; |
| | | |
| | | // å¨æè·¯ç±ï¼åºäºç¨æ·æé卿å»å è½½ |
| | |
| | | <div> |
| | | <el-button type="primary" |
| | | @click="openForm('add')">æ°å¢å®¢æ·</el-button> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="back">æµå
¥å
¬æµ·</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="info" |
| | | plain |
| | |
| | | addReturnVisit, |
| | | getReturnVisit, |
| | | } from "@/api/basicData/customerFile.js"; |
| | | import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer} from "@/api/basicData/customer.js"; |
| | | import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer, backCustomer} from "@/api/basicData/customer.js"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | |
| | | }); |
| | | }; |
| | | |
| | | const back = () => { |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map(item => item.id); |
| | | ElMessageBox.confirm("éä¸ç客æ·å°æµå
¥å
¬æµ·ï¼æ¯å¦ç¡®è®¤ï¼", "æµå
¥å
¬æµ·æç¤º", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | return Promise.all(ids.map(id => backCustomer(id))) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("æµå
¥å
¬æµ·æå"); |
| | | selectedRows.value = []; |
| | | getList(); |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }) |
| | | .catch(error => { |
| | | if (error === "cancel" || error === "close") { |
| | | proxy.$modal.msg("已忶"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // æå¼å访æéå¼¹çª |
| | | const openReminderDialog = row => { |
| | | currentCustomerId.value = row.id; |
| | |
| | | const downloadAttachment = row => { |
| | | if (row.url) { |
| | | // proxy.download(row.url, {}, row.name); |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } else { |
| | | proxy.$modal.msgError("ä¸è½½é¾æ¥ä¸åå¨"); |
| | | } |
| | |
| | | const downloadAttachment = row => { |
| | | if (row.url) { |
| | | // proxy.download(row.url, {}, row.name); |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } else { |
| | | proxy.$modal.msgError("ä¸è½½é¾æ¥ä¸åå¨"); |
| | | } |
| | |
| | | <el-button type="primary" |
| | | link |
| | | :disabled="isTopLevelNode(data, node)" |
| | | @click="openProDia('edit', data)"> |
| | | @click="openProDia('edit', data, node)"> |
| | | ç¼è¾ |
| | | </el-button> |
| | | <el-button type="primary" |
| | | link |
| | | @click="openProDia('add', data)"> |
| | | @click="openProDia('add', data, node)"> |
| | | æ·»å 产å |
| | | </el-button> |
| | | <el-button v-if="!node.childNodes.length" |
| | |
| | | const search = ref(""); |
| | | const currentId = ref(""); |
| | | const currentParentId = ref(""); |
| | | /** 产åå¼¹çªï¼add åç¶èç¹ idï¼edit åå½åèç¹ id ä¸ parentIdï¼ä¸ä¾èµæ éä¸é¡¹ï¼ */ |
| | | const productDialogTarget = ref(null); |
| | | const operationType = ref(""); |
| | | const treeLoad = ref(false); |
| | | const list = ref([]); |
| | |
| | | return [null, undefined, "", 0, "0"].includes(data?.parentId); |
| | | }; |
| | | // æå¼äº§åå¼¹æ¡ |
| | | const openProDia = (type, data) => { |
| | | if (data && type === "edit" && isTopLevelNode(data)) { |
| | | const openProDia = (type, data, node) => { |
| | | if (data && type === "edit" && isTopLevelNode(data, node)) { |
| | | proxy.$modal.msgWarning("ä¸çº§èç¹ä¸è½ç¼è¾æå é¤"); |
| | | return; |
| | | } |
| | | operationType.value = type; |
| | | productDia.value = true; |
| | | form.value.productName = ""; |
| | | if (type === "edit") { |
| | | form.value.productName = data.productName; |
| | | productDialogTarget.value = null; |
| | | if (type === "add" && data) { |
| | | productDialogTarget.value = { parentId: data.id }; |
| | | } else if (type === "edit" && data) { |
| | | let parentId = data.parentId; |
| | | if ( |
| | | [null, undefined, ""].includes(parentId) && |
| | | node?.parent?.data?.id != null |
| | | ) { |
| | | parentId = node.parent.data.id; |
| | | } |
| | | productDialogTarget.value = { id: data.id, parentId }; |
| | | } |
| | | productDia.value = true; |
| | | form.value.productName = |
| | | type === "edit" && data ? data.productName : ""; |
| | | }; |
| | | // æå¼è§æ ¼åå·å¼¹æ¡ |
| | | const openModelDia = (type, data) => { |
| | |
| | | proxy.$refs.formRef.validate(valid => { |
| | | if (valid) { |
| | | if (operationType.value === "add") { |
| | | form.value.parentId = currentId.value; |
| | | form.value.parentId = |
| | | productDialogTarget.value?.parentId ?? currentId.value; |
| | | form.value.id = ""; |
| | | } else if (operationType.value === "addOne") { |
| | | form.value.id = ""; |
| | | form.value.parentId = ""; |
| | | } else { |
| | | form.value.id = currentId.value; |
| | | form.value.parentId = ""; |
| | | form.value.id = |
| | | productDialogTarget.value?.id ?? currentId.value; |
| | | form.value.parentId = productDialogTarget.value?.parentId ?? ""; |
| | | } |
| | | addOrEditProduct(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | |
| | | // å
³é产åå¼¹æ¡ |
| | | const closeProDia = () => { |
| | | proxy.$refs.formRef.resetFields(); |
| | | productDialogTarget.value = null; |
| | | productDia.value = false; |
| | | }; |
| | | |
| | |
| | | } |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | |
| | | tableData.value = list |
| | | } |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | const lookFile = (row) => { |
| | | filePreviewRef.value.open(row.url) |
| | |
| | | tableData.value = list |
| | | } |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | const lookFile = (row) => { |
| | | filePreviewRef.value.open(row.url) |
| | |
| | | const showQRCode = async (row) => { |
| | | // ç´æ¥ä½¿ç¨URLï¼ä¸è¦ç¨JSON.stringifyå
è£
|
| | | const qrContent = proxy.javaApi + '/device-info?deviceId=' + row.id; |
| | | qrCodeUrl.value = await QRCode.toDataURL(qrContent); |
| | | const qrDataUrl = await QRCode.toDataURL(qrContent, { width: 200, margin: 2 }); |
| | | |
| | | // å建canvasåæå¸¦åç§°çäºç»´ç å¾ç |
| | | const canvas = document.createElement('canvas'); |
| | | const ctx = canvas.getContext('2d'); |
| | | const qrSize = 200; |
| | | const textHeight = 30; |
| | | const padding = 10; |
| | | canvas.width = qrSize + padding * 2; |
| | | canvas.height = qrSize + textHeight + padding * 2; |
| | | |
| | | // å¡«å
ç½è²èæ¯ |
| | | ctx.fillStyle = '#ffffff'; |
| | | ctx.fillRect(0, 0, canvas.width, canvas.height); |
| | | |
| | | // ç»å¶äºç»´ç |
| | | const qrImg = new Image(); |
| | | qrImg.src = qrDataUrl; |
| | | await new Promise((resolve) => { qrImg.onload = resolve; }); |
| | | ctx.drawImage(qrImg, padding, padding, qrSize, qrSize); |
| | | |
| | | // ç»å¶è®¾å¤åç§° |
| | | ctx.fillStyle = '#333333'; |
| | | ctx.font = 'bold 14px Arial'; |
| | | ctx.textAlign = 'center'; |
| | | ctx.fillText(row.deviceName || '', canvas.width / 2, qrSize + padding + 20); |
| | | |
| | | qrCodeUrl.value = canvas.toDataURL('image/png'); |
| | | qrRowData.value = row; |
| | | qrDialogVisible.value = true; |
| | | }; |
| | |
| | | } |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤é¡¹ç®" prop="machineryCategory"> |
| | | <el-input |
| | | v-model.trim="form.machineryCategory" |
| | | placeholder="请è¾å
¥è®¾å¤é¡¹ç®" |
| | | maxlength="100" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä»»å¡é¢ç" prop="frequencyType"> |
| | | <el-select v-model="form.frequencyType" placeholder="è¯·éæ©" clearable> |
| | | <el-option label="æ¯æ¥" value="DAILY"/> |
| | |
| | | taskName: undefined, |
| | | // å½å
¥äººï¼åéä¸ä¸ªç¨æ· id |
| | | inspector: undefined, |
| | | machineryCategory: "", |
| | | remarks: '', |
| | | frequencyType: '', |
| | | frequencyDetail: '', |
| | |
| | | rules: { |
| | | taskId: [{ required: true, message: "è¯·éæ©è®¾å¤", trigger: "change" },], |
| | | inspector: [{ required: true, message: "è¯·éæ©å½å
¥äºº", trigger: "blur" },], |
| | | registrationDate: [{ required: true, message: "è¯·éæ©ç»è®°æ¶é´", trigger: "change" }] |
| | | registrationDate: [{ required: true, message: "è¯·éæ©ç»è®°æ¶é´", trigger: "change" }], |
| | | machineryCategory: [{ required: true, message: "请è¾å
¥è®¾å¤é¡¹ç®", trigger: "blur" }] |
| | | } |
| | | }) |
| | | const { form, rules } = toRefs(data) |
| | |
| | | taskId: undefined, |
| | | taskName: undefined, |
| | | inspector: undefined, |
| | | inspector: undefined, |
| | | machineryCategory: "", |
| | | remarks: '', |
| | | frequencyType: '', |
| | | frequencyDetail: '', |
| | |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "设å¤é¡¹ç®", |
| | | prop: "machineryCategory", |
| | | minWidth: 120, |
| | | formatData: cell => cell || "--", |
| | | }, |
| | | { |
| | | prop: "frequencyType", |
| | | label: "颿¬¡", |
| | | minWidth: 150, |
| | |
| | | prop: "createUserName", |
| | | }, |
| | | { |
| | | label: "项ç®", |
| | | label: "设å¤é¡¹ç®", |
| | | align: "center", |
| | | prop: "machineryCategory", |
| | | formatData: cell => cell || "--", |
| | | }, |
| | | // { |
| | | // label: "å½å
¥æ¥æ", |
| | |
| | | <template> |
| | | <!-- éè´å
¥åº --> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="å
¥åºåå·:"> |
| | | <el-input v-model="filters.inCode" placeholder="请è¾å
¥å
¥åºåå·" clearable style="width: 200px;" /> |
| | | <el-input v-model="filters.inboundBatches" placeholder="请è¾å
¥å
¥åºåå·" clearable style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="ä¾åºå:"> |
| | | <el-select v-model="filters.supplierId" placeholder="è¯·éæ©ä¾åºå" clearable style="width: 200px;"> |
| | | <el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id" /> |
| | | </el-select> |
| | | <el-input v-model="filters.supplierName" placeholder="请è¾å
¥ä¾åºå" clearable style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="å
¥åºæ¥æ:"> |
| | | <el-date-picker v-model="filters.dateRange" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" range-separator="è³" start-placeholder="å¼å§æ¥æ" end-placeholder="ç»ææ¥æ" clearable /> |
| | | <el-date-picker |
| | | v-model="filters.dateRange" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData">æç´¢</el-button> |
| | | <el-button type="primary" @click="onSearch">æç´¢</el-button> |
| | | <el-button @click="resetFilters">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | rowKey="id" |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :tableLoading="tableLoading" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | |
| | | }" |
| | | @pagination="changePage" |
| | | > |
| | | <template #amount="{ row }"> |
| | | <span class="text-primary">Â¥{{ formatMoney(row.amount) }}</span> |
| | | </template> |
| | | <template #status="{ row }"> |
| | | <el-tag :type="getStatusType(row.status)">{{ getStatusLabel(row.status) }}</el-tag> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <el-button type="primary" link @click="view(row)">æ¥ç</el-button> |
| | | <el-button type="primary" link @click="edit(row)" v-if="row.status === 'pending'">ç¼è¾</el-button> |
| | | <el-button type="danger" link @click="handleDelete(row)" v-if="row.status === 'pending'">å é¤</el-button> |
| | | <template #inboundDate="{ row }"> |
| | | {{ row.InboundDate || row.inboundDate || "" }} |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | |
| | | <FormDialog :title="dialogTitle" v-model="dialogVisible" width="800px" @confirm="submitForm" @cancel="dialogVisible = false"> |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="100px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºåå·" prop="inCode"> |
| | | <el-input v-model="form.inCode" placeholder="请è¾å
¥å
¥åºåå·" :disabled="isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºå" prop="supplierId"> |
| | | <el-select v-model="form.supplierId" placeholder="è¯·éæ©ä¾åºå" style="width: 100%;" :disabled="isEdit"> |
| | | <el-option v-for="item in supplierList" :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="inDate"> |
| | | <el-date-picker v-model="form.inDate" type="date" placeholder="éæ©æ¥æ" value-format="YYYY-MM-DD" style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºéé¢" prop="amount"> |
| | | <el-input-number v-model="form.amount" :min="0" :precision="2" style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="å
¥åºæç»" prop="details"> |
| | | <el-table :data="form.details" border style="width: 100%"> |
| | | <el-table-column prop="materialName" label="ç©æåç§°" width="150"> |
| | | <template #default="{ $index }"> |
| | | <el-input v-model="form.details[$index].materialName" placeholder="ç©æåç§°" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="spec" label="è§æ ¼" width="120"> |
| | | <template #default="{ $index }"> |
| | | <el-input v-model="form.details[$index].spec" placeholder="è§æ ¼" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="quantity" label="æ°é" width="100"> |
| | | <template #default="{ $index }"> |
| | | <el-input-number v-model="form.details[$index].quantity" :min="0" style="width: 100%;" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitPrice" label="åä»·" width="120"> |
| | | <template #default="{ $index }"> |
| | | <el-input-number v-model="form.details[$index].unitPrice" :min="0" :precision="2" style="width: 100%;" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="total" label="éé¢" width="120"> |
| | | <template #default="{ row }"> |
| | | <span>Â¥{{ formatMoney(row.quantity * row.unitPrice) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="80"> |
| | | <template #default="{ $index }"> |
| | | <el-button type="danger" link @click="removeDetail($index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-button type="primary" link @click="addDetail" style="margin-top: 10px;">+ æ·»å æç»</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button type="primary" @click="submitForm">ç¡®å®</el-button> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | </template> |
| | | </FormDialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import FormDialog from "@/components/Dialog/FormDialog.vue"; |
| | | import { ref, reactive, onMounted, getCurrentInstance } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { listPageAccountPurchase } from "@/api/financialManagement/accountPurchase"; |
| | | |
| | | defineOptions({ |
| | | name: "éè´å
¥åº", |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const filters = reactive({ |
| | | inCode: "", |
| | | supplierId: "", |
| | | inboundBatches: "", |
| | | supplierName: "", |
| | | dateRange: [], |
| | | }); |
| | | |
| | |
| | | }); |
| | | |
| | | const columns = [ |
| | | { label: "å
¥åºåå·", prop: "inCode", width: "150" }, |
| | | { label: "ä¾åºå", prop: "supplierName", width: "180" }, |
| | | { label: "å
¥åºæ¥æ", prop: "inDate", width: "120" }, |
| | | { label: "å
¥åºéé¢", prop: "amount", slot: "amount" }, |
| | | { label: "ç¶æ", prop: "status", slot: "status" }, |
| | | { label: "夿³¨", prop: "remark", showOverflowTooltip: true }, |
| | | { label: "æä½", prop: "operation", slot: "operation", width: "200", fixed: "right" }, |
| | | { label: "å
¥åºåå·", prop: "inboundBatches", minWidth: "150" }, |
| | | { label: "ä¾åºå", prop: "supplierName", minWidth: "180" }, |
| | | { |
| | | label: "å
¥åºæ¥æ", |
| | | prop: "InboundDate", |
| | | minWidth: "170", |
| | | dataType: "slot", |
| | | slot: "inboundDate", |
| | | }, |
| | | { label: "产ååç§°", prop: "productName", minWidth: "140" }, |
| | | { label: "产åè§æ ¼", prop: "specificationModel", minWidth: "140" }, |
| | | { label: "éè´è®¢åå·", prop: "purchaseContractNumber", minWidth: "150" }, |
| | | ]; |
| | | |
| | | const dataList = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const dialogTitle = ref(""); |
| | | const formRef = ref(null); |
| | | const isEdit = ref(false); |
| | | const currentId = ref(null); |
| | | const tableLoading = ref(false); |
| | | |
| | | const supplierList = [ |
| | | { id: 1, name: "åäº¬åææä¾åºå" }, |
| | | { id: 2, name: "䏿µ·çµåå
å¨ä»¶å
¬å¸" }, |
| | | { id: 3, name: "广å·å
è£
ææå" }, |
| | | { id: 4, name: "æ·±å³äºéé
ä»¶å
¬å¸" }, |
| | | ]; |
| | | function buildFilterParams() { |
| | | const params = { |
| | | inboundBatches: filters.inboundBatches || undefined, |
| | | supplierName: filters.supplierName || undefined, |
| | | }; |
| | | if (filters.dateRange && filters.dateRange.length === 2) { |
| | | params.startDate = filters.dateRange[0]; |
| | | params.endDate = filters.dateRange[1]; |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | const form = reactive({ |
| | | inCode: "", |
| | | supplierId: "", |
| | | inDate: "", |
| | | amount: 0, |
| | | details: [], |
| | | remark: "", |
| | | }); |
| | | |
| | | const rules = { |
| | | inCode: [{ required: true, message: "请è¾å
¥å
¥åºåå·", trigger: "blur" }], |
| | | supplierId: [{ required: true, message: "è¯·éæ©ä¾åºå", trigger: "change" }], |
| | | inDate: [{ required: true, message: "è¯·éæ©å
¥åºæ¥æ", trigger: "change" }], |
| | | amount: [{ required: true, message: "请è¾å
¥å
¥åºéé¢", trigger: "blur" }], |
| | | }; |
| | | |
| | | const mockData = [ |
| | | { id: 1, inCode: "RK2024001", supplierId: 1, supplierName: "åäº¬åææä¾åºå", inDate: "2024-01-10", amount: 8000, status: "approved", details: [{ materialName: "颿", spec: "Q235", quantity: 10, unitPrice: 500 }], remark: "" }, |
| | | { id: 2, inCode: "RK2024002", supplierId: 2, supplierName: "䏿µ·çµåå
å¨ä»¶å
¬å¸", inDate: "2024-01-12", amount: 12000, status: "pending", details: [{ materialName: "è¯ç", spec: "STM32", quantity: 100, unitPrice: 80 }], remark: "" }, |
| | | { id: 3, inCode: "RK2024003", supplierId: 3, supplierName: "广å·å
è£
ææå", inDate: "2024-01-15", amount: 3500, status: "approved", details: [{ materialName: "纸箱", spec: "50*40*30", quantity: 500, unitPrice: 5 }], remark: "" }, |
| | | ]; |
| | | |
| | | const formatMoney = (value) => { |
| | | if (value === undefined || value === null) return "0.00"; |
| | | return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
| | | }; |
| | | |
| | | const getStatusLabel = (status) => { |
| | | const map = { pending: "å¾
å®¡æ ¸", approved: "å·²å®¡æ ¸", rejected: "已驳å" }; |
| | | return map[status] || status; |
| | | }; |
| | | |
| | | const getStatusType = (status) => { |
| | | const map = { pending: "warning", approved: "success", rejected: "danger" }; |
| | | return map[status] || ""; |
| | | const onSearch = () => { |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const getTableData = () => { |
| | | let result = [...mockData]; |
| | | if (filters.inCode) { |
| | | result = result.filter(item => item.inCode.includes(filters.inCode)); |
| | | } |
| | | if (filters.supplierId) { |
| | | result = result.filter(item => item.supplierId === filters.supplierId); |
| | | } |
| | | if (filters.dateRange && filters.dateRange.length === 2) { |
| | | result = result.filter(item => item.inDate >= filters.dateRange[0] && item.inDate <= filters.dateRange[1]); |
| | | } |
| | | pagination.total = result.length; |
| | | dataList.value = result.slice((pagination.currentPage - 1) * pagination.pageSize, pagination.currentPage * pagination.pageSize); |
| | | tableLoading.value = true; |
| | | listPageAccountPurchase({ |
| | | ...buildFilterParams(), |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | }) |
| | | .then((res) => { |
| | | const ok = res.code === 200 || res.code === 0; |
| | | if (ok && res.data) { |
| | | pagination.total = res.data.total ?? 0; |
| | | dataList.value = res.data.records ?? []; |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | dataList.value = []; |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | dataList.value = []; |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const resetFilters = () => { |
| | | filters.inCode = ""; |
| | | filters.supplierId = ""; |
| | | filters.inboundBatches = ""; |
| | | filters.supplierName = ""; |
| | | filters.dateRange = []; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const changePage = ({ current, size }) => { |
| | | pagination.currentPage = current; |
| | | pagination.pageSize = size; |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const addDetail = () => { |
| | | form.details.push({ materialName: "", spec: "", quantity: 0, unitPrice: 0 }); |
| | | }; |
| | | |
| | | const removeDetail = (index) => { |
| | | form.details.splice(index, 1); |
| | | }; |
| | | |
| | | const add = () => { |
| | | isEdit.value = false; |
| | | dialogTitle.value = "æ°å¢å
¥åº"; |
| | | Object.assign(form, { |
| | | inCode: "RK" + Date.now().toString().slice(-8), |
| | | supplierId: "", |
| | | inDate: new Date().toISOString().split('T')[0], |
| | | amount: 0, |
| | | details: [{ materialName: "", spec: "", quantity: 0, unitPrice: 0 }], |
| | | remark: "", |
| | | }); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | const edit = (row) => { |
| | | isEdit.value = true; |
| | | currentId.value = row.id; |
| | | dialogTitle.value = "ç¼è¾å
¥åº"; |
| | | Object.assign(form, row); |
| | | if (!form.details || form.details.length === 0) { |
| | | form.details = [{ materialName: "", spec: "", quantity: 0, unitPrice: 0 }]; |
| | | } |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | const view = (row) => { |
| | | ElMessage.info(`æ¥çå
¥åºå: ${row.inCode}`); |
| | | }; |
| | | |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm("确认å é¤è¯¥å
¥åºååï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | const index = mockData.findIndex(item => item.id === row.id); |
| | | if (index !== -1) { |
| | | mockData.splice(index, 1); |
| | | } |
| | | ElMessage.success("å 餿å"); |
| | | getTableData(); |
| | | }); |
| | | }; |
| | | |
| | | const handleOut = () => { |
| | | ElMessage.success("å¯¼åºæå"); |
| | | }; |
| | | |
| | | const submitForm = () => { |
| | | formRef.value.validate((valid) => { |
| | | if (valid) { |
| | | const supplier = supplierList.find(item => item.id === form.supplierId); |
| | | if (isEdit.value) { |
| | | const index = mockData.findIndex(item => item.id === currentId.value); |
| | | if (index !== -1) { |
| | | mockData[index] = { ...mockData[index], ...form, supplierName: supplier?.name }; |
| | | } |
| | | ElMessage.success("ç¼è¾æå"); |
| | | } else { |
| | | const newId = mockData.length > 0 ? Math.max(...mockData.map(item => item.id)) + 1 : 1; |
| | | mockData.push({ id: newId, ...form, supplierName: supplier?.name, status: "pending" }); |
| | | ElMessage.success("æ°å¢æå"); |
| | | } |
| | | dialogVisible.value = false; |
| | | getTableData(); |
| | | } |
| | | }); |
| | | proxy.download( |
| | | "/accountPurchase/exportAccountPurchaseInbound", |
| | | buildFilterParams(), |
| | | `éè´å
¥åº_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .text-primary { |
| | | color: #409eff; |
| | | font-weight: bold; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- éè´éè´§ --> |
| | | |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="éè´§åå·:"> |
| | | <el-input |
| | | v-model="filters.returnNo" |
| | | placeholder="请è¾å
¥éè´§åå·" |
| | | clearable |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="ä¾åºå:"> |
| | | <el-input |
| | | v-model="filters.supplierName" |
| | | placeholder="请è¾å
¥ä¾åºå" |
| | | clearable |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="éè´§æ¥æ:"> |
| | | <el-date-picker |
| | | v-model="filters.dateRange" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button type="primary" @click="onSearch">æç´¢</el-button> |
| | | |
| | | <el-button @click="resetFilters">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <div></div> |
| | | |
| | | <div> |
| | | <el-button @click="handleOut" icon="Download">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :tableLoading="tableLoading" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | |
| | | size: pagination.pageSize, |
| | | |
| | | total: pagination.total, |
| | | }" |
| | | @pagination="changePage" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted, getCurrentInstance } from "vue"; |
| | | |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | import { listPageAccountPurchaseReturn } from "@/api/financialManagement/accountPurchase"; |
| | | |
| | | defineOptions({ |
| | | name: "éè´éè´§", |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const filters = reactive({ |
| | | returnNo: "", |
| | | |
| | | supplierName: "", |
| | | |
| | | dateRange: [], |
| | | }); |
| | | |
| | | const pagination = reactive({ |
| | | currentPage: 1, |
| | | |
| | | pageSize: 10, |
| | | |
| | | total: 0, |
| | | }); |
| | | |
| | | const columns = [ |
| | | { label: "éè´§åå·", prop: "returnNo", minWidth: "150" }, |
| | | |
| | | { label: "ä¾åºå", prop: "supplierName", minWidth: "180" }, |
| | | |
| | | { label: "å
³èå
¥åºåå·", prop: "inboundBatches", minWidth: "150" }, |
| | | |
| | | { label: "éè´§æ¥æ", prop: "preparedAt", minWidth: "170" }, |
| | | |
| | | { |
| | | label: "鿬¾æ»é¢", |
| | | |
| | | prop: "totalAmount", |
| | | |
| | | minWidth: "150", |
| | | |
| | | align: "right", |
| | | |
| | | formatData: (val) => |
| | | val === null || val === undefined || val === "" |
| | | ? "" |
| | | : Number(val).toLocaleString("zh-CN", { |
| | | minimumFractionDigits: 2, |
| | | maximumFractionDigits: 2, |
| | | }), |
| | | }, |
| | | |
| | | { label: "éè´§æ¹å¼", prop: "returnType", minWidth: "150" }, |
| | | |
| | | { label: "éè´è®¢åå·", prop: "purchaseContractNumber", minWidth: "150" }, |
| | | ]; |
| | | |
| | | const dataList = ref([]); |
| | | |
| | | const tableLoading = ref(false); |
| | | |
| | | function buildFilterParams() { |
| | | const params = { |
| | | returnNo: filters.returnNo || undefined, |
| | | |
| | | supplierName: filters.supplierName || undefined, |
| | | }; |
| | | |
| | | if (filters.dateRange && filters.dateRange.length === 2) { |
| | | params.startDate = filters.dateRange[0]; |
| | | |
| | | params.endDate = filters.dateRange[1]; |
| | | } |
| | | |
| | | return params; |
| | | } |
| | | |
| | | const onSearch = () => { |
| | | pagination.currentPage = 1; |
| | | |
| | | getTableData(); |
| | | }; |
| | | |
| | | const getTableData = () => { |
| | | tableLoading.value = true; |
| | | |
| | | listPageAccountPurchaseReturn({ |
| | | ...buildFilterParams(), |
| | | |
| | | current: pagination.currentPage, |
| | | |
| | | size: pagination.pageSize, |
| | | }) |
| | | .then((res) => { |
| | | const ok = res.code === 200 || res.code === 0; |
| | | |
| | | if (ok && res.data) { |
| | | pagination.total = res.data.total ?? 0; |
| | | |
| | | dataList.value = res.data.records ?? []; |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | |
| | | dataList.value = []; |
| | | } |
| | | }) |
| | | |
| | | .catch(() => { |
| | | dataList.value = []; |
| | | }) |
| | | |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const resetFilters = () => { |
| | | filters.returnNo = ""; |
| | | |
| | | filters.supplierName = ""; |
| | | |
| | | filters.dateRange = []; |
| | | |
| | | pagination.currentPage = 1; |
| | | |
| | | getTableData(); |
| | | }; |
| | | |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | |
| | | pagination.pageSize = limit; |
| | | |
| | | getTableData(); |
| | | }; |
| | | |
| | | const handleOut = () => { |
| | | proxy.download( |
| | | "/accountPurchase/exportAccountPurchaseReturn", |
| | | |
| | | buildFilterParams(), |
| | | |
| | | `éè´éè´§_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |
| | | </script> |
| | | |
| | | |
| | | |
| | | <style lang="scss" scoped> |
| | | .actions { |
| | | display: flex; |
| | | |
| | | justify-content: space-between; |
| | | |
| | | margin-bottom: 15px; |
| | | } |
| | | </style> |
| | | |
| | |
| | | <template> |
| | | <!-- éå®åºåº --> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="åºåºåå·:"> |
| | | <el-input v-model="filters.outCode" placeholder="请è¾å
¥åºåºåå·" clearable style="width: 200px;" /> |
| | | <el-input v-model="filters.outboundBatches" placeholder="请è¾å
¥åºåºåå·" clearable style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·:"> |
| | | <el-select v-model="filters.customerId" placeholder="è¯·éæ©å®¢æ·" clearable style="width: 200px;"> |
| | | <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" /> |
| | | </el-select> |
| | | <el-form-item label="客æ·åç§°:"> |
| | | <el-input v-model="filters.customerName" placeholder="请è¾å
¥å®¢æ·åç§°" clearable style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="åºåºæ¥æ:"> |
| | | <el-date-picker v-model="filters.dateRange" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" range-separator="è³" start-placeholder="å¼å§æ¥æ" end-placeholder="ç»ææ¥æ" clearable /> |
| | | <el-date-picker |
| | | v-model="filters.dateRange" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData">æç´¢</el-button> |
| | | <el-button type="primary" @click="onSearch">æç´¢</el-button> |
| | | <el-button @click="resetFilters">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | rowKey="id" |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :tableLoading="tableLoading" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | @pagination="changePage" |
| | | > |
| | | <template #status="{ row }"> |
| | | <el-tag :type="getStatusType(row.status)">{{ getStatusLabel(row.status) }}</el-tag> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <el-button type="primary" link @click="view(row)">æ¥ç</el-button> |
| | | <el-button type="primary" link @click="edit(row)" v-if="row.status === 'pending'">ç¼è¾</el-button> |
| | | <el-button type="danger" link @click="handleDelete(row)" v-if="row.status === 'pending'">å é¤</el-button> |
| | | </template> |
| | | </PIMTable> |
| | | /> |
| | | </div> |
| | | |
| | | <FormDialog :title="dialogTitle" v-model="dialogVisible" width="800px" @confirm="submitForm" @cancel="dialogVisible = false"> |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="100px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåºåå·" prop="outCode"> |
| | | <el-input v-model="form.outCode" placeholder="请è¾å
¥åºåºåå·" :disabled="isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·" prop="customerId"> |
| | | <el-select v-model="form.customerId" placeholder="è¯·éæ©å®¢æ·" style="width: 100%;" :disabled="isEdit"> |
| | | <el-option v-for="item in customerList" :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="outDate"> |
| | | <el-date-picker v-model="form.outDate" type="date" placeholder="éæ©æ¥æ" value-format="YYYY-MM-DD" style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éé¢" prop="amount"> |
| | | <el-input-number v-model="form.amount" :min="0" :precision="2" 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> |
| | | <template #footer> |
| | | <el-button type="primary" @click="submitForm">ç¡®å®</el-button> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | </template> |
| | | </FormDialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import FormDialog from "@/components/Dialog/FormDialog.vue"; |
| | | import { ref, reactive, onMounted, getCurrentInstance } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { listPageAccountSales } from "@/api/financialManagement/accountSales"; |
| | | |
| | | defineOptions({ |
| | | name: "éå®åºåº", |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const filters = reactive({ |
| | | outCode: "", |
| | | customerId: "", |
| | | outboundBatches: "", |
| | | customerName: "", |
| | | dateRange: [], |
| | | }); |
| | | |
| | |
| | | }); |
| | | |
| | | const columns = [ |
| | | { label: "åºåºåå·", prop: "outCode", width: "150" }, |
| | | { label: "客æ·åç§°", prop: "customerName", width: "180" }, |
| | | { label: "åºåºæ¥æ", prop: "outDate", width: "120" }, |
| | | { label: "éé¢", prop: "amount", width: "120" }, |
| | | { label: "ç¶æ", prop: "status", slot: "status" }, |
| | | { label: "夿³¨", prop: "remark", showOverflowTooltip: true }, |
| | | { label: "æä½", prop: "operation", slot: "operation", width: "200", fixed: "right" }, |
| | | { label: "åºåºåå·", prop: "outboundBatches", minWidth: "150" }, |
| | | { label: "客æ·åç§°", prop: "customerName", minWidth: "180" }, |
| | | { label: "åºåºæ¥æ", prop: "shippingDate", width: "170" }, |
| | | { label: "产ååç§°", prop: "productName", minWidth: "140" }, |
| | | { label: "产åè§æ ¼", prop: "specificationModel", minWidth: "140" }, |
| | | { |
| | | label: "éé¢", |
| | | prop: "outboundAmount", |
| | | minWidth: "120", |
| | | align: "right", |
| | | formatData: (val) => (val === null || val === undefined || val === "" ? "" : Number(val).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 })), |
| | | }, |
| | | { label: "åè´§ç¼å·", prop: "shippingNo", minWidth: "140" }, |
| | | { label: "éå®è®¢åå·", prop: "salesContractNo", minWidth: "150" }, |
| | | ]; |
| | | |
| | | const dataList = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const dialogTitle = ref(""); |
| | | const formRef = ref(null); |
| | | const isEdit = ref(false); |
| | | const currentId = ref(null); |
| | | const tableLoading = ref(false); |
| | | |
| | | const customerList = [ |
| | | { id: 1, name: "åäº¬ç§ææéå
¬å¸" }, |
| | | { id: 2, name: "䏿µ·è´¸æå
¬å¸" }, |
| | | { id: 3, name: "广å·å®ä¸æéå
¬å¸" }, |
| | | { id: 4, name: "æ·±å³çµåå
¬å¸" }, |
| | | ]; |
| | | function buildFilterParams() { |
| | | const params = { |
| | | outboundBatches: filters.outboundBatches || undefined, |
| | | customerName: filters.customerName || undefined, |
| | | }; |
| | | if (filters.dateRange && filters.dateRange.length === 2) { |
| | | params.startDate = filters.dateRange[0]; |
| | | params.endDate = filters.dateRange[1]; |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | const form = reactive({ |
| | | outCode: "", |
| | | customerId: "", |
| | | outDate: "", |
| | | amount: 0, |
| | | remark: "", |
| | | }); |
| | | |
| | | const rules = { |
| | | outCode: [{ required: true, message: "请è¾å
¥åºåºåå·", trigger: "blur" }], |
| | | customerId: [{ required: true, message: "è¯·éæ©å®¢æ·", trigger: "change" }], |
| | | outDate: [{ required: true, message: "è¯·éæ©åºåºæ¥æ", trigger: "change" }], |
| | | amount: [{ required: true, message: "请è¾å
¥éé¢", trigger: "blur" }], |
| | | }; |
| | | |
| | | const mockData = [ |
| | | { id: 1, outCode: "CK2024001", customerId: 1, customerName: "åäº¬ç§ææéå
¬å¸", outDate: "2024-01-15", amount: 5000, status: "approved", remark: "" }, |
| | | { id: 2, outCode: "CK2024002", customerId: 2, customerName: "䏿µ·è´¸æå
¬å¸", outDate: "2024-01-16", amount: 8000, status: "pending", remark: "" }, |
| | | { id: 3, outCode: "CK2024003", customerId: 3, customerName: "广å·å®ä¸æéå
¬å¸", outDate: "2024-01-18", amount: 12000, status: "approved", remark: "" }, |
| | | { id: 4, outCode: "CK2024004", customerId: 4, customerName: "æ·±å³çµåå
¬å¸", outDate: "2024-01-20", amount: 3500, status: "pending", remark: "" }, |
| | | ]; |
| | | |
| | | const getStatusLabel = (status) => { |
| | | const map = { pending: "å¾
å®¡æ ¸", approved: "å·²å®¡æ ¸", rejected: "已驳å" }; |
| | | return map[status] || status; |
| | | }; |
| | | |
| | | const getStatusType = (status) => { |
| | | const map = { pending: "warning", approved: "success", rejected: "danger" }; |
| | | return map[status] || ""; |
| | | const onSearch = () => { |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const getTableData = () => { |
| | | let result = [...mockData]; |
| | | if (filters.outCode) { |
| | | result = result.filter(item => item.outCode.includes(filters.outCode)); |
| | | } |
| | | if (filters.customerId) { |
| | | result = result.filter(item => item.customerId === filters.customerId); |
| | | } |
| | | if (filters.dateRange && filters.dateRange.length === 2) { |
| | | result = result.filter(item => item.outDate >= filters.dateRange[0] && item.outDate <= filters.dateRange[1]); |
| | | } |
| | | pagination.total = result.length; |
| | | dataList.value = result.slice((pagination.currentPage - 1) * pagination.pageSize, pagination.currentPage * pagination.pageSize); |
| | | tableLoading.value = true; |
| | | listPageAccountSales({ |
| | | ...buildFilterParams(), |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | }) |
| | | .then((res) => { |
| | | const ok = res.code === 200 || res.code === 0; |
| | | if (ok && res.data) { |
| | | pagination.total = res.data.total ?? 0; |
| | | dataList.value = res.data.records ?? []; |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | dataList.value = []; |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | dataList.value = []; |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const resetFilters = () => { |
| | | filters.outCode = ""; |
| | | filters.customerId = ""; |
| | | filters.outboundBatches = ""; |
| | | filters.customerName = ""; |
| | | filters.dateRange = []; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const changePage = ({ current, size }) => { |
| | | pagination.currentPage = current; |
| | | pagination.pageSize = size; |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const add = () => { |
| | | isEdit.value = false; |
| | | dialogTitle.value = "æ°å¢åºåº"; |
| | | Object.assign(form, { |
| | | outCode: "CK" + Date.now(), |
| | | customerId: "", |
| | | outDate: "", |
| | | amount: 0, |
| | | remark: "", |
| | | }); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | const edit = (row) => { |
| | | isEdit.value = true; |
| | | currentId.value = row.id; |
| | | dialogTitle.value = "ç¼è¾åºåº"; |
| | | Object.assign(form, row); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | const view = (row) => { |
| | | ElMessage.info(`æ¥çåºåºå: ${row.outCode}`); |
| | | }; |
| | | |
| | | const submitForm = () => { |
| | | formRef.value.validate((valid) => { |
| | | if (valid) { |
| | | const customer = customerList.find(item => item.id === form.customerId); |
| | | if (isEdit.value) { |
| | | const index = mockData.findIndex(item => item.id === currentId.value); |
| | | if (index !== -1) { |
| | | mockData[index] = { ...mockData[index], ...form, customerName: customer?.name }; |
| | | } |
| | | ElMessage.success("ç¼è¾æå"); |
| | | } else { |
| | | const newId = mockData.length > 0 ? Math.max(...mockData.map(item => item.id)) + 1 : 1; |
| | | mockData.push({ id: newId, ...form, customerName: customer?.name, status: "pending" }); |
| | | ElMessage.success("æ°å¢æå"); |
| | | } |
| | | dialogVisible.value = false; |
| | | getTableData(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm("确认å é¤è¯¥åºåºååï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | const index = mockData.findIndex(item => item.id === row.id); |
| | | if (index !== -1) { |
| | | mockData.splice(index, 1); |
| | | } |
| | | ElMessage.success("å 餿å"); |
| | | getTableData(); |
| | | }); |
| | | }; |
| | | |
| | | const handleOut = () => { |
| | | ElMessage.success("å¯¼åºæå"); |
| | | proxy.download( |
| | | "/accountSales/exportAccountSalesOutbound", |
| | | buildFilterParams(), |
| | | `éå®åºåº_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | |
| | | <template> |
| | | <!-- éå®éè´§ --> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="éè´§åå·:"> |
| | | <el-input v-model="filters.returnCode" placeholder="请è¾å
¥éè´§åå·" clearable style="width: 200px;" /> |
| | | <el-input v-model="filters.returnNo" placeholder="请è¾å
¥éè´§åå·" clearable style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·:"> |
| | | <el-select v-model="filters.customerId" placeholder="è¯·éæ©å®¢æ·" clearable style="width: 200px;"> |
| | | <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" /> |
| | | </el-select> |
| | | <el-form-item label="客æ·åç§°:"> |
| | | <el-input v-model="filters.customerName" placeholder="请è¾å
¥å®¢æ·åç§°" clearable style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="éè´§æ¥æ:"> |
| | | <el-date-picker v-model="filters.dateRange" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" range-separator="è³" start-placeholder="å¼å§æ¥æ" end-placeholder="ç»ææ¥æ" clearable /> |
| | | <el-date-picker |
| | | v-model="filters.dateRange" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData">æç´¢</el-button> |
| | | <el-button type="primary" @click="onSearch">æç´¢</el-button> |
| | | <el-button @click="resetFilters">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | rowKey="id" |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :tableLoading="tableLoading" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | @pagination="changePage" |
| | | > |
| | | <template #status="{ row }"> |
| | | <el-tag :type="getStatusType(row.status)">{{ getStatusLabel(row.status) }}</el-tag> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <el-button type="primary" link @click="view(row)">æ¥ç</el-button> |
| | | <el-button type="primary" link @click="edit(row)" v-if="row.status === 'pending'">ç¼è¾</el-button> |
| | | <el-button type="success" link @click="handleAudit(row)" v-if="row.status === 'pending'">å®¡æ ¸</el-button> |
| | | </template> |
| | | </PIMTable> |
| | | /> |
| | | </div> |
| | | |
| | | <FormDialog :title="dialogTitle" v-model="dialogVisible" width="800px" @confirm="submitForm" @cancel="dialogVisible = false"> |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="120px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éè´§åå·" prop="returnCode"> |
| | | <el-input v-model="form.returnCode" placeholder="请è¾å
¥éè´§åå·" :disabled="isEdit" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
³èåºåºå" prop="outCode"> |
| | | <el-select v-model="form.outCode" placeholder="è¯·éæ©åºåºå" style="width: 100%;" :disabled="isEdit"> |
| | | <el-option v-for="item in outList" :key="item.outCode" :label="item.outCode" :value="item.outCode" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·" prop="customerId"> |
| | | <el-select v-model="form.customerId" placeholder="è¯·éæ©å®¢æ·" style="width: 100%;" :disabled="isEdit"> |
| | | <el-option v-for="item in customerList" :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="returnDate"> |
| | | <el-date-picker v-model="form.returnDate" type="date" placeholder="éæ©æ¥æ" value-format="YYYY-MM-DD" style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éè´§éé¢" prop="amount"> |
| | | <el-input-number v-model="form.amount" :min="0" :precision="2" style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éè´§åå " prop="reason"> |
| | | <el-input v-model="form.reason" placeholder="请è¾å
¥éè´§åå " /> |
| | | </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> |
| | | <template #footer> |
| | | <el-button type="primary" @click="submitForm">ç¡®å®</el-button> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | </template> |
| | | </FormDialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import FormDialog from "@/components/Dialog/FormDialog.vue"; |
| | | import { ref, reactive, onMounted, getCurrentInstance } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { listPageAccountSalesReturn } from "@/api/financialManagement/accountSales"; |
| | | |
| | | defineOptions({ |
| | | name: "éå®éè´§", |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const filters = reactive({ |
| | | returnCode: "", |
| | | customerId: "", |
| | | returnNo: "", |
| | | customerName: "", |
| | | dateRange: [], |
| | | }); |
| | | |
| | |
| | | }); |
| | | |
| | | const columns = [ |
| | | { label: "éè´§åå·", prop: "returnCode", width: "150" }, |
| | | { label: "客æ·åç§°", prop: "customerName", width: "180" }, |
| | | { label: "å
³èåºåºå", prop: "outCode", width: "150" }, |
| | | { label: "éè´§æ¥æ", prop: "returnDate", width: "120" }, |
| | | { label: "éè´§éé¢", prop: "amount", width: "120" }, |
| | | { label: "éè´§åå ", prop: "reason", width: "150", showOverflowTooltip: true }, |
| | | { label: "ç¶æ", prop: "status", slot: "status" }, |
| | | { label: "æä½", prop: "operation", slot: "operation", width: "200", fixed: "right" }, |
| | | { label: "éè´§åå·", prop: "returnNo", minWidth: "150" }, |
| | | { label: "客æ·åç§°", prop: "customerName", minWidth: "180" }, |
| | | { label: "å
³èåè´§åå·", prop: "shippingNo", minWidth: "150" }, |
| | | { label: "éè´§æ¥æ", prop: "makeTime", minWidth: "170" }, |
| | | { |
| | | label: "鿬¾æ»é¢", |
| | | prop: "refundAmount", |
| | | minWidth: "120", |
| | | align: "right", |
| | | formatData: (val) => |
| | | val === null || val === undefined || val === "" |
| | | ? "" |
| | | : Number(val).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 }), |
| | | }, |
| | | { label: "éè´§åå ", prop: "returnReason", minWidth: "150", showOverflowTooltip: true }, |
| | | { label: "éå®è®¢åå·", prop: "salesContractNo", minWidth: "150" }, |
| | | ]; |
| | | |
| | | const dataList = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const dialogTitle = ref(""); |
| | | const formRef = ref(null); |
| | | const isEdit = ref(false); |
| | | const currentId = ref(null); |
| | | const tableLoading = ref(false); |
| | | |
| | | const customerList = [ |
| | | { id: 1, name: "åäº¬ç§ææéå
¬å¸" }, |
| | | { id: 2, name: "䏿µ·è´¸æå
¬å¸" }, |
| | | { id: 3, name: "广å·å®ä¸æéå
¬å¸" }, |
| | | { id: 4, name: "æ·±å³çµåå
¬å¸" }, |
| | | ]; |
| | | function buildFilterParams() { |
| | | const params = { |
| | | returnNo: filters.returnNo || undefined, |
| | | customerName: filters.customerName || undefined, |
| | | }; |
| | | if (filters.dateRange && filters.dateRange.length === 2) { |
| | | params.startDate = filters.dateRange[0]; |
| | | params.endDate = filters.dateRange[1]; |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | const outList = [ |
| | | { outCode: "CK2024001", customerId: 1 }, |
| | | { outCode: "CK2024002", customerId: 2 }, |
| | | { outCode: "CK2024003", customerId: 3 }, |
| | | ]; |
| | | |
| | | const form = reactive({ |
| | | returnCode: "", |
| | | outCode: "", |
| | | customerId: "", |
| | | returnDate: "", |
| | | amount: 0, |
| | | reason: "", |
| | | remark: "", |
| | | }); |
| | | |
| | | const rules = { |
| | | returnCode: [{ required: true, message: "请è¾å
¥éè´§åå·", trigger: "blur" }], |
| | | outCode: [{ required: true, message: "è¯·éæ©å
³èåºåºå", trigger: "change" }], |
| | | customerId: [{ required: true, message: "è¯·éæ©å®¢æ·", trigger: "change" }], |
| | | returnDate: [{ required: true, message: "è¯·éæ©éè´§æ¥æ", trigger: "change" }], |
| | | amount: [{ required: true, message: "请è¾å
¥éè´§éé¢", trigger: "blur" }], |
| | | }; |
| | | |
| | | const mockData = [ |
| | | { id: 1, returnCode: "TH2024001", outCode: "CK2024001", customerId: 1, customerName: "åäº¬ç§ææéå
¬å¸", returnDate: "2024-01-20", amount: 1000, reason: "è´¨éé®é¢", status: "approved", remark: "" }, |
| | | { id: 2, returnCode: "TH2024002", outCode: "CK2024002", customerId: 2, customerName: "䏿µ·è´¸æå
¬å¸", returnDate: "2024-01-22", amount: 500, reason: "è§æ ¼ä¸ç¬¦", status: "pending", remark: "" }, |
| | | ]; |
| | | |
| | | const getStatusLabel = (status) => { |
| | | const map = { pending: "å¾
å®¡æ ¸", approved: "å·²å®¡æ ¸", rejected: "已驳å" }; |
| | | return map[status] || status; |
| | | }; |
| | | |
| | | const getStatusType = (status) => { |
| | | const map = { pending: "warning", approved: "success", rejected: "danger" }; |
| | | return map[status] || ""; |
| | | const onSearch = () => { |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const getTableData = () => { |
| | | let result = [...mockData]; |
| | | if (filters.returnCode) { |
| | | result = result.filter(item => item.returnCode.includes(filters.returnCode)); |
| | | } |
| | | if (filters.customerId) { |
| | | result = result.filter(item => item.customerId === filters.customerId); |
| | | } |
| | | if (filters.dateRange && filters.dateRange.length === 2) { |
| | | result = result.filter(item => item.returnDate >= filters.dateRange[0] && item.returnDate <= filters.dateRange[1]); |
| | | } |
| | | pagination.total = result.length; |
| | | dataList.value = result.slice((pagination.currentPage - 1) * pagination.pageSize, pagination.currentPage * pagination.pageSize); |
| | | tableLoading.value = true; |
| | | listPageAccountSalesReturn({ |
| | | ...buildFilterParams(), |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | }) |
| | | .then((res) => { |
| | | const ok = res.code === 200 || res.code === 0; |
| | | if (ok && res.data) { |
| | | pagination.total = res.data.total ?? 0; |
| | | dataList.value = res.data.records ?? []; |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | dataList.value = []; |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | dataList.value = []; |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const resetFilters = () => { |
| | | filters.returnCode = ""; |
| | | filters.customerId = ""; |
| | | filters.returnNo = ""; |
| | | filters.customerName = ""; |
| | | filters.dateRange = []; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const changePage = ({ current, size }) => { |
| | | pagination.currentPage = current; |
| | | pagination.pageSize = size; |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | getTableData(); |
| | | }; |
| | | |
| | | const add = () => { |
| | | isEdit.value = false; |
| | | dialogTitle.value = "æ°å¢éè´§"; |
| | | Object.assign(form, { |
| | | returnCode: "TH" + Date.now(), |
| | | outCode: "", |
| | | customerId: "", |
| | | returnDate: "", |
| | | amount: 0, |
| | | reason: "", |
| | | remark: "", |
| | | }); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | const edit = (row) => { |
| | | isEdit.value = true; |
| | | currentId.value = row.id; |
| | | dialogTitle.value = "ç¼è¾éè´§"; |
| | | Object.assign(form, row); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | const view = (row) => { |
| | | ElMessage.info(`æ¥çéè´§å: ${row.returnCode}`); |
| | | }; |
| | | |
| | | const handleAudit = (row) => { |
| | | ElMessageBox.confirm("ç¡®è®¤å®¡æ ¸éè¿è¯¥éè´§ååï¼", "æç¤º", { |
| | | confirmButtonText: "éè¿", |
| | | cancelButtonText: "驳å", |
| | | distinguishCancelAndClose: true, |
| | | type: "warning", |
| | | }).then(() => { |
| | | const index = mockData.findIndex(item => item.id === row.id); |
| | | if (index !== -1) { |
| | | mockData[index].status = "approved"; |
| | | } |
| | | ElMessage.success("å®¡æ ¸éè¿"); |
| | | getTableData(); |
| | | }).catch((action) => { |
| | | if (action === "cancel") { |
| | | const index = mockData.findIndex(item => item.id === row.id); |
| | | if (index !== -1) { |
| | | mockData[index].status = "rejected"; |
| | | } |
| | | ElMessage.warning("已驳å"); |
| | | getTableData(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const submitForm = () => { |
| | | formRef.value.validate((valid) => { |
| | | if (valid) { |
| | | const customer = customerList.find(item => item.id === form.customerId); |
| | | if (isEdit.value) { |
| | | const index = mockData.findIndex(item => item.id === currentId.value); |
| | | if (index !== -1) { |
| | | mockData[index] = { ...mockData[index], ...form, customerName: customer?.name }; |
| | | } |
| | | ElMessage.success("ç¼è¾æå"); |
| | | } else { |
| | | const newId = mockData.length > 0 ? Math.max(...mockData.map(item => item.id)) + 1 : 1; |
| | | mockData.push({ id: newId, ...form, customerName: customer?.name, status: "pending" }); |
| | | ElMessage.success("æ°å¢æå"); |
| | | } |
| | | dialogVisible.value = false; |
| | | getTableData(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const handleOut = () => { |
| | | ElMessage.success("å¯¼åºæå"); |
| | | proxy.download( |
| | | "/accountSales/exportAccountSalesReturn", |
| | | buildFilterParams(), |
| | | `éå®éè´§_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | |
| | | // è·åå·¥åºå表 |
| | | const getProcessList = () => { |
| | | list().then(res => { |
| | | processOptions.value = res.data |
| | | processOptions.value = res.data.records |
| | | }) |
| | | } |
| | | |
| | |
| | | <template> |
| | | <div> |
| | | <div class="search_form" style="margin-bottom: 10px;"> |
| | | <div> |
| | | <span class="search_title ml10">åºåºæ¥æï¼</span> |
| | | <el-date-picker |
| | | v-model="searchForm.timeStr" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | @change="handleQuery" |
| | | /> |
| | | <span class="search_title ml10">æ¥æºï¼</span> |
| | | <el-select v-model="searchForm.recordType" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©" |
| | | clearable> |
| | | <el-option v-for="item in stockRecordTypeOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"/> |
| | | </el-select> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px" |
| | | >æç´¢</el-button |
| | | > |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="handleBatchApprove">审æ¹</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | <el-button type="primary" plain @click="handlePrint">æå°</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" |
| | | :row-key="(row) => row.id" |
| | | style="width: 100%" |
| | | height="calc(100vh - 18.5em)" |
| | | > |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column |
| | | label="åºåºæ¹æ¬¡" |
| | | prop="outboundBatches" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | <div> |
| | | <div class="search_form" style="margin-bottom: 10px"> |
| | | <div> |
| | | <span class="search_title ml10">åºåºæ¥æï¼</span> |
| | | <el-date-picker |
| | | v-model="searchForm.timeStr" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | @change="handleQuery" |
| | | /> |
| | | <el-table-column |
| | | label="åºåºæ¥æ" |
| | | prop="createTime" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="产å大类" |
| | | prop="productName" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="è§æ ¼åå·" |
| | | prop="model" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="æ¹å·" |
| | | prop="batchNo" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åä½" |
| | | prop="unit" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åºåºæ°é" |
| | | prop="stockOutNum" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åºåºäºº" |
| | | prop="createBy" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="æ¥æº" |
| | | prop="recordType" |
| | | show-overflow-tooltip> |
| | | <span class="search_title ml10">æ¥æºï¼</span> |
| | | <el-select |
| | | v-model="searchForm.recordType" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in stockRecordTypeOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px" |
| | | >æç´¢</el-button |
| | | > |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="handleBatchApprove">审æ¹</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | <el-button type="primary" plain @click="handlePrint">æå°</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" |
| | | :row-key="(row) => row.id" |
| | | style="width: 100%" |
| | | height="calc(100vh - 18.5em)" |
| | | > |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column |
| | | label="åºåºæ¹æ¬¡" |
| | | prop="outboundBatches" |
| | | min-width="100" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åºåºæ¥æ" |
| | | prop="createTime" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="产å大类" |
| | | prop="productName" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="è§æ ¼åå·" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="æ¹å·" prop="batchNo" show-overflow-tooltip /> |
| | | <el-table-column label="åä½" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column |
| | | label="åºåºæ°é" |
| | | prop="stockOutNum" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="åºåºäºº" prop="createBy" show-overflow-tooltip /> |
| | | <el-table-column label="æ¥æº" prop="recordType" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{ getRecordType(scope.row.recordType) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="审æ¹ç¶æ" prop="approvalStatus" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)" size="small"> |
| | | {{ getApprovalStatusLabel(scope.row.approvalStatus) }} |
| | | </el-tag> |
| | | </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> |
| | | </div> |
| | | <el-table-column |
| | | label="审æ¹ç¶æ" |
| | | prop="approvalStatus" |
| | | show-overflow-tooltip |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="getApprovalStatusTagType(scope.row.approvalStatus)" |
| | | size="small" |
| | | > |
| | | {{ getApprovalStatusLabel(scope.row.approvalStatus) }} |
| | | </el-tag> |
| | | </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> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | import { |
| | | getStockOutPage, |
| | | delPendingStockOut, |
| | | batchApproveStockOutRecords, |
| | | getStockOutPage, |
| | | delPendingStockOut, |
| | | batchApproveStockOutRecords, |
| | | } from "@/api/inventoryManagement/stockOut.js"; |
| | | import { |
| | | findAllQualifiedStockOutRecordTypeOptions, findAllUnQualifiedStockOutRecordTypeOptions, |
| | | findAllQualifiedStockOutRecordTypeOptions, |
| | | findAllUnQualifiedStockOutRecordTypeOptions, |
| | | } from "@/api/basicData/enum.js"; |
| | | |
| | | const userStore = useUserStore(); |
| | |
| | | // æ¥æºç±»åé项 |
| | | const stockRecordTypeOptions = ref([]); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | current: 1, |
| | | size: 100, |
| | | }); |
| | | const total = ref(0); |
| | | |
| | |
| | | type: { |
| | | type: String, |
| | | required: true, |
| | | default: '0' |
| | | default: "0", |
| | | }, |
| | | topParentProductId: { |
| | | type: [String, Number], |
| | | default: undefined |
| | | } |
| | | }) |
| | | default: undefined, |
| | | }, |
| | | }); |
| | | |
| | | // æå°ç¸å
³ |
| | | const printPreviewVisible = ref(false); |
| | |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const data = reactive({ |
| | | searchForm: { |
| | | supplierName: "", |
| | | timeStr: "", |
| | | searchForm: { |
| | | supplierName: "", |
| | | timeStr: "", |
| | | recordType: "", |
| | | } |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | getStockOutPage({ ...searchForm.value, ...page, topParentProductId: props.topParentProductId }) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | tableData.value.map((item) => { |
| | | item.children = []; |
| | | }); |
| | | total.value = res.data.total; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | tableLoading.value = true; |
| | | getStockOutPage({ |
| | | ...searchForm.value, |
| | | ...page, |
| | | topParentProductId: props.topParentProductId, |
| | | }) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | tableData.value.map((item) => { |
| | | item.children = []; |
| | | }); |
| | | total.value = res.data.total; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const getRecordType = (recordType) => { |
| | | return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || '' |
| | | } |
| | | return ( |
| | | stockRecordTypeOptions.value.find((item) => item.value === recordType) |
| | | ?.label || "" |
| | | ); |
| | | }; |
| | | |
| | | const approvalStatusLabelMap = { |
| | | 0: "å¾
审æ¹", |
| | | 1: "éè¿", |
| | | 2: "驳å", |
| | | pending: "å¾
审æ¹", |
| | | approved: "éè¿", |
| | | rejected: "驳å", |
| | | PENDING: "å¾
审æ¹", |
| | | APPROVED: "éè¿", |
| | | REJECTED: "驳å", |
| | | 0: "å¾
审æ¹", |
| | | 1: "éè¿", |
| | | 2: "驳å", |
| | | 3: "å¾
确认", |
| | | pending: "å¾
审æ¹", |
| | | approved: "éè¿", |
| | | rejected: "驳å", |
| | | PENDING: "å¾
审æ¹", |
| | | APPROVED: "éè¿", |
| | | REJECTED: "驳å", |
| | | }; |
| | | |
| | | const getApprovalStatusLabel = (status) => { |
| | | if (status === null || status === undefined || status === "") { |
| | | return "å¾
审æ¹"; |
| | | } |
| | | return approvalStatusLabelMap[status] || "å¾
审æ¹"; |
| | | if (status === null || status === undefined || status === "") { |
| | | return "å¾
审æ¹"; |
| | | } |
| | | return approvalStatusLabelMap[status] || "å¾
审æ¹"; |
| | | }; |
| | | |
| | | // éè¿/驳ååºå®è²ï¼å
¶ä½ï¼å«å¾
审æ¹ã空å¼ãæªæ å°ä½ææ¡ä¸ºå¾
审æ¹ï¼ç»ä¸ç¨ warning é¢è¦è² |
| | | const getApprovalStatusTagType = (status) => { |
| | | if (status === 1 || status === "1" || status === "approved" || status === "APPROVED") return "success"; |
| | | if (status === 2 || status === "2" || status === "rejected" || status === "REJECTED") return "danger"; |
| | | return "warning"; |
| | | if ( |
| | | status === 1 || |
| | | status === "1" || |
| | | status === "approved" || |
| | | status === "APPROVED" |
| | | ) |
| | | return "success"; |
| | | if ( |
| | | status === 2 || |
| | | status === "2" || |
| | | status === "rejected" || |
| | | status === "REJECTED" |
| | | ) |
| | | return "danger"; |
| | | return "warning"; |
| | | }; |
| | | |
| | | // è·åæ¥æºç±»åé项 |
| | | const fetchStockRecordTypeOptions = () => { |
| | | if (props.type === '0') { |
| | | findAllQualifiedStockOutRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | return |
| | | if (props.type === "0") { |
| | | findAllQualifiedStockOutRecordTypeOptions().then((res) => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }); |
| | | return; |
| | | } |
| | | findAllUnQualifiedStockOutRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | } |
| | | findAllUnQualifiedStockOutRecordTypeOptions().then((res) => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }); |
| | | }; |
| | | |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter((item) => item.id); |
| | | console.log("selection", selectedRows.value); |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter((item) => item.id); |
| | | console.log("selection", selectedRows.value); |
| | | }; |
| | | const expandedRowKeys = ref([]); |
| | | |
| | | const handleBatchApprove = () => { |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | ElMessageBox.confirm("è¯·éæ©å®¡æ¹ç»æ", "审æ¹", { |
| | | confirmButtonText: "éè¿", |
| | | cancelButtonText: "驳å", |
| | | type: "warning", |
| | | distinguishCancelAndClose: true, |
| | | }) |
| | | .then(() => { |
| | | batchApproveStockOutRecords({ ids, approvalStatus: 1 }) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("审æ¹éè¿æå"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msgError("审æ¹éè¿å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch((action) => { |
| | | if (action === "cancel") { |
| | | batchApproveStockOutRecords({ ids, approvalStatus: 2 }) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("审æ¹é©³åæå"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msgError("审æ¹é©³å失败"); |
| | | }); |
| | | return; |
| | | } |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | ElMessageBox.confirm("è¯·éæ©å®¡æ¹ç»æ", "审æ¹", { |
| | | confirmButtonText: "éè¿", |
| | | cancelButtonText: "驳å", |
| | | type: "warning", |
| | | distinguishCancelAndClose: true, |
| | | }) |
| | | .then(() => { |
| | | batchApproveStockOutRecords({ ids, approvalStatus: 1 }) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("审æ¹éè¿æå"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msgError("审æ¹éè¿å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch((action) => { |
| | | if (action === "cancel") { |
| | | batchApproveStockOutRecords({ ids, approvalStatus: 2 }) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("审æ¹é©³åæå"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msgError("审æ¹é©³å失败"); |
| | | }); |
| | | return; |
| | | } |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/stockOutRecord/exportStockOutRecord", {type: props.type}, props.type === '0' ? "åæ ¼åºåºå°è´¦.xlsx" : "ä¸åæ ¼åºåºå°è´¦.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | ElMessageBox.confirm("æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download( |
| | | "/stockOutRecord/exportStockOutRecord", |
| | | { type: props.type }, |
| | | props.type === "0" ? "åæ ¼åºåºå°è´¦.xlsx" : "ä¸åæ ¼åºåºå°è´¦.xlsx" |
| | | ); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delPendingStockOut(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delPendingStockOut(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // æå°åè½ |
| | | const handlePrint = () => { |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("è¯·éæ©è¦æå°çæ°æ®"); |
| | | return; |
| | | } |
| | | printData.value = [...selectedRows.value]; |
| | | console.log('æå°æ°æ®:', printData.value); |
| | | printPreviewVisible.value = true; |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("è¯·éæ©è¦æå°çæ°æ®"); |
| | | return; |
| | | } |
| | | printData.value = [...selectedRows.value]; |
| | | console.log("æå°æ°æ®:", printData.value); |
| | | printPreviewVisible.value = true; |
| | | }; |
| | | |
| | | // æ§è¡æå° |
| | | const executePrint = () => { |
| | | console.log('å¼å§æ§è¡æå°ï¼æ°æ®æ¡æ°:', printData.value.length); |
| | | console.log('æå°æ°æ®:', printData.value); |
| | | |
| | | // å建ä¸ä¸ªæ°çæå°çªå£ |
| | | const printWindow = window.open('', '_blank', 'width=800,height=600'); |
| | | |
| | | // æå»ºæå°å
容 |
| | | let printContent = ` |
| | | console.log("å¼å§æ§è¡æå°ï¼æ°æ®æ¡æ°:", printData.value.length); |
| | | console.log("æå°æ°æ®:", printData.value); |
| | | |
| | | // å建ä¸ä¸ªæ°çæå°çªå£ |
| | | const printWindow = window.open("", "_blank", "width=800,height=600"); |
| | | |
| | | // æå»ºæå°å
容 |
| | | let printContent = ` |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | |
| | | </head> |
| | | <body> |
| | | `; |
| | | |
| | | // ä¸ºæ¯æ¡æ°æ®çææå°é¡µé¢ |
| | | printData.value.forEach((item, index) => { |
| | | printContent += ` |
| | | |
| | | // ä¸ºæ¯æ¡æ°æ®çææå°é¡µé¢ |
| | | printData.value.forEach((item, index) => { |
| | | printContent += ` |
| | | <div class="print-page"> |
| | | <div class="delivery-note"> |
| | | <div class="header"> |
| | |
| | | </div> |
| | | <div class="info-row"> |
| | | <span class="label">åå·ï¼</span> |
| | | <span class="value">${item.code || ''}</span> |
| | | <span class="value">${item.code || ""}</span> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </thead> |
| | | <tbody> |
| | | <tr> |
| | | <td>${item.productName || 'ç ç°ç '}</td> |
| | | <td>${item.model || 'æ å'}</td> |
| | | <td>${item.unit || 'å'}</td> |
| | | <td>${item.taxInclusiveUnitPrice || '0'}</td> |
| | | <td>${item.inboundNum || '2000'}</td> |
| | | <td>${item.taxInclusiveTotalPrice || '0'}</td> |
| | | <td>${item.productName || "ç ç°ç "}</td> |
| | | <td>${item.model || "æ å"}</td> |
| | | <td>${item.unit || "å"}</td> |
| | | <td>${item.taxInclusiveUnitPrice || "0"}</td> |
| | | <td>${item.inboundNum || "2000"}</td> |
| | | <td>${item.taxInclusiveTotalPrice || "0"}</td> |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | |
| | | <td class="total-value"></td> |
| | | <td class="total-value"></td> |
| | | <td class="total-value"></td> |
| | | <td class="total-value">${item.inboundNum || '2000'}</td> |
| | | <td class="total-value">${item.taxInclusiveTotalPrice || '0'}</td> |
| | | <td class="total-value">${item.inboundNum || "2000"}</td> |
| | | <td class="total-value">${ |
| | | item.taxInclusiveTotalPrice || "0" |
| | | }</td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | |
| | | <div class="footer-row"> |
| | | <div class="footer-item"> |
| | | <span class="label">æä½åï¼</span> |
| | | <span class="value">${userStore.nickName || 'æå¼å'}</span> |
| | | <span class="value">${userStore.nickName || "æå¼å"}</span> |
| | | </div> |
| | | <div class="footer-item"> |
| | | <span class="label">æå°æ¥æï¼</span> |
| | |
| | | </div> |
| | | </div> |
| | | `; |
| | | }); |
| | | |
| | | printContent += ` |
| | | }); |
| | | |
| | | printContent += ` |
| | | </body> |
| | | </html> |
| | | `; |
| | | |
| | | // åå
¥å
容尿°çªå£ |
| | | printWindow.document.write(printContent); |
| | | printWindow.document.close(); |
| | | |
| | | // çå¾
å
容å è½½å®æåæå° |
| | | printWindow.onload = () => { |
| | | setTimeout(() => { |
| | | printWindow.print(); |
| | | printWindow.close(); |
| | | printPreviewVisible.value = false; |
| | | }, 500); |
| | | }; |
| | | |
| | | // åå
¥å
容尿°çªå£ |
| | | printWindow.document.write(printContent); |
| | | printWindow.document.close(); |
| | | |
| | | // çå¾
å
容å è½½å®æåæå° |
| | | printWindow.onload = () => { |
| | | setTimeout(() => { |
| | | printWindow.print(); |
| | | printWindow.close(); |
| | | printPreviewVisible.value = false; |
| | | }, 500); |
| | | }; |
| | | }; |
| | | |
| | | |
| | | |
| | | // æ ¼å¼åæ¥æ |
| | | const formatDate = (dateString) => { |
| | | if (!dateString) return getCurrentDate(); |
| | | const date = new Date(dateString); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | return `${year}/${month}/${day}`; |
| | | if (!dateString) return getCurrentDate(); |
| | | const date = new Date(dateString); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | return `${year}/${month}/${day}`; |
| | | }; |
| | | |
| | | // æ ¼å¼åæ¥ææ¶é´ |
| | | const formatDateTime = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | const seconds = String(date.getSeconds()).padStart(2, "0"); |
| | | return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`; |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | const seconds = String(date.getSeconds()).padStart(2, "0"); |
| | | return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`; |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | getList(); |
| | | fetchStockRecordTypeOptions(); |
| | | }); |
| | | |
| | |
| | | |
| | | <style scoped lang="scss"> |
| | | .print-preview-dialog { |
| | | .el-dialog__body { |
| | | padding: 0; |
| | | max-height: 80vh; |
| | | overflow-y: auto; |
| | | } |
| | | .el-dialog__body { |
| | | padding: 0; |
| | | max-height: 80vh; |
| | | overflow-y: auto; |
| | | } |
| | | } |
| | | |
| | | .print-preview-container { |
| | | .print-preview-header { |
| | | padding: 15px; |
| | | border-bottom: 1px solid #e4e7ed; |
| | | text-align: center; |
| | | |
| | | .el-button { |
| | | margin: 0 10px; |
| | | } |
| | | } |
| | | |
| | | .print-preview-content { |
| | | padding: 20px; |
| | | background-color: #f5f5f5; |
| | | min-height: 400px; |
| | | } |
| | | .print-preview-header { |
| | | padding: 15px; |
| | | border-bottom: 1px solid #e4e7ed; |
| | | text-align: center; |
| | | |
| | | .el-button { |
| | | margin: 0 10px; |
| | | } |
| | | } |
| | | |
| | | .print-preview-content { |
| | | padding: 20px; |
| | | background-color: #f5f5f5; |
| | | min-height: 400px; |
| | | } |
| | | } |
| | | |
| | | .print-page { |
| | | width: 220mm; |
| | | height: 90mm; |
| | | padding: 10mm; |
| | | margin: 0 auto; |
| | | background: white; |
| | | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| | | margin-bottom: 10px; |
| | | box-sizing: border-box; |
| | | width: 220mm; |
| | | height: 90mm; |
| | | padding: 10mm; |
| | | margin: 0 auto; |
| | | background: white; |
| | | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| | | margin-bottom: 10px; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .delivery-note { |
| | | width: 100%; |
| | | height: 100%; |
| | | font-family: "SimSun", serif; |
| | | font-size: 10px; |
| | | line-height: 1.2; |
| | | display: flex; |
| | | flex-direction: column; |
| | | width: 100%; |
| | | height: 100%; |
| | | font-family: "SimSun", serif; |
| | | font-size: 10px; |
| | | line-height: 1.2; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .header { |
| | | text-align: center; |
| | | margin-bottom: 8px; |
| | | |
| | | .company-name { |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | margin-bottom: 4px; |
| | | } |
| | | |
| | | .document-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | text-align: center; |
| | | margin-bottom: 8px; |
| | | |
| | | .company-name { |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | margin-bottom: 4px; |
| | | } |
| | | |
| | | .document-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | |
| | | .info-section { |
| | | margin-bottom: 8px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | |
| | | .info-row { |
| | | line-height: 20px; |
| | | |
| | | .label { |
| | | font-weight: bold; |
| | | width: 60px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .value { |
| | | margin-right: 20px; |
| | | min-width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | margin-bottom: 8px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | |
| | | .info-row { |
| | | line-height: 20px; |
| | | |
| | | .label { |
| | | font-weight: bold; |
| | | width: 60px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .value { |
| | | margin-right: 20px; |
| | | min-width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .table-section { |
| | | margin-bottom: 4px; |
| | | flex: 1; |
| | | |
| | | .product-table { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | border: 1px solid #000; |
| | | |
| | | th, td { |
| | | border: 1px solid #000; |
| | | padding: 6px; |
| | | text-align: center; |
| | | font-size: 14px; |
| | | line-height: 1.4; |
| | | } |
| | | |
| | | th { |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .total-label { |
| | | text-align: right; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .total-value { |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | margin-bottom: 4px; |
| | | flex: 1; |
| | | |
| | | .product-table { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | border: 1px solid #000; |
| | | |
| | | th, |
| | | td { |
| | | border: 1px solid #000; |
| | | padding: 6px; |
| | | text-align: center; |
| | | font-size: 14px; |
| | | line-height: 1.4; |
| | | } |
| | | |
| | | th { |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .total-label { |
| | | text-align: right; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .total-value { |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .footer-section { |
| | | .footer-row { |
| | | display: flex; |
| | | margin-bottom: 3px; |
| | | line-height: 20px; |
| | | justify-content: space-between; |
| | | |
| | | .footer-item { |
| | | display: flex; |
| | | margin-right: 20px; |
| | | |
| | | .label { |
| | | font-weight: bold; |
| | | width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .value { |
| | | min-width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | &.address-item { |
| | | .address-value { |
| | | min-width: 200px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .footer-row { |
| | | display: flex; |
| | | margin-bottom: 3px; |
| | | line-height: 20px; |
| | | justify-content: space-between; |
| | | |
| | | .footer-item { |
| | | display: flex; |
| | | margin-right: 20px; |
| | | |
| | | .label { |
| | | font-weight: bold; |
| | | width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .value { |
| | | min-width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | &.address-item { |
| | | .address-value { |
| | | min-width: 200px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @media print { |
| | | .app-container { |
| | | display: none; |
| | | } |
| | | |
| | | .print-page { |
| | | box-shadow: none; |
| | | margin: 0; |
| | | padding: 10mm; |
| | | padding-left: 20mm; |
| | | page-break-inside: avoid; |
| | | page-break-after: always; |
| | | } |
| | | .print-page:last-child { |
| | | page-break-after: avoid; |
| | | } |
| | | .app-container { |
| | | display: none; |
| | | } |
| | | |
| | | .print-page { |
| | | box-shadow: none; |
| | | margin: 0; |
| | | padding: 10mm; |
| | | padding-left: 20mm; |
| | | page-break-inside: avoid; |
| | | page-break-after: always; |
| | | } |
| | | .print-page:last-child { |
| | | page-break-after: avoid; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | :selectable="isRowSelectableForApprove" |
| | | width="55"/> |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | |
| | | APPROVED: "éè¿", |
| | | REJECTED: "驳å", |
| | | }; |
| | | approvalStatusLabelMap[3] = "å¾
确认"; |
| | | |
| | | const getApprovalStatusLabel = (status) => { |
| | | if (status === null || status === undefined || status === "") { |
| | |
| | | if (status === 1 || status === "1" || status === "approved" || status === "APPROVED") return "success"; |
| | | if (status === 2 || status === "2" || status === "rejected" || status === "REJECTED") return "danger"; |
| | | return "warning"; |
| | | }; |
| | | |
| | | const isPendingApproval = status => { |
| | | return status === 0 || status === "0" || status === "pending" || status === "PENDING" || status === null || status === undefined || status === ""; |
| | | }; |
| | | |
| | | const isRowSelectableForApprove = row => { |
| | | return isPendingApproval(row?.approvalStatus); |
| | | }; |
| | | |
| | | const pageProductChange = obj => { |
| | |
| | | |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = selection => { |
| | | selectedRows.value = selection.filter(item => item.id); |
| | | selectedRows.value = selection.filter(item => item.id && isPendingApproval(item.approvalStatus)); |
| | | }; |
| | | |
| | | const expandedRowKeys = ref([]); |
| | |
| | | } |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | |
| | | } |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | |
| | | tableData.value = list |
| | | } |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | const lookFile = (row) => { |
| | | filePreviewRef.value.open(row.url) |
| | |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: row => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: row => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | } |
| | | |
| | | function downloadAttachment(att) { |
| | | if (att?.name) { |
| | | if (att) { |
| | | try { |
| | | proxy.$download.name(att.url); |
| | | proxy.$download.byUrl(att.url, att.originalFilename); |
| | | return |
| | | } catch (e) {} |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | function downloadAttachment(att) { |
| | | if (att?.url) { |
| | | function downloadAttachment(row) { |
| | | if (row?.url) { |
| | | try { |
| | | proxy.$download.resource(att.url) |
| | | return |
| | | } catch (e) {} |
| | | } |
| | | if (att?.name) { |
| | | try { |
| | | proxy.$download.name(att.name, false) |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | return |
| | | } catch (e) {} |
| | | } |
| | |
| | | } |
| | | |
| | | /** ä¸è½½éä»¶ */ |
| | | function handleDownload(attachment) { |
| | | const url = attachment?.url || attachment?.fileUrl || attachment?.tempPath || attachment?.fileName; |
| | | if (!url) { |
| | | ElMessage.warning("æªæ¾å°å¯ä¸è½½çæä»¶å°å"); |
| | | return; |
| | | } |
| | | proxy.$download.name(url); |
| | | function handleDownload(row) { |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | |
| | | onMounted(() => { |
| | |
| | | }; |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | |
| | | }; |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | |
| | | } |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | // é¢è§éä»¶ |
| | | const lookFile = (row) => { |
| | |
| | | tableData.value = list |
| | | } |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | |
| | | } |
| | | const lookFile = (row) => { |
| | |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" :inline="true"> |
| | | <el-form-item label="éå®è®¢åå·ï¼"> |
| | | <el-input v-model="searchForm.salesContractNo" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery"/> |
| | | <el-input |
| | | v-model="searchForm.salesContractNo" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="车çå·ï¼"> |
| | | <el-input v-model="searchForm.shippingCarNumber" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery"/> |
| | | <el-input |
| | | v-model="searchForm.shippingCarNumber" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å¿«éåå·ï¼"> |
| | | <el-input v-model="searchForm.expressNumber" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery"/> |
| | | <el-input |
| | | v-model="searchForm.expressNumber" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery"> æç´¢</el-button> |
| | |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :row-key="(row) => row.id" style="width: 100%" height="calc(100vh - 21.5em)"> |
| | | <el-table-column align="center" type="selection" width="55"/> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60"/> |
| | | <el-table-column label="éå®è®¢å" prop="salesContractNo" show-overflow-tooltip/> |
| | | <el-table-column label="å货订åå·" prop="shippingNo" show-overflow-tooltip/> |
| | | <el-table-column label="客æ·åç§°" prop="customerName" show-overflow-tooltip/> |
| | | <el-table-column label="产ååç§°" prop="productName" show-overflow-tooltip/> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" show-overflow-tooltip/> |
| | | <el-table-column label="åè´§æ¶é´" prop="shippingDate" show-overflow-tooltip/> |
| | | <el-table-column label="å货车çå·" prop="shippingCarNumber" show-overflow-tooltip/> |
| | | <el-table-column label="å¿«éå
¬å¸" prop="expressCompany" show-overflow-tooltip/> |
| | | <el-table-column label="å¿«éåå·" prop="expressNumber" show-overflow-tooltip/> |
| | | <el-table-column label="å®¡æ ¸ç¶æ" prop="status" align="center" width="120"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | :row-key="(row) => row.id" |
| | | style="width: 100%" |
| | | height="calc(100vh - 21.5em)" |
| | | > |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column |
| | | label="éå®è®¢å" |
| | | prop="salesContractNo" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="å货订åå·" |
| | | prop="shippingNo" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="客æ·åç§°" |
| | | prop="customerName" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="产ååç§°" |
| | | prop="productName" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="è§æ ¼åå·" |
| | | prop="specificationModel" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åè´§æ¶é´" |
| | | prop="shippingDate" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="å货车çå·" |
| | | prop="shippingCarNumber" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="å¿«éå
¬å¸" |
| | | prop="expressCompany" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="å¿«éåå·" |
| | | prop="expressNumber" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="å®¡æ ¸ç¶æ" |
| | | prop="status" |
| | | align="center" |
| | | width="120" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getApprovalStatusType(scope.row.status)"> |
| | | {{ getApprovalStatusText(scope.row.status) }} |
| | |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="æä½" width="220" align="center"> |
| | | <template #default="scope"> |
| | | <!-- <el-button--> |
| | | <!-- link--> |
| | | <!-- type="primary"--> |
| | | <!-- :disabled="!isApproved(scope.row.status)"--> |
| | | <!-- @click="openForm('edit', scope.row)">åè´§--> |
| | | <!-- </el-button>--> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | :disabled="!isApproved(scope.row.status)" |
| | | @click="openForm('edit', scope.row)">åè´§ |
| | | link |
| | | type="primary" |
| | | style="color: #67c23a" |
| | | @click="openDetail(scope.row)" |
| | | >详æ
|
| | | </el-button> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | style="color: #67C23A" |
| | | @click="openDetail(scope.row)" |
| | | >详æ
|
| | | </el-button> |
| | | <el-button |
| | | link |
| | | type="danger" |
| | | :disabled="isApproving(scope.row.status)" |
| | | @click="handleDeleteSingle(scope.row)">å é¤ |
| | | link |
| | | type="danger" |
| | | :disabled="isApproving(scope.row.status)" |
| | | @click="handleDeleteSingle(scope.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"/> |
| | | <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="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢åè´§å°è´¦' : 'ç¼è¾åè´§å°è´¦'" |
| | | width="40%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="120px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-dialog |
| | | v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢åè´§å°è´¦' : 'ç¼è¾åè´§å°è´¦'" |
| | | width="40%" |
| | | @close="closeDia" |
| | | > |
| | | <el-form |
| | | :model="form" |
| | | label-width="120px" |
| | | label-position="top" |
| | | :rules="rules" |
| | | ref="formRef" |
| | | > |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åè´§ç±»åï¼" prop="type"> |
| | | <el-select |
| | | v-model="form.type" |
| | | placeholder="è¯·éæ©åè´§ç±»å" |
| | | style="width: 100%" |
| | | @change="handleShippingTypeChange" |
| | | v-model="form.type" |
| | | placeholder="è¯·éæ©åè´§ç±»å" |
| | | style="width: 100%" |
| | | @change="handleShippingTypeChange" |
| | | > |
| | | <el-option label="货车" value="货车"/> |
| | | <el-option label="å¿«é" value="å¿«é"/> |
| | | <el-option label="货车" value="货车" /> |
| | | <el-option label="å¿«é" value="å¿«é" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="24"> |
| | | <el-form-item label="åè´§æ¥æï¼" prop="shippingDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.shippingDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©åè´§æ¥æ" |
| | | clearable |
| | | style="width: 100%" |
| | | v-model="form.shippingDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©åè´§æ¥æ" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="24" v-if="form.type === '货车'"> |
| | | <el-form-item label="å货车çå·ï¼" prop="shippingCarNumber"> |
| | | <el-input |
| | | v-model="form.shippingCarNumber" |
| | | placeholder="请è¾å
¥å货车çå·" |
| | | clearable |
| | | v-model="form.shippingCarNumber" |
| | | placeholder="请è¾å
¥å货车çå·" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-else> |
| | | <el-form-item label="å¿«éå
¬å¸ï¼" prop="expressCompany"> |
| | | <el-input |
| | | v-model="form.expressCompany" |
| | | placeholder="请è¾å
¥å¿«éå
¬å¸" |
| | | clearable |
| | | v-model="form.expressCompany" |
| | | placeholder="请è¾å
¥å¿«éå
¬å¸" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="24"> |
| | | <el-form-item label="å¿«éåå·ï¼" prop="expressNumber"> |
| | | <el-input |
| | | v-model="form.expressNumber" |
| | | placeholder="请è¾å
¥å¿«éåå·" |
| | | clearable |
| | | v-model="form.expressNumber" |
| | | placeholder="请è¾å
¥å¿«éåå·" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åè´§å¾çï¼"> |
| | | <ImageUpload v-model:file-list="deliveryFileList" :limit="9"/> |
| | | <ImageUpload v-model:file-list="deliveryFileList" :limit="9" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- 详æ
å¼¹æ¡ --> |
| | | <el-dialog v-model="detailDialogVisible" title="åè´§å°è´¦è¯¦æ
" width="55%" @close="closeDetail"> |
| | | <el-dialog |
| | | v-model="detailDialogVisible" |
| | | title="åè´§å°è´¦è¯¦æ
" |
| | | width="55%" |
| | | @close="closeDetail" |
| | | > |
| | | <div v-if="detailRow" class="detail-wrapper"> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="éå®è®¢å">{{ detailRow.salesContractNo || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å货订åå·">{{ detailRow.shippingNo || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·åç§°">{{ detailRow.customerName || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="产ååç§°">{{ detailRow.productName || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="è§æ ¼åå·">{{ detailRow.specificationModel || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§ç±»å">{{ detailRow.type || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§æ¥æ">{{ detailRow.shippingDate || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¡æ ¸ç¶æ">{{ getApprovalStatusText(detailRow.status) }}</el-descriptions-item> |
| | | <el-descriptions-item label="å货车çå·">{{ detailRow.shippingCarNumber || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éå
¬å¸">{{ detailRow.expressCompany || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éåå·" :span="2">{{ detailRow.expressNumber || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="éå®è®¢å">{{ |
| | | detailRow.salesContractNo || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å货订åå·">{{ |
| | | detailRow.shippingNo || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·åç§°">{{ |
| | | detailRow.customerName || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="产ååç§°">{{ |
| | | detailRow.productName || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="è§æ ¼åå·">{{ |
| | | detailRow.specificationModel || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§ç±»å">{{ |
| | | detailRow.type || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§æ¥æ">{{ |
| | | detailRow.shippingDate || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¡æ ¸ç¶æ">{{ |
| | | getApprovalStatusText(detailRow.status) |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å货车çå·">{{ |
| | | detailRow.shippingCarNumber || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éå
¬å¸">{{ |
| | | detailRow.expressCompany || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éåå·" :span="2">{{ |
| | | detailRow.expressNumber || "--" |
| | | }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-table :data="getDeliveryProductInfoList()" |
| | | border |
| | | size="small" |
| | | class="delivery-product-table" |
| | | style="width: 100%; margin-top: 16px;"> |
| | | <el-table-column label="æ¹å·" |
| | | prop="batchNo" |
| | | min-width="160" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="产ååç§°" |
| | | prop="productName" |
| | | min-width="160" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="è§æ ¼åå·" |
| | | prop="specificationModel" |
| | | min-width="160" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="åè´§æ°é" |
| | | prop="deliveryQuantity" |
| | | min-width="120" |
| | | align="center"/> |
| | | <el-table |
| | | :data="getDeliveryProductInfoList()" |
| | | border |
| | | size="small" |
| | | class="delivery-product-table" |
| | | style="width: 100%; margin-top: 16px" |
| | | > |
| | | <el-table-column |
| | | label="æ¹å·" |
| | | prop="batchNo" |
| | | min-width="160" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="产ååç§°" |
| | | prop="productName" |
| | | min-width="160" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="è§æ ¼åå·" |
| | | prop="specificationModel" |
| | | min-width="160" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åè´§æ°é" |
| | | prop="deliveryQuantity" |
| | | min-width="120" |
| | | align="center" |
| | | /> |
| | | </el-table> |
| | | <ImagePreview :file-list="detailRow.storageBlobVOs || []" /> |
| | | </div> |
| | |
| | | |
| | | <script setup> |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import {onMounted, ref, reactive, toRefs, getCurrentInstance} from "vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {getCurrentDate} from "@/utils/index.js"; |
| | | import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | import { |
| | | deliveryLedgerListPage, |
| | | delDeliveryLedger, |
| | | deductStock, |
| | | getDeliveryDetail, |
| | | } from "@/api/salesManagement/deliveryLedger.js"; |
| | | import {delLedgerFile} from "@/api/salesManagement/salesLedger.js"; |
| | | import { delLedgerFile } from "@/api/salesManagement/salesLedger.js"; |
| | | import ImageUpload from "@/components/AttachmentUpload/image/index.vue"; |
| | | import ImagePreview from "@/components/AttachmentPreview/image/index.vue"; |
| | | |
| | | |
| | | const {proxy} = getCurrentInstance(); |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | |
| | | expressNumber: "", // å¿«éåå· |
| | | }, |
| | | rules: { |
| | | salesContractNo: [{required: true, message: "è¯·éæ©éå®è®¢å", trigger: "change"}], |
| | | customerName: [{required: true, message: "请è¾å
¥å®¢æ·åç§°", trigger: "blur"}], |
| | | type: [ |
| | | {required: true, message: "è¯·éæ©åè´§ç±»å", trigger: "change"} |
| | | salesContractNo: [ |
| | | { required: true, message: "è¯·éæ©éå®è®¢å", trigger: "change" }, |
| | | ], |
| | | shippingDate: [{required: true, message: "è¯·éæ©åè´§æ¶é´", trigger: "change"}], |
| | | customerName: [ |
| | | { required: true, message: "请è¾å
¥å®¢æ·åç§°", trigger: "blur" }, |
| | | ], |
| | | type: [{ required: true, message: "è¯·éæ©åè´§ç±»å", trigger: "change" }], |
| | | shippingDate: [ |
| | | { required: true, message: "è¯·éæ©åè´§æ¶é´", trigger: "change" }, |
| | | ], |
| | | shippingCarNumber: [ |
| | | {validator: (_, value, callback) => validateShippingCarNumber(value, callback), trigger: "blur"} |
| | | { |
| | | validator: (_, value, callback) => |
| | | validateShippingCarNumber(value, callback), |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | expressCompany: [ |
| | | {validator: (_, value, callback) => validateExpressCompany(value, callback), trigger: "blur"} |
| | | { |
| | | validator: (_, value, callback) => |
| | | validateExpressCompany(value, callback), |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }); |
| | | const {form, rules} = toRefs(data); |
| | | const {searchForm} = toRefs(data); |
| | | |
| | | const { form, rules } = toRefs(data); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | // æ¥è¯¢å表 |
| | | const handleQuery = () => { |
| | |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | deliveryLedgerListPage({...searchForm.value, ...page}) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records || []; |
| | | total.value = res.data.total || 0; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | deliveryLedgerListPage({ ...searchForm.value, ...page }) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records || []; |
| | | total.value = res.data.total || 0; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | // éå®è®¢åååæ¶èªå¨å¡«å
客æ·åç§° |
| | | const handleSalesOrderChange = (value) => { |
| | | const selectedOrder = salesOrderOptions.value.find(item => item.salesContractNo === value); |
| | | const selectedOrder = salesOrderOptions.value.find( |
| | | (item) => item.salesContractNo === value |
| | | ); |
| | | if (selectedOrder) { |
| | | form.value.customerName = selectedOrder.customerName; |
| | | } |
| | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = async (type, row) => { |
| | | // åè´§ï¼ä»
âå®¡æ ¸éè¿âå
许ç¼è¾ |
| | | if (type === 'edit' && row && !isApproved(row.status)) { |
| | | if (type === "edit" && row && !isApproved(row.status)) { |
| | | proxy.$modal.msgWarning("åªæå®¡æ ¸éè¿çæ°æ®æå¯ä»¥åè´§"); |
| | | return; |
| | | } |
| | | |
| | | operationType.value = type; |
| | | |
| | | if (type === 'edit' && row) { |
| | | if (type === "edit" && row) { |
| | | form.value = { |
| | | id: row.id ?? null, |
| | | salesContractNo: row.salesContractNo ?? "", |
| | |
| | | proxy.$modal.msgError("å è½½åè´§å°è´¦è¯¦æ
失败"); |
| | | } |
| | | }; |
| | | const resolveDeliveryDetailList = data => { |
| | | const resolveDeliveryDetailList = (data) => { |
| | | if (Array.isArray(data)) return data; |
| | | if (!data || typeof data !== "object") return []; |
| | | return [ |
| | | data.batchNoDetailList, |
| | | data.batchNoList, |
| | | data.shippingBatchList, |
| | | data.shippingInfoDetailList, |
| | | data.detailList, |
| | | data.batchDetailList, |
| | | data.rows, |
| | | data.records, |
| | | data.list, |
| | | data.data, |
| | | ].find(value => Array.isArray(value) && value.length) || []; |
| | | return ( |
| | | [ |
| | | data.batchNoDetailList, |
| | | data.batchNoList, |
| | | data.shippingBatchList, |
| | | data.shippingInfoDetailList, |
| | | data.detailList, |
| | | data.batchDetailList, |
| | | data.rows, |
| | | data.records, |
| | | data.list, |
| | | data.data, |
| | | ].find((value) => Array.isArray(value) && value.length) || [] |
| | | ); |
| | | }; |
| | | const getDeliveryProductInfoList = () => { |
| | | const row = detailRow.value; |
| | | if (!row) return []; |
| | | const normalizeBatchNoList = value => { |
| | | const normalizeBatchNoList = (value) => { |
| | | if (Array.isArray(value)) return value; |
| | | if (typeof value === "string" && value.includes(",")) { |
| | | return value.split(",").map(item => item.trim()).filter(Boolean); |
| | | return value |
| | | .split(",") |
| | | .map((item) => item.trim()) |
| | | .filter(Boolean); |
| | | } |
| | | return value ? [value] : []; |
| | | }; |
| | | const detailList = detailProductList.value.length ? detailProductList.value : [ |
| | | row.batchNoDetailList, |
| | | row.batchNoList, |
| | | row.shippingBatchList, |
| | | row.shippingInfoDetailList, |
| | | row.detailList, |
| | | row.batchDetailList, |
| | | ].find(value => Array.isArray(value) && value.length); |
| | | const detailList = detailProductList.value.length |
| | | ? detailProductList.value |
| | | : [ |
| | | row.batchNoDetailList, |
| | | row.batchNoList, |
| | | row.shippingBatchList, |
| | | row.shippingInfoDetailList, |
| | | row.detailList, |
| | | row.batchDetailList, |
| | | ].find((value) => Array.isArray(value) && value.length); |
| | | const batchNoList = normalizeBatchNoList(row.batchNo); |
| | | const toTableRow = (item = {}) => ({ |
| | | batchNo: |
| | | typeof item === "string" || typeof item === "number" |
| | | ? item |
| | | : item.batchNo ?? item.batchNumber ?? row.batchNo ?? "--", |
| | | typeof item === "string" || typeof item === "number" |
| | | ? item |
| | | : item.batchNo ?? item.batchNumber ?? row.batchNo ?? "--", |
| | | productName: item.productName ?? row.productName ?? "--", |
| | | specificationModel: |
| | | item.specificationModel ?? item.model ?? row.specificationModel ?? "--", |
| | | item.specificationModel ?? item.model ?? row.specificationModel ?? "--", |
| | | deliveryQuantity: |
| | | item.deliveryQuantity ?? |
| | | item.quantity ?? |
| | | item.shippingQuantity ?? |
| | | row.deliveryQuantity ?? |
| | | row.quantity ?? |
| | | "--", |
| | | item.deliveryQuantity ?? |
| | | item.quantity ?? |
| | | item.shippingQuantity ?? |
| | | row.deliveryQuantity ?? |
| | | row.quantity ?? |
| | | "--", |
| | | }); |
| | | if (detailList?.length) { |
| | | return detailList.map(toTableRow); |
| | | } |
| | | if (batchNoList.length) { |
| | | return batchNoList.map(batchNo => toTableRow({batchNo})); |
| | | return batchNoList.map((batchNo) => toTableRow({ batchNo })); |
| | | } |
| | | return [toTableRow()]; |
| | | }; |
| | |
| | | id: form.value.id, |
| | | type: form.value.type, |
| | | shippingDate: form.value.shippingDate, |
| | | shippingCarNumber: form.value.type === "货车" ? form.value.shippingCarNumber : "", |
| | | expressCompany: form.value.type === "å¿«é" ? form.value.expressCompany : "", |
| | | expressNumber: form.value.type === "å¿«é" ? form.value.expressNumber : "", |
| | | shippingCarNumber: |
| | | form.value.type === "货车" ? form.value.shippingCarNumber : "", |
| | | expressCompany: |
| | | form.value.type === "å¿«é" ? form.value.expressCompany : "", |
| | | expressNumber: |
| | | form.value.type === "å¿«é" ? form.value.expressNumber : "", |
| | | storageBlobDTOs: deliveryFileList.value || [], |
| | | }; |
| | | deductStock(payload).then((res) => { |
| | |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/shippingInfo/export", {}, "åè´§å°è´¦.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | .then(() => { |
| | | proxy.download("/shippingInfo/export", {}, "åè´§å°è´¦.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // æ¹éå é¤ |
| | |
| | | } |
| | | |
| | | // æ£æ¥éä¸çè¡æ¯å¦æ"å®¡æ ¸ä¸"ç¶æ |
| | | const approvingRows = selectedRows.value.filter(row => isApproving(row.status)); |
| | | const approvingRows = selectedRows.value.filter((row) => |
| | | isApproving(row.status) |
| | | ); |
| | | if (approvingRows.length > 0) { |
| | | proxy.$modal.msgWarning("å®¡æ ¸ä¸çæ°æ®ä¸è½å é¤"); |
| | | return; |
| | |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delDeliveryLedger(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | .then(() => { |
| | | delDeliveryLedger(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // å个å é¤ |
| | |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delDeliveryLedger([row.id]).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | .then(() => { |
| | | delDeliveryLedger([row.id]).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // åè´§ç±»åæ ¡éªï¼è´§è½¦æ¶è¦æ±è½¦çï¼å¿«éæ¶è¦æ±å¿«éå
¬å¸ |
| | |
| | | // åè´§å¾çä¸ä¼ åæ ¡æ£ |
| | | function handleDeliveryBeforeUpload(file) { |
| | | // æ ¡æ£æä»¶ç±»å |
| | | const isImage = file.type === 'image/png' || file.type === 'image/jpeg' || file.type === 'image/jpg'; |
| | | const isImage = |
| | | file.type === "image/png" || |
| | | file.type === "image/jpeg" || |
| | | file.type === "image/jpg"; |
| | | if (!isImage) { |
| | | proxy.$modal.msgError("åªè½ä¸ä¼ jpgãjpegãpng æ ¼å¼çå¾ç!"); |
| | | return false; |
| | |
| | | |
| | | // ç§»é¤åè´§å¾ç |
| | | function handleDeliveryRemove(file) { |
| | | console.log('file--', file) |
| | | console.log("file--", file); |
| | | // 妿æ¯ç¼è¾æ¨¡å¼ä¸æä»¶æ idï¼éè¦è°ç¨æ¥å£å é¤ |
| | | if (operationType.value === "edit") { |
| | | let ids = []; |
| | | ids.push(file.uid); |
| | | delLedgerFile(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | // 仿件å表ä¸ç§»é¤ |
| | | const index = deliveryFileList.value.findIndex(item => item.uid === file.uid); |
| | | if (index > -1) { |
| | | deliveryFileList.value.splice(index, 1); |
| | | } |
| | | }).catch(() => { |
| | | proxy.$modal.msgError("å é¤å¤±è´¥"); |
| | | }); |
| | | delLedgerFile(ids) |
| | | .then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | // 仿件å表ä¸ç§»é¤ |
| | | const index = deliveryFileList.value.findIndex( |
| | | (item) => item.uid === file.uid |
| | | ); |
| | | if (index > -1) { |
| | | deliveryFileList.value.splice(index, 1); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msgError("å é¤å¤±è´¥"); |
| | | }); |
| | | } else { |
| | | // æ°å¢æ¨¡å¼ææ²¡æ id çæä»¶ï¼ç´æ¥ä»å表ä¸ç§»é¤ |
| | | const index = deliveryFileList.value.findIndex(item => item.uid === file.uid); |
| | | const index = deliveryFileList.value.findIndex( |
| | | (item) => item.uid === file.uid |
| | | ); |
| | | if (index > -1) { |
| | | deliveryFileList.value.splice(index, 1); |
| | | } |
| | |
| | | |
| | | // è·åå®¡æ ¸ç¶æææ¬ |
| | | const getApprovalStatusText = (status) => { |
| | | if (status === null || status === undefined || status === '') { |
| | | return 'å¾
å®¡æ ¸'; |
| | | if (status === null || status === undefined || status === "") { |
| | | return "å¾
å®¡æ ¸"; |
| | | } |
| | | // å¦ææ¯æ°å |
| | | if (typeof status === 'number') { |
| | | if (typeof status === "number") { |
| | | const statusMap = { |
| | | 0: 'å¾
å®¡æ ¸', |
| | | 1: 'å®¡æ ¸ä¸', |
| | | 2: 'å®¡æ ¸æç»', |
| | | 3: 'å®¡æ ¸éè¿' |
| | | 0: "å¾
å®¡æ ¸", |
| | | 1: "å®¡æ ¸ä¸", |
| | | 2: "å®¡æ ¸æç»", |
| | | 3: "å®¡æ ¸éè¿", |
| | | }; |
| | | return statusMap[status] || 'å¾
å®¡æ ¸'; |
| | | return statusMap[status] || "å¾
å®¡æ ¸"; |
| | | } |
| | | // 妿æ¯å符串ï¼ç´æ¥è¿åææ å° |
| | | const statusStr = String(status).trim(); |
| | | const statusTextMap = { |
| | | 'å¾
å®¡æ ¸': 'å¾
å®¡æ ¸', |
| | | 'å®¡æ ¸ä¸': 'å®¡æ ¸ä¸', |
| | | 'å®¡æ ¸æç»': 'å®¡æ ¸æç»', |
| | | 'å®¡æ ¸éè¿': 'å®¡æ ¸éè¿', |
| | | 'å·²åè´§': 'å·²åè´§', |
| | | '0': 'å¾
å®¡æ ¸', |
| | | '1': 'å®¡æ ¸ä¸', |
| | | '2': 'å®¡æ ¸æç»', |
| | | '3': 'å®¡æ ¸éè¿' |
| | | å¾
å®¡æ ¸: "å¾
å®¡æ ¸", |
| | | å®¡æ ¸ä¸: "å®¡æ ¸ä¸", |
| | | å®¡æ ¸æç»: "å®¡æ ¸æç»", |
| | | å®¡æ ¸éè¿: "å®¡æ ¸éè¿", |
| | | å·²åè´§: "å·²åè´§", |
| | | 0: "å¾
å®¡æ ¸", |
| | | 1: "å®¡æ ¸ä¸", |
| | | 2: "å®¡æ ¸æç»", |
| | | 3: "å®¡æ ¸éè¿", |
| | | }; |
| | | return statusTextMap[statusStr] || statusStr || 'å¾
å®¡æ ¸'; |
| | | return statusTextMap[statusStr] || statusStr || "å¾
å®¡æ ¸"; |
| | | }; |
| | | |
| | | // è·åå®¡æ ¸ç¶ææ ç¾ç±»åï¼é¢è²ï¼ |
| | | const getApprovalStatusType = (status) => { |
| | | if (status === null || status === undefined || status === '') { |
| | | return 'info'; |
| | | if (status === null || status === undefined || status === "") { |
| | | return "info"; |
| | | } |
| | | // å¦ææ¯æ°å |
| | | if (typeof status === 'number') { |
| | | if (typeof status === "number") { |
| | | const typeMap = { |
| | | 0: 'info', // å¾
å®¡æ ¸ - ç°è² |
| | | 1: 'warning', // å®¡æ ¸ä¸ - é»è² |
| | | 2: 'danger', // å®¡æ ¸æç» - çº¢è² |
| | | 3: 'success' // å®¡æ ¸éè¿ - ç»¿è² |
| | | 0: "info", // å¾
å®¡æ ¸ - ç°è² |
| | | 1: "warning", // å®¡æ ¸ä¸ - é»è² |
| | | 2: "danger", // å®¡æ ¸æç» - çº¢è² |
| | | 3: "success", // å®¡æ ¸éè¿ - ç»¿è² |
| | | }; |
| | | return typeMap[status] || 'info'; |
| | | return typeMap[status] || "info"; |
| | | } |
| | | // 妿æ¯å符串 |
| | | const statusStr = String(status).trim(); |
| | | const typeTextMap = { |
| | | 'å¾
å®¡æ ¸': 'info', |
| | | 'å®¡æ ¸ä¸': 'warning', |
| | | 'å®¡æ ¸æç»': 'danger', |
| | | 'å®¡æ ¸éè¿': 'success', |
| | | 'å·²åè´§': 'success', |
| | | '0': 'info', |
| | | '1': 'warning', |
| | | '2': 'danger', |
| | | '3': 'success' |
| | | å¾
å®¡æ ¸: "info", |
| | | å®¡æ ¸ä¸: "warning", |
| | | å®¡æ ¸æç»: "danger", |
| | | å®¡æ ¸éè¿: "success", |
| | | å·²åè´§: "success", |
| | | 0: "info", |
| | | 1: "warning", |
| | | 2: "danger", |
| | | 3: "success", |
| | | }; |
| | | return typeTextMap[statusStr] || 'info'; |
| | | return typeTextMap[statusStr] || "info"; |
| | | }; |
| | | |
| | | // æ£æ¥å®¡æ ¸ç¶ææ¯å¦ä¸º"å®¡æ ¸éè¿" |
| | | const isApproved = (status) => { |
| | | if (status === null || status === undefined || status === '') { |
| | | if (status === null || status === undefined || status === "") { |
| | | return false; |
| | | } |
| | | // å¦ææ¯æ°åï¼3 è¡¨ç¤ºå®¡æ ¸éè¿ |
| | | if (typeof status === 'number') { |
| | | if (typeof status === "number") { |
| | | return status === 3; |
| | | } |
| | | // 妿æ¯å符串 |
| | | const statusStr = String(status).trim(); |
| | | return statusStr === 'å®¡æ ¸éè¿' || statusStr === '3'; |
| | | return statusStr === "å®¡æ ¸éè¿" || statusStr === "3"; |
| | | }; |
| | | |
| | | // æ£æ¥å®¡æ ¸ç¶ææ¯å¦ä¸º"å®¡æ ¸ä¸" |
| | | const isApproving = (status) => { |
| | | if (status === null || status === undefined || status === '') { |
| | | if (status === null || status === undefined || status === "") { |
| | | return false; |
| | | } |
| | | // å¦ææ¯æ°åï¼1 è¡¨ç¤ºå®¡æ ¸ä¸ |
| | | if (typeof status === 'number') { |
| | | if (typeof status === "number") { |
| | | return status === 1; |
| | | } |
| | | // 妿æ¯å符串 |
| | | const statusStr = String(status).trim(); |
| | | return statusStr === 'å®¡æ ¸ä¸' || statusStr === '1'; |
| | | return statusStr === "å®¡æ ¸ä¸" || statusStr === "1"; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | |
| | | color: #909399; |
| | | } |
| | | </style> |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | const handleFile = (commonFiles) => { |
| | | commonFiles.forEach((e) => { |
| | | proxy.$download.name(e.url); |
| | | }); |
| | | }; |
| | | |
| | | const clearRange = () => { |
| | | searchForm.invoiceDate = []; |
| | | searchForm.invoiceDateStart = undefined; |
| | |
| | | } |
| | | |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | } |
| | | |
| | | const lookFile = (row) => { |
| | |
| | | <el-date-picker v-model="form.makeTime" type="datetime" style="width:100%" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <!-- <el-col :span="4"> |
| | | <el-form-item label="ç¶æï¼" prop="status"> |
| | | <el-select v-model="form.status" placeholder="è¯·éæ©ç¶æ"> |
| | | <el-option label="å¾
å¤ç" :value="0" /> |
| | | <el-option label="å·²å¤ç" :value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="4"> |
| | | <el-form-item label="éè´§åå ï¼" prop="returnReason"> |
| | | <el-input v-model="form.returnReason" placeholder="请è¾å
¥éè´§åå " /> |
| | |
| | | import { returnManagementAdd, returnManagementUpdate, returnManagementGetByShippingId, getSalesLedger, returnManagementGetById } from "@/api/salesManagement/returnOrder.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { listProject } from "@/api/oaSystem/projectManagement.js"; |
| | | import { listProject } from "@/api/projectManagement/project.js"; |
| | | import {listCustomer} from "@/api/basicData/customer.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | tableData.value = list |
| | | } |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | proxy.$download.byUrl(row.url, row.originalFilename); |
| | | |
| | | } |
| | | const lookFile = (row) => { |
| | |
| | | prop="type"> |
| | | <el-select v-model="deliveryForm.type" |
| | | placeholder="è¯·éæ©åè´§ç±»å" |
| | | style="width: 100%"> |
| | | style="width: 100%" |
| | | @change="handleDeliveryTypeChange"> |
| | | <el-option label="货车" |
| | | value="货车" /> |
| | | <el-option label="å¿«é" |
| | |
| | | <el-form-item label="å¾
åè´§æ°éï¼"> |
| | | <el-input :model-value="currentDeliveryRow?.noQuantity" |
| | | disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24" v-if="deliveryForm.type === '货车'"> |
| | | <el-form-item label="å货车çå·ï¼" |
| | | prop="shippingCarNumber"> |
| | | <el-input v-model="deliveryForm.shippingCarNumber" |
| | | placeholder="请è¾å
¥å货车çå·" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-else> |
| | | <el-form-item label="å¿«éå
¬å¸ï¼" |
| | | prop="expressCompany"> |
| | | <el-input v-model="deliveryForm.expressCompany" |
| | | placeholder="请è¾å
¥å¿«éå
¬å¸" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30" v-if="deliveryForm.type === 'å¿«é'"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="å¿«éåå·ï¼" |
| | | prop="expressNumber"> |
| | | <el-input v-model="deliveryForm.expressNumber" |
| | | placeholder="请è¾å
¥å¿«éåå·" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åè´§å¾çï¼"> |
| | | <ImageUpload v-model:file-list="deliveryFileList" :limit="9" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | import dayjs from "dayjs"; |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | import ImageUpload from "@/components/AttachmentUpload/image/index.vue"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | import { listCustomer } from "@/api/basicData/customer.js"; |
| | | |
| | |
| | | }); |
| | | const total = ref(0); |
| | | const fileList = ref([]); |
| | | const deliveryFileList = ref([]); |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref(""); |
| | |
| | | deliveryQuantity: 0, |
| | | })); |
| | | }; |
| | | const validateDeliveryShippingCarNumber = (_rule, value, callback) => { |
| | | if (deliveryForm.value.type === "货车" && !value) { |
| | | return callback(new Error("请è¾å
¥å货车çå·")); |
| | | } |
| | | callback(); |
| | | }; |
| | | const validateDeliveryExpressCompany = (_rule, value, callback) => { |
| | | if (deliveryForm.value.type === "å¿«é" && !value) { |
| | | return callback(new Error("请è¾å
¥å¿«éå
¬å¸")); |
| | | } |
| | | callback(); |
| | | }; |
| | | const deliveryFormData = reactive({ |
| | | deliveryForm: { |
| | | shippingCarNumber: "", |
| | | expressCompany: "", |
| | | expressNumber: "", |
| | | type: "货车", // 货车, å¿«é |
| | | }, |
| | | deliveryRules: { |
| | | shippingCarNumber: [ |
| | | { validator: validateDeliveryShippingCarNumber, trigger: "blur" }, |
| | | ], |
| | | expressCompany: [{ validator: validateDeliveryExpressCompany, trigger: "blur" }], |
| | | type: [{ required: true, message: "è¯·éæ©åè´§ç±»å", trigger: "change" }], |
| | | }, |
| | | }); |
| | |
| | | row.productModelId || row.modelId |
| | | ); |
| | | deliveryForm.value = { |
| | | shippingCarNumber: "", |
| | | expressCompany: "", |
| | | expressNumber: "", |
| | | type: "货车", |
| | | batchNo: [], |
| | | batchNoList, |
| | | }; |
| | | deliveryFileList.value = []; |
| | | deliveryFormVisible.value = true; |
| | | }; |
| | | |
| | |
| | | salesLedgerId: salesLedgerId, |
| | | salesLedgerProductId: currentDeliveryRow.value.id, |
| | | type: deliveryForm.value.type, |
| | | shippingCarNumber: |
| | | deliveryForm.value.type === "货车" |
| | | ? deliveryForm.value.shippingCarNumber |
| | | : "", |
| | | expressCompany: |
| | | deliveryForm.value.type === "å¿«é" |
| | | ? deliveryForm.value.expressCompany |
| | | : "", |
| | | expressNumber: |
| | | deliveryForm.value.type === "å¿«é" |
| | | ? deliveryForm.value.expressNumber |
| | | : "", |
| | | storageBlobDTOs: deliveryFileList.value || [], |
| | | batchNo: deliveryForm.value.batchNo, |
| | | batchNoDetailList: selectedBatchRows.map(item => ({ |
| | | stockInventoryId: item.id, |
| | |
| | | }; |
| | | |
| | | // å
³éåè´§å¼¹æ¡ |
| | | const handleDeliveryTypeChange = val => { |
| | | if (val === "货车") { |
| | | deliveryForm.value.expressCompany = ""; |
| | | deliveryForm.value.expressNumber = ""; |
| | | } else { |
| | | deliveryForm.value.shippingCarNumber = ""; |
| | | } |
| | | }; |
| | | |
| | | const closeDeliveryDia = () => { |
| | | proxy.resetForm("deliveryFormRef"); |
| | | deliveryFileList.value = []; |
| | | deliveryFormVisible.value = false; |
| | | currentDeliveryRow.value = null; |
| | | }; |