<template>
|
<div class="detail-view">
|
<el-drawer :visible.sync="detailConfig.visible" size="80%" :before-close="handleClose" :wrapperClosable="false">
|
<template slot="title">
|
<div class="header">
|
<span class="header-label">质检单详情</span>
|
<span class="header-title">{{ detailConfig.infomation.name }}</span>
|
</div>
|
<div class="btn" style="float:right;margin-right:30px;">
|
<el-button type="primary" size="mini" @click="qualityClick" icon="el-icon-search" style="margin-right: 5px"
|
>打印</el-button
|
>
|
<el-button type="primary" size="mini" icon="el-icon-refresh-left" @click="qualityClick">去质检</el-button>
|
</div>
|
</template>
|
<div class="content">
|
<div class="tab-view">
|
<el-tabs v-model="activeName">
|
<el-tab-pane label="详情" name="first"></el-tab-pane>
|
|
</el-tabs>
|
</div>
|
<div v-if="activeName === 'first'" class="detail">
|
<!-- 基本信息 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('basic')">
|
<i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">基本信息</span>
|
</div>
|
<div v-show="isBasicExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in basicInfoList" :key="i">
|
<div class="left">
|
<div class="content-title">{{ item.leftStr + ":" }}</div>
|
<div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
|
</div>
|
<div v-if="item.rightStr && item.rightStr.length > 0" class="right">
|
<div class="content-title">{{ item.rightStr + ":" }}</div>
|
<div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
|
</div>
|
</li>
|
</ul>
|
<div class="business_scope">
|
<div class="content-title">{{ "备注信息:" }}</div>
|
<div class="content-data">{{ record ? record : "--" }}</div>
|
</div>
|
</div>
|
</div>
|
<!-- 账户信息 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('dynamic')">
|
<i v-if="isDynamicExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">产品信息</span>
|
</div>
|
<div v-show="isDynamicExpand" class="basic-info-content">
|
<TableCommonView
|
style='margin-top:2px;'
|
class="content-table"
|
ref="tableListRef"
|
:table-list="tableList"
|
>
|
</TableCommonView>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
</el-drawer>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: "DetailSupplier",
|
props: {
|
commonDetail: {
|
type: Object,
|
default: () => {
|
return {
|
visible: false,
|
infomation: {},
|
tableList:[],
|
}
|
}
|
}
|
},
|
components: {},
|
computed: {},
|
data() {
|
return {
|
detailConfig: this.commonDetail,
|
activeName: "first",
|
isBasicExpand: true, // 基本信息展开
|
basicInfoList: [],
|
isDynamicExpand: true, // 产品信息
|
tableList: [],
|
addConfig: {},
|
record: "", // 最新进展
|
}
|
},
|
created() {
|
this.setData(this.detailConfig.infomation)
|
this.addConfig = {
|
id_name: "sales_leads_id",
|
id: this.detailConfig.infomation.id,
|
common_name: this.detailConfig.infomation.id,
|
sales_leads_name: this.detailConfig.infomation.name,
|
sales_leads_id: this.detailConfig.infomation.id
|
}
|
},
|
mounted() {},
|
methods: {
|
// 去质检
|
qualityClick(){
|
this.$emit('qualityClick')
|
},
|
setData(item) {
|
if (item.FollowRecord && item.FollowRecord.length > 0) {
|
this.record = item.FollowRecord[0].record
|
console.log(item.FollowRecord[0].follow_time)
|
}
|
this.basicInfoList = [
|
{
|
leftStr: "采购质检单编号",
|
leftValue: item.number,
|
rightStr: "质检状态",
|
rightValue: item.name
|
},
|
{
|
leftStr: "采购单编号",
|
leftValue: item.contact_name,
|
rightStr: "质检员",
|
rightValue: item.contact_position
|
},
|
{
|
leftStr: "供应商名称",
|
leftValue: item.contact_phone,
|
rightStr: "到货仓库",
|
rightValue: "18513375588"
|
},
|
{
|
leftStr: "物流公司",
|
leftValue: item.sales_resources,
|
rightStr: "创建时间",
|
rightValue: item.member_name
|
},
|
{
|
leftStr: "物流单号",
|
leftValue: item.sales_resources,
|
rightStr: "",
|
rightValue: ""
|
}
|
]
|
this.tableList = {
|
tableInfomation: [],
|
selectIndex: true,
|
tableColumn: [
|
{ label: "产品名称", prop: "number", min: 190, isCommonClick: true },
|
{ label: "产品编码", prop: "name", min: 130, isCommonClick: true},
|
{ label: "计量单位", prop: "contact_name", min: 130 },
|
{ label: "规格型号", prop: "contact_phone", min: 130 },
|
{ label: "到货数量", prop: "contact_phone", min: 130 },
|
{ label: "合格数量", prop: "sales_resources", min: 130 },
|
{ label: "不合格数量", prop: "province", min: 130 },
|
]
|
}
|
},
|
handleClose() {
|
this.detailConfig.visible = false
|
},
|
|
// 展开收起点击事件
|
expandClick(value) {
|
console.log(value)
|
if (value === "basic") {
|
this.isBasicExpand = !this.isBasicExpand
|
} else if (value === "dynamic") {
|
this.isDynamicExpand = !this.isDynamicExpand
|
}
|
},
|
// 计算两个日期之间的差值
|
getDiffDay(date_1, date_2) {
|
let totalDays, diffDate
|
let myDate_1 = date_1
|
let myDate_2 = Date.parse(date_2)
|
// 将两个日期都转换为毫秒格式,然后做差
|
diffDate = Math.abs(myDate_1 - myDate_2) // 取相差毫秒数的绝对值
|
|
totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整
|
// console.log(totalDays)
|
|
return totalDays // 相差的天数
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.detail-view {
|
.header {
|
height: 56px;
|
display: flex;
|
align-items: center;
|
padding-left: 10px;
|
.header-label {
|
padding: 5px;
|
border-radius: 4px;
|
background-color: #ff6600;
|
color: #fff;
|
font-size: 12px;
|
}
|
.header-title {
|
color: #323232;
|
font-size: 15px;
|
margin-left: 10px;
|
font-weight: inherit;
|
}
|
}
|
.content {
|
height:100%;
|
background-color: rgb(230, 233, 240);
|
padding: 8px;
|
.tab-view {
|
background: #fff;
|
// .tab-view-pane {
|
// position: relative;
|
.item {
|
position: absolute;
|
top: 0px;
|
right: 0px;
|
}
|
// }
|
}
|
.detail {
|
height:calc(100% - 40px);
|
background:#fff;
|
overflow:auto;
|
.basic-info {
|
.basic-info-label {
|
padding-left: 10px;
|
height: 42px;
|
line-height: 42px;
|
background: #f4f8fe;
|
color: #333;
|
font-size: 14px;
|
}
|
.basic-info-content {
|
background: #fff;
|
ul {
|
padding-inline-start: 0;
|
}
|
li {
|
display: flex;
|
font-size: 14px;
|
font-family: PingFangSC;
|
border-bottom: 1px solid #f9f9fb;
|
.left,
|
.right {
|
width: 50%;
|
display: flex;
|
align-items: center;
|
height: 40px;
|
.content-title {
|
width: 180px;
|
text-align: right;
|
color: #555;
|
}
|
.content-data {
|
text-align: left;
|
margin-left: 25px;
|
color: #333;
|
}
|
}
|
.remark {
|
width: 100%;
|
}
|
}
|
.business_scope {
|
display: flex;
|
align-items: center;
|
font-size: 14px;
|
min-height: 40px;
|
.content-title {
|
width: 180px;
|
text-align: right;
|
color: #555;
|
}
|
.content-data {
|
flex: 1;
|
padding: 5px;
|
text-align: left;
|
margin-left: 25px;
|
color: #333;
|
}
|
}
|
}
|
}
|
}
|
.second {
|
background: #fff;
|
.followup-records {
|
.table-view {
|
margin-top: 0 !important;
|
margin-bottom: 0;
|
}
|
}
|
}
|
}
|
}
|
::v-deep .el-drawer__body{
|
height:calc(100% - 60px)!important;
|
}
|
::v-deep {
|
.el-drawer__header {
|
padding: 0;
|
margin-bottom: 0px;
|
}
|
|
.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
|
padding-left: 20px;
|
}
|
.el-tabs__item.is-active {
|
color: $color-primary;
|
}
|
.el-tabs__item:hover {
|
color: $color-primary;
|
}
|
.el-tabs__active-bar {
|
background-color: $color-primary;
|
}
|
.el-tabs__header {
|
margin: 0;
|
}
|
}
|
</style>
|