|
@@ -17,24 +17,47 @@
|
|
|
<el-input v-model="form.brandname" placeholder="请输入品牌名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="20">
|
|
|
<el-form-item label="企业名称:" prop="enterprisename">
|
|
|
- <el-popover
|
|
|
- placement="bottom"
|
|
|
- width="100%"
|
|
|
- v-model="visible">
|
|
|
- <div>
|
|
|
- <ul class="enterprisePanel">
|
|
|
- <li v-for="item in ENlist" :key="item.sys_enterpriseid" @click="chooseEnterprise(item)">
|
|
|
- <p>{{item.enterprisename}}</p>
|
|
|
- <small>{{item.province}}-{{item.city}}-{{item.county}}</small>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <el-input slot="reference" v-model="form.enterprisename" @focus="queryEnterpriseArchives" @input.native="onChange" placeholder="输入企业名称" clearable></el-input>
|
|
|
- </el-popover>
|
|
|
+ <el-input v-model="form.enterprisename" placeholder="输入企业名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-popover
|
|
|
+ placement="right"
|
|
|
+ width="900"
|
|
|
+ v-model="businessShow"
|
|
|
+ trigger="manual">
|
|
|
+ <el-input
|
|
|
+ style="width:300px;margin-bottom: 10px"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="form.enterprisename"
|
|
|
+ clearable
|
|
|
+ @clear="businessSearch"
|
|
|
+ size="mini"
|
|
|
+ @keyup.enter.native="businessSearch">
|
|
|
+ <i slot="prefix" class="el-icon-search" @click="businessSearch"></i>
|
|
|
+ </el-input>
|
|
|
+ <el-table :data="businessData" @row-click="businessSelect" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
|
|
|
+ <el-table-column width="260" label="客户名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.companyName?scope.row.companyName:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="客户地址">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="200" label="客户税号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.taxNum?scope.row.taxNum:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-button size="mini" type="primary" style="width: 100%" @click="businessSearch" slot="reference" :disabled="form.enterprisename === ''">工商查询</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="优势信息:" >
|
|
|
<el-input type="textarea" rows="5" v-model="form.advantage" placeholder="请输入优势信息"></el-input>
|
|
@@ -55,6 +78,7 @@
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
<el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
|
|
|
+ <duplicateCheck ref="check" :data="form" @onSuccess="onClose"></duplicateCheck>
|
|
|
<el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
@@ -62,12 +86,24 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import duplicateCheck from "@/components/duplicatesCheck/competitorCheck";
|
|
|
export default {
|
|
|
name: "edit",
|
|
|
props:['data','btnType'],
|
|
|
+ components:{duplicateCheck},
|
|
|
data(){
|
|
|
return {
|
|
|
dialogFormVisible:false,
|
|
|
+ businessData:[],
|
|
|
+ businessParam:{
|
|
|
+ "id": 20221208103601,
|
|
|
+ "content": {
|
|
|
+ "pageNumber":1,
|
|
|
+ "pageSize":5,
|
|
|
+ "keyword":''
|
|
|
+ },
|
|
|
+ },
|
|
|
+ businessShow:false,
|
|
|
form:{
|
|
|
sa_competitorid:'',
|
|
|
sys_enterpriseid:"",
|
|
@@ -94,21 +130,46 @@ export default {
|
|
|
this.dialogFormVisible = true
|
|
|
this.form = this.data
|
|
|
},
|
|
|
+ /*工商查询*/
|
|
|
+ async businessSearch(){
|
|
|
+ this.businessParam.content.keyword = this.form.enterprisename
|
|
|
+ const res = await this.$api.requested(this.businessParam)
|
|
|
+ console.log(res,"工商查询结果")
|
|
|
+ this.businessData = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
+ this.businessShow = true
|
|
|
+ },
|
|
|
+ /*选择工商信息*/
|
|
|
+ businessSelect(val){
|
|
|
+ console.log("选择的工商信息",val)
|
|
|
+ this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.businessShow = false
|
|
|
+ this.form.enterprisename = val.companyName
|
|
|
+ this.form.address = val.address
|
|
|
+ this.form.taxno = val.taxNum
|
|
|
+ this.value = [val.regProvince,val.regCity,val.regArea]
|
|
|
+ this.form.province = val.regProvince
|
|
|
+ this.form.city = val.regCity
|
|
|
+ this.form.county = val.regArea
|
|
|
+ this.form.contact = val.legalPerson
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消更新'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
onSubmit(){
|
|
|
- if (this.form.sys_enterpriseid === ''){
|
|
|
- this.form.sys_enterpriseid = 0
|
|
|
- }
|
|
|
- this.$refs['form'].validate(async (valid) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
if (!valid) return false
|
|
|
- const res = await this.$api.requested({
|
|
|
- "id": 20221018164102,
|
|
|
- "content": this.form
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.$emit('onSuccess')
|
|
|
- this.$refs['form'].resetFields()
|
|
|
- this.dialogFormVisible = false
|
|
|
- })
|
|
|
+ this.$refs.check.creatShow = true
|
|
|
+ this.$refs.check.buttonTitle = '确定保存'
|
|
|
+ this.$refs.check.listData()
|
|
|
})
|
|
|
},
|
|
|
async queryEnterpriseArchives () {
|
|
@@ -124,6 +185,21 @@ export default {
|
|
|
})
|
|
|
this.ENlist = res.data
|
|
|
},
|
|
|
+ onClose(){
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
+ this.form = {
|
|
|
+ sa_competitorid:0,
|
|
|
+ sys_enterpriseid:"",
|
|
|
+ enterprisename:"",
|
|
|
+ brandname:"",
|
|
|
+ inferiority:"",
|
|
|
+ advantage:"",
|
|
|
+ remarks:"",
|
|
|
+ enterpriseid:""
|
|
|
+ }
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ },
|
|
|
onChange () {
|
|
|
this.visible = true
|
|
|
this.debounce(this.queryEnterpriseArchives,500)()
|