crm 报价 商机 合同 三块整改
parent
cd23457490
commit
10942b3fae
|
|
@ -4,7 +4,7 @@ NODE_ENV=development
|
||||||
VITE_DEV=true
|
VITE_DEV=true
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='http://172.22.3.168:48080'
|
VITE_BASE_URL='http://localhost:48080'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ NODE_ENV=production
|
||||||
VITE_DEV=false
|
VITE_DEV=false
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='http://localhost:48080'
|
VITE_BASE_URL='http://172.22.3.168:48080'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,13 @@
|
||||||
>
|
>
|
||||||
<el-table :data="formData" class="-mt-10px">
|
<el-table :data="formData" class="-mt-10px">
|
||||||
<el-table-column label="序号" type="index" width="100" />
|
<el-table-column label="序号" type="index" width="100" />
|
||||||
|
<el-table-column label="产品编号" min-width="150">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||||
|
<el-input v-model="row.productId" placeholder="请输入产品编号" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="产品名称" min-width="150">
|
<el-table-column label="产品名称" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productName`" :rules="formRules.productName" class="mb-0px!">
|
||||||
|
|
@ -16,123 +23,73 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品类型" min-width="150">
|
<el-table-column label="产品类别" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
|
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
|
||||||
<el-select v-model="row.category" placeholder="请选择状态" disabled class="!w-240px">
|
<el-input v-model="row.category" placeholder="请输入产品类别" disabled />
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_CATEGORY)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="产品明细" min-width="150">
|
||||||
<el-table-column label="产品明细类型" min-width="150">
|
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
|
||||||
<el-select v-model="row.detailType" placeholder="请选择状态" disabled class="!w-240px">
|
<el-input v-model="row.detailType" placeholder="产品明细" disabled />
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品单位" min-width="150">
|
<el-table-column label="产品单位" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productUnit`" :rules="formRules.productUnit" class="mb-0px!">
|
||||||
<el-select v-model="row.productUnit" placeholder="请选择状态" disabled class="!w-240px">
|
<el-input v-model="row.productUnit" placeholder="请输入产品单位" disabled />
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_UNIT)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="线上价格" min-width="150">
|
<el-table-column label="线上价格" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.onlinePrice`" :rules="formRules.onlinePrice" class="mb-0px!">
|
||||||
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" disabled />
|
<el-input v-model="row.onlinePrice" placeholder="请输入线上价格" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="线下价格" min-width="150">
|
<el-table-column label="线下价格" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.offlinePrice`" :rules="formRules.offlinePrice" class="mb-0px!">
|
||||||
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" disabled />
|
<el-input v-model="row.offlinePrice" placeholder="请输入线下价格" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="总计价格" min-width="150">
|
<el-table-column label="总计价格" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.totalPrice`" :rules="formRules.totalPrice" class="mb-0px!">
|
||||||
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" disabled />
|
<el-input v-model="row.totalPrice" placeholder="请输入总计价格" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品票据" min-width="150">
|
<el-table-column label="产品票据" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productInvoice`" :rules="formRules.productInvoice" class="mb-0px!">
|
||||||
<el-select v-model="row.productInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
<el-input v-model="row.productInvoice" placeholder="请输入产品票据" />
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品开具项目" min-width="150">
|
<el-table-column label="产品开具项目" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.productInvoiceItems`" :rules="formRules.productInvoiceItems" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productInvoiceItem`" :rules="formRules.productInvoiceItem" class="mb-0px!">
|
||||||
<el-select v-model="row.productInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
<el-input v-model="row.productInvoiceItem" placeholder="请输入产品开具项目" />
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_INVOICE_ITEMS)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="服务费票据" min-width="150">
|
<el-table-column label="服务费票据" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.serviceFeeInvoice`" :rules="formRules.serviceFeeInvoice" class="mb-0px!">
|
<el-form-item :prop="`${$index}.serviceInvoice`" :rules="formRules.serviceInvoice" class="mb-0px!">
|
||||||
<el-select v-model="row.serviceFeeInvoice" placeholder="请选择状态" clearable class="!w-240px">
|
<el-input v-model="row.serviceInvoice" placeholder="请输入服务费票据" />
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="服务开具项目" min-width="150">
|
<el-table-column label="服务开具项目" min-width="150">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-form-item :prop="`${$index}.serviceFeeInvoiceItems`" :rules="formRules.serviceFeeInvoiceItems" class="mb-0px!">
|
<el-form-item :prop="`${$index}.serviceInvoiceItem`" :rules="formRules.serviceInvoiceItem" class="mb-0px!">
|
||||||
<el-select v-model="row.serviceFeeInvoiceItems" placeholder="请选择状态" clearable class="!w-240px">
|
<el-input v-model="row.serviceInvoiceItem" placeholder="请输入服务开具项目" />
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_INVOICE_ITEMS)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -149,14 +106,11 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { QuotationApi } from '@/api/crm/quotation'
|
import { QuotationApi } from '@/api/crm/quotation'
|
||||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
quotationId: undefined, // 报价编号(主表的关联字段)
|
quotationId: undefined, // 报价编号(主表的关联字段)
|
||||||
businessId: undefined,
|
businessId: undefined
|
||||||
billTemplateId: undefined
|
|
||||||
}>()
|
}>()
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref([])
|
const formData = ref([])
|
||||||
|
|
@ -164,8 +118,8 @@ const formRules = reactive({
|
||||||
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
|
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
|
||||||
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
|
||||||
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
|
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
|
||||||
category: [{ required: true, message: '产品类型不能为空', trigger: 'blur' }],
|
category: [{ required: true, message: '产品类别不能为空', trigger: 'blur' }],
|
||||||
detailType: [{ required: true, message: '产品明细类型不能为空', trigger: 'blur' }],
|
detailType: [{ required: true, message: '产品明细不能为空', trigger: 'blur' }],
|
||||||
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
|
||||||
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
|
||||||
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],
|
||||||
|
|
@ -198,49 +152,21 @@ watch(
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.billTemplateId,
|
|
||||||
async (val) => {
|
|
||||||
// 1. 重置表单
|
|
||||||
formData.value = []
|
|
||||||
// 2. val 非空,则加载数据
|
|
||||||
if (!val) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
formLoading.value = true
|
|
||||||
// if(val.quotationId) {
|
|
||||||
// formData.value = await QuotationApi.getQuotationProductListByQuotationId(val.quotationId)
|
|
||||||
// } else if(val.businessId) {
|
|
||||||
const business = await BillTemplateApi.getTemplateProduct({
|
|
||||||
businessId: props.businessId,
|
|
||||||
billTemplateId: val,
|
|
||||||
});
|
|
||||||
console.log('%csrc/views/crm/quotation/components/QuotationProductForm.vue:167 business.data', 'color: #007acc;', business.data);
|
|
||||||
formData.value = business
|
|
||||||
// }
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
const row = {
|
const row = {
|
||||||
quotationId: undefined,
|
quotationId: undefined,
|
||||||
productId: undefined,
|
productId: undefined,
|
||||||
productName: undefined,
|
productName: undefined,
|
||||||
detailType: undefined,
|
productCategoryId: undefined,
|
||||||
productUnit: undefined,
|
productUnit: undefined,
|
||||||
onlinePrice: undefined,
|
onlinePrice: undefined,
|
||||||
offlinePrice: undefined,
|
offlinePrice: undefined,
|
||||||
totalPrice: undefined,
|
totalPrice: undefined,
|
||||||
productInvoice: undefined,
|
productInvoice: undefined,
|
||||||
productInvoiceItems: undefined,
|
productInvoiceItem: undefined,
|
||||||
serviceFeeInvoice: undefined,
|
serviceInvoice: undefined,
|
||||||
serviceFeeInvoiceItems: undefined
|
serviceInvoiceItem: undefined
|
||||||
}
|
}
|
||||||
row.quotationId = props.quotationId
|
row.quotationId = props.quotationId
|
||||||
formData.value.push(row)
|
formData.value.push(row)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue