|
|
|
@ -38,7 +38,7 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<el-table :data="dataList" :height="height" border highlight-current-row v-loading="loading" style="width:100%" stripe> |
|
|
|
<el-table :data="dataList" :height="height" border ref="mainTable" highlight-current-row v-loading="loading" style="width:100%" stripe> |
|
|
|
<el-table-column fixed="right" :label="'操作'" header-align="center" align="center" width="140"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a class="customer-a" v-if="scope.row.status === '已报价'" @click="openDialog(scope.row)">审批</a> |
|
|
|
@ -142,6 +142,14 @@ |
|
|
|
:total="totalPage" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" /> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 标签页 --> |
|
|
|
<el-tabs v-model="activeName" style="margin-top: 0px; width: 99%;" @tab-click="tabClick" class="customer-tab" type="border-card"> |
|
|
|
<el-tab-pane label="附件" name="attachments"> |
|
|
|
<attachments ref="attachments" :height="tabHeight"></attachments> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<!-- 新增 / 编辑 弹窗 --> |
|
|
|
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="800px" :close-on-click-modal="false" v-drag> |
|
|
|
<el-form label-position="top" class="pi-form" :model="form" label-width="120px"> |
|
|
|
@ -512,6 +520,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
searchPurReplyHistPage, |
|
|
|
@ -525,8 +534,13 @@ import { |
|
|
|
createPartSupplierRelation |
|
|
|
} from '../../../api/part/partSupplierRelation' |
|
|
|
|
|
|
|
import attachments from './com_inquiry_Attachments' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'MyQuotation', |
|
|
|
components: { |
|
|
|
attachments |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
height: 200, |
|
|
|
@ -536,6 +550,8 @@ export default { |
|
|
|
pageIndex: 1, |
|
|
|
pageSize: 20, |
|
|
|
totalPage: 0, |
|
|
|
currentRow: {}, |
|
|
|
activeName: 'attachments', |
|
|
|
searchData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
createdBy: this.$store.state.user.name, |
|
|
|
@ -636,8 +652,31 @@ export default { |
|
|
|
methods: { |
|
|
|
calcHeight() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.height = window.innerHeight - 212 |
|
|
|
// this.height = window.innerHeight - 212 |
|
|
|
this.height = (window.innerHeight - 280) / 2 |
|
|
|
this.tabHeight = this.height - 50 |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
}) |
|
|
|
}, |
|
|
|
refreshCurrentTabTable() { |
|
|
|
if (this.currentRow === '' || this.currentRow === null) { |
|
|
|
this.currentRow = {site: '', orderNo: ''} |
|
|
|
} |
|
|
|
|
|
|
|
if (this.activeName === 'attachments') { |
|
|
|
this.refreshAttachments() |
|
|
|
} |
|
|
|
}, |
|
|
|
refreshAttachments () { |
|
|
|
console.log('刷新附件组件,当前行数据:', this.currentRow) |
|
|
|
let inData = { |
|
|
|
orderRef1: this.currentRow.site, |
|
|
|
orderRef2: this.currentRow.orderNo, |
|
|
|
orderRef3: this.currentRow.partNo, |
|
|
|
orderReftype: 'purQuotationDetail', |
|
|
|
height: this.tabHeight |
|
|
|
} |
|
|
|
this.$refs.attachments.init(inData) |
|
|
|
}, |
|
|
|
getStatusType(status) { |
|
|
|
const map = { |
|
|
|
@ -672,6 +711,13 @@ export default { |
|
|
|
this.pageIndex = data.page.currPage |
|
|
|
this.pageSize = data.page.pageSize |
|
|
|
this.totalPage = data.page.totalCount |
|
|
|
if (this.dataList.length > 0) { |
|
|
|
this.$refs.mainTable.setCurrentRow(this.dataList[0]) |
|
|
|
console.log('默认选中第一行:', this.dataList[0]) |
|
|
|
this.changeData(this.dataList[0]) |
|
|
|
} else { |
|
|
|
this.changeData(null) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.error((data && data.msg) || '获取列表失败') |
|
|
|
} |
|
|
|
@ -681,6 +727,15 @@ export default { |
|
|
|
this.$message.error('请求失败') |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeData(row) { |
|
|
|
this.currentRow = row ? JSON.parse(JSON.stringify(row)) : { site: '', orderNo: '', itemNo: '' } |
|
|
|
console.log('选中行数据:', this.currentRow) |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
|
|
|
|
}, |
|
|
|
tabClick() { |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
}, |
|
|
|
sizeChangeHandle(val) { |
|
|
|
this.pageSize = val |
|
|
|
this.pageIndex = 1 |
|
|
|
|