|
|
@@ -1,13 +1,56 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-button type="text" size="mini" @click="queryRule" :disabled="!tool.checkAuth($route.name,'recovery')">恢 复</el-button>
|
|
|
+ <el-dialog title="重复客户" :visible.sync="dialogTableVisible" append-to-body width="1000px" @close="onClose">
|
|
|
+ <div slot="title" class="dialog-title">
|
|
|
+ <span class="title-text">{{type === '客户'?'重复客户':'重复项目'}}</span>
|
|
|
+ <p style="font-size: 14px;color: red">{{type === '客户'?'已存在重复客户不可恢复':'当前项目重复是否恢复至原位置'}}</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'">
|
|
|
+ <div v-for="item in scope.column.data.tag_sys" :key="item.index" style="float: left;margin-left: 5px;margin-bottom: 5px">
|
|
|
+ <el-tag color="#3874F6" size="mini" type="primary" effect="dark">
|
|
|
+ <span>{{item}}</span>
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <div v-for="item in scope.column.data.tag" :key="item.index" style="float: left;margin-left: 5px;margin-bottom: 5px">
|
|
|
+ <el-tag color="#FA8C16" size="mini" type="warning" effect="dark">
|
|
|
+ <span>{{item}}</span>
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'leader'">
|
|
|
+ <span>{{scope.column.data.leader?scope.column.data.leader.length !== 0 ? scope.column.data.leader[0].name:'--':'--'}}</span>
|
|
|
+ </div>
|
|
|
+ <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
|
|
|
+ </template>
|
|
|
+ </tableLayout>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ :page-size="20"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button v-if="type === '客户'" @click="dialogTableVisible = false" size="small" type="primary" class="normal-btn-width">确 定</el-button>
|
|
|
+ <el-button v-if="type === '项目'" @click="dialogTableVisible = false;onRecovery()" size="small" type="primary" class="normal-btn-width">确定恢复</el-button>
|
|
|
+ <el-button v-if="type === '项目'" @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>-->
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
name: "recovery",
|
|
|
- props:["sys_object","ownerid","data"],
|
|
|
+ props:["sys_object","ownerid","data","type"],
|
|
|
data(){
|
|
|
return {
|
|
|
dialogTableVisible:false,
|
|
|
@@ -34,14 +77,25 @@ export default {
|
|
|
methods:{
|
|
|
/*查询规则*/
|
|
|
async queryRule(){
|
|
|
- const res = await this.$api.requested({
|
|
|
- "id": "20230410090502",
|
|
|
- "content": {},
|
|
|
- })
|
|
|
- this.fields1 = res.data.custcheckrule.fields1
|
|
|
- this.fields2 = res.data.custcheckrule.fields2
|
|
|
- this.fields3 = res.data.custcheckrule.fields3
|
|
|
- this.queryData()
|
|
|
+ if (this.type === '项目' || this.type === '客户'){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20230410090502",
|
|
|
+ "content": {},
|
|
|
+ })
|
|
|
+ if (this.type === '客户'){
|
|
|
+ this.fields1 = res.data.custcheckrule.fields1
|
|
|
+ this.fields2 = res.data.custcheckrule.fields2
|
|
|
+ this.fields3 = res.data.custcheckrule.fields3
|
|
|
+ }else {
|
|
|
+ this.fields1 = res.data.projectcheckrule.fields1
|
|
|
+ this.fields2 = res.data.projectcheckrule.fields2
|
|
|
+ this.fields3 = res.data.projectcheckrule.fields3
|
|
|
+ }
|
|
|
+ this.queryData()
|
|
|
+ }else {
|
|
|
+ this.onshow()
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
async queryData(){
|
|
|
console.log(this.fields1,'fields1')
|
|
|
@@ -57,7 +111,13 @@ export default {
|
|
|
this.fields3.forEach(item=>{
|
|
|
this.param.content[item] = this.data[item] || ""
|
|
|
})
|
|
|
- this.param.content.sa_customersid = this.data.sa_customersid
|
|
|
+ if (this.type === '客户'){
|
|
|
+ this.param.id = 20221208172002
|
|
|
+ this.param.content.sa_customersid = this.data.sa_customersid
|
|
|
+ }else {
|
|
|
+ this.param.id = 20221208184202
|
|
|
+ this.param.content.sa_projectid = this.data.sa_projectid
|
|
|
+ }
|
|
|
const res = await this.$api.requested(this.param)
|
|
|
this.list = res.data
|
|
|
this.total = res.total
|
|
|
@@ -68,7 +128,6 @@ export default {
|
|
|
}else {
|
|
|
this.onshow()
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
onshow() {
|
|
|
this.$confirm('数据恢复至原账号原位置,是否继续?', '提示', {
|
|
|
@@ -96,7 +155,24 @@ export default {
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.$emit("recoverySuccess")
|
|
|
})
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.param.content.pageSize = val
|
|
|
+ this.queryData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.param.content.pageNumber = val
|
|
|
+ this.queryData()
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ this.dialogTableVisible = false
|
|
|
}
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.type === '客户'?this.tool.tabelCol(this.$route.name).duplicatesCustomerTable.tablecols:this.type === '项目'?this.tool.tabelCol(this.$route.name).duplicatesProjectTable.tablecols:[]
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|