Browse Source

调整查看重复和新增编辑时查重功能

qymljy 2 years ago
parent
commit
c1671dfe01

+ 1 - 1
src/HDrpManagement/ProductMag/detail/modules/detailedData.vue

@@ -25,7 +25,7 @@
         <el-descriptions-item  label="特殊说明">{{ basic.specalnote}}</el-descriptions-item>
         <el-descriptions-item  label="产品标准">{{ basic.standards}}</el-descriptions-item>
         <el-descriptions-item  label="重量">毛重:{{ basic.grossweight}};净重:{{basic.weight}}</el-descriptions-item>
-        <el-descriptions-item  label="条形码">{{ basic.barcode}}</el-descriptions-item>
+<!--        <el-descriptions-item  label="条形码">{{ basic.barcode}}</el-descriptions-item>-->
         <el-descriptions-item  label="是否序列号管理">{{ basic.skucontrol ? '是' : '否'}}</el-descriptions-item>
         <el-descriptions-item  label="交期信息">{{ basic.delivery ? basic.delivery + '天' : '不限制'}}</el-descriptions-item>
 <!--        <el-descriptions-item  label="建议零售价">{{ tool.formatAmount(basic.price,2)}}</el-descriptions-item>-->

+ 2 - 1
src/HDrpManagement/orderManage/details/index.vue

@@ -46,7 +46,7 @@
           </el-popover>
           <el-button v-if="tool.checkAuth($route.name,'examine') && mainData.status === '审核'"  type="primary" size="mini" @click="onReturnCheck">反审核</el-button>
           <el-button v-if="tool.checkAuth($route.name,'reback') && mainData.status === '提交'"  type="primary" size="mini" @click="dialogVisible = true">退 回</el-button>
-          <el-button v-if="tool.checkAuth($route.name,'submit') && mainData.status === '新建'" type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
+          <el-button v-if="tool.checkAuth($route.name,'submit') && mainData.status === '新建' " :disabled="mainData.qty === 0"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
           <el-button v-if="tool.checkAuth($route.name,'finishOrder') && mainData.status === '审核'"  type="primary" size="mini" @click="closeOrder">结 案</el-button>
           <el-button v-if="tool.checkAuth($route.name,'insert')" class="inline-16"  type="primary" size="mini" @click="onCopy">复 制</el-button>
         </div>
