Browse Source

导入时保存客户模版

java8
han\hanst 4 weeks ago
parent
commit
4d06f612f9
  1. 2
      src/api/ecss/ecss.js
  2. 59
      src/views/modules/ecss/del_upload_excel.vue

2
src/api/ecss/ecss.js

@ -140,6 +140,8 @@ export const getCustomerAdd = data => createAPI(`/select/ecssMapper/getCustomerA
export const getCustomerTemplateList = data => createAPI(`/ecss/coDel/getCustomerTemplateList`,'post',data) export const getCustomerTemplateList = data => createAPI(`/ecss/coDel/getCustomerTemplateList`,'post',data)
export const updateCustomerTemplate = data => createAPI(`/ecss/coDel/updateCustomerTemplate`,'post',data)
export const updateCodelPalletHeaderPalletQty = data => createAPI(`/ecss/coDel/updateCodelPalletHeaderPalletQty`,'post',data) export const updateCodelPalletHeaderPalletQty = data => createAPI(`/ecss/coDel/updateCodelPalletHeaderPalletQty`,'post',data)
// PDF导出接口 // PDF导出接口

59
src/views/modules/ecss/del_upload_excel.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="customer-css"> <div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" <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-form label-position="top">
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12">
@ -118,7 +118,7 @@
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户地址" width="160">
<el-table-column label="客户地址" min-width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.selectedLocalAddress" v-model="scope.row.selectedLocalAddress"
@ -169,7 +169,7 @@
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="贸易国" min-width="80">
<el-table-column label="贸易国" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.selectedSalesArea" v-model="scope.row.selectedSalesArea"
@ -181,6 +181,17 @@
</el-input> </el-input>
</template> </template>
</el-table-column> </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> </el-table>
</div> </div>
@ -565,7 +576,7 @@
<script> <script>
import {queryFileId} from "@/api/qc/qc.js" 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 {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {getBuList}from '@/api/factory/site.js' import {getBuList}from '@/api/factory/site.js'
export default { export default {
@ -900,6 +911,7 @@
console.log(row) console.log(row)
if (this.currentRow) { if (this.currentRow) {
// 使 // 使
this.currentRow.templateNo = row.template_no
this.currentRow.selectedTemplate = row.template_name this.currentRow.selectedTemplate = row.template_name
this.currentRow.selectedCustomer = row.ccusname || '' this.currentRow.selectedCustomer = row.ccusname || ''
this.currentRow.selectedLocalAddress = row.localShipAddress || '' this.currentRow.selectedLocalAddress = row.localShipAddress || ''
@ -1587,6 +1599,45 @@
this.invalidMaterialsDialog.invoice = '' this.invalidMaterialsDialog.invoice = ''
this.invalidMaterialsDialog.materials = [] 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> </script>

Loading…
Cancel
Save