|
|
|
|
@ -3,17 +3,17 @@
|
|
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width='100px'>
|
|
|
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
|
|
|
|
|
<el-form-item label="报价单号" prop="quoteCode">
|
|
|
|
|
<el-input v-model="queryParams.quoteCode" placeholder="请输入报价单号" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="报价单名称" prop="quoteName">
|
|
|
|
|
<el-input v-model="queryParams.quoteName" placeholder="请输入报价单名称" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="报价轮次" prop="quoteRound">
|
|
|
|
|
<!-- <el-form-item label="报价轮次" prop="quoteRound">
|
|
|
|
|
<el-input v-model="queryParams.quoteRound" placeholder="请输入报价轮次" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="报价大类" prop="quoteCategory">
|
|
|
|
|
<!-- <el-form-item label="报价大类" prop="quoteCategory">
|
|
|
|
|
<el-select v-model="queryParams.quoteCategory" placeholder="请选择报价大类" clearable >
|
|
|
|
|
<el-option v-for="dict in quote_category" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
@ -28,10 +28,10 @@
|
|
|
|
|
<el-option v-for="dict in business_direction" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="部门" prop="quoteDeptId">
|
|
|
|
|
<!-- <el-form-item label="部门" prop="quoteDeptId">
|
|
|
|
|
<el-input v-model="queryParams.quoteDeptId" placeholder="请输入部门" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="报价日期" prop="quoteDate">
|
|
|
|
|
<!-- <el-form-item label="报价日期" prop="quoteDate">
|
|
|
|
|
<el-date-picker clearable
|
|
|
|
|
v-model="queryParams.quoteDate"
|
|
|
|
|
type="date"
|
|
|
|
|
@ -61,15 +61,15 @@
|
|
|
|
|
<el-form-item label="交货期" prop="deliveryPeriod">
|
|
|
|
|
<el-input v-model="queryParams.deliveryPeriod" placeholder="请输入交货期" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="交付/交货方式" prop="deliveryMethod">
|
|
|
|
|
<!-- <el-form-item label="交付/交货方式" prop="deliveryMethod">
|
|
|
|
|
<el-input v-model="queryParams.deliveryMethod" placeholder="请输入交付/交货方式" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="付款方式" prop="paymentMethod">
|
|
|
|
|
<el-select v-model="queryParams.paymentMethod" placeholder="请选择付款方式" clearable >
|
|
|
|
|
<el-option v-for="dict in payment_method" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
|
|
|
|
<!-- <el-form-item label="付款方式" prop="paymentMethod">
|
|
|
|
|
<el-select v-model="queryParams.paymentMethod" placeholder="请选择付款方式" clearable>
|
|
|
|
|
<el-option v-for="dict in payment_method" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="币种" prop="currencyType">
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
<!-- <el-form-item label="币种" prop="currencyType">
|
|
|
|
|
<el-select v-model="queryParams.currencyType" placeholder="请选择币种" clearable >
|
|
|
|
|
<el-option v-for="dict in currency_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
@ -151,16 +151,28 @@
|
|
|
|
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['oa/crm:crmQuoteInfo:add']">新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['oa/crm:crmQuoteInfo:edit']">修改</el-button>
|
|
|
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['oa/crm:crmQuoteInfo:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['oa/crm:crmQuoteInfo:remove']">删除</el-button>
|
|
|
|
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['oa/crm:crmQuoteInfo:remove']"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['oa/crm:crmQuoteInfo:export']">导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.8">
|
|
|
|
|
<el-button type="primary" plain icon="Document" :disabled="single" @click="handleExportTemplate()" v-hasPermi="['oa/crm:crmQuoteInfo:exportTemplate']">模板导出</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="Document"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleExportTemplate()"
|
|
|
|
|
v-hasPermi="['oa/crm:crmQuoteInfo:export']"
|
|
|
|
|
>模板导出</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
@ -168,26 +180,26 @@
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" border :data="crmQuoteInfoList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="序号" align="center" type="index" width="50" v-if="columns[0].visible"/>
|
|
|
|
|
<el-table-column label="报价单号" align="center" prop="quoteCode" v-if="columns[1].visible"/>
|
|
|
|
|
<el-table-column label="报价单名称" align="center" prop="quoteName" v-if="columns[2].visible"/>
|
|
|
|
|
<el-table-column label="报价轮次" align="center" prop="quoteRound" v-if="columns[3].visible"/>
|
|
|
|
|
<el-table-column label="序号" align="center" type="index" width="50" v-if="columns[0].visible" />
|
|
|
|
|
<el-table-column label="报价单号" align="center" prop="quoteCode" v-if="columns[1].visible" />
|
|
|
|
|
<el-table-column label="报价单名称" align="center" prop="quoteName" v-if="columns[2].visible" />
|
|
|
|
|
<el-table-column label="报价轮次" align="center" prop="quoteRound" v-if="columns[3].visible" />
|
|
|
|
|
<el-table-column label="报价大类" align="center" prop="quoteCategory" v-if="columns[4].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="quote_category" :value="scope.row.quoteCategory"/>
|
|
|
|
|
<dict-tag :options="quote_category" :value="scope.row.quoteCategory" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="报价类型" align="center" prop="quoteType" v-if="columns[5].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="contract_type" :value="scope.row.quoteType"/>
|
|
|
|
|
<dict-tag :options="contract_type" :value="scope.row.quoteType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="业务方向" align="center" prop="businessDirection" v-if="columns[6].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="business_direction" :value="scope.row.businessDirection"/>
|
|
|
|
|
<dict-tag :options="business_direction" :value="scope.row.businessDirection" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="部门" align="center" prop="quoteDeptId" v-if="columns[7].visible"/>
|
|
|
|
|
<el-table-column label="部门" align="center" prop="deptName" v-if="columns[7].visible" />
|
|
|
|
|
<el-table-column label="报价日期" align="center" prop="quoteDate" width="180" v-if="columns[8].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.quoteDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
@ -198,83 +210,87 @@
|
|
|
|
|
<span>{{ parseTime(scope.row.validFrom, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="报价有效期" align="center" prop="validDays" v-if="columns[10].visible"/>
|
|
|
|
|
<el-table-column label="报价有效期" align="center" prop="validDays" v-if="columns[10].visible" />
|
|
|
|
|
<el-table-column label="报价有效期止" align="center" prop="validTo" width="180" v-if="columns[11].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.validTo, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="交货期" align="center" prop="deliveryPeriod" v-if="columns[12].visible"/>
|
|
|
|
|
<el-table-column label="交付/交货方式" align="center" prop="deliveryMethod" v-if="columns[13].visible"/>
|
|
|
|
|
<el-table-column label="交货期" align="center" prop="deliveryPeriod" v-if="columns[12].visible" />
|
|
|
|
|
<el-table-column label="交付/交货方式" align="center" prop="deliveryMethod" v-if="columns[13].visible" />
|
|
|
|
|
<el-table-column label="付款方式" align="center" prop="paymentMethod" v-if="columns[14].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="payment_method" :value="scope.row.paymentMethod"/>
|
|
|
|
|
<dict-tag :options="payment_method" :value="scope.row.paymentMethod" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="币种" align="center" prop="currencyType" v-if="columns[15].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="currency_type" :value="scope.row.currencyType"/>
|
|
|
|
|
<dict-tag :options="currency_type" :value="scope.row.currencyType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="含税信息" align="center" prop="taxIncludedInfo" v-if="columns[16].visible"/>
|
|
|
|
|
<el-table-column label="税率(默认按明细可覆盖)" align="center" prop="taxRate" v-if="columns[17].visible"/>
|
|
|
|
|
<el-table-column label="总报价" align="center" prop="totalPrice" v-if="columns[18].visible"/>
|
|
|
|
|
<el-table-column label="未税总价" align="center" prop="totalBeforeTax" v-if="columns[19].visible"/>
|
|
|
|
|
<el-table-column label="税额" align="center" prop="totalTax" v-if="columns[20].visible"/>
|
|
|
|
|
<el-table-column label="含税总价" align="center" prop="totalIncludingTax" v-if="columns[21].visible"/>
|
|
|
|
|
<el-table-column label="客户方联系人ID" align="center" prop="customerContactId" v-if="columns[22].visible"/>
|
|
|
|
|
<el-table-column label="客户方联系人" align="center" prop="customerContactName" v-if="columns[23].visible"/>
|
|
|
|
|
<el-table-column label="客户方联系电话" align="center" prop="customerContactPhone" v-if="columns[24].visible"/>
|
|
|
|
|
<el-table-column label="客户方电子邮箱" align="center" prop="customerContactEmail" v-if="columns[25].visible"/>
|
|
|
|
|
<el-table-column label="供货方ID" align="center" prop="supplierContactId" v-if="columns[26].visible"/>
|
|
|
|
|
<el-table-column label="供货方联系人" align="center" prop="supplierContactName" v-if="columns[27].visible"/>
|
|
|
|
|
<el-table-column label="供货方联系电话" align="center" prop="supplierContactPhone" v-if="columns[28].visible"/>
|
|
|
|
|
<el-table-column label="供货方电子邮箱" align="center" prop="supplierContactEmail" v-if="columns[29].visible"/>
|
|
|
|
|
<el-table-column label="项目ID(可选)" align="center" prop="projectId" v-if="columns[30].visible"/>
|
|
|
|
|
<el-table-column label="打印模板ID(可选)" align="center" prop="templateId" v-if="columns[31].visible"/>
|
|
|
|
|
<el-table-column label="附件ID" align="center" prop="ossId" v-if="columns[32].visible"/>
|
|
|
|
|
<el-table-column label="含税信息" align="center" prop="taxIncludedInfo" v-if="columns[16].visible" />
|
|
|
|
|
<el-table-column label="税率(默认按明细可覆盖)" align="center" prop="taxRate" v-if="columns[17].visible" />
|
|
|
|
|
<el-table-column label="总报价" align="center" prop="totalPrice" v-if="columns[18].visible" />
|
|
|
|
|
<el-table-column label="未税总价" align="center" prop="totalBeforeTax" v-if="columns[19].visible" />
|
|
|
|
|
<el-table-column label="税额" align="center" prop="totalTax" v-if="columns[20].visible" />
|
|
|
|
|
<el-table-column label="含税总价" align="center" prop="totalIncludingTax" v-if="columns[21].visible" />
|
|
|
|
|
<el-table-column label="客户名称" align="center" prop="customerName" v-if="columns[22].visible" />
|
|
|
|
|
<el-table-column label="客户方联系人" align="center" prop="customerContactName" v-if="columns[23].visible" />
|
|
|
|
|
<el-table-column label="客户方联系电话" align="center" prop="customerContactPhone" v-if="columns[24].visible" />
|
|
|
|
|
<el-table-column label="客户方电子邮箱" align="center" prop="customerContactEmail" v-if="columns[25].visible" />
|
|
|
|
|
<el-table-column label="供应商名称" align="center" prop="supplierName" v-if="columns[26].visible" />
|
|
|
|
|
<el-table-column label="供货方联系人" align="center" prop="supplierContactName" v-if="columns[27].visible" />
|
|
|
|
|
<el-table-column label="供货方联系电话" align="center" prop="supplierContactPhone" v-if="columns[28].visible" />
|
|
|
|
|
<el-table-column label="供货方电子邮箱" align="center" prop="supplierContactEmail" v-if="columns[29].visible" />
|
|
|
|
|
<el-table-column label="项目ID(可选)" align="center" prop="projectId" v-if="columns[30].visible" />
|
|
|
|
|
<el-table-column label="打印模板ID(可选)" align="center" prop="templateId" v-if="columns[31].visible" />
|
|
|
|
|
<el-table-column label="附件ID" align="center" prop="ossId" v-if="columns[32].visible" />
|
|
|
|
|
<el-table-column label="报价单状态" align="center" prop="quoteStatus" v-if="columns[33].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="quote_status" :value="scope.row.quoteStatus"/>
|
|
|
|
|
<dict-tag :options="quote_status" :value="scope.row.quoteStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="流程状态" align="center" prop="flowStatus" v-if="columns[34].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="flow_status" :value="scope.row.flowStatus"/>
|
|
|
|
|
<dict-tag :options="wf_business_status" :value="scope.row.flowStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[35].visible"/>
|
|
|
|
|
<el-table-column label="创建人" align="center" prop="createName" v-if="columns[36].visible"/>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[35].visible" />
|
|
|
|
|
<el-table-column label="创建人" align="center" prop="createName" v-if="columns[36].visible" />
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[37].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tooltip content="查看" placement="top">
|
|
|
|
|
<el-button link type="info" icon="DocumentChecked" @click="handleView(scope.row)"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="修改" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['oa/crm:crmQuoteInfo:edit']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="审批记录(预留)" placement="top">
|
|
|
|
|
<el-button link type="info" icon="View"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['oa/crm:crmQuoteInfo:remove']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="模板导出" placement="top">
|
|
|
|
|
<el-button link type="warning" icon="Document" @click="handleExportTemplate(scope.row)" v-hasPermi="['oa/crm:crmQuoteInfo:exportTemplate']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tooltip content="查看详情" placement="top" v-if="canViewDetail(scope.row)">
|
|
|
|
|
<el-button link type="info" icon="DocumentChecked" @click="handleView(scope.row)"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="修改" placement="top" v-if="scope.row.quoteStatus === '1'">
|
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['oa/crm:crmQuoteInfo:edit']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<!-- 审批记录统一通过编辑页顶部组件查看,这里暂不展示 -->
|
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['oa/crm:crmQuoteInfo:remove']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="模板导出" placement="top">
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="warning"
|
|
|
|
|
icon="Document"
|
|
|
|
|
@click="handleExportTemplate(scope.row)"
|
|
|
|
|
v-hasPermi="['oa/crm:crmQuoteInfo:exportTemplate']"
|
|
|
|
|
></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
</el-card>
|
|
|
|
|
<!-- 添加或修改报价单信息对话框 -->
|
|
|
|
|
<!-- <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
|
|
|
<!-- <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="crmQuoteInfoFormRef" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-form-item label="报价单号" prop="quoteCode">
|
|
|
|
|
<el-input v-model="form.quoteCode" placeholder="请输入报价单号" />
|
|
|
|
|
@ -457,8 +473,8 @@
|
|
|
|
|
|
|
|
|
|
<script setup name="CrmQuoteInfo" lang="ts">
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
|
|
import { listCrmQuoteInfo, getCrmQuoteInfo, delCrmQuoteInfo, addCrmQuoteInfo, updateCrmQuoteInfo, exportQuoteTemplate } from '@/api/oa/crm/crmQuoteInfo';
|
|
|
|
|
import { CrmQuoteInfoVO, CrmQuoteInfoQuery, CrmQuoteInfoForm } from '@/api/oa/crm/crmQuoteInfo/types';
|
|
|
|
|
import { addCrmQuoteInfo, delCrmQuoteInfo, exportQuoteTemplate, listCrmQuoteInfo, updateCrmQuoteInfo } from '@/api/oa/crm/crmQuoteInfo';
|
|
|
|
|
import { CrmQuoteInfoForm, CrmQuoteInfoQuery, CrmQuoteInfoVO } from '@/api/oa/crm/crmQuoteInfo/types';
|
|
|
|
|
import { getCrmCustomerContactList } from '@/api/oa/crm/customerContact';
|
|
|
|
|
import FileSaver from 'file-saver';
|
|
|
|
|
import { blobValidate } from '@/utils/ruoyi';
|
|
|
|
|
@ -466,7 +482,9 @@ import { blobValidate } from '@/utils/ruoyi';
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const { business_direction, currency_type, quote_category, payment_method, quote_status, flow_status, contract_type } = toRefs<any>(proxy?.useDict('business_direction', 'currency_type', 'quote_category', 'payment_method', 'quote_status', 'flow_status', 'contract_type'));
|
|
|
|
|
const { business_direction, currency_type, quote_category, payment_method, quote_status, wf_business_status, contract_type } = toRefs<any>(
|
|
|
|
|
proxy?.useDict('business_direction', 'currency_type', 'quote_category', 'payment_method', 'quote_status', 'wf_business_status', 'contract_type')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const crmQuoteInfoList = ref<CrmQuoteInfoVO[]>([]);
|
|
|
|
|
const buttonLoading = ref(false);
|
|
|
|
|
@ -491,10 +509,10 @@ const columns = ref<FieldOption[]>([
|
|
|
|
|
{ key: 1, label: `报价单号`, visible: true },
|
|
|
|
|
{ key: 2, label: `报价单名称`, visible: true },
|
|
|
|
|
{ key: 3, label: `报价轮次`, visible: false },
|
|
|
|
|
{ key: 4, label: `报价大类`, visible: false },
|
|
|
|
|
{ key: 5, label: `报价类型`, visible: false },
|
|
|
|
|
{ key: 6, label: `业务方向`, visible: false },
|
|
|
|
|
{ key: 7, label: `部门`, visible: false },
|
|
|
|
|
{ key: 4, label: `报价大类`, visible: true },
|
|
|
|
|
{ key: 5, label: `报价类型`, visible: true },
|
|
|
|
|
{ key: 6, label: `业务方向`, visible: true },
|
|
|
|
|
{ key: 7, label: `部门`, visible: true },
|
|
|
|
|
{ key: 8, label: `报价日期`, visible: true },
|
|
|
|
|
{ key: 9, label: `报价有效期起`, visible: true },
|
|
|
|
|
{ key: 10, label: `报价有效期`, visible: false },
|
|
|
|
|
@ -505,26 +523,26 @@ const columns = ref<FieldOption[]>([
|
|
|
|
|
{ key: 15, label: `币种`, visible: false },
|
|
|
|
|
{ key: 16, label: `含税信息`, visible: false },
|
|
|
|
|
{ key: 17, label: `税率(默认按明细可覆盖)`, visible: false },
|
|
|
|
|
{ key: 18, label: `总报价`, visible: false },
|
|
|
|
|
{ key: 18, label: `总报价`, visible: true },
|
|
|
|
|
{ key: 19, label: `未税总价`, visible: false },
|
|
|
|
|
{ key: 20, label: `税额`, visible: false },
|
|
|
|
|
{ key: 21, label: `含税总价`, visible: true },
|
|
|
|
|
{ key: 22, label: `客户方联系人ID`, visible: false },
|
|
|
|
|
{ key: 22, label: `客户名称`, visible: true },
|
|
|
|
|
{ key: 23, label: `客户方联系人`, visible: false },
|
|
|
|
|
{ key: 24, label: `客户方联系电话`, visible: false },
|
|
|
|
|
{ key: 25, label: `客户方电子邮箱`, visible: false },
|
|
|
|
|
{ key: 26, label: `供货方ID`, visible: false },
|
|
|
|
|
{ key: 26, label: `供应商名称`, visible: false },
|
|
|
|
|
{ key: 27, label: `供货方联系人`, visible: false },
|
|
|
|
|
{ key: 28, label: `供货方联系电话`, visible: false },
|
|
|
|
|
{ key: 29, label: `供货方电子邮箱`, visible: false },
|
|
|
|
|
{ key: 30, label: `项目ID(可选)`, visible: false },
|
|
|
|
|
{ key: 31, label: `打印模板ID(可选)`, visible: false },
|
|
|
|
|
{ key: 32, label: `附件ID`, visible: false },
|
|
|
|
|
{ key: 33, label: `报价单状态`, visible: false },
|
|
|
|
|
{ key: 34, label: `流程状态`, visible: false },
|
|
|
|
|
{ key: 33, label: `报价单状态`, visible: true },
|
|
|
|
|
{ key: 34, label: `流程状态`, visible: true },
|
|
|
|
|
{ key: 35, label: `备注`, visible: true },
|
|
|
|
|
{ key: 36, label: `创建人`, visible: true },
|
|
|
|
|
{ key: 37, label: `创建时间`, visible: true },
|
|
|
|
|
{ key: 37, label: `创建时间`, visible: true }
|
|
|
|
|
// 预留:删除标志、创建部门、更新人、更新时间等
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
@ -565,10 +583,10 @@ const initFormData: CrmQuoteInfoForm = {
|
|
|
|
|
quoteStatus: undefined,
|
|
|
|
|
flowStatus: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
createName: undefined,
|
|
|
|
|
}
|
|
|
|
|
createName: undefined
|
|
|
|
|
};
|
|
|
|
|
const data = reactive<PageData<CrmQuoteInfoForm, CrmQuoteInfoQuery>>({
|
|
|
|
|
form: {...initFormData},
|
|
|
|
|
form: { ...initFormData },
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
@ -607,13 +625,10 @@ const data = reactive<PageData<CrmQuoteInfoForm, CrmQuoteInfoQuery>>({
|
|
|
|
|
quoteStatus: undefined,
|
|
|
|
|
flowStatus: undefined,
|
|
|
|
|
createName: undefined,
|
|
|
|
|
params: {
|
|
|
|
|
}
|
|
|
|
|
params: {}
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
quoteId: [
|
|
|
|
|
{ required: true, message: "报价ID不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
quoteId: [{ required: true, message: '报价ID不能为空', trigger: 'blur' }]
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -626,38 +641,38 @@ const getList = async () => {
|
|
|
|
|
crmQuoteInfoList.value = res.rows;
|
|
|
|
|
total.value = res.total;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 取消按钮 */
|
|
|
|
|
const cancel = () => {
|
|
|
|
|
reset();
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 表单重置 */
|
|
|
|
|
const reset = () => {
|
|
|
|
|
form.value = {...initFormData};
|
|
|
|
|
form.value = { ...initFormData };
|
|
|
|
|
crmQuoteInfoFormRef.value?.resetFields();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
const handleQuery = () => {
|
|
|
|
|
queryParams.value.pageNum = 1;
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
queryFormRef.value?.resetFields();
|
|
|
|
|
handleQuery();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 多选框选中数据 */
|
|
|
|
|
const handleSelectionChange = (selection: CrmQuoteInfoVO[]) => {
|
|
|
|
|
ids.value = selection.map(item => item.quoteId);
|
|
|
|
|
ids.value = selection.map((item) => item.quoteId);
|
|
|
|
|
single.value = selection.length != 1;
|
|
|
|
|
multiple.value = !selection.length;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 新增按钮操作(改为路由跳转到编辑页) */
|
|
|
|
|
const handleAdd = () => {
|
|
|
|
|
@ -666,7 +681,7 @@ const handleAdd = () => {
|
|
|
|
|
path: '/oa/crm/crmQuoteInfo/edit',
|
|
|
|
|
query: { type: 'add' }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 修改按钮操作(改为路由跳转到编辑页) */
|
|
|
|
|
const handleUpdate = (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
@ -676,7 +691,7 @@ const handleUpdate = (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
path: '/oa/crm/crmQuoteInfo/edit',
|
|
|
|
|
query: { id: _quoteId, type: 'update' }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 查看按钮操作(查看模式只读) */
|
|
|
|
|
const handleView = (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
@ -686,7 +701,12 @@ const handleView = (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
path: '/oa/crm/crmQuoteInfo/edit',
|
|
|
|
|
query: { id: _quoteId, type: 'view' }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 判断是否可以查看详情:仅非草稿状态可进入查看页 */
|
|
|
|
|
const canViewDetail = (row: CrmQuoteInfoVO) => {
|
|
|
|
|
return row.quoteStatus !== '1';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
const submitForm = () => {
|
|
|
|
|
@ -694,32 +714,36 @@ const submitForm = () => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
buttonLoading.value = true;
|
|
|
|
|
if (form.value.quoteId) {
|
|
|
|
|
await updateCrmQuoteInfo(form.value).finally(() => buttonLoading.value = false);
|
|
|
|
|
await updateCrmQuoteInfo(form.value).finally(() => (buttonLoading.value = false));
|
|
|
|
|
} else {
|
|
|
|
|
await addCrmQuoteInfo(form.value).finally(() => buttonLoading.value = false);
|
|
|
|
|
await addCrmQuoteInfo(form.value).finally(() => (buttonLoading.value = false));
|
|
|
|
|
}
|
|
|
|
|
proxy?.$modal.msgSuccess("操作成功");
|
|
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
|
|
dialog.visible = false;
|
|
|
|
|
await getList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
const handleDelete = async (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
const _quoteIds = row?.quoteId || ids.value;
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除报价单信息编号为"' + _quoteIds + '"的数据项?').finally(() => loading.value = false);
|
|
|
|
|
await proxy?.$modal.confirm('是否确认删除报价单信息编号为"' + _quoteIds + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
await delCrmQuoteInfo(_quoteIds);
|
|
|
|
|
proxy?.$modal.msgSuccess("删除成功");
|
|
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
|
|
await getList();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const handleExport = () => {
|
|
|
|
|
proxy?.download('oa/crm/crmQuoteInfo/export', {
|
|
|
|
|
...queryParams.value
|
|
|
|
|
}, `crmQuoteInfo_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
proxy?.download(
|
|
|
|
|
'oa/crm/crmQuoteInfo/export',
|
|
|
|
|
{
|
|
|
|
|
...queryParams.value
|
|
|
|
|
},
|
|
|
|
|
`crmQuoteInfo_${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 模板导出(支持选中或行内按钮,GET Blob 下载) */
|
|
|
|
|
const handleExportTemplate = async (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
@ -729,12 +753,13 @@ const handleExportTemplate = async (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
const resp: Blob = await exportQuoteTemplate(_quoteId);
|
|
|
|
|
const resp = await exportQuoteTemplate(_quoteId);
|
|
|
|
|
// 校验是否为有效文件(后端错误时返回JSON)
|
|
|
|
|
if (blobValidate(resp)) {
|
|
|
|
|
FileSaver.saveAs(resp, `报价单_${new Date().getTime()}.xlsx`);
|
|
|
|
|
if (blobValidate(resp as any)) {
|
|
|
|
|
const blob = resp as any;
|
|
|
|
|
FileSaver.saveAs(blob as Blob, `报价单_${new Date().getTime()}.xlsx`);
|
|
|
|
|
} else {
|
|
|
|
|
const resText = await resp.text();
|
|
|
|
|
const resText = await (resp as any).text();
|
|
|
|
|
const rspObj = JSON.parse(resText);
|
|
|
|
|
proxy?.$modal.msgError(rspObj.msg || '导出失败');
|
|
|
|
|
}
|
|
|
|
|
@ -742,13 +767,13 @@ const handleExportTemplate = async (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
console.error(e);
|
|
|
|
|
proxy?.$modal.msgError('导出失败,请联系管理员');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let crmCustomerContactList = ref([]);
|
|
|
|
|
const getCustomerContactList = async () => {
|
|
|
|
|
const res = await getCrmCustomerContactList(null);
|
|
|
|
|
crmCustomerContactList.value = res.data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getCustomerContactList();
|
|
|
|
|
getList();
|
|
|
|
|
|