| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" :inline="true"> |
| | | <el-form :model="searchForm" |
| | | :inline="true"> |
| | | <el-form-item label="客æ·åç§°ï¼"> |
| | | <el-input v-model="searchForm.customerName" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | <el-input v-model="searchForm.customerName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="éå®ååå·ï¼"> |
| | | <el-input v-model="searchForm.salesContractNo" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | <el-input v-model="searchForm.salesContractNo" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="项ç®åç§°ï¼"> |
| | | <el-input v-model="searchForm.projectName" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | <el-input v-model="searchForm.projectName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="å½å
¥æ¥æï¼"> |
| | | <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | placeholder="è¯·éæ©" clearable @change="changeDaterange" /> |
| | | <el-date-picker v-model="searchForm.entryDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="daterange" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | @change="changeDaterange" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery"> æç´¢ </el-button> |
| | | <el-button type="primary" |
| | | @click="handleQuery"> æç´¢ </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | <div class="actions"> |
| | | <div></div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')"> |
| | | <el-button type="primary" |
| | | @click="openForm('add')"> |
| | | æ°å¢å°è´¦ |
| | | </el-button> |
| | | <el-button type="primary" plain @click="handleImport">导å
¥</el-button> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="handleImport">导å
¥</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> |
| | | <el-button type="danger" |
| | | plain |
| | | @click="handleDelete">å é¤</el-button> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="handlePrint">æå°</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" :row-key="(row) => row.id" :row-class-name="tableRowClassName" show-summary style="width: 100%" |
| | | :summary-method="summarizeMainTable" @expand-change="expandChange" height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" type="selection" width="55" fixed="left"/> |
| | | <el-table-column type="expand" width="60" fixed="left"> |
| | | <el-table :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" |
| | | :row-key="(row) => row.id" |
| | | :row-class-name="tableRowClassName" |
| | | show-summary |
| | | style="width: 100%" |
| | | :summary-method="summarizeMainTable" |
| | | @expand-change="expandChange" |
| | | height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | width="55" |
| | | fixed="left" /> |
| | | <el-table-column type="expand" |
| | | width="60" |
| | | fixed="left"> |
| | | <template #default="props"> |
| | | <el-table :data="props.row.children" border show-summary :summary-method="(param) => summarizeChildrenTable(param, props.row)"> |
| | | <el-table-column align="center" label="åºå·" type="index"/> |
| | | <el-table-column label="产å大类" prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" /> |
| | | <el-table-column label="åä½" prop="unit" /> |
| | | <el-table :data="props.row.children" |
| | | border |
| | | show-summary |
| | | :summary-method="(param) => summarizeChildrenTable(param, props.row)"> |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | | type="index" /> |
| | | <el-table-column label="产å大类" |
| | | prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" |
| | | prop="specificationModel" /> |
| | | <el-table-column label="åä½" |
| | | prop="unit" /> |
| | | <el-table-column label="产åç¶æ" |
| | | width="100px" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | |
| | | <el-tag v-if="scope.row.approveStatus === 1 && (!scope.row.shippingDate || !scope.row.shippingCarNumber)" |
| | | type="success">å
è¶³</el-tag> |
| | | <el-tag v-else-if="scope.row.approveStatus === 0 && (scope.row.shippingDate || scope.row.shippingCarNumber)" |
| | | type="success">å·²åºåº</el-tag> |
| | | <el-tag v-else type="danger">ä¸è¶³</el-tag> |
| | | <el-tag v-else |
| | | type="danger">ä¸è¶³</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åè´§ç¶æ" width="140" align="center"> |
| | | <el-table-column label="åè´§ç¶æ" |
| | | width="140" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getShippingStatusType(scope.row)" size="small"> |
| | | <el-tag :type="getShippingStatusType(scope.row)" |
| | | size="small"> |
| | | {{ getShippingStatusText(scope.row) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¿«éå
¬å¸" prop="expressCompany" show-overflow-tooltip /> |
| | | <el-table-column label="å¿«éåå·" prop="expressNumber" show-overflow-tooltip /> |
| | | <el-table-column label="å货车ç" minWidth="100px" align="center"> |
| | | <el-table-column label="å¿«éå
¬å¸" |
| | | prop="expressCompany" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="å¿«éåå·" |
| | | prop="expressNumber" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="å货车ç" |
| | | minWidth="100px" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <div> |
| | | <el-tag type="success" v-if="scope.row.shippingCarNumber">{{ scope.row.shippingCarNumber }}</el-tag> |
| | | <el-tag v-else type="info">-</el-tag> |
| | | <el-tag type="success" |
| | | v-if="scope.row.shippingCarNumber">{{ scope.row.shippingCarNumber }}</el-tag> |
| | | <el-tag v-else |
| | | type="info">-</el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ°é" prop="quantity" /> |
| | | <el-table-column label="ç¨ç(%)" prop="taxRate" /> |
| | | <el-table-column label="å«ç¨åä»·(å
)" prop="taxInclusiveUnitPrice" :formatter="sensitiveAmountFormatter" /> |
| | | <el-table-column label="å«ç¨æ»ä»·(å
)" prop="taxInclusiveTotalPrice" :formatter="sensitiveAmountFormatter" /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·(å
)" prop="taxExclusiveTotalPrice" :formatter="sensitiveAmountFormatter" /> |
| | | <el-table-column label="æ°é" |
| | | prop="quantity" /> |
| | | <el-table-column label="ç¨ç(%)" |
| | | prop="taxRate" /> |
| | | <el-table-column label="å«ç¨åä»·(å
)" |
| | | prop="taxInclusiveUnitPrice" |
| | | :formatter="sensitiveAmountFormatter" /> |
| | | <el-table-column label="å«ç¨æ»ä»·(å
)" |
| | | prop="taxInclusiveTotalPrice" |
| | | :formatter="sensitiveAmountFormatter" /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·(å
)" |
| | | prop="taxExclusiveTotalPrice" |
| | | :formatter="sensitiveAmountFormatter" /> |
| | | <!--æä½--> |
| | | <el-table-column Width="60px" label="æä½" align="center"> |
| | | <el-table-column Width="60px" |
| | | label="æä½" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | link |
| | | <el-button link |
| | | type="primary" |
| | | :disabled="!canShip(scope.row)" |
| | | @click="openDeliveryForm(scope.row)"> |
| | |
| | | </el-table> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="éå®ååå·" prop="salesContractNo" width="180" show-overflow-tooltip /> |
| | | <el-table-column label="客æ·åç§°" prop="customerName" width="300" show-overflow-tooltip /> |
| | | <el-table-column label="ä¸å¡å" prop="salesman" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="项ç®åç§°" prop="projectName" width="180" show-overflow-tooltip /> |
| | | <el-table-column label="仿¬¾æ¹å¼" prop="paymentMethod" show-overflow-tooltip /> |
| | | <el-table-column label="ååéé¢(å
)" prop="contractAmount" width="220" show-overflow-tooltip |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" /> |
| | | <el-table-column label="éå®ååå·" |
| | | prop="salesContractNo" |
| | | width="180" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="客æ·åç§°" |
| | | prop="customerName" |
| | | width="300" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="ä¸å¡å" |
| | | prop="salesman" |
| | | width="100" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="项ç®åç§°" |
| | | prop="projectName" |
| | | width="180" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="仿¬¾æ¹å¼" |
| | | prop="paymentMethod" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="ååéé¢(å
)" |
| | | prop="contractAmount" |
| | | width="220" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="å½å
¥äºº" prop="entryPersonName" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å½å
¥æ¥æ" prop="entryDate" width="120" show-overflow-tooltip /> |
| | | <el-table-column label="ç¾è®¢æ¥æ" prop="executionDate" width="120" show-overflow-tooltip /> |
| | | <el-table-column label="äº¤ä»æ¥æ" prop="deliveryDate" width="120" show-overflow-tooltip /> |
| | | <el-table-column label="夿³¨" prop="remarks" width="200" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" width="130" align="center"> |
| | | <el-table-column label="å½å
¥äºº" |
| | | prop="entryPersonName" |
| | | width="100" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="å½å
¥æ¥æ" |
| | | prop="entryDate" |
| | | width="120" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="ç¾è®¢æ¥æ" |
| | | prop="executionDate" |
| | | width="120" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="äº¤ä»æ¥æ" |
| | | prop="deliveryDate" |
| | | width="120" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="夿³¨" |
| | | prop="remarks" |
| | | width="200" |
| | | show-overflow-tooltip /> |
| | | <el-table-column fixed="right" |
| | | label="æä½" |
| | | width="130" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openForm('edit', scope.row)" :disabled="!scope.row.isEdit || scope.row.hasProductionRecord || !canEditLedger(scope.row)">ç¼è¾</el-button> |
| | | <el-button link type="primary" @click="downLoadFile(scope.row)">éä»¶</el-button> |
| | | <el-button link |
| | | type="primary" |
| | | @click="openForm('edit', scope.row)" |
| | | :disabled="!scope.row.isEdit || scope.row.hasProductionRecord || !canEditLedger(scope.row)">ç¼è¾</el-button> |
| | | <el-button link |
| | | type="primary" |
| | | @click="downLoadFile(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> |
| | | <FormDialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢éå®å°è´¦é¡µé¢' : 'ç¼è¾éå®å°è´¦é¡µé¢'" :width="'70%'" |
| | | :operation-type="operationType" @close="closeDia" @confirm="submitForm" @cancel="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <FormDialog v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢éå®å°è´¦é¡µé¢' : 'ç¼è¾éå®å°è´¦é¡µé¢'" |
| | | :width="'70%'" |
| | | :operation-type="operationType" |
| | | @close="closeDia" |
| | | @confirm="submitForm" |
| | | @cancel="closeDia"> |
| | | <el-form :model="form" |
| | | label-width="140px" |
| | | label-position="top" |
| | | :rules="rules" |
| | | ref="formRef"> |
| | | <!-- æ¥ä»·å导å
¥å
¥å£ï¼æ¾å¨è¡¨åé¡¶é¨ï¼éæ©å忾客æ·/ä¸å¡åç --> |
| | | <el-row v-if="operationType === 'add'" style="margin-bottom: 10px;"> |
| | | <el-col :span="24" style="text-align: right;"> |
| | | <el-button type="primary" plain @click="openQuotationDialog"> |
| | | <el-row v-if="operationType === 'add'" |
| | | style="margin-bottom: 10px;"> |
| | | <el-col :span="24" |
| | | style="text-align: right;"> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="openQuotationDialog"> |
| | | ä»é宿¥ä»·å¯¼å
¥ |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éå®ååå·ï¼" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="èªå¨çæ" clearable disabled /> |
| | | <el-form-item label="éå®ååå·ï¼" |
| | | prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" |
| | | placeholder="èªå¨çæ" |
| | | clearable |
| | | disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å¡åï¼" prop="salesman"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'" filterable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | <el-form-item label="ä¸å¡åï¼" |
| | | prop="salesman"> |
| | | <el-select v-model="form.salesman" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | :disabled="operationType === 'view'" |
| | | filterable> |
| | | <el-option v-for="item in userList" |
| | | :key="item.nickName" |
| | | :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·åç§°ï¼" prop="customerId"> |
| | | <el-select v-model="form.customerId" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'" filterable> |
| | | <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id"> |
| | | <el-form-item label="客æ·åç§°ï¼" |
| | | prop="customerId"> |
| | | <el-select v-model="form.customerId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | :disabled="operationType === 'view'" |
| | | filterable> |
| | | <el-option v-for="item in customerOption" |
| | | :key="item.id" |
| | | :label="item.customerName" |
| | | :value="item.id"> |
| | | {{ |
| | | item.customerName + "ââ" + item.taxpayerIdentificationNumber |
| | | }} |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç®åç§°ï¼" prop="projectName"> |
| | | <el-input v-model="form.projectName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | <el-form-item label="项ç®åç§°ï¼" |
| | | prop="projectName"> |
| | | <el-input v-model="form.projectName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¾è®¢æ¥æï¼" prop="executionDate"> |
| | | <el-date-picker style="width: 100%" v-model="form.executionDate" value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" type="date" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'" /> |
| | | <el-form-item label="ç¾è®¢æ¥æï¼" |
| | | prop="executionDate"> |
| | | <el-date-picker style="width: 100%" |
| | | v-model="form.executionDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仿¬¾æ¹å¼"> |
| | | <el-input v-model="form.paymentMethod" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | <el-input v-model="form.paymentMethod" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½å
¥äººï¼" prop="entryPerson"> |
| | | <el-form-item label="å½å
¥äººï¼" |
| | | prop="entryPerson"> |
| | | <el-select v-model="form.entryPerson" |
| | | filterable |
| | | default-first-option |
| | | :reserve-keyword="false" placeholder="è¯·éæ©" clearable @change="changs"> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> |
| | | :reserve-keyword="false" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | @change="changs"> |
| | | <el-option v-for="item in userList" |
| | | :key="item.userId" |
| | | :label="item.nickName" |
| | | :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½å
¥æ¥æï¼" prop="entryDate"> |
| | | <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | <el-form-item label="å½å
¥æ¥æï¼" |
| | | prop="entryDate"> |
| | | <el-date-picker style="width: 100%" |
| | | v-model="form.entryDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="äº¤è´§æ¥æï¼" prop="entryDate"> |
| | | <el-date-picker style="width: 100%" v-model="form.deliveryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | <el-form-item label="äº¤è´§æ¥æï¼" |
| | | prop="entryDate"> |
| | | <el-date-picker style="width: 100%" |
| | | v-model="form.deliveryDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-form-item label="产åä¿¡æ¯ï¼" prop="entryDate"> |
| | | <el-button v-if="operationType !== 'view'" type="primary" @click="openProductForm('add')">æ·»å </el-button> |
| | | <el-button v-if="operationType !== 'view'" plain type="danger" @click="deleteProduct" >å é¤</el-button> |
| | | <el-form-item label="产åä¿¡æ¯ï¼" |
| | | prop="entryDate"> |
| | | <el-button v-if="operationType !== 'view'" |
| | | type="primary" |
| | | @click="openProductForm('add')">æ·»å </el-button> |
| | | <el-button v-if="operationType !== 'view'" |
| | | plain |
| | | type="danger" |
| | | @click="deleteProduct">å é¤</el-button> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary |
| | | <el-table :data="productData" |
| | | border |
| | | @selection-change="productSelected" |
| | | show-summary |
| | | :summary-method="summarizeMainTable"> |
| | | <el-table-column align="center" type="selection" width="55" v-if="operationType !== 'view'" |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | width="55" |
| | | v-if="operationType !== 'view'" |
| | | :selectable="(row) => !isProductShipped(row)" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="产å大类" prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" /> |
| | | <el-table-column label="åä½" prop="unit" /> |
| | | <el-table-column label="æ°é" prop="quantity" /> |
| | | <el-table-column label="ç¨ç(%)" prop="taxRate" /> |
| | | <el-table-column label="å«ç¨åä»·(å
)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="å«ç¨æ»ä»·(å
)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·(å
)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> |
| | | <el-table-column fixed="right" label="æä½" min-width="60" align="center" v-if="operationType !== 'view'"> |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" /> |
| | | <el-table-column label="产å大类" |
| | | prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" |
| | | prop="specificationModel" /> |
| | | <el-table-column label="åä½" |
| | | prop="unit" /> |
| | | <el-table-column label="æ°é" |
| | | prop="quantity" /> |
| | | <el-table-column label="ç¨ç(%)" |
| | | prop="taxRate" /> |
| | | <el-table-column label="å«ç¨åä»·(å
)" |
| | | prop="taxInclusiveUnitPrice" |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="å«ç¨æ»ä»·(å
)" |
| | | prop="taxInclusiveTotalPrice" |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·(å
)" |
| | | prop="taxExclusiveTotalPrice" |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="æ¯å¦ç产" |
| | | prop="isProduction" |
| | | width="150"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" |
| | | <el-tag :type="scope.row.isProduction ? 'success' : 'info'"> |
| | | {{ scope.row.isProduction ? 'æ¯' : 'å¦' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" |
| | | label="æä½" |
| | | min-width="60" |
| | | align="center" |
| | | v-if="operationType !== 'view'"> |
| | | <template #default="scope"> |
| | | <el-button link |
| | | type="primary" |
| | | size="small" |
| | | :disabled="isProductShipped(scope.row)" |
| | | @click="openProductForm('edit', scope.row,scope.$index)">ç¼è¾</el-button> |
| | | </template> |
| | |
| | | </el-table> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨ï¼" prop="remarks"> |
| | | <el-input v-model="form.remarks" placeholder="请è¾å
¥" clearable type="textarea" :rows="2" :disabled="operationType === 'view'" /> |
| | | <el-form-item label="夿³¨ï¼" |
| | | prop="remarks"> |
| | | <el-input v-model="form.remarks" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | type="textarea" |
| | | :rows="2" |
| | | :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éä»¶ææï¼" prop="salesLedgerFiles"> |
| | | <el-upload v-model:file-list="fileList" :action="upload.url" multiple ref="fileUpload" auto-upload |
| | | :headers="upload.headers" :before-upload="handleBeforeUpload" :on-error="handleUploadError" |
| | | :on-success="handleUploadSuccess" :on-remove="handleRemove"> |
| | | <el-button type="primary" v-if="operationType !== 'view'">ä¸ä¼ </el-button> |
| | | <template #tip v-if="operationType !== 'view'"> |
| | | <el-form-item label="éä»¶ææï¼" |
| | | prop="salesLedgerFiles"> |
| | | <el-upload v-model:file-list="fileList" |
| | | :action="upload.url" |
| | | multiple |
| | | ref="fileUpload" |
| | | auto-upload |
| | | :headers="upload.headers" |
| | | :before-upload="handleBeforeUpload" |
| | | :on-error="handleUploadError" |
| | | :on-success="handleUploadSuccess" |
| | | :on-remove="handleRemove"> |
| | | <el-button type="primary" |
| | | v-if="operationType !== 'view'">ä¸ä¼ </el-button> |
| | | <template #tip |
| | | v-if="operationType !== 'view'"> |
| | | <div class="el-upload__tip"> |
| | | æä»¶æ ¼å¼æ¯æ |
| | | docï¼docxï¼xlsï¼xlsxï¼pptï¼pptxï¼pdfï¼txtï¼xmlï¼jpgï¼jpegï¼pngï¼gifï¼bmpï¼rarï¼zipï¼7z |
| | |
| | | </el-row> |
| | | </el-form> |
| | | </FormDialog> |
| | | |
| | | <!-- 仿¥ä»·å导å
¥ï¼ä»
审æ¹éè¿ï¼ --> |
| | | <el-dialog |
| | | v-model="quotationDialogVisible" |
| | | <el-dialog v-model="quotationDialogVisible" |
| | | title="鿩审æ¹éè¿çé宿¥ä»·å" |
| | | width="80%" |
| | | :close-on-click-modal="false" |
| | | > |
| | | :close-on-click-modal="false"> |
| | | <div style="margin-bottom: 12px; display:flex; gap: 12px; align-items:center;"> |
| | | <el-input |
| | | v-model="quotationSearchForm.quotationNo" |
| | | <el-input v-model="quotationSearchForm.quotationNo" |
| | | placeholder="请è¾å
¥æ¥ä»·åå·" |
| | | clearable |
| | | style="max-width: 260px;" |
| | | @change="fetchQuotationList" |
| | | /> |
| | | <el-input |
| | | v-model="quotationSearchForm.customer" |
| | | @change="fetchQuotationList" /> |
| | | <el-input v-model="quotationSearchForm.customer" |
| | | placeholder="请è¾å
¥å®¢æ·åç§°" |
| | | clearable |
| | | style="max-width: 260px;" |
| | | @change="fetchQuotationList" |
| | | /> |
| | | <el-button type="primary" @click="fetchQuotationList">æç´¢</el-button> |
| | | @change="fetchQuotationList" /> |
| | | <el-button type="primary" |
| | | @click="fetchQuotationList">æç´¢</el-button> |
| | | <el-button @click="resetQuotationSearch">éç½®</el-button> |
| | | </div> |
| | | |
| | | <el-table |
| | | :data="quotationList" |
| | | <el-table :data="quotationList" |
| | | border |
| | | stripe |
| | | v-loading="quotationLoading" |
| | | height="420px" |
| | | > |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column prop="quotationNo" label="æ¥ä»·åå·" width="180" show-overflow-tooltip /> |
| | | <el-table-column prop="customer" label="客æ·åç§°" min-width="220" show-overflow-tooltip /> |
| | | <el-table-column prop="salesperson" label="ä¸å¡å" width="120" show-overflow-tooltip /> |
| | | <el-table-column prop="quotationDate" label="æ¥ä»·æ¥æ" width="140" /> |
| | | <el-table-column prop="status" label="审æ¹ç¶æ" width="120" align="center" /> |
| | | <el-table-column prop="totalAmount" label="æ¥ä»·éé¢(å
)" width="160" align="right"> |
| | | height="420px"> |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" /> |
| | | <el-table-column prop="quotationNo" |
| | | label="æ¥ä»·åå·" |
| | | width="180" |
| | | show-overflow-tooltip /> |
| | | <el-table-column prop="customer" |
| | | label="客æ·åç§°" |
| | | min-width="220" |
| | | show-overflow-tooltip /> |
| | | <el-table-column prop="salesperson" |
| | | label="ä¸å¡å" |
| | | width="120" |
| | | show-overflow-tooltip /> |
| | | <el-table-column prop="quotationDate" |
| | | label="æ¥ä»·æ¥æ" |
| | | width="140" /> |
| | | <el-table-column prop="status" |
| | | label="审æ¹ç¶æ" |
| | | width="120" |
| | | align="center" /> |
| | | <el-table-column prop="totalAmount" |
| | | label="æ¥ä»·éé¢(å
)" |
| | | width="160" |
| | | align="right"> |
| | | <template #default="scope"> |
| | | {{ Number(scope.row.totalAmount ?? 0).toFixed(2) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="æä½" width="120" align="center"> |
| | | <el-table-column fixed="right" |
| | | label="æä½" |
| | | width="120" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" link @click="applyQuotation(scope.row)">éæ©</el-button> |
| | | <el-button type="primary" |
| | | link |
| | | @click="applyQuotation(scope.row)">éæ©</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="quotationPage.total > 0" |
| | | <pagination v-show="quotationPage.total > 0" |
| | | :total="quotationPage.total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="quotationPage.current" |
| | | :limit="quotationPage.size" |
| | | @pagination="quotationPaginationChange" |
| | | /> |
| | | |
| | | @pagination="quotationPaginationChange" /> |
| | | <template #footer> |
| | | <el-button @click="quotationDialogVisible = false">å
³é</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | <FormDialog |
| | | v-model="productFormVisible" |
| | | <FormDialog v-model="productFormVisible" |
| | | :title="productOperationType === 'add' ? 'æ°å¢äº§å' : 'ç¼è¾äº§å'" |
| | | :width="'40%'" |
| | | :operation-type="productOperationType" |
| | | @close="closeProductDia" |
| | | @confirm="submitProduct" |
| | | @cancel="closeProductDia"> |
| | | <el-form :model="productForm" label-width="140px" label-position="top" :rules="productRules" ref="productFormRef"> |
| | | <el-form :model="productForm" |
| | | label-width="140px" |
| | | label-position="top" |
| | | :rules="productRules" |
| | | ref="productFormRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产å大类ï¼" prop="productCategory"> |
| | | <el-tree-select v-model="productForm.productCategory" placeholder="è¯·éæ©" clearable filterable check-strictly |
| | | @change="getModels" :data="productOptions" :render-after-expand="false" style="width: 100%" /> |
| | | <el-form-item label="产å大类ï¼" |
| | | prop="productCategory"> |
| | | <el-tree-select v-model="productForm.productCategory" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | filterable |
| | | check-strictly |
| | | @change="getModels" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="productModelId"> |
| | | <el-select v-model="productForm.productModelId" placeholder="è¯·éæ©" clearable @change="getProductModel" filterable> |
| | | <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" /> |
| | | <el-form-item label="è§æ ¼åå·ï¼" |
| | | prop="productModelId"> |
| | | <el-select v-model="productForm.productModelId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | @change="getProductModel" |
| | | filterable> |
| | | <el-option v-for="item in modelOptions" |
| | | :key="item.id" |
| | | :label="item.model" |
| | | :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="unit"> |
| | | <el-input v-model="productForm.unit" placeholder="请è¾å
¥" clearable /> |
| | | <el-form-item label="åä½ï¼" |
| | | prop="unit"> |
| | | <el-input v-model="productForm.unit" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¨ç(%)ï¼" prop="taxRate"> |
| | | <el-select v-model="productForm.taxRate" placeholder="è¯·éæ©" clearable @change="calculateFromTaxRate"> |
| | | <el-option label="1" value="1" /> |
| | | <el-option label="6" value="6" /> |
| | | <el-option label="13" value="13" /> |
| | | <el-form-item label="ç¨ç(%)ï¼" |
| | | prop="taxRate"> |
| | | <el-select v-model="productForm.taxRate" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | @change="calculateFromTaxRate"> |
| | | <el-option label="1" |
| | | value="1" /> |
| | | <el-option label="6" |
| | | value="6" /> |
| | | <el-option label="13" |
| | | value="13" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨åä»·(å
)ï¼" prop="taxInclusiveUnitPrice"> |
| | | <el-input-number :step="0.01" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%" |
| | | <el-form-item label="å«ç¨åä»·(å
)ï¼" |
| | | prop="taxInclusiveUnitPrice"> |
| | | <el-input-number :step="0.01" |
| | | :min="0" |
| | | v-model="productForm.taxInclusiveUnitPrice" |
| | | style="width: 100%" |
| | | :precision="2" |
| | | placeholder="请è¾å
¥" clearable @change="calculateFromUnitPrice" /> |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | @change="calculateFromUnitPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ°éï¼" prop="quantity"> |
| | | <el-input-number :step="0.1" :min="0" v-model="productForm.quantity" placeholder="请è¾å
¥" clearable |
| | | <el-form-item label="æ°éï¼" |
| | | prop="quantity"> |
| | | <el-input-number :step="0.1" |
| | | :min="0" |
| | | v-model="productForm.quantity" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | :precision="2" |
| | | @change="calculateFromQuantity" style="width: 100%" /> |
| | | @change="calculateFromQuantity" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨æ»ä»·(å
)ï¼" prop="taxInclusiveTotalPrice"> |
| | | <el-input v-model="productForm.taxInclusiveTotalPrice" placeholder="请è¾å
¥" clearable @change="calculateFromTotalPrice" /> |
| | | <el-form-item label="å«ç¨æ»ä»·(å
)ï¼" |
| | | prop="taxInclusiveTotalPrice"> |
| | | <el-input v-model="productForm.taxInclusiveTotalPrice" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | @change="calculateFromTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å«ç¨æ»ä»·(å
)ï¼" prop="taxExclusiveTotalPrice"> |
| | | <el-input v-model="productForm.taxExclusiveTotalPrice" placeholder="请è¾å
¥" clearable @change="calculateFromExclusiveTotalPrice" /> |
| | | <el-form-item label="ä¸å«ç¨æ»ä»·(å
)ï¼" |
| | | prop="taxExclusiveTotalPrice"> |
| | | <el-input v-model="productForm.taxExclusiveTotalPrice" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | @change="calculateFromExclusiveTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票类åï¼" prop="invoiceType"> |
| | | <el-select v-model="productForm.invoiceType" placeholder="è¯·éæ©" clearable> |
| | | <el-option label="墿®ç¥¨" value="墿®ç¥¨" /> |
| | | <el-option label="å¢ä¸ç¥¨" value="å¢ä¸ç¥¨" /> |
| | | <el-form-item label="å票类åï¼" |
| | | prop="invoiceType"> |
| | | <el-select v-model="productForm.invoiceType" |
| | | placeholder="è¯·éæ©" |
| | | clearable> |
| | | <el-option label="墿®ç¥¨" |
| | | value="墿®ç¥¨" /> |
| | | <el-option label="å¢ä¸ç¥¨" |
| | | value="å¢ä¸ç¥¨" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯å¦ç产ï¼" |
| | | prop="isProduction"> |
| | | <el-radio-group v-model="productForm.isProduction"> |
| | | <el-radio label="æ¯" |
| | | :value="true" /> |
| | | <el-radio label="å¦" |
| | | :value="false" /> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </FormDialog> |
| | | <!-- 导å
¥å¼¹çª --> |
| | | <FormDialog |
| | | v-model="importUpload.open" |
| | | <FormDialog v-model="importUpload.open" |
| | | :title="importUpload.title" |
| | | :width="'600px'" |
| | | @close="importUpload.open = false" |
| | | @confirm="submitImportFile" |
| | | @cancel="importUpload.open = false" |
| | | > |
| | | <el-upload |
| | | ref="importUploadRef" |
| | | @cancel="importUpload.open = false"> |
| | | <el-upload ref="importUploadRef" |
| | | :limit="1" |
| | | accept=".xlsx,.xls" |
| | | :action="importUpload.url" |
| | |
| | | :on-progress="importUpload.onProgress" |
| | | :on-change="importUpload.onChange" |
| | | :auto-upload="false" |
| | | drag |
| | | > |
| | | drag> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text"> |
| | | å°æä»¶æå°æ¤å¤ï¼æ<em>ç¹å»ä¸ä¼ </em> |
| | |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | ä»
æ¯æ xls/xlsxï¼å¤§å°ä¸è¶
è¿ 10MBã |
| | | <el-button link type="primary" @click="downloadTemplate">ä¸è½½å¯¼å
¥æ¨¡æ¿</el-button> |
| | | <el-button link |
| | | type="primary" |
| | | @click="downloadTemplate">ä¸è½½å¯¼å
¥æ¨¡æ¿</el-button> |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | </FormDialog> |
| | | <!-- éä»¶åè¡¨å¼¹çª --> |
| | | <FileListDialog |
| | | ref="fileListRef" |
| | | <FileListDialog ref="fileListRef" |
| | | v-model="fileListDialogVisible" |
| | | title="éä»¶å表" |
| | | /> |
| | | title="éä»¶å表" /> |
| | | <!-- æå°é¢è§å¼¹çª --> |
| | | <el-dialog |
| | | v-model="printPreviewVisible" |
| | | <el-dialog v-model="printPreviewVisible" |
| | | title="æå°é¢è§" |
| | | width="90%" |
| | | :close-on-click-modal="false" |
| | | class="print-preview-dialog" |
| | | > |
| | | class="print-preview-dialog"> |
| | | <div class="print-preview-container"> |
| | | <div class="print-preview-header"> |
| | | <el-button type="primary" @click="executePrint">æ§è¡æå°</el-button> |
| | | <el-button type="primary" |
| | | @click="executePrint">æ§è¡æå°</el-button> |
| | | <el-button @click="printPreviewVisible = false">å
³éé¢è§</el-button> |
| | | </div> |
| | | <div class="print-preview-content"> |
| | | <div v-if="printData.length === 0" style="text-align: center; padding: 50px; color: #999;"> |
| | | <div v-if="printData.length === 0" |
| | | style="text-align: center; padding: 50px; color: #999;"> |
| | | ææ æå°æ°æ® |
| | | </div> |
| | | <div v-else style="text-align: center; padding: 10px; color: #666; font-size: 14px; background: #e8f4fd; margin-bottom: 10px;"> |
| | | <div v-else |
| | | style="text-align: center; padding: 10px; color: #666; font-size: 14px; background: #e8f4fd; margin-bottom: 10px;"> |
| | | å
± {{ printData.length }} æ¡æ°æ®å¾
æå° |
| | | </div> |
| | | <div v-for="(item, index) in printData" :key="index" class="print-page"> |
| | | <div v-for="(item, index) in printData" |
| | | :key="index" |
| | | class="print-page"> |
| | | <div class="delivery-note"> |
| | | <div class="header"> |
| | | <div class="document-title">é¶å®åè´§å</div> |
| | | </div> |
| | | |
| | | <div class="info-section"> |
| | | <div class="info-row"> |
| | | <div> |
| | |
| | | <span class="value">{{ item.salesContractNo }}</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="table-section"> |
| | | <table class="product-table"> |
| | | <thead> |
| | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="product in item.products" :key="product.id"> |
| | | <tr v-for="product in item.products" |
| | | :key="product.id"> |
| | | <td>{{ product.productCategory || '' }}</td> |
| | | <td>{{ product.specificationModel || '' }}</td> |
| | | <td>{{ product.unit || '' }}</td> |
| | |
| | | <td>{{ product.taxInclusiveTotalPrice || '0' }}</td> |
| | | </tr> |
| | | <tr v-if="!item.products || item.products.length === 0"> |
| | | <td colspan="6" style="text-align: center; color: #999;">ææ äº§åæ°æ®</td> |
| | | <td colspan="6" |
| | | style="text-align: center; color: #999;">ææ äº§åæ°æ®</td> |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | |
| | | </tfoot> |
| | | </table> |
| | | </div> |
| | | |
| | | <div class="footer-section"> |
| | | <div class="footer-row"> |
| | | <div class="footer-item"> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- åè´§å¼¹æ¡ --> |
| | | <el-dialog |
| | | v-model="deliveryFormVisible" |
| | | <el-dialog v-model="deliveryFormVisible" |
| | | title="åè´§ä¿¡æ¯" |
| | | width="40%" |
| | | @close="closeDeliveryDia" |
| | | > |
| | | <el-form :model="deliveryForm" label-width="120px" label-position="top" :rules="deliveryRules" ref="deliveryFormRef"> |
| | | @close="closeDeliveryDia"> |
| | | <el-form :model="deliveryForm" |
| | | label-width="120px" |
| | | label-position="top" |
| | | :rules="deliveryRules" |
| | | ref="deliveryFormRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åè´§ç±»åï¼" prop="type"> |
| | | <el-select |
| | | v-model="deliveryForm.type" |
| | | <el-form-item label="åè´§ç±»åï¼" |
| | | prop="type"> |
| | | <el-select v-model="deliveryForm.type" |
| | | placeholder="è¯·éæ©åè´§ç±»å" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="货车" value="货车" /> |
| | | <el-option label="å¿«é" value="å¿«é" /> |
| | | style="width: 100%"> |
| | | <el-option label="货车" |
| | | value="货车" /> |
| | | <el-option label="å¿«é" |
| | | value="å¿«é" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitDelivery">确认åè´§</el-button> |
| | | <el-button type="primary" |
| | | @click="submitDelivery">确认åè´§</el-button> |
| | | <el-button @click="closeDeliveryDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | import { UploadFilled, Download } from "@element-plus/icons-vue"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import FileListDialog from '@/components/Dialog/FileListDialog.vue'; |
| | | import FormDialog from '@/components/Dialog/FormDialog.vue'; |
| | | import FileListDialog from "@/components/Dialog/FileListDialog.vue"; |
| | | import FormDialog from "@/components/Dialog/FormDialog.vue"; |
| | | import { getQuotationList } from "@/api/salesManagement/salesQuotation.js"; |
| | | import { |
| | | ledgerListPage, |
| | |
| | | delLedger, |
| | | addOrUpdateSalesLedgerProduct, |
| | | delProduct, |
| | | delLedgerFile, getProductInventory, |
| | | delLedgerFile, |
| | | getProductInventory, |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | |
| | | taxInclusiveTotalPrice: "", |
| | | taxExclusiveTotalPrice: "", |
| | | invoiceType: "", |
| | | isProduction: false, |
| | | }, |
| | | productRules: { |
| | | productCategory: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | |
| | | { required: true, message: "请è¾å
¥", trigger: "blur" }, |
| | | ], |
| | | invoiceType: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | isProduction: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { productForm, productRules } = toRefs(productFormData); |
| | |
| | | type: "货车", // 货车, å¿«é |
| | | }, |
| | | deliveryRules: { |
| | | type: [ |
| | | { required: true, message: "è¯·éæ©åè´§ç±»å", trigger: "change" } |
| | | ] |
| | | type: [{ required: true, message: "è¯·éæ©åè´§ç±»å", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { deliveryForm, deliveryRules } = toRefs(deliveryFormData); |
| | |
| | | url: import.meta.env.VITE_APP_BASE_API + "/sales/ledger/import", |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | isUploading: false, |
| | | beforeUpload: (file) => { |
| | | const isExcel = file.name.endsWith('.xlsx') || file.name.endsWith('.xls'); |
| | | beforeUpload: file => { |
| | | const isExcel = file.name.endsWith(".xlsx") || file.name.endsWith(".xls"); |
| | | const isLt10M = file.size / 1024 / 1024 < 10; |
| | | if (!isExcel) { |
| | | proxy.$modal.msgError("ä¸ä¼ æä»¶åªè½æ¯ xlsx/xls æ ¼å¼!"); |
| | |
| | | return true; |
| | | }, |
| | | onChange: (file, fileList) => { |
| | | console.log('æä»¶ç¶ææ¹å', file, fileList); |
| | | console.log("æä»¶ç¶ææ¹å", file, fileList); |
| | | }, |
| | | onProgress: (event, file, fileList) => { |
| | | console.log('ä¸ä¼ ä¸...', event.percent); |
| | | console.log("ä¸ä¼ ä¸...", event.percent); |
| | | }, |
| | | onSuccess: (response, file, fileList) => { |
| | | console.log('ä¸ä¼ æå', response, file, fileList); |
| | | console.log("ä¸ä¼ æå", response, file, fileList); |
| | | importUpload.isUploading = false; |
| | | if (response.code === 200) { |
| | | proxy.$modal.msgSuccess("导å
¥æå"); |
| | |
| | | } |
| | | }, |
| | | onError: (error, file, fileList) => { |
| | | console.error('ä¸ä¼ 失败', error, file, fileList); |
| | | console.error("ä¸ä¼ 失败", error, file, fileList); |
| | | importUpload.isUploading = false; |
| | | proxy.$modal.msgError("导å
¥å¤±è´¥ï¼è¯·éè¯"); |
| | | }, |
| | | }); |
| | | |
| | | const changeDaterange = (value) => { |
| | | const changeDaterange = value => { |
| | | if (value) { |
| | | searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); |
| | | searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); |
| | |
| | | expandedRowKeys.value = []; |
| | | getList(); |
| | | }; |
| | | const paginationChange = (obj) => { |
| | | const paginationChange = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | |
| | | // ç§»é¤å½å
¥æ¥æçé»è®¤å¼è®¾ç½®ï¼åªä¿çèå´æ¥æå段 |
| | | delete params.entryDate; |
| | | return ledgerListPage(params) |
| | | .then((res) => { |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.records; |
| | | tableData.value.map((item) => { |
| | | tableData.value.map(item => { |
| | | item.children = []; |
| | | }); |
| | | total.value = res.total; |
| | |
| | | // è·å产å大类treeæ°æ® |
| | | const getProductOptions = () => { |
| | | // è¿å Promiseï¼ä¾¿äºå¨ç¼è¾äº§åæ¶çå¾
å è½½å®æ |
| | | return productTreeList().then((res) => { |
| | | return productTreeList().then(res => { |
| | | productOptions.value = convertIdToValue(res); |
| | | return productOptions.value; |
| | | }); |
| | |
| | | } |
| | | return parseFloat(cellValue).toFixed(2); |
| | | }; |
| | | const findLedgerRecordByRow = (row) => { |
| | | const findLedgerRecordByRow = row => { |
| | | if (!row) return null; |
| | | if ( |
| | | row.maintainer !== undefined || |
| | |
| | | return row; |
| | | } |
| | | if (row.salesLedgerId !== undefined && row.salesLedgerId !== null) { |
| | | return tableData.value.find((item) => String(item.id) === String(row.salesLedgerId)) || null; |
| | | return ( |
| | | tableData.value.find( |
| | | item => String(item.id) === String(row.salesLedgerId) |
| | | ) || null |
| | | ); |
| | | } |
| | | return null; |
| | | }; |
| | | const isCurrentUserMaintainer = (row) => { |
| | | const isCurrentUserMaintainer = row => { |
| | | const ledgerRecord = findLedgerRecordByRow(row); |
| | | if (!ledgerRecord) return true; |
| | | const currentUserId = String(userStore.id ?? ""); |
| | | const currentNickName = String(userStore.nickName ?? "").trim(); |
| | | const maintainerId = ledgerRecord.maintainerId ?? ledgerRecord.entryPerson; |
| | | const maintainerName = |
| | | ledgerRecord.maintainerName ?? ledgerRecord.maintainer ?? ledgerRecord.entryPersonName; |
| | | if (maintainerId !== undefined && maintainerId !== null && String(maintainerId) !== "") { |
| | | ledgerRecord.maintainerName ?? |
| | | ledgerRecord.maintainer ?? |
| | | ledgerRecord.entryPersonName; |
| | | if ( |
| | | maintainerId !== undefined && |
| | | maintainerId !== null && |
| | | String(maintainerId) !== "" |
| | | ) { |
| | | return String(maintainerId) === currentUserId; |
| | | } |
| | | if (maintainerName !== undefined && maintainerName !== null && String(maintainerName).trim() !== "") { |
| | | if ( |
| | | maintainerName !== undefined && |
| | | maintainerName !== null && |
| | | String(maintainerName).trim() !== "" |
| | | ) { |
| | | return String(maintainerName).trim() === currentNickName; |
| | | } |
| | | return true; |
| | | }; |
| | | const canEditLedger = (row) => isCurrentUserMaintainer(row); |
| | | const canDeleteLedger = (row) => isCurrentUserMaintainer(row); |
| | | const canEditLedger = row => isCurrentUserMaintainer(row); |
| | | const canDeleteLedger = row => isCurrentUserMaintainer(row); |
| | | const sensitiveAmountFormatter = (row, column, cellValue) => { |
| | | if (!isCurrentUserMaintainer(row)) { |
| | | return "*****"; |
| | |
| | | return formattedNumber(row, column, cellValue); |
| | | }; |
| | | // è·åtreeåæ°æ® |
| | | const getModels = (value) => { |
| | | const getModels = value => { |
| | | productForm.value.productCategory = findNodeById(productOptions.value, value); |
| | | modelList({ id: value }).then((res) => { |
| | | modelList({ id: value }).then(res => { |
| | | modelOptions.value = res; |
| | | }); |
| | | }; |
| | | const getProductModel = (value) => { |
| | | const index = modelOptions.value.findIndex((item) => item.id === value); |
| | | const getProductModel = value => { |
| | | const index = modelOptions.value.findIndex(item => item.id === value); |
| | | if (index !== -1) { |
| | | productForm.value.specificationModel = modelOptions.value[index].model; |
| | | productForm.value.unit = modelOptions.value[index].unit; |
| | |
| | | return null; // æ²¡ææ¾å°èç¹ï¼è¿ånull |
| | | }; |
| | | function convertIdToValue(data) { |
| | | return data.map((item) => { |
| | | return data.map(item => { |
| | | const { id, children, ...rest } = item; |
| | | const newItem = { |
| | | ...rest, |
| | |
| | | return null; |
| | | } |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | const handleSelectionChange = selection => { |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter((item) => item.children !== undefined); |
| | | selectedRows.value = selection.filter(item => item.children !== undefined); |
| | | console.log("selection", selectedRows.value); |
| | | }; |
| | | const productSelected = (selectedRows) => { |
| | | const productSelected = selectedRows => { |
| | | productSelectedRows.value = selectedRows; |
| | | }; |
| | | const expandedRowKeys = ref([]); |
| | |
| | | if (expandedRows.length > 0) { |
| | | expandedRowKeys.value = []; |
| | | try { |
| | | productList({ salesLedgerId: row.id, type: 1 }).then((res) => { |
| | | const index = tableData.value.findIndex((item) => item.id === row.id); |
| | | productList({ salesLedgerId: row.id, type: 1 }).then(res => { |
| | | const index = tableData.value.findIndex(item => item.id === row.id); |
| | | if (index > -1) { |
| | | tableData.value[index].children = res.data; |
| | | } |
| | |
| | | |
| | | // æ·»å 表è¡ç±»åæ¹æ³ |
| | | const tableRowClassName = ({ row }) => { |
| | | if (!row.deliveryDate) return ''; |
| | | if (row.isFh) return ''; |
| | | if (!row.deliveryDate) return ""; |
| | | if (row.isFh) return ""; |
| | | |
| | | const diff = row.deliveryDaysDiff; |
| | | if (diff === 15) { |
| | | return 'yellow'; |
| | | return "yellow"; |
| | | } else if (diff === 10) { |
| | | return 'pink'; |
| | | return "pink"; |
| | | } else if (diff === 2) { |
| | | return 'purple'; |
| | | return "purple"; |
| | | } else if (diff < 2) { |
| | | return 'red'; |
| | | return "red"; |
| | | } |
| | | }; |
| | | // 主表åè®¡æ¹æ³ |
| | | const summarizeMainTable = (param) => { |
| | | const summarizeMainTable = param => { |
| | | return proxy.summarizeTable(param, [ |
| | | "contractAmount", |
| | | "taxInclusiveTotalPrice", |
| | |
| | | if (index === 0) { |
| | | return "å计"; |
| | | } |
| | | if (["taxInclusiveUnitPrice", "taxInclusiveTotalPrice", "taxExclusiveTotalPrice"].includes(column.property)) { |
| | | if ( |
| | | [ |
| | | "taxInclusiveUnitPrice", |
| | | "taxInclusiveTotalPrice", |
| | | "taxExclusiveTotalPrice", |
| | | ].includes(column.property) |
| | | ) { |
| | | return "*****"; |
| | | } |
| | | return ""; |
| | |
| | | selectedQuotation.value = null; |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | listCustomerPrivatePool({current: -1,size:-1}).then((res) => { |
| | | listCustomerPrivatePool({ current: -1, size: -1 }).then(res => { |
| | | customerOption.value = res.data.records; |
| | | }); |
| | | form.value.entryPerson = userStore.id; |
| | |
| | | form.value.executionDate = getCurrentDate(); |
| | | } else { |
| | | currentId.value = row.id; |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => { |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => { |
| | | form.value = { ...res }; |
| | | form.value.entryPerson = Number(res.entryPerson); |
| | | productData.value = form.value.productData; |
| | |
| | | // å
ç¡®ä¿å®¢æ·å表已å è½½ï¼ä¾¿äºåç»åå¡« customerId |
| | | if (!customerOption.value || customerOption.value.length === 0) { |
| | | try { |
| | | listCustomerPrivatePool({current: -1,size:-1}).then((res) => { |
| | | listCustomerPrivatePool({ current: -1, size: -1 }).then(res => { |
| | | customerOption.value = res.data.records; |
| | | }); |
| | | } catch (e) { |
| | |
| | | }; |
| | | |
| | | // æ¥ä»·åå¼¹æ¡å页忢 |
| | | const quotationPaginationChange = (obj) => { |
| | | const quotationPaginationChange = obj => { |
| | | quotationPage.current = obj.page; |
| | | quotationPage.size = obj.limit; |
| | | fetchQuotationList(); |
| | | }; |
| | | |
| | | // é䏿¥ä»·åååå¡«å°å°è´¦è¡¨å |
| | | const applyQuotation = (row) => { |
| | | const applyQuotation = row => { |
| | | if (!row) return; |
| | | selectedQuotation.value = row; |
| | | |
| | |
| | | |
| | | // 客æ·åç§° -> customerId |
| | | const qCustomerName = String(row.customer || "").trim(); |
| | | const customer = (customerOption.value || []).find((c) => { |
| | | const customer = (customerOption.value || []).find(c => { |
| | | const name = String(c.customerName || "").trim(); |
| | | return name === qCustomerName || name.includes(qCustomerName) || qCustomerName.includes(name); |
| | | return ( |
| | | name === qCustomerName || |
| | | name.includes(qCustomerName) || |
| | | qCustomerName.includes(name) |
| | | ); |
| | | }); |
| | | if (customer?.id) { |
| | | form.value.customerId = customer.id; |
| | |
| | | |
| | | // 产åä¿¡æ¯æ å°ï¼æ¥ä»· products -> å°è´¦ productData |
| | | const products = Array.isArray(row.products) ? row.products : []; |
| | | productData.value = products.map((p) => { |
| | | productData.value = products.map(p => { |
| | | const quantity = Number(p.quantity ?? 0) || 0; |
| | | const unitPrice = Number(p.unitPrice ?? 0) || 0; |
| | | const taxRate = "13"; // é»è®¤ 13%ï¼ä¾¿äºç´æ¥æäº¤ï¼å¦éå¯å¨äº§åä¸èªè¡ä¿®æ¹ï¼ |
| | | const taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2); |
| | | const taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(taxInclusiveTotalPrice, taxRate); |
| | | const taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice( |
| | | taxInclusiveTotalPrice, |
| | | taxRate |
| | | ); |
| | | return { |
| | | // å°è´¦å段 |
| | | productCategory: p.product || p.productName || "", |
| | |
| | | taxInclusiveTotalPrice: taxInclusiveTotalPrice, |
| | | taxExclusiveTotalPrice: taxExclusiveTotalPrice, |
| | | invoiceType: "墿®ç¥¨", |
| | | isProduction: true, |
| | | }; |
| | | }); |
| | | |
| | |
| | | if (operationType.value === "edit") { |
| | | let ids = []; |
| | | ids.push(file.id); |
| | | delLedgerFile(ids).then((res) => { |
| | | delLedgerFile(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }); |
| | | } |
| | | } |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate((valid) => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | console.log('productData.value--', productData.value) |
| | | console.log("productData.value--", productData.value); |
| | | if (productData.value !== null && productData.value.length > 0) { |
| | | form.value.productData = proxy.HaveJson(productData.value); |
| | | } else { |
| | |
| | | } |
| | | let tempFileIds = []; |
| | | if (fileList.value !== null && fileList.value.length > 0) { |
| | | tempFileIds = fileList.value.map((item) => item.tempId); |
| | | tempFileIds = fileList.value.map(item => item.tempId); |
| | | } |
| | | form.value.tempFileIds = tempFileIds; |
| | | form.value.type = 1; |
| | | addOrUpdateSalesLedger(form.value).then((res) => { |
| | | addOrUpdateSalesLedger(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | expandedRowKeys.value = []; |
| | |
| | | |
| | | productOperationType.value = type; |
| | | productForm.value = {}; |
| | | if (type === "add") { |
| | | productForm.value.isProduction = true; |
| | | } |
| | | proxy.resetForm("productFormRef"); |
| | | if (type === "edit") { |
| | | productForm.value = { ...row }; |
| | | productIndex.value = index; |
| | | // ç¼è¾æ¶æ ¹æ®äº§å大类åç§°åæ¥ tree èç¹ idï¼å¹¶å è½½è§æ ¼åå·å表 |
| | | try { |
| | | const options = productOptions.value && productOptions.value.length > 0 |
| | | const options = |
| | | productOptions.value && productOptions.value.length > 0 |
| | | ? productOptions.value |
| | | : await getProductOptions(); |
| | | const categoryId = findNodeIdByLabel(options, productForm.value.productCategory); |
| | | const categoryId = findNodeIdByLabel( |
| | | options, |
| | | productForm.value.productCategory |
| | | ); |
| | | if (categoryId) { |
| | | const models = await modelList({ id: categoryId }); |
| | | modelOptions.value = models || []; |
| | | // æ ¹æ®å½åè§æ ¼åå·åç§°åæ¥å¹¶è®¾ç½® productModelIdï¼ä¾¿äºä¸ææ¡æ¾ç¤ºå·²éå¼ |
| | | const currentModel = (modelOptions.value || []).find( |
| | | (m) => m.model === productForm.value.specificationModel |
| | | m => m.model === productForm.value.specificationModel |
| | | ); |
| | | if (currentModel) { |
| | | productForm.value.productModelId = currentModel.id; |
| | |
| | | console.error("å 载产åè§æ ¼åå·å¤±è´¥", e); |
| | | } |
| | | } else { |
| | | getProductOptions() |
| | | getProductOptions(); |
| | | } |
| | | productFormVisible.value = true; |
| | | }; |
| | | // æäº¤äº§å表å |
| | | const submitProduct = () => { |
| | | proxy.$refs["productFormRef"].validate((valid) => { |
| | | proxy.$refs["productFormRef"].validate(valid => { |
| | | if (valid) { |
| | | if (operationType.value === "edit") { |
| | | submitProductEdit(); |
| | |
| | | if(productOperationType.value === "add"){ |
| | | productData.value.push({ ...productForm.value }); |
| | | }else{ |
| | | productData.value[productIndex.value] = { ...productForm.value } |
| | | productData.value[productIndex.value] = { ...productForm.value }; |
| | | } |
| | | closeProductDia(); |
| | | } |
| | |
| | | }; |
| | | const submitProductEdit = () => { |
| | | productForm.value.salesLedgerId = currentId.value; |
| | | productForm.value.type = 1 |
| | | addOrUpdateSalesLedgerProduct(productForm.value).then((res) => { |
| | | productForm.value.type = 1; |
| | | addOrUpdateSalesLedgerProduct(productForm.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeProductDia(); |
| | | getSalesLedgerWithProducts({ id: currentId.value, type: 1 }).then((res) => { |
| | | getSalesLedgerWithProducts({ id: currentId.value, type: 1 }).then(res => { |
| | | productData.value = res.productData; |
| | | }); |
| | | }); |
| | |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦æå·²åè´§æå®¡æ ¸éè¿ç产å |
| | | const shippedProducts = productSelectedRows.value.filter(row => isProductShipped(row)); |
| | | const shippedProducts = productSelectedRows.value.filter(row => |
| | | isProductShipped(row) |
| | | ); |
| | | if (shippedProducts.length > 0) { |
| | | proxy.$modal.msgWarning("å·²åè´§æå®¡æ ¸éè¿ç产åä¸è½å é¤"); |
| | | return; |
| | | } |
| | | |
| | | if (operationType.value === "add") { |
| | | productSelectedRows.value.forEach((selectedRow) => { |
| | | productSelectedRows.value.forEach(selectedRow => { |
| | | const index = productData.value.findIndex( |
| | | (product) => product.id === selectedRow.id |
| | | product => product.id === selectedRow.id |
| | | ); |
| | | if (index !== -1) { |
| | | productData.value.splice(index, 1); |
| | |
| | | } else { |
| | | let ids = []; |
| | | if (productSelectedRows.value.length > 0) { |
| | | ids = productSelectedRows.value.map((item) => item.id); |
| | | ids = productSelectedRows.value.map(item => item.id); |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delProduct(ids).then((res) => { |
| | | delProduct(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | closeProductDia(); |
| | | getSalesLedgerWithProducts({ id: currentId.value, type: 1 }).then( |
| | | (res) => { |
| | | res => { |
| | | productData.value = res.productData; |
| | | } |
| | | ); |
| | |
| | | }); |
| | | }; |
| | | /** 夿åä¸ªäº§åæ¯å¦å·²åè´§ï¼æ ¹æ®shippingStatus夿ï¼å·²åè´§æå®¡æ ¸éè¿ä¸å¯ç¼è¾åå é¤ï¼ */ |
| | | const isProductShipped = (product) => { |
| | | const isProductShipped = product => { |
| | | if (!product) return false; |
| | | const status = String(product.shippingStatus || "").trim(); |
| | | // 妿åè´§ç¶ææ¯"å·²åè´§"æ"å®¡æ ¸éè¿"ï¼åä¸å¯ç¼è¾åå é¤ |
| | |
| | | }; |
| | | |
| | | /** 夿éå®è®¢å䏿¯å¦åå¨å·²åè´§/åè´§å®æç产åï¼ä¸å¯å é¤ï¼ */ |
| | | const hasShippedProducts = (products) => { |
| | | const hasShippedProducts = products => { |
| | | if (!products || !products.length) return false; |
| | | return products.some((p) => { |
| | | return products.some(p => { |
| | | const status = String(p.shippingStatus || "").trim(); |
| | | // æåè´§æ¥ææè½¦çå·è§ä¸ºå·²åè´§ |
| | | if (p.shippingDate || p.shippingCarNumber) return true; |
| | | // å·²è¿è¡åè´§ãåè´§å®æãå·²åè´§ åä¸å¯å é¤ |
| | | return status === "å·²è¿è¡åè´§" || status === "åè´§å®æ" || status === "å·²åè´§"; |
| | | return ( |
| | | status === "å·²è¿è¡åè´§" || status === "åè´§å®æ" || status === "å·²åè´§" |
| | | ); |
| | | }); |
| | | }; |
| | | |
| | |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | const unauthorizedRows = selectedRows.value.filter((row) => !canDeleteLedger(row)); |
| | | const unauthorizedRows = selectedRows.value.filter( |
| | | row => !canDeleteLedger(row) |
| | | ); |
| | | if (unauthorizedRows.length > 0) { |
| | | proxy.$modal.msgWarning("å½åç»å½ç¨æ·ä¸æ¯å½å
¥äººï¼ä¸è½å é¤è¯¥æ°æ®"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | const ids = selectedRows.value.map(item => item.id); |
| | | |
| | | // æ£æ¥æ¯å¦æå·²è¿è¡åè´§æåè´§å®æçéå®è®¢åï¼è¥æåä¸å
许å é¤ |
| | | const cannotDeleteNames = []; |
| | | for (const row of selectedRows.value) { |
| | | let products = row.children && row.children.length > 0 ? row.children : null; |
| | | let products = |
| | | row.children && row.children.length > 0 ? row.children : null; |
| | | if (!products) { |
| | | try { |
| | | const res = await productList({ salesLedgerId: row.id, type: 1 }); |
| | |
| | | } |
| | | } |
| | | if (cannotDeleteNames.length > 0) { |
| | | proxy.$modal.msgWarning("å·²è¿è¡åè´§æåè´§å®æçéå®è®¢åä¸è½å é¤ï¼" + cannotDeleteNames.join("ã")); |
| | | proxy.$modal.msgWarning( |
| | | "å·²è¿è¡åè´§æåè´§å®æçéå®è®¢åä¸è½å é¤ï¼" + cannotDeleteNames.join("ã") |
| | | ); |
| | | return; |
| | | } |
| | | |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delLedger(ids).then((res) => { |
| | | delLedger(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | |
| | | for (const row of selectedRows.value) { |
| | | try { |
| | | // è°ç¨productListæ¥å£æ¥è¯¢äº§åæ°æ® |
| | | const productRes = await productList({ salesLedgerId: row.id, type: 1 }); |
| | | const productRes = await productList({ |
| | | salesLedgerId: row.id, |
| | | type: 1, |
| | | }); |
| | | |
| | | // å°äº§åæ°æ®æ´åå°éå®å°è´¦è®°å½ä¸ |
| | | const rowWithProducts = { |
| | | ...row, |
| | | products: productRes.data || [] |
| | | products: productRes.data || [], |
| | | }; |
| | | |
| | | printDataWithProducts.push(rowWithProducts); |
| | |
| | | // å³ä½¿æä¸ªè®°å½çäº§åæ°æ®è·å失败ï¼ä¹è¦å
å«è¯¥è®°å½ |
| | | printDataWithProducts.push({ |
| | | ...row, |
| | | products: [] |
| | | products: [], |
| | | }); |
| | | } |
| | | } |
| | | |
| | | printData.value = printDataWithProducts; |
| | | console.log('æå°æ°æ®ï¼å
å«äº§åï¼:', printData.value); |
| | | console.log("æå°æ°æ®ï¼å
å«äº§åï¼:", printData.value); |
| | | printPreviewVisible.value = true; |
| | | |
| | | } catch (error) { |
| | | console.error('è·åäº§åæ°æ®å¤±è´¥:', error); |
| | | console.error("è·åäº§åæ°æ®å¤±è´¥:", error); |
| | | proxy.$modal.msgError("è·åäº§åæ°æ®å¤±è´¥ï¼è¯·éè¯"); |
| | | } finally { |
| | | proxy.$modal.closeLoading(); |
| | |
| | | }; |
| | | // æ§è¡æå° |
| | | const executePrint = () => { |
| | | console.log('å¼å§æ§è¡æå°ï¼æ°æ®æ¡æ°:', printData.value.length); |
| | | console.log('æå°æ°æ®:', printData.value); |
| | | console.log("å¼å§æ§è¡æå°ï¼æ°æ®æ¡æ°:", printData.value.length); |
| | | console.log("æå°æ°æ®:", printData.value); |
| | | |
| | | // å建ä¸ä¸ªæ°çæå°çªå£ |
| | | const printWindow = window.open('', '_blank', 'width=800,height=600'); |
| | | const printWindow = window.open("", "_blank", "width=800,height=600"); |
| | | |
| | | // æå»ºæå°å
容 |
| | | let printContent = ` |
| | |
| | | <div class="info-row"> |
| | | <div> |
| | | <span class="label">åè´§æ¥æï¼</span> |
| | | <span class="value">${formatDate(item.createTime)}</span> |
| | | <span class="value">${formatDate( |
| | | item.createTime |
| | | )}</span> |
| | | </div> |
| | | <div> |
| | | <span class="label">客æ·åç§°ï¼</span> |
| | | <span class="value">${item.customerName}</span> |
| | | <span class="value">${ |
| | | item.customerName |
| | | }</span> |
| | | </div> |
| | | </div> |
| | | <div class="info-row"> |
| | | <span class="label">åå·ï¼</span> |
| | | <span class="value">${item.salesContractNo || ''}</span> |
| | | <span class="value">${ |
| | | item.salesContractNo || "" |
| | | }</span> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | ${item.products && item.products.length > 0 ? |
| | | item.products.map(product => ` |
| | | ${ |
| | | item.products && |
| | | item.products.length > 0 |
| | | ? item.products |
| | | .map( |
| | | product => ` |
| | | <tr> |
| | | <td>${product.productCategory || ''}</td> |
| | | <td>${product.specificationModel || ''}</td> |
| | | <td>${product.unit || ''}</td> |
| | | <td>${product.taxInclusiveUnitPrice || '0'}</td> |
| | | <td>${product.quantity || '0'}</td> |
| | | <td>${product.taxInclusiveTotalPrice || '0'}</td> |
| | | <td>${ |
| | | product.productCategory || |
| | | "" |
| | | }</td> |
| | | <td>${ |
| | | product.specificationModel || |
| | | "" |
| | | }</td> |
| | | <td>${ |
| | | product.unit || "" |
| | | }</td> |
| | | <td>${ |
| | | product.taxInclusiveUnitPrice || |
| | | "0" |
| | | }</td> |
| | | <td>${ |
| | | product.quantity || |
| | | "0" |
| | | }</td> |
| | | <td>${ |
| | | product.taxInclusiveTotalPrice || |
| | | "0" |
| | | }</td> |
| | | </tr> |
| | | `).join('') : |
| | | '<tr><td colspan="6" style="text-align: center; color: #999;">ææ äº§åæ°æ®</td></tr>' |
| | | ` |
| | | ) |
| | | .join("") |
| | | : '<tr><td colspan="6" style="text-align: center; color: #999;">ææ äº§åæ°æ®</td></tr>' |
| | | } |
| | | </tbody> |
| | | <tfoot> |
| | |
| | | <td class="total-value"></td> |
| | | <td class="total-value"></td> |
| | | <td class="total-value"></td> |
| | | <td class="total-value">${getTotalQuantityForPrint(item.products)}</td> |
| | | <td class="total-value">${getTotalAmountForPrint(item.products)}</td> |
| | | <td class="total-value">${getTotalQuantityForPrint( |
| | | item.products |
| | | )}</td> |
| | | <td class="total-value">${getTotalAmountForPrint( |
| | | item.products |
| | | )}</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> |
| | | <span class="value">${formatDateTime(new Date())}</span> |
| | | <span class="value">${formatDateTime( |
| | | new Date() |
| | | )}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }; |
| | | }; |
| | | // æ ¼å¼åæ¥æ |
| | | const formatDate = (dateString) => { |
| | | const formatDate = dateString => { |
| | | if (!dateString) return getCurrentDate(); |
| | | const date = new Date(dateString); |
| | | const year = date.getFullYear(); |
| | |
| | | return `${year}/${month}/${day}`; |
| | | }; |
| | | // æ ¼å¼åæ¥ææ¶é´ |
| | | const formatDateTime = (date) => { |
| | | const formatDateTime = date => { |
| | | 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} ${hours}:${minutes}:${seconds}`; |
| | | }; |
| | | // 计ç®äº§åæ»æ°é |
| | | const getTotalQuantity = (products) => { |
| | | if (!products || products.length === 0) return '0'; |
| | | const getTotalQuantity = products => { |
| | | if (!products || products.length === 0) return "0"; |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.quantity) || 0); |
| | | }, 0); |
| | |
| | | }; |
| | | |
| | | // 计ç®äº§åæ»éé¢ |
| | | const getTotalAmount = (products) => { |
| | | if (!products || products.length === 0) return '0'; |
| | | const getTotalAmount = products => { |
| | | if (!products || products.length === 0) return "0"; |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0); |
| | | }, 0); |
| | |
| | | }; |
| | | |
| | | // ç¨äºæå°ç计ç®å½æ° |
| | | const getTotalQuantityForPrint = (products) => { |
| | | if (!products || products.length === 0) return '0'; |
| | | const getTotalQuantityForPrint = products => { |
| | | if (!products || products.length === 0) return "0"; |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.quantity) || 0); |
| | | }, 0); |
| | | return total.toFixed(2); |
| | | }; |
| | | |
| | | const getTotalAmountForPrint = (products) => { |
| | | if (!products || products.length === 0) return '0'; |
| | | const getTotalAmountForPrint = products => { |
| | | if (!products || products.length === 0) return "0"; |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0); |
| | | }, 0); |
| | |
| | | } |
| | | if (isCalculating.value) return; |
| | | |
| | | const exclusiveTotalPrice = parseFloat(productForm.value.taxExclusiveTotalPrice); |
| | | const exclusiveTotalPrice = parseFloat( |
| | | productForm.value.taxExclusiveTotalPrice |
| | | ); |
| | | const quantity = parseFloat(productForm.value.quantity); |
| | | const taxRate = parseFloat(productForm.value.taxRate); |
| | | |
| | |
| | | productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(2); |
| | | |
| | | // 计ç®å«ç¨åä»· = å«ç¨æ»ä»· / æ°é |
| | | productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(2); |
| | | productForm.value.taxInclusiveUnitPrice = ( |
| | | inclusiveTotalPrice / quantity |
| | | ).toFixed(2); |
| | | |
| | | isCalculating.value = false; |
| | | }; |
| | |
| | | } |
| | | if (isCalculating.value) return; |
| | | |
| | | const inclusiveTotalPrice = parseFloat(productForm.value.taxInclusiveTotalPrice); |
| | | const inclusiveTotalPrice = parseFloat( |
| | | productForm.value.taxInclusiveTotalPrice |
| | | ); |
| | | const taxRate = parseFloat(productForm.value.taxRate); |
| | | |
| | | if (!inclusiveTotalPrice || !taxRate) { |
| | |
| | | |
| | | // 计ç®ä¸å«ç¨æ»ä»· |
| | | productForm.value.taxExclusiveTotalPrice = |
| | | proxy.calculateTaxExclusiveTotalPrice( |
| | | inclusiveTotalPrice, |
| | | taxRate |
| | | ); |
| | | proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate); |
| | | |
| | | isCalculating.value = false; |
| | | }; |
| | |
| | | * è·ååè´§ç¶æææ¬ |
| | | * @param row è¡æ°æ® |
| | | */ |
| | | const getShippingStatusText = (row) => { |
| | | const getShippingStatusText = row => { |
| | | // 妿已åè´§ï¼æåè´§æ¥ææè½¦çå·ï¼ï¼æ¾ç¤º"å·²åè´§" |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return 'å·²åè´§'; |
| | | return "å·²åè´§"; |
| | | } |
| | | |
| | | // è·ååè´§ç¶æåæ®µ |
| | | const status = row.shippingStatus; |
| | | |
| | | // å¦æç¶æä¸ºç©ºææªå®ä¹ï¼é»è®¤ä¸º"å¾
åè´§" |
| | | if (status === null || status === undefined || status === '') { |
| | | return 'å¾
åè´§'; |
| | | if (status === null || status === undefined || status === "") { |
| | | return "å¾
åè´§"; |
| | | } |
| | | |
| | | // ç¶ææ¯å符串 |
| | | const statusStr = String(status).trim(); |
| | | const statusTextMap = { |
| | | 'å¾
åè´§': 'å¾
åè´§', |
| | | 'å¾
å®¡æ ¸': 'å¾
å®¡æ ¸', |
| | | 'å®¡æ ¸ä¸': 'å®¡æ ¸ä¸', |
| | | 'å®¡æ ¸æç»': 'å®¡æ ¸æç»', |
| | | 'å®¡æ ¸éè¿': 'å®¡æ ¸éè¿', |
| | | 'å·²åè´§': 'å·²åè´§' |
| | | å¾
åè´§: "å¾
åè´§", |
| | | å¾
å®¡æ ¸: "å¾
å®¡æ ¸", |
| | | å®¡æ ¸ä¸: "å®¡æ ¸ä¸", |
| | | å®¡æ ¸æç»: "å®¡æ ¸æç»", |
| | | å®¡æ ¸éè¿: "å®¡æ ¸éè¿", |
| | | å·²åè´§: "å·²åè´§", |
| | | }; |
| | | return statusTextMap[statusStr] || 'å¾
åè´§'; |
| | | return statusTextMap[statusStr] || "å¾
åè´§"; |
| | | }; |
| | | |
| | | /** |
| | | * è·ååè´§ç¶ææ ç¾ç±»åï¼é¢è²ï¼ |
| | | * @param row è¡æ°æ® |
| | | */ |
| | | const getShippingStatusType = (row) => { |
| | | const getShippingStatusType = row => { |
| | | // 妿已åè´§ï¼æåè´§æ¥ææè½¦çå·ï¼ï¼æ¾ç¤ºç»¿è² |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return 'success'; |
| | | return "success"; |
| | | } |
| | | |
| | | // è·ååè´§ç¶æåæ®µ |
| | | const status = row.shippingStatus; |
| | | |
| | | // å¦æç¶æä¸ºç©ºææªå®ä¹ï¼é»è®¤ä¸ºç°è²ï¼å¾
åè´§ï¼ |
| | | if (status === null || status === undefined || status === '') { |
| | | return 'info'; |
| | | if (status === null || status === undefined || status === "") { |
| | | return "info"; |
| | | } |
| | | |
| | | // ç¶ææ¯å符串 |
| | | const statusStr = String(status).trim(); |
| | | const typeTextMap = { |
| | | 'å¾
åè´§': 'info', |
| | | 'å¾
å®¡æ ¸': 'info', |
| | | 'å®¡æ ¸ä¸': 'warning', |
| | | 'å®¡æ ¸æç»': 'danger', |
| | | 'å®¡æ ¸éè¿': 'success', |
| | | 'å·²åè´§': 'success' |
| | | å¾
åè´§: "info", |
| | | å¾
å®¡æ ¸: "info", |
| | | å®¡æ ¸ä¸: "warning", |
| | | å®¡æ ¸æç»: "danger", |
| | | å®¡æ ¸éè¿: "success", |
| | | å·²åè´§: "success", |
| | | }; |
| | | return typeTextMap[statusStr] || 'info'; |
| | | return typeTextMap[statusStr] || "info"; |
| | | }; |
| | | |
| | | /** |
| | |
| | | * åªæå¨äº§åç¶ææ¯å
è¶³ï¼åè´§ç¶ææ¯å¾
åè´§åå®¡æ ¸æç»çæ¶åæå¯ä»¥åè´§ |
| | | * @param row è¡æ°æ® |
| | | */ |
| | | const canShip = (row) => { |
| | | const canShip = row => { |
| | | // 产åç¶æå¿
é¡»æ¯å
è¶³ï¼approveStatus === 1ï¼ |
| | | if (row.approveStatus !== 1) { |
| | | return false; |
| | |
| | | } |
| | | |
| | | // åè´§ç¶æå¿
é¡»æ¯"å¾
åè´§"æ"å®¡æ ¸æç»" |
| | | const statusStr = shippingStatus ? String(shippingStatus).trim() : ''; |
| | | return statusStr === 'å¾
åè´§' || statusStr === 'å®¡æ ¸æç»'; |
| | | const statusStr = shippingStatus ? String(shippingStatus).trim() : ""; |
| | | return statusStr === "å¾
åè´§" || statusStr === "å®¡æ ¸æç»"; |
| | | }; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param row ä¸è½½æä»¶çç¸å
³ä¿¡æ¯å¯¹è±¡ |
| | | */ |
| | | const fileListRef = ref(null) |
| | | const fileListDialogVisible = ref(false) |
| | | const downLoadFile = (row) => { |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => { |
| | | const fileListRef = ref(null); |
| | | const fileListDialogVisible = ref(false); |
| | | const downLoadFile = row => { |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => { |
| | | if (fileListRef.value) { |
| | | fileListRef.value.open(res.salesLedgerFiles) |
| | | fileListRef.value.open(res.salesLedgerFiles); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æå¼åè´§å¼¹æ¡ |
| | | const openDeliveryForm = (row) => { |
| | | const openDeliveryForm = row => { |
| | | // æ£æ¥æ¯å¦å¯ä»¥åè´§ |
| | | if (!canShip(row)) { |
| | | proxy.$modal.msgWarning("åªæå¨äº§åç¶ææ¯å
è¶³ï¼åè´§ç¶ææ¯å¾
åè´§æå®¡æ ¸æç»çæ¶åæå¯ä»¥åè´§"); |
| | | proxy.$modal.msgWarning( |
| | | "åªæå¨äº§åç¶ææ¯å
è¶³ï¼åè´§ç¶ææ¯å¾
åè´§æå®¡æ ¸æç»çæ¶åæå¯ä»¥åè´§" |
| | | ); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | // æäº¤å货表å |
| | | const submitDelivery = () => { |
| | | proxy.$refs["deliveryFormRef"].validate((valid) => { |
| | | proxy.$refs["deliveryFormRef"].validate(valid => { |
| | | if (valid) { |
| | | // ä¿åå½åå±å¼çè¡IDï¼ä»¥ä¾¿åè´§åéæ°å è½½åè¡¨æ ¼æ°æ® |
| | | const currentExpandedKeys = [...expandedRowKeys.value]; |
| | |
| | | salesLedgerId: salesLedgerId, |
| | | salesLedgerProductId: currentDeliveryRow.value.id, |
| | | type: deliveryForm.value.type, |
| | | }) |
| | | .then(() => { |
| | | }).then(() => { |
| | | proxy.$modal.msgSuccess("åè´§æå"); |
| | | closeDeliveryDia(); |
| | | // å·æ°ä¸»è¡¨æ°æ® |
| | |
| | | if (currentExpandedKeys.length > 0) { |
| | | // ä½¿ç¨ Promise.all å¹¶è¡å è½½ææå±å¼è¡çåè¡¨æ ¼æ°æ® |
| | | const loadPromises = currentExpandedKeys.map(ledgerId => { |
| | | return productList({ salesLedgerId: ledgerId, type: 1 }).then((res) => { |
| | | const index = tableData.value.findIndex((item) => item.id === ledgerId); |
| | | return productList({ salesLedgerId: ledgerId, type: 1 }).then( |
| | | res => { |
| | | const index = tableData.value.findIndex( |
| | | item => item.id === ledgerId |
| | | ); |
| | | if (index > -1) { |
| | | tableData.value[index].children = res.data; |
| | | } |
| | | }); |
| | | } |
| | | ); |
| | | }); |
| | | Promise.all(loadPromises).then(() => { |
| | | // æ¢å¤å±å¼ç¶æ |
| | |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | getList(); |
| | | userListNoPage().then(res => { |
| | | userList.value = res.data; |
| | | }) |
| | | }); |
| | | getCurrentFactoryName(); |
| | | }); |
| | | </script> |
| | |
| | | } |
| | | |
| | | :deep(.yellow) { |
| | | background-color: #FAF0DE; |
| | | background-color: #faf0de; |
| | | } |
| | | |
| | | :deep(.pink) { |
| | | background-color: #FAE1DE; |
| | | background-color: #fae1de; |
| | | } |
| | | |
| | | :deep(.red) { |
| | | background-color: #FAE1DE; |
| | | background-color: #fae1de; |
| | | } |
| | | |
| | | :deep(.purple){ |
| | | background-color: #F4DEFA; |
| | | background-color: #f4defa; |
| | | } |
| | | |
| | | .table_list { |
| | |
| | | border-collapse: collapse; |
| | | border: 1px solid #000; |
| | | |
| | | th, td { |
| | | th, |
| | | td { |
| | | border: 1px solid #000; |
| | | padding: 6px; |
| | | text-align: center; |