@@ -531,6 +531,7 @@ export default {
     },
     select (data) {
       this.selection = data
+      console.log(this.selection,'selection')
     },
     async adddispatch () {
       const res = await this.$api.requested({

+ 5 - 4
src/SDrpManagement/agentOrder/details/index.vue

@@ -16,7 +16,7 @@
         <div slot="customOperation" class="inline-16">
           <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" />
           <el-button :disabled="mainData.status !== '交期待确认'"  type="primary" size="mini" @click="confirmdate">确认交期</el-button>
-          <el-button class="inline-16" v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
+          <el-button class="inline-16" v-if="tool.checkAuth($route.name,'submit') " :disabled="mainData.status !== '新建' || mainData.qty === 0"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
           <customBtn 
             btnName="撤回"
             message="确认撤回当前订单吗?"
@@ -27,15 +27,16 @@
             class="inline-16"
             v-if="mainData.status == '提交' && tool.checkAuth($route.name,'reback')"
           />
-          <el-button class="inline-16" v-if="tool.checkAuth($route.name,'insert')"  type="primary" size="mini" @click="onCopy">复 制</el-button>
-          <customBtn 
+          <el-button  style="margin-left: 0px" v-else-if="tool.checkAuth($route.name,'insert') "  type="primary" size="mini" @click="onCopy">复 制</el-button>
+          <customBtn
+            style="margin-left: 10px; display: inline-block !important;"
             btnName="删 除"
             message="确认删除当前订单吗?"
             idName="20221108152102"
             keyName="sa_orderids"
             :id="[$route.query.id]"
             @onSuccess="$router.back()"
-            class="inline-16"
+
             v-if="mainData.status == '新建' && tool.checkAuth($route.name,'delete')"
           />
         </div>

+ 1 - 1
src/SDrpManagement/salerOrder/details/index.vue

@@ -16,7 +16,7 @@
         <div slot="customOperation" class="inline-16">
           <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" />
           <el-button :disabled="mainData.status !== '交期待确认'"  type="primary" size="mini" @click="confirmdate">确认交期</el-button>
-          <el-button  v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
+          <el-button  v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建' || mainData.qty === 0"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
           <customBtn 
             btnName="撤回"
             message="确认撤回当前订单吗?"

+ 4 - 1
src/SDrpManagement/salerPrivatecustomer/detail/customerDetail.vue

@@ -23,7 +23,7 @@
         <statusChange class="inline-16" v-if="tool.checkAuth($route.name,'statusChange')" :disabled="mainData.disabled" :id="mainData.sa_customersid"  @statusChangeSuccess="statusChangeSuccess"></statusChange>
         <share class="inline-16" v-if="tool.checkAuth($route.name,'share') && mainData.sourcepoolname === ''" :disabled="mainData.disabled" :id="mainData.sa_customersid" @onshow="onSuccess" @shareSuccess="onSuccess"></share>
         <toBack class="inline-16" v-if="tool.checkAuth($route.name,'back') && mainData.sa_customerpoolid_source !== 0" :disabled="mainData.disabled" :data="mainData" @backSuccess="onSuccess"></toBack>
-        <duplicatesCustomer class="inline-16" v-if="tool.checkAuth($route.name,'queryDuplicates')" :data="mainData"></duplicatesCustomer>
+        <duplicatesCustomer class="inline-16" v-if="tool.checkAuth($route.name,'queryDuplicates')" :data="mainData"  @onSuccessTag="onSuccessTag"></duplicatesCustomer>
         <to_void class="inline-16" v-if="tool.checkAuth($route.name,'toVoid')" :id="mainData.sa_customersid" :disabled="mainData.disabled" @onshow="onSuccess" @toVoidSuccess="onSuccess"></to_void>
         <recovery class="inline-16" v-if="tool.checkAuth($route.name,'recovery') && mainData.sa_customerpoolid_source !== 0 " :data="mainData" @onshow="onSuccess" @backSuccess="onSuccess"></recovery>
 
@@ -304,6 +304,9 @@ export default {
           break
         }
       }
+    },
+    onSuccessTag(){
+      this.$refs.details.$refs.tag.queryTag()
     }
   },
   mounted () {

+ 5 - 4
src/components/duplicatesCheck/competitorCheck.vue

@@ -2,6 +2,11 @@
   <div>
     <el-button size="small" type="primary" @click="listData" class="inline-16 normal-btn-width">查 重</el-button>
     <el-dialog title="重复竞争对手" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+      <div slot="title" class="dialog-title">
+        <span class="title-text">重复竞争对手</span>
+        <p v-if="buttonTitle === '确定保存'" style="font-size: 14px;color: red">已存在重复竞争对手,是否确认继续保存</p>
+        <p v-else style="font-size: 14px;color: red">已存在重复竞争对手,是否确认继续创建</p>
+      </div>
       <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
         <template v-slot:customcol="scope">
           <p >{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
@@ -102,7 +107,6 @@ export default {
         "content": this.data
       })
       this.tool.showMessage(res,()=>{
-        console.log(this.duplicates,'duplicates')
         if (this.duplicates){
           if (this.buttonTitle === '确定保存'){
             this.tagData(res.data.sa_competitorid)
@@ -117,7 +121,6 @@ export default {
       })
     },
     async setTag(id,data){
-      console.log(id,data,'设置标签')
       const res = await this.$api.requested({
         "id": 20220929090901,
         "content": {
@@ -149,8 +152,6 @@ export default {
         },
         id: 20220929085401
       })
-      console.log(res,'获取标签')
-      console.log(this.duplicates)
       var resTagData = []
       resTagData = res.data.datatag
      if (this.duplicates){

+ 6 - 7
src/components/duplicatesCheck/customerChangeCheck.vue

@@ -2,6 +2,10 @@
   <div>
     <el-button size="small" type="primary" @click="queryRule" class="inline-16 normal-btn-width">查 重</el-button>
     <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+      <div slot="title" class="dialog-title">
+        <span class="title-text">重复客户</span>
+        <p style="font-size: 14px;color: red">已存在重复客户不可继续创建</p>
+      </div>
       <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'tag'">
@@ -34,8 +38,8 @@
         </el-pagination>
       </div>
       <span slot="footer" class="dialog-footer" v-if="creatShow">
-        <el-button @click="dialogTableVisible = false" size="small" class="normal-btn-width">取 消</el-button>
-        <el-button :type="buttonTitle === '确定保存'?'warning':'primary'" @click="onCheck" size="small" class="normal-btn-width">{{buttonTitle}}</el-button>
+        <el-button @click="dialogTableVisible = false" type="primary" size="small" class="normal-btn-width">确 定</el-button>
+<!--        <el-button :type="buttonTitle === '确定保存'?'warning':'primary'" @click="onCheck" size="small" class="normal-btn-width">{{buttonTitle}}</el-button>-->
       </span>
     </el-dialog>
   </div>
@@ -72,7 +76,6 @@ export default {
   },
   methods:{
     async listData(){
-      console.log(this.data,'data')
       this.param.content.sa_customersid = this.data.sa_customersid || 0
       this.fields1.forEach(item=>{
         this.param.content[item] = this.data[item] || ""
@@ -121,14 +124,11 @@ export default {
       });
     },
     async onSubmit(){
-      console.log(this.data,'data')
       const res = await this.$api.requested({
         "id": 20221216184302,
         "content": this.data
       })
       this.tool.showMessage(res,()=>{
-        console.log(res,'res')
-        console.log(this.duplicates,'duplicates')
         if (this.duplicates){
           this.setTag(res.data.sa_customersid,'疑似重复')
         }else {
@@ -138,7 +138,6 @@ export default {
       })
     },
     async setTag(id,data){
-      console.log(id,data,'设置标签')
       const res = await this.$api.requested({
         "id": 20220929090901,
         "content": {

+ 7 - 7
src/components/duplicatesCheck/customerCheck.vue

@@ -1,7 +1,11 @@
 <template>
   <div>
     <el-button size="small" type="primary" @click="queryRule" class="inline-16 normal-btn-width">查 重</el-button>
-    <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+    <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px" @close="dialogTableVisible = false">
+      <div slot="title" class="dialog-title">
+        <span class="title-text">重复客户</span>
+        <p style="font-size: 14px;color: red">已存在重复客户不可继续创建</p>
+      </div>
       <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'tag'">
@@ -34,8 +38,8 @@
         </el-pagination>
       </div>
       <span slot="footer" class="dialog-footer" v-if="creatShow">
-        <el-button @click="dialogTableVisible = false" size="small" class="normal-btn-width">取 消</el-button>
-        <el-button :type="buttonTitle === '确定保存'?'warning':'primary'" @click="onCheck" size="small" class="normal-btn-width">{{buttonTitle}}</el-button>
+        <el-button @click="dialogTableVisible = false" size="small" type="primary" class="normal-btn-width">确 定</el-button>
+<!--        <el-button :type="buttonTitle === '确定保存'?'warning':'primary'" @click="onCheck" size="small" class="normal-btn-width">{{buttonTitle}}</el-button>-->
       </span>
     </el-dialog>
   </div>
@@ -125,7 +129,6 @@ export default {
         "content": this.data
       })
       this.tool.showMessage(res,()=>{
-        console.log(this.duplicates,'duplicates')
         if (this.duplicates){
           if (this.buttonTitle === '确定保存'){
             this.tagData(res.data.sa_customersid)
@@ -142,7 +145,6 @@ export default {
       })
     },
     async setTag(id,data){
-      console.log(id,data,'设置标签')
       const res = await this.$api.requested({
         "id": 20220929090901,
         "content": {
@@ -164,8 +166,6 @@ export default {
         },
         id: 20220929085401
       })
-      console.log(res,'获取标签')
-      console.log(this.duplicates)
       var resTagData = []
       resTagData = res.data.datatag
       if (this.duplicates){

+ 6 - 12
src/components/duplicatesCheck/projectChangeCheck.vue

@@ -1,7 +1,12 @@
 <template>
   <div>
     <el-button size="small" type="primary" @click="queryRule" class="inline-16 normal-btn-width">查 重</el-button>
-    <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+    <el-dialog title="重复项目" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+      <div slot="title" class="dialog-title">
+        <span class="title-text">重复项目</span>
+        <p v-if="buttonTitle === '确定保存'" style="font-size: 14px;color: red">已存在重复项目,是否确认继续保存</p>
+        <p v-else style="font-size: 14px;color: red">已存在重复项目,是否确认继续创建</p>
+      </div>
       <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'tag'">
@@ -71,7 +76,6 @@ export default {
   },
   methods:{
     async listData(){
-      console.log(this.data,'data')
       this.param.content.sa_projectid = this.data.sa_projectid || 0
       this.fields1.forEach(item=>{
         this.param.content[item] = this.data[item] || ""
@@ -122,8 +126,6 @@ export default {
     async onSubmit(){
       if (this.data.signdate_due !== ''){
         const data = new Date(this.data.signdate_due)
-        console.log(data.getFullYear())
-        console.log(data.getMonth()+1)
         if (data.getMonth() +1 < 10){
           this.data.signdate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
         }else {
@@ -134,8 +136,6 @@ export default {
       }
       if (this.data.begdate_due !== ''){
         const data = new Date(this.data.begdate_due)
-        console.log(data.getFullYear())
-        console.log(data.getMonth()+1)
         if (data.getMonth() +1 < 10){
           this.data.begdate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
         }else {
@@ -146,8 +146,6 @@ export default {
       }
       if (this.data.enddate_due !== ''){
         const data = new Date(this.data.enddate_due)
-        console.log(data.getFullYear())
-        console.log(data.getMonth()+1)
         if (data.getMonth() +1 < 10){
           this.data.enddate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
         }else {
@@ -156,14 +154,11 @@ export default {
       }else {
         this.data.enddate_due = ''
       }
-      console.log(this.data,'data')
       const res = await this.$api.requested({
         "id": 20221124154902,
         "content": this.data
       })
       this.tool.showMessage(res,()=>{
-        console.log(res,'res')
-        console.log(this.duplicates,'duplicates')
         if (this.duplicates){
           this.setTag(res.data.sa_projectid,'疑似重复')
         }else {
@@ -173,7 +168,6 @@ export default {
       })
     },
     async setTag(id,data){
-      console.log(id,data,'设置标签')
       const res = await this.$api.requested({
         "id": 20220929090901,
         "content": {

+ 11 - 11
src/components/duplicatesCheck/projectCheck.vue

@@ -2,6 +2,11 @@
   <div>
     <el-button size="small" type="primary" @click="queryRule" class="inline-16 normal-btn-width">查 重</el-button>
     <el-dialog title="重复项目" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+      <div slot="title" class="dialog-title">
+        <span class="title-text">重复项目</span>
+        <p v-if="buttonTitle === '确定保存'" style="font-size: 14px;color: red">已存在重复项目,是否确认继续保存</p>
+        <p v-else style="font-size: 14px;color: red">已存在重复项目,是否确认继续创建</p>
+      </div>
       <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'tag'">
@@ -71,7 +76,6 @@ export default {
   },
   methods:{
     async listData(){
-      console.log(this.data,'项目商机data')
       this.param.content.sa_projectid = this.data.sa_projectid || 0
       this.fields1.forEach(item=>{
         this.param.content[item] = this.data[item] || ""
@@ -122,8 +126,7 @@ export default {
     async onSubmit(){
       if (this.data.signdate_due !== ''){
         const data = new Date(this.data.signdate_due)
-        console.log(data.getFullYear())
-        console.log(data.getMonth()+1)
+
         if (data.getMonth() +1 < 10){
           this.data.signdate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
         }else {
@@ -134,8 +137,7 @@ export default {
       }
       if (this.data.begdate_due !== ''){
         const data = new Date(this.data.begdate_due)
-        console.log(data.getFullYear())
-        console.log(data.getMonth()+1)
+
         if (data.getMonth() +1 < 10){
           this.data.begdate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
         }else {
@@ -146,8 +148,7 @@ export default {
       }
       if (this.data.enddate_due !== ''){
         const data = new Date(this.data.enddate_due)
-        console.log(data.getFullYear())
-        console.log(data.getMonth()+1)
+
         if (data.getMonth() +1 < 10){
           this.data.enddate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
         }else {
@@ -161,7 +162,7 @@ export default {
         "content": this.data
       })
       this.tool.showMessage(res,()=>{
-        console.log(this.duplicates,'duplicates')
+
         if (this.duplicates){
           if (this.buttonTitle === '确定保存'){
             this.tagData(res.data.sa_projectid)
@@ -178,7 +179,7 @@ export default {
       })
     },
     async setTag(id,data){
-      console.log(id,data,'设置标签')
+
       const res = await this.$api.requested({
         "id": 20220929090901,
         "content": {
@@ -210,8 +211,7 @@ export default {
         },
         id: 20220929085401
       })
-      console.log(res,'获取标签')
-      console.log(this.duplicates)
+
       var resTagData = []
       resTagData = res.data.datatag
      if (this.duplicates){

+ 7 - 4
src/components/duplicatesCheck/projectRecovery.vue

@@ -2,6 +2,10 @@
   <div>
     <el-button size="mini" :type="!disabled ?'':'primary'" @click="queryRule" :disabled="!disabled ">恢 复</el-button>
     <el-dialog title="重复项目" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+      <div slot="title" class="dialog-title">
+        <span class="title-text">重复项目</span>
+        <p style="font-size: 14px;color: red">已存在重复项目,是否确认继续恢复</p>
+      </div>
       <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'tag'">
@@ -119,12 +123,12 @@ export default {
         },
       })
       this.tool.showMessage(res,()=>{
-        console.log(this.duplicates,'duplicates')
+
         this.tagData(res.data.sa_projectid)
       })
     },
     async setTag(id,data){
-      console.log(id,data,'设置标签')
+
       const res = await this.$api.requested({
         "id": 20220929090901,
         "content": {
@@ -156,8 +160,7 @@ export default {
         },
         id: 20220929085401
       })
-      console.log(res,'获取标签')
-      console.log(this.duplicates)
+
       var resTagData = []
       resTagData = res.data.datatag
      if (this.duplicates){

+ 8 - 4
src/components/duplicatesCheck/publicCustomerCheck.vue

@@ -2,6 +2,11 @@
   <div>
     <el-button size="small" type="primary" @click="queryRule" class="inline-16 normal-btn-width">查 重</el-button>
     <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px">
+      <div slot="title" class="dialog-title">
+        <span class="title-text">重复客户</span>
+        <p v-if="buttonTitle === '确定保存'" style="font-size: 14px;color: red">已存在重复客户不可继续保存</p>
+        <p v-else style="font-size: 14px;color: red">已存在重复客户不可继续创建</p>
+      </div>
       <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'tag'">
@@ -34,8 +39,8 @@
         </el-pagination>
       </div>
       <span slot="footer" class="dialog-footer" v-if="creatShow">
-        <el-button @click="dialogTableVisible = false" size="small" class="normal-btn-width">取 消</el-button>
-        <el-button :type="buttonTitle === '确定保存'?'warning':'primary'" @click="onCheck" size="small" class="normal-btn-width">{{buttonTitle}}</el-button>
+        <el-button @click="dialogTableVisible = false" size="small" type="primary" class="normal-btn-width">确 定</el-button>
+<!--        <el-button :type="buttonTitle === '确定保存'?'warning':'primary'" @click="onCheck" size="small" class="normal-btn-width">{{buttonTitle}}</el-button>-->
       </span>
     </el-dialog>
   </div>
@@ -172,8 +177,7 @@ export default {
         },
         id: 20220929085401
       })
-      console.log(res,'获取标签')
-      console.log(this.duplicates)
+
       var resTagData = []
       resTagData = res.data.datatag
       if (this.duplicates){

+ 42 - 1
src/components/duplicatesData/duplicatesCompetitor.vue

@@ -54,11 +54,14 @@ export default {
       this.param.content.sa_competitorid = this.data.sa_competitorid || 0
       this.param.content.enterprisename = this.data.enterprisename
       const res = await this.$api.requested(this.param)
-      console.log(res,'res')
+
       this.list = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
       this.dialogTableVisible = true
+      if (res.data.length !== 0){
+        this.tagData(this.$route.query.id)
+      }
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -70,6 +73,44 @@ export default {
       this.param.content.pageNumber = val
       this.queryData()
     },
+    // 获取标签数据
+    async tagData(id){
+      const res = await this.$api.requested({
+        content: {
+          ownertable: "sa_competitor",
+          ownerid: this.$route.query.id
+        },
+        id: 20220929085401
+      })
+
+      var resTagData = []
+      resTagData = res.data.datatag
+      let flag = 0
+      for (var i=0;i<res.data.datatag.length;i++){
+        if (res.data.datatag[i] === '疑似重复'){
+          flag = 1
+          break
+        }
+      }
+      if (flag === 1){
+        this.setTag(id,resTagData)
+      }else {
+        resTagData.push('疑似重复')
+        this.setTag(id,resTagData)
+      }
+    },
+    async setTag(id,data){
+
+      const res = await this.$api.requested({
+        "id": 20220929090901,
+        "content": {
+          "ownertable":"sa_competitor",
+          "ownerid":id,
+          "datatag":data
+        }
+      })
+
+    },
     onClose(){
       this.$emit('dialogClose')
     }

+ 49 - 4
src/components/duplicatesData/duplicatesCustomer.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
     <el-button size="mini" type="primary" @click="queryRule">查看重复</el-button>
-    <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px">
-      <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true">
+    <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px" @close="onClose">
+      <tableLayout :layout="tablecols"   :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true" >
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'tag'">
             <div v-for="item in scope.column.data.tag_sys" :key="item.index"  style="float: left;margin-left: 5px;margin-bottom: 5px">
@@ -77,16 +77,19 @@ export default {
         this.param.content[item] = this.data[item] || ""
       })
       this.param.content.sa_customersid = this.data.sa_customersid
-      console.log(this.param)
+
       // this.param.content.enterprisename = this.data.enterprisename
       // this.param.content.taxno = this.data.taxno
       // this.param.content.address = this.data.address
       const res = await this.$api.requested(this.param)
-      console.log(res,'res')
+
       this.list = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
       this.dialogTableVisible = true
+      if (res.data.length !== 0){
+        this.tagData(this.$route.query.id)
+      }
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -108,6 +111,48 @@ export default {
       this.fields2 = res.data.custcheckrule.fields2
       this.fields3 = res.data.custcheckrule.fields3
       this.queryData()
+    },
+    // 获取标签数据
+    async tagData(id){
+      const res = await this.$api.requested({
+        content: {
+          ownertable: "sa_customers",
+          ownerid: this.$route.query.id
+        },
+        id: 20220929085401
+      })
+
+      var resTagData = []
+      resTagData = res.data.datatag
+      let flag = 0
+      for (var i=0;i<res.data.datatag.length;i++){
+        if (res.data.datatag[i] === '疑似重复'){
+          flag = 1
+          break
+        }
+      }
+      if (flag === 1){
+        this.setTag(id,resTagData)
+      }else {
+        resTagData.push('疑似重复')
+        this.setTag(id,resTagData)
+      }
+    },
+    async setTag(id,data){
+
+      const res = await this.$api.requested({
+        "id": 20220929090901,
+        "content": {
+          "ownertable":"sa_customers",
+          "ownerid":id,
+          "datatag":data
+        }
+      })
+
+    },
+    onClose(){
+      this.dialogTableVisible = false
+      this.$emit('onSuccessTag')
     }
   },
   mounted() {

+ 41 - 0
src/components/duplicatesData/duplicatesProject.vue

@@ -82,6 +82,9 @@ export default {
       const res = await this.$api.requested(this.param)
       this.list = res.data
       this.dialogTableVisible = true
+      if (res.data.length !== 0){
+        this.tagData(this.$route.query.id)
+      }
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -104,6 +107,44 @@ export default {
       this.fields3 = res.data.projectcheckrule.fields3
       this.queryData()
     },
+    // 获取标签数据
+    async tagData(id){
+      const res = await this.$api.requested({
+        content: {
+          ownertable: "sa_project",
+          ownerid: this.$route.query.id
+        },
+        id: 20220929085401
+      })
+
+      var resTagData = []
+      resTagData = res.data.datatag
+      let flag = 0
+      for (var i=0;i<res.data.datatag.length;i++){
+        if (res.data.datatag[i] === '疑似重复'){
+          flag = 1
+          break
+        }
+      }
+      if (flag === 1){
+        this.setTag(id,resTagData)
+      }else {
+        resTagData.push('疑似重复')
+        this.setTag(id,resTagData)
+      }
+    },
+    async setTag(id,data){
+
+      const res = await this.$api.requested({
+        "id": 20220929090901,
+        "content": {
+          "ownertable":"sa_project",
+          "ownerid":id,
+          "datatag":data
+        }
+      })
+
+    },
     onClose(){
       this.$emit('dialogClose')
     }