提交
This commit is contained in:
1 parent
dacfdc9ff6
commit
f9676f8759
906 files changed
+533306
-12946
No files matched your search
@@ -98,19 +98,31 @@
|
||||
</span>
|
||||
</el-divider>
|
||||
<div>
|
||||
<div class="product-toolbar mb-3">
|
||||
<el-button class="btn-main" type="primary" @click="handleAddProduct">
|
||||
<el-icon><Plus /></el-icon>添加产品
|
||||
</el-button>
|
||||
<el-button class="btn-ghost" :disabled="selectedProducts.length === 0" @click="handleDeleteProducts">
|
||||
<el-icon><Delete /></el-icon>删除选中
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="panel dialog-list-panel">
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
<el-button class="btn-main" type="primary" @click="handleAddProduct">
|
||||
<el-icon><Plus /></el-icon>添加产品
|
||||
</el-button>
|
||||
<el-button class="btn-ghost" :disabled="selectedProducts.length === 0" @click="handleDeleteProducts">
|
||||
<el-icon><Delete /></el-icon>删除选中
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 产品列表 -->
|
||||
<el-table :data="form.products" border @selection-change="handleProductSelection" :max-height="400" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
:data="form.products"
|
||||
class="list-table"
|
||||
stripe
|
||||
@selection-change="handleProductSelection"
|
||||
:max-height="400"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="60" align="center" header-align="center" />
|
||||
<el-table-column label="产品名称" prop="productName" min-width="160" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.productName" placeholder="请输入产品名称" clearable readonly />
|
||||
@@ -152,7 +164,13 @@
|
||||
<el-table-column prop="price" width="130">
|
||||
<template #header> <span style="color: #f56c6c">*</span> 含税单价/元</template>
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="含税单价" @input="handlePriceChange(scope.row)" clearable />
|
||||
<el-input
|
||||
v-model="scope.row.price"
|
||||
class="money-field-input"
|
||||
placeholder="含税单价"
|
||||
@input="handlePriceChange(scope.row)"
|
||||
clearable
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="subtotal" width="130" align="right">
|
||||
@@ -192,14 +210,16 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="80" align="center" fixed="right">
|
||||
<el-table-column label="操作" min-width="80" align="center" header-align="center" fixed="right" class-name="col-actions">
|
||||
<template #default="scope">
|
||||
<el-button link type="danger" @click="handleRemoveProduct(scope.$index)">
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 合计信息 -->
|
||||
<el-row class="mt-4">
|
||||
@@ -389,7 +409,7 @@
|
||||
选择审批人<span class="form-label-tip">可选择多个审批人,按顺序依次审批</span>
|
||||
</template>
|
||||
<el-select v-model="submitForm.approverIds" multiple placeholder="请选择审批人" style="width: 100%">
|
||||
<el-option v-for="user in userList" :key="user.userId" :label="`${user.nickName}(${user.userName})`" :value="user.userId" />
|
||||
<el-option v-for="user in userList" :key="user.userId" :label="formatApproverOptionLabel(user)" :value="user.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注说明" prop="remark" class="form-col-span-2">
|
||||
@@ -940,6 +960,13 @@ const handleOwnerChange = (userId: string | number | undefined) => {
|
||||
form.value.ownerUserName = user?.nickName || ''
|
||||
}
|
||||
|
||||
const formatApproverOptionLabel = (user: { nickName?: string; userName?: string }) => {
|
||||
const nick = (user.nickName || '').trim()
|
||||
const account = (user.userName || '').trim()
|
||||
if (nick && account) return `${nick}(${account})`
|
||||
return nick || account
|
||||
}
|
||||
|
||||
/** 加载用户列表 */
|
||||
const loadUserList = async () => {
|
||||
try {
|
||||
@@ -947,8 +974,8 @@ const loadUserList = async () => {
|
||||
const options = (res as any)?.data ?? res ?? [];
|
||||
userList.value = (Array.isArray(options) ? options : []).map((item: any) => ({
|
||||
userId: item.value ?? item.userId ?? item.id,
|
||||
nickName: item.label ?? item.nickName ?? item.userName ?? '',
|
||||
userName: item.userNo ?? item.userName ?? '',
|
||||
nickName: item.nickName ?? item.label ?? item.userName ?? '',
|
||||
userName: item.userNo ?? item.user_no ?? item.userName ?? '',
|
||||
deptName: item.deptName ?? ''
|
||||
}));
|
||||
} catch (error) {
|
||||
@@ -1079,12 +1106,11 @@ const handleProductConfirm = (products: any[]) => {
|
||||
categoryName: product.categoryName,
|
||||
model: product.model, // 型号/规格
|
||||
unit: product.unit, // 单位
|
||||
price: product.price || 0,
|
||||
quantity: 1,
|
||||
discount: 0,
|
||||
taxRate: normalizeTaxRateDisplay(product.taxRate, 13), // 税率:整数不显示小数位
|
||||
taxAmount: 0,
|
||||
subtotal: product.price || 0,
|
||||
subtotal: 0,
|
||||
packageSpec: '',
|
||||
deliveryMethod: ''
|
||||
};
|
||||
@@ -1590,6 +1616,13 @@ const initEdit = async (id: string | number) => {
|
||||
await getQuoteInfo(id);
|
||||
};
|
||||
|
||||
const initCopy = async (copyId: string | number) => {
|
||||
resetPanelState();
|
||||
await dictStore.loadAllDict();
|
||||
await Promise.all([loadSupplierList(), loadUserList()]);
|
||||
await getQuoteInfoForCopy(copyId);
|
||||
};
|
||||
|
||||
const finishClose = () => {
|
||||
if (props.hideFooter) {
|
||||
emit('close');
|
||||
@@ -1615,6 +1648,7 @@ defineExpose({
|
||||
formTitle,
|
||||
initNew,
|
||||
initEdit,
|
||||
initCopy,
|
||||
handleSaveDraft,
|
||||
handleSubmit,
|
||||
saveLoading
|
||||
|
||||
Reference in new issue
Block a user