fix: 项目信息显示问题
This commit is contained in:
@@ -321,7 +321,7 @@ class User extends Common
|
|||||||
$ret['company'] = "上海诺力智能科技有限公司";
|
$ret['company'] = "上海诺力智能科技有限公司";
|
||||||
}
|
}
|
||||||
$ret['id'] = $login_id;
|
$ret['id'] = $login_id;
|
||||||
$ret['name'] = $res['user_name'];
|
// $ret['name'] = $res['user_name'];
|
||||||
}
|
}
|
||||||
//客户
|
//客户
|
||||||
if (2 == $res['user_type'])
|
if (2 == $res['user_type'])
|
||||||
@@ -333,9 +333,9 @@ class User extends Common
|
|||||||
->field('i.contacts_name as name, i.contacts_idcard as idcard, c.company_name as company')
|
->field('i.contacts_name as name, i.contacts_idcard as idcard, c.company_name as company')
|
||||||
->find();
|
->find();
|
||||||
$ret['id'] = $login_id;
|
$ret['id'] = $login_id;
|
||||||
$ret['name'] = $res['user_name'];
|
// $ret['name'] = $res['user_name'];
|
||||||
}
|
}
|
||||||
|
$ret['name'] = $res['user_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|||||||
@@ -56,4 +56,13 @@ export default {
|
|||||||
data: param
|
data: param
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取供应商详细信息
|
||||||
|
GetPartnerInfo(param) {
|
||||||
|
return request({
|
||||||
|
url: `/Partner/GetPartnerInfo`,
|
||||||
|
method: 'post',
|
||||||
|
data: param
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,13 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
prop="company_name"
|
prop="company_name"
|
||||||
label="公司名称"
|
label="公司名称"
|
||||||
min-width="200"/>
|
min-width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" @click="showPartnerDetail(scope.row)">
|
||||||
|
{{ scope.row.company_name }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="service_type_name"
|
prop="service_type_name"
|
||||||
label="服务类型"
|
label="服务类型"
|
||||||
@@ -56,7 +62,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="company_address"
|
prop="company_address"
|
||||||
label="公司官网"
|
label="公司"
|
||||||
min-width="200">
|
min-width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.company_url || '-' }}
|
{{ scope.row.company_url || '-' }}
|
||||||
@@ -91,6 +97,107 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 供应商详情弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="currentPartner.company_name"
|
||||||
|
width="80%"
|
||||||
|
top="5vh">
|
||||||
|
<div v-loading="dialogLoading">
|
||||||
|
<!-- 联系人信息 -->
|
||||||
|
<el-card class="box-card" style="margin-bottom: 20px;">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>公司联系人</span>
|
||||||
|
<!-- <el-button
|
||||||
|
style="float: right; padding: 3px 0"
|
||||||
|
type="text"
|
||||||
|
@click="addContact">添加</el-button> -->
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="partnerDetail.contacts"
|
||||||
|
style="width: 100%"
|
||||||
|
border>
|
||||||
|
<el-table-column
|
||||||
|
prop="contacts_name"
|
||||||
|
label="姓名"
|
||||||
|
width="150"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="contacts_idcard"
|
||||||
|
label="工号"
|
||||||
|
width="150"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="contacts_phone"
|
||||||
|
label="电话"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="contacts_position"
|
||||||
|
label="岗位"/>
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="small" @click="editContact(scope.row)">编辑</el-button>
|
||||||
|
<el-button type="text" size="small" @click="deleteContact(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<template slot="empty">
|
||||||
|
<div style="padding: 20px; color: #999;">暂无数据</div>
|
||||||
|
</template>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 合作项目 -->
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>合作项目</span>
|
||||||
|
<!-- <el-button
|
||||||
|
style="float: right; padding: 3px 0"
|
||||||
|
type="text"
|
||||||
|
@click="addProject">添加</el-button> -->
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="partnerDetail.projects"
|
||||||
|
style="width: 100%"
|
||||||
|
border>
|
||||||
|
<el-table-column
|
||||||
|
prop="project_id"
|
||||||
|
label="项目编号"
|
||||||
|
width="150"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="project_name"
|
||||||
|
label="项目名称"
|
||||||
|
min-width="200"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="project_intro"
|
||||||
|
label="项目描述"
|
||||||
|
min-width="200"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="project_type"
|
||||||
|
label="合作类型"
|
||||||
|
width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-if="scope.row.project_type === 1">销售</div>
|
||||||
|
<div v-else="scope.row.project_type === 4">采购</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="project_state_desp"
|
||||||
|
label="项目状态"
|
||||||
|
width="120"/>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="small" @click="editProject(scope.row)">编辑</el-button>
|
||||||
|
<el-button type="text" size="small" @click="deleteProject(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<template slot="empty">
|
||||||
|
<div style="padding: 20px; color: #999;">暂无数据</div>
|
||||||
|
</template>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -108,7 +215,15 @@ export default {
|
|||||||
// 分页相关
|
// 分页相关
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
total: 0
|
total: 0,
|
||||||
|
// 弹窗相关
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogLoading: false,
|
||||||
|
currentPartner: {},
|
||||||
|
partnerDetail: {
|
||||||
|
contacts: [],
|
||||||
|
projects: []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -170,6 +285,69 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 显示供应商详情
|
||||||
|
async showPartnerDetail(row) {
|
||||||
|
this.currentPartner = row
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.dialogLoading = true
|
||||||
|
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
company_id: row.company_id,
|
||||||
|
partner_type: 2 // 2表示供应商,1表示客户
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await supplierApi.GetPartnerInfo(params)
|
||||||
|
const apiResponse = response.data || response
|
||||||
|
|
||||||
|
if (apiResponse.code === 20000) {
|
||||||
|
const data = apiResponse.data || {}
|
||||||
|
this.partnerDetail = {
|
||||||
|
contacts: Array.isArray(data.contacts) ? data.contacts : [],
|
||||||
|
projects: Array.isArray(data.projects) ? data.projects : []
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(apiResponse.msg || '获取供应商详情失败')
|
||||||
|
this.partnerDetail = {
|
||||||
|
contacts: [],
|
||||||
|
projects: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取供应商详情失败:', error)
|
||||||
|
this.$message.error('获取详情失败,请稍后重试')
|
||||||
|
this.partnerDetail = {
|
||||||
|
contacts: [],
|
||||||
|
projects: []
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
this.dialogLoading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 添加联系人
|
||||||
|
addContact() {
|
||||||
|
this.$message.info('添加联系人功能待实现')
|
||||||
|
},
|
||||||
|
// 编辑联系人
|
||||||
|
editContact(row) {
|
||||||
|
this.$message.info('编辑联系人功能待实现')
|
||||||
|
},
|
||||||
|
// 删除联系人
|
||||||
|
deleteContact(row) {
|
||||||
|
this.$message.info('删除联系人功能待实现')
|
||||||
|
},
|
||||||
|
// 添加项目
|
||||||
|
addProject() {
|
||||||
|
this.$message.info('添加项目功能待实现')
|
||||||
|
},
|
||||||
|
// 编辑项目
|
||||||
|
editProject(row) {
|
||||||
|
this.$message.info('编辑项目功能待实现')
|
||||||
|
},
|
||||||
|
// 删除项目
|
||||||
|
deleteProject(row) {
|
||||||
|
this.$message.info('删除项目功能待实现')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user