|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<div class="customer-css"> |
|
|
|
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" |
|
|
|
:width="showPreview ? '1200px' : '600px'" class="customer-dialog" > |
|
|
|
:width="showPreview ? '1300px' : '600px'" class="customer-dialog" > |
|
|
|
<el-form label-position="top"> |
|
|
|
<el-row :gutter="16"> |
|
|
|
<el-col :span="12"> |
|
|
|
@ -118,7 +118,7 @@ |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="客户地址" width="160"> |
|
|
|
<el-table-column label="客户地址" min-width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.selectedLocalAddress" |
|
|
|
@ -169,7 +169,7 @@ |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="贸易国" min-width="80"> |
|
|
|
<el-table-column label="贸易国" width="80"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.selectedSalesArea" |
|
|
|
@ -181,6 +181,17 @@ |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="60" fixed="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a v-if="scope.row.selectedTemplate" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="saveTemplateChanges(scope.row)"> |
|
|
|
保存模板 |
|
|
|
</a> |
|
|
|
<span v-else style="color: #C0C4CC; font-size: 12px;">未选择</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -565,7 +576,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import {queryFileId} from "@/api/qc/qc.js" |
|
|
|
import {previewExcel,saveEcssCoDelNotifyByExcel,getCustomerList,getCustomers,getCustomerAdd,getCustomerTemplateList} from '@/api/ecss/ecss.js' |
|
|
|
import {previewExcel,saveEcssCoDelNotifyByExcel,getCustomerList,getCustomers,getCustomerAdd,getCustomerTemplateList,updateCustomerTemplate} from '@/api/ecss/ecss.js' |
|
|
|
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js' |
|
|
|
import {getBuList}from '@/api/factory/site.js' |
|
|
|
export default { |
|
|
|
@ -900,6 +911,7 @@ |
|
|
|
console.log(row) |
|
|
|
if (this.currentRow) { |
|
|
|
// 使用模板设置当前行的所有信息 |
|
|
|
this.currentRow.templateNo = row.template_no |
|
|
|
this.currentRow.selectedTemplate = row.template_name |
|
|
|
this.currentRow.selectedCustomer = row.ccusname || '' |
|
|
|
this.currentRow.selectedLocalAddress = row.localShipAddress || '' |
|
|
|
@ -1587,6 +1599,45 @@ |
|
|
|
this.invalidMaterialsDialog.invoice = '' |
|
|
|
this.invalidMaterialsDialog.materials = [] |
|
|
|
}, |
|
|
|
|
|
|
|
// 保存模板修改 |
|
|
|
async saveTemplateChanges(row) { |
|
|
|
// 验证必填字段 |
|
|
|
if (!row.selectedTemplate) { |
|
|
|
this.$message.warning('请先选择客户模板') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!row.selectedCustomer) { |
|
|
|
this.$message.warning('请填写客户信息') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 准备保存数据 |
|
|
|
const templateData = { |
|
|
|
templateNo: row.templateNo, |
|
|
|
templateName: row.selectedTemplate, |
|
|
|
ccusname: row.selectedCustomer, |
|
|
|
localShipAddress: row.selectedLocalAddress || '', |
|
|
|
overseasShipper: row.selectedOverseasShipper || '', |
|
|
|
overseasAddress: row.selectedOverseasAddress || '', |
|
|
|
cnative: row.selectedCnative || '', |
|
|
|
salesArea: row.selectedSalesArea || '' |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
const { data } = await updateCustomerTemplate(templateData) |
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success(`模板"${row.selectedTemplate}"保存成功!`) |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '保存模板失败') |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('保存模板失败:', error) |
|
|
|
this.$message.error('保存模板失败:' + (error.message || '网络异常')) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|