|
|
|
|
@ -160,9 +160,9 @@
|
|
|
|
|
>删除</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.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"
|
|
|
|
|
@ -235,13 +235,41 @@
|
|
|
|
|
<el-table-column label="未税总价" align="center" prop="totalBeforeTax" width="130" v-if="columns[19].visible" />
|
|
|
|
|
<el-table-column label="税额" align="center" prop="totalTax" width="130" v-if="columns[20].visible" />
|
|
|
|
|
<el-table-column label="含税总价" align="center" prop="totalIncludingTax" width="130" v-if="columns[21].visible" />
|
|
|
|
|
<el-table-column label="客户方联系人" align="center" prop="customerContactName" width="130" v-if="columns[23].visible" show-overflow-tooltip />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="客户方联系人"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="customerContactName"
|
|
|
|
|
width="130"
|
|
|
|
|
v-if="columns[23].visible"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="客户方联系电话" align="center" prop="customerContactPhone" width="140" v-if="columns[24].visible" />
|
|
|
|
|
<el-table-column label="客户方电子邮箱" align="center" prop="customerContactEmail" width="180" v-if="columns[25].visible" show-overflow-tooltip />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="客户方电子邮箱"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="customerContactEmail"
|
|
|
|
|
width="180"
|
|
|
|
|
v-if="columns[25].visible"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="供应商名称" align="center" prop="supplierName" width="180" v-if="columns[26].visible" show-overflow-tooltip />
|
|
|
|
|
<el-table-column label="供货方联系人" align="center" prop="supplierContactName" width="130" v-if="columns[27].visible" show-overflow-tooltip />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="供货方联系人"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="supplierContactName"
|
|
|
|
|
width="130"
|
|
|
|
|
v-if="columns[27].visible"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="供货方联系电话" align="center" prop="supplierContactPhone" width="140" v-if="columns[28].visible" />
|
|
|
|
|
<el-table-column label="供货方电子邮箱" align="center" prop="supplierContactEmail" width="180" v-if="columns[29].visible" show-overflow-tooltip />
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="供货方电子邮箱"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="supplierContactEmail"
|
|
|
|
|
width="180"
|
|
|
|
|
v-if="columns[29].visible"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="项目ID(可选)" align="center" prop="projectId" width="120" v-if="columns[30].visible" />
|
|
|
|
|
<el-table-column label="打印模板ID(可选)" align="center" prop="templateId" width="140" v-if="columns[31].visible" />
|
|
|
|
|
<el-table-column label="附件ID" align="center" prop="ossId" width="120" v-if="columns[32].visible" />
|
|
|
|
|
@ -272,10 +300,10 @@
|
|
|
|
|
<el-tooltip content="查看详情" placement="top" v-if="scope.row.flowStatus && scope.row.flowStatus !== 'draft'">
|
|
|
|
|
<el-button link type="info" icon="DocumentChecked" @click="handleView(scope.row)"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<!-- <!– 审批记录:非草稿状态可查看 –>-->
|
|
|
|
|
<!-- <el-tooltip content="审批记录" placement="top" v-if="scope.row.flowStatus && scope.row.flowStatus !== 'draft'">-->
|
|
|
|
|
<!-- <el-button link type="warning" icon="Tickets" @click="handleApprovalRecord(scope.row)"></el-button>-->
|
|
|
|
|
<!-- </el-tooltip>-->
|
|
|
|
|
<!-- <!– 审批记录:非草稿状态可查看 –>-->
|
|
|
|
|
<!-- <el-tooltip content="审批记录" placement="top" v-if="scope.row.flowStatus && scope.row.flowStatus !== 'draft'">-->
|
|
|
|
|
<!-- <el-button link type="warning" icon="Tickets" @click="handleApprovalRecord(scope.row)"></el-button>-->
|
|
|
|
|
<!-- </el-tooltip>-->
|
|
|
|
|
<!-- 删除:仅草稿状态可删除 -->
|
|
|
|
|
<el-tooltip content="删除" placement="top" v-if="!scope.row.flowStatus || scope.row.flowStatus === 'draft'">
|
|
|
|
|
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['oa/crm:crmQuoteInfo:remove']"></el-button>
|
|
|
|
|
@ -287,7 +315,7 @@
|
|
|
|
|
type="success"
|
|
|
|
|
icon="Document"
|
|
|
|
|
@click="handleExportTemplate(scope.row)"
|
|
|
|
|
v-hasPermi="['oa/crm:crmQuoteInfo:exportTemplate']"
|
|
|
|
|
v-hasPermi="['oa/crm:crmQuoteInfo:export']"
|
|
|
|
|
></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
@ -482,11 +510,9 @@
|
|
|
|
|
|
|
|
|
|
<script setup name="CrmQuoteInfo" lang="ts">
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
|
|
import { addCrmQuoteInfo, delCrmQuoteInfo, exportQuoteTemplate, listCrmQuoteInfo, updateCrmQuoteInfo } from '@/api/oa/crm/crmQuoteInfo';
|
|
|
|
|
import { addCrmQuoteInfo, delCrmQuoteInfo, 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';
|
|
|
|
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
@ -740,8 +766,8 @@ const handleDelete = async (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
await getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const handleExport = () => {
|
|
|
|
|
/** 导出按钮操作(Excel导出-已停用) */
|
|
|
|
|
/*const handleExport = () => {
|
|
|
|
|
proxy?.download(
|
|
|
|
|
'oa/crm/crmQuoteInfo/export',
|
|
|
|
|
{
|
|
|
|
|
@ -749,35 +775,28 @@ const handleExport = () => {
|
|
|
|
|
},
|
|
|
|
|
`crmQuoteInfo_${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
};*/
|
|
|
|
|
|
|
|
|
|
/** 审批记录按钮操作 */
|
|
|
|
|
const handleApprovalRecord = (row: CrmQuoteInfoVO) => {
|
|
|
|
|
approvalRecordRef.value?.init(row.quoteId as any);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 模板导出(支持选中或行内按钮,GET Blob 下载) */
|
|
|
|
|
const handleExportTemplate = async (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
const _quoteId = row?.quoteId || ids.value[0];
|
|
|
|
|
if (!_quoteId) {
|
|
|
|
|
/** 模板导出:跳转printTemplate预览页,由UmoEditor导出PDF */
|
|
|
|
|
const handleExportTemplate = (row?: CrmQuoteInfoVO) => {
|
|
|
|
|
const _quote = row || crmQuoteInfoList.value.find((item) => item.quoteId === ids.value[0]);
|
|
|
|
|
if (!_quote?.quoteId) {
|
|
|
|
|
proxy?.$modal.msgWarning('请先选择一条报价记录');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
const resp = await exportQuoteTemplate(_quoteId);
|
|
|
|
|
// 校验是否为有效文件(后端错误时返回JSON)
|
|
|
|
|
if (blobValidate(resp as any)) {
|
|
|
|
|
const blob = resp as any;
|
|
|
|
|
FileSaver.saveAs(blob as Blob, `报价单_${new Date().getTime()}.xlsx`);
|
|
|
|
|
} else {
|
|
|
|
|
const resText = await (resp as any).text();
|
|
|
|
|
const rspObj = JSON.parse(resText);
|
|
|
|
|
proxy?.$modal.msgError(rspObj.msg || '导出失败');
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error(e);
|
|
|
|
|
proxy?.$modal.msgError('导出失败,请联系管理员');
|
|
|
|
|
if (!_quote.templateId) {
|
|
|
|
|
proxy?.$modal.msgWarning('请先在报价单上选择打印模板');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
router.push({
|
|
|
|
|
path: '/quote/quoteView',
|
|
|
|
|
query: { templateId: _quote.templateId, quoteId: _quote.quoteId }
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let crmCustomerContactList = ref([]);
|
|
|
|
|
|