客户和供应商新增合同时间
This commit is contained in:
@@ -154,6 +154,16 @@
|
||||
<el-input v-model="form.throwRatio" placeholder="请输入抛比" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同开始时间" prop="contractStartDate">
|
||||
<el-date-picker v-model="form.contractStartDate" type="date" value-format="YYYY-MM-DD" placeholder="选择合同开始时间" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同结束时间" prop="contractEndDate">
|
||||
<el-date-picker v-model="form.contractEndDate" type="date" value-format="YYYY-MM-DD" placeholder="选择合同结束时间" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注说明" prop="remark">
|
||||
@@ -783,6 +793,8 @@ function buildEmptyForm() {
|
||||
weightThreshold: null,
|
||||
throwRatio: null,
|
||||
creditEd: 0,
|
||||
contractStartDate: null,
|
||||
contractEndDate: null,
|
||||
productCodes: null,
|
||||
attachmentList: [],
|
||||
companyList: [],
|
||||
@@ -1224,6 +1236,11 @@ function submitForm() {
|
||||
activeTab.value = 'base'
|
||||
return
|
||||
}
|
||||
if (form.value.contractStartDate && form.value.contractEndDate && form.value.contractEndDate < form.value.contractStartDate) {
|
||||
proxy.$modal.msgError('合同结束时间不能早于开始时间')
|
||||
activeTab.value = 'base'
|
||||
return
|
||||
}
|
||||
const nullIfEmpty = v => (v === '' || v === undefined ? null : v)
|
||||
const payload = {
|
||||
...form.value,
|
||||
@@ -1234,7 +1251,9 @@ function submitForm() {
|
||||
settlementUserId: nullIfEmpty(form.value.settlementUserId),
|
||||
settlementUser: nullIfEmpty(form.value.settlementUser),
|
||||
serviceUserId: nullIfEmpty(form.value.serviceUserId),
|
||||
serviceUser: nullIfEmpty(form.value.serviceUser)
|
||||
serviceUser: nullIfEmpty(form.value.serviceUser),
|
||||
contractStartDate: nullIfEmpty(form.value.contractStartDate),
|
||||
contractEndDate: nullIfEmpty(form.value.contractEndDate)
|
||||
}
|
||||
saving.value = true
|
||||
const req = isAdd.value ? addCustomer(payload) : updateCustomer(payload)
|
||||
|
||||
@@ -179,6 +179,12 @@
|
||||
<span v-else>{{ scope.row.creditEd }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColVisible('contractStartDate')" label="合同开始时间" align="center" prop="contractStartDate" width="120">
|
||||
<template #default="scope">{{ formatDateOnly(scope.row.contractStartDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColVisible('contractEndDate')" label="合同结束时间" align="center" prop="contractEndDate" width="120">
|
||||
<template #default="scope">{{ formatDateOnly(scope.row.contractEndDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColVisible('productCodes')" label="绑定产品" align="center" prop="productCodes" min-width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="productNames(scope.row.productCodes)">{{ productNames(scope.row.productCodes) }}</span>
|
||||
@@ -326,6 +332,8 @@ const columnDefs = [
|
||||
{ key: 'weightThreshold', label: '重量阈值' },
|
||||
{ key: 'throwRatio', label: '抛比' },
|
||||
{ key: 'creditEd', label: '信用额度' },
|
||||
{ key: 'contractStartDate', label: '合同开始时间' },
|
||||
{ key: 'contractEndDate', label: '合同结束时间' },
|
||||
{ key: 'productCodes', label: '绑定产品' },
|
||||
{ key: 'priceSetName', label: '绑定套餐' },
|
||||
{ key: 'remark', label: '备注说明' }
|
||||
@@ -359,6 +367,12 @@ function formatBalance(val) {
|
||||
return isNaN(num) ? '0.00' : num.toFixed(2)
|
||||
}
|
||||
|
||||
function formatDateOnly(value) {
|
||||
if (!value) return ''
|
||||
const s = String(value)
|
||||
return s.length > 10 ? s.substring(0, 10) : s
|
||||
}
|
||||
|
||||
/* ================= 右键复制列值 ================= */
|
||||
const copyMenuRef = ref(null)
|
||||
/** 右键可复制列(取值口径与表格展示一致) */
|
||||
@@ -379,6 +393,8 @@ const copyColumns = computed(() => [
|
||||
{ key: 'weightThreshold', label: '重量阈值', get: r => (r.weightThreshold === null || r.weightThreshold === undefined ? '' : r.weightThreshold) },
|
||||
{ key: 'throwRatio', label: '抛比', get: r => (r.throwRatio === null || r.throwRatio === undefined ? '' : r.throwRatio) },
|
||||
{ key: 'creditEd', label: '信用额度', get: r => (r.creditEd === null || r.creditEd === undefined ? '' : r.creditEd) },
|
||||
{ key: 'contractStartDate', label: '合同开始时间', get: r => formatDateOnly(r.contractStartDate) },
|
||||
{ key: 'contractEndDate', label: '合同结束时间', get: r => formatDateOnly(r.contractEndDate) },
|
||||
{ key: 'productCodes', label: '绑定产品', get: r => productNames(r.productCodes) },
|
||||
{ key: 'priceSetName', label: '绑定套餐', get: r => r.priceSetName || '' },
|
||||
{ key: 'remark', label: '备注说明', get: r => r.remark || '' }
|
||||
|
||||
@@ -166,6 +166,12 @@
|
||||
<el-table-column v-if="isColVisible('cooperationStartDate')" label="合作开始日期" align="center" prop="cooperationStartDate">
|
||||
<template #default="scope">{{ formatDateOnly(scope.row.cooperationStartDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColVisible('contractStartDate')" label="合同开始时间" align="center" prop="contractStartDate" width="120">
|
||||
<template #default="scope">{{ formatDateOnly(scope.row.contractStartDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColVisible('contractEndDate')" label="合同结束时间" align="center" prop="contractEndDate" width="120">
|
||||
<template #default="scope">{{ formatDateOnly(scope.row.contractEndDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColVisible('cooperationStatus')" label="合作状态" align="center" prop="cooperationStatus">
|
||||
<template #default="scope">{{ formatOption(cooperationStatusOptions, scope.row.cooperationStatus) }}</template>
|
||||
</el-table-column>
|
||||
@@ -240,6 +246,8 @@ const columnDefs = [
|
||||
{ key: 'weightThreshold', label: '重量阈值' },
|
||||
{ key: 'throwRatio', label: '抛比' },
|
||||
{ key: 'cooperationStartDate', label: '合作开始日期' },
|
||||
{ key: 'contractStartDate', label: '合同开始时间' },
|
||||
{ key: 'contractEndDate', label: '合同结束时间' },
|
||||
{ key: 'cooperationStatus', label: '合作状态' },
|
||||
{ key: 'channelIds', label: '绑定渠道' },
|
||||
{ key: 'remark', label: '备注说明' }
|
||||
@@ -312,6 +320,8 @@ const copyColumns = computed(() => [
|
||||
{ key: 'weightThreshold', label: '重量阈值', get: r => (r.weightThreshold === null || r.weightThreshold === undefined ? '' : r.weightThreshold) },
|
||||
{ key: 'throwRatio', label: '抛比', get: r => (r.throwRatio === null || r.throwRatio === undefined ? '' : r.throwRatio) },
|
||||
{ key: 'cooperationStartDate', label: '合作开始日期', get: r => formatDateOnly(r.cooperationStartDate) },
|
||||
{ key: 'contractStartDate', label: '合同开始时间', get: r => formatDateOnly(r.contractStartDate) },
|
||||
{ key: 'contractEndDate', label: '合同结束时间', get: r => formatDateOnly(r.contractEndDate) },
|
||||
{ key: 'cooperationStatus', label: '合作状态', get: r => formatOption(cooperationStatusOptions.value, r.cooperationStatus) },
|
||||
{ key: 'channelIds', label: '绑定渠道', get: r => channelNames(r.channelIds) },
|
||||
{ key: 'remark', label: '备注说明', get: r => r.remark || '' }
|
||||
|
||||
@@ -161,6 +161,16 @@
|
||||
<el-date-picker v-model="form.cooperationStartDate" type="date" value-format="YYYY-MM-DD" placeholder="选择合作开始日期" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同开始时间" prop="contractStartDate">
|
||||
<el-date-picker v-model="form.contractStartDate" type="date" value-format="YYYY-MM-DD" placeholder="选择合同开始时间" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同结束时间" prop="contractEndDate">
|
||||
<el-date-picker v-model="form.contractEndDate" type="date" value-format="YYYY-MM-DD" placeholder="选择合同结束时间" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合作状态" prop="cooperationStatus">
|
||||
<el-select v-model="form.cooperationStatus" placeholder="请选择合作状态" clearable style="width: 100%;">
|
||||
@@ -685,6 +695,8 @@ function buildEmptyForm() {
|
||||
throwRatio: null,
|
||||
creditEd: null,
|
||||
cooperationStartDate: null,
|
||||
contractStartDate: null,
|
||||
contractEndDate: null,
|
||||
cooperationStatus: null,
|
||||
channelIds: null,
|
||||
attachmentList: [],
|
||||
@@ -1021,6 +1033,11 @@ function submitForm() {
|
||||
activeTab.value = 'base'
|
||||
return
|
||||
}
|
||||
if (form.value.contractStartDate && form.value.contractEndDate && form.value.contractEndDate < form.value.contractStartDate) {
|
||||
proxy.$modal.msgError('合同结束时间不能早于开始时间')
|
||||
activeTab.value = 'base'
|
||||
return
|
||||
}
|
||||
const nullIfEmpty = v => (v === '' || v === undefined ? null : v)
|
||||
const payload = {
|
||||
...form.value,
|
||||
@@ -1029,7 +1046,9 @@ function submitForm() {
|
||||
settlementUserId: nullIfEmpty(form.value.settlementUserId),
|
||||
settlementUser: nullIfEmpty(form.value.settlementUser),
|
||||
serviceUserId: nullIfEmpty(form.value.serviceUserId),
|
||||
serviceUser: nullIfEmpty(form.value.serviceUser)
|
||||
serviceUser: nullIfEmpty(form.value.serviceUser),
|
||||
contractStartDate: nullIfEmpty(form.value.contractStartDate),
|
||||
contractEndDate: nullIfEmpty(form.value.contractEndDate)
|
||||
}
|
||||
saving.value = true
|
||||
const req = isAdd.value ? addSupplier(payload) : updateSupplier(payload)
|
||||
|
||||
Reference in New Issue
Block a user