|
|
|
@ -46,6 +46,13 @@ |
|
|
|
value-format="yyyy-MM-dd" placeholder="结束日期" size="small" |
|
|
|
style="width: 100px;margin-top: 2px"></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否存档"> |
|
|
|
<el-select v-model="searchData.whetherArchive" clearable size="small" placeholder="全部" |
|
|
|
style="width: 90px;margin-top: 2px"> |
|
|
|
<el-option label="是" value="Y"></el-option> |
|
|
|
<el-option label="否" value="N"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="searchContract" style="margin-top: 2px">查询</el-button> |
|
|
|
<el-button @click="resetSearch" style="margin-left: 10px;">重置</el-button> |
|
|
|
@ -55,30 +62,42 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 合同信息列表 --> |
|
|
|
<el-table :data="contractList" border :height="height" style="width: 100%;"> |
|
|
|
<el-table-column prop="contractNo" header-align="center" align="center" min-width="100" label="合同号" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table :data="contractList" border :height="height" style="width: 100%;" @sort-change="handleSortChange"> |
|
|
|
<el-table-column prop="contractNo" header-align="center" align="center" min-width="100" label="合同号" sortable="custom" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="customerName" header-align="center" align="left" min-width="200" label="客户名称" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="projectName" header-align="center" align="left" min-width="200" label="项目名称" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="contractDate" header-align="center" align="center" min-width="100" label="合同日期"></el-table-column> |
|
|
|
<el-table-column prop="contractDate" header-align="center" align="center" min-width="100" sortable="custom" label="合同日期"></el-table-column> |
|
|
|
<el-table-column prop="contractAmount" header-align="center" align="right" min-width="80" label="合同金额"></el-table-column> |
|
|
|
<el-table-column prop="currency" header-align="center" align="center" min-width="70" label="货币"></el-table-column> |
|
|
|
<el-table-column prop="versionNo" header-align="center" align="center" min-width="100" label="版本号" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="partnerType" header-align="center" align="center" min-width="85" label="往来单位类型"></el-table-column> |
|
|
|
<el-table-column prop="validStartDate" header-align="center" align="center" min-width="100" label="有效期起始"></el-table-column> |
|
|
|
<el-table-column prop="validEndDate" header-align="center" align="center" min-width="100" label="有效期终止"></el-table-column> |
|
|
|
<el-table-column prop="whetherArchive" header-align="center" align="center" min-width="80" label="是否存档"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span :style="{ color: scope.row.whetherArchive === 'Y' ? '#409EFF' : '#909399' }"> |
|
|
|
{{ scope.row.whetherArchive === 'Y' ? '是' : '否' }} |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="archivePerson" header-align="center" align="center" min-width="100" label="存档人" show-overflow-tooltip> |
|
|
|
<template slot-scope="scope">{{ scope.row.archivePerson || '-' }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="archiveDate" header-align="center" align="center" min-width="100" label="存档日期"> |
|
|
|
<template slot-scope="scope">{{ (scope.row.archiveDate || '').substring(0, 10) || '-' }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="remark" header-align="center" align="left" min-width="120" label="备注" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column fixed="right" header-align="center" align="right" class-name="op-col" width="200" label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="editContract(scope.row)">编辑</a> |
|
|
|
<a type="text" size="small" style="margin-left: 8px;" @click="deleteContract(scope.row)">删除</a> |
|
|
|
|
|
|
|
<!-- 存档:已存档→存档详情 / 取消存档(都走原有逻辑);未存档→存档(默认登录人+今天,可改) --> |
|
|
|
<template v-if="scope.row.whetherArchive === 'Y'"> |
|
|
|
<a type="text" size="small" style="margin-left: 8px;" |
|
|
|
@click="viewArchiveDetail(scope.row)">存档详情</a> |
|
|
|
</template> |
|
|
|
<a v-else type="text" size="small" style="margin-left: 8px;" |
|
|
|
@click="openArchiveModal(scope.row)">存档</a> |
|
|
|
<!-- 存档:未存档→存档弹窗;已存档→直接取消存档(存档人/日期已在表格里,详情弹窗没必要了) --> |
|
|
|
<a v-if="scope.row.whetherArchive === 'Y'" type="text" size="small" |
|
|
|
style="margin-left: 8px; color:#F56C6C;" |
|
|
|
@click="cancelArchive(scope.row)">取消存档</a> |
|
|
|
<a v-else type="text" size="small" style="margin-left: 8px;" |
|
|
|
@click="openArchiveModal(scope.row)">存档</a> |
|
|
|
|
|
|
|
<!-- 附件:无附件→文字;有附件→鼠标悬浮下拉,每个附件都能预览/下载 --> |
|
|
|
<span v-if="!(scope.row.attachmentCount > 0)" |
|
|
|
@ -331,28 +350,22 @@ |
|
|
|
该文件类型不支持预览,请下载后查看 |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<!-- 存档弹窗(新增 / 查看共用) --> |
|
|
|
<!-- 存档弹窗(只用于新增存档;取消存档走操作列按钮 + 二次确认) --> |
|
|
|
<el-dialog :title="archiveModalTitle" :visible.sync="showArchiveModal" width="270px" top="15vh"> |
|
|
|
<el-form class="archive-form" :model="archiveForm" label-position="left" label-width="72px"> |
|
|
|
<el-form-item label="存档人"> |
|
|
|
<el-input v-if="archiveMode === 'edit'" v-model="archiveForm.archivePerson" size="small" style="width: 130px;margin-top: 3px"></el-input> |
|
|
|
<span v-else style="line-height: 38px;">{{ archiveForm.archivePerson || '-' }}</span> |
|
|
|
<el-form-item label="存档人"> |
|
|
|
<el-input v-model="archiveForm.archivePerson" size="small" style="width: 130px;margin-top: 3px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="存档日期"> |
|
|
|
<el-date-picker v-if="archiveMode === 'edit'" v-model="archiveForm.archiveDate" type="date" |
|
|
|
<el-date-picker v-model="archiveForm.archiveDate" type="date" |
|
|
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" |
|
|
|
size="small" style="width: 130px;margin-top: 3px"></el-date-picker> |
|
|
|
<span v-else style="line-height: 38px;">{{ (archiveForm.archiveDate || '').substring(0, 10) || '-' }}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<span slot="footer"> |
|
|
|
<el-button v-if="archiveMode === 'edit'" size="small" @click="showArchiveModal = false">取消</el-button> |
|
|
|
<el-button v-if="archiveMode === 'edit'" size="small" type="primary" @click="confirmArchive">确定</el-button> |
|
|
|
<template v-else> |
|
|
|
<el-button size="small" type="danger" plain @click="cancelArchive(currentArchiveRow)">取消存档</el-button> |
|
|
|
<el-button size="small" @click="showArchiveModal = false">关闭</el-button> |
|
|
|
</template> |
|
|
|
</span> |
|
|
|
<el-button size="small" @click="showArchiveModal = false">取消</el-button> |
|
|
|
<el-button size="small" type="primary" @click="confirmArchive">确定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -378,6 +391,7 @@ export default { |
|
|
|
validEndDateEnd: '', |
|
|
|
archiveDateStart: '', |
|
|
|
archiveDateEnd: '', |
|
|
|
whetherArchive: '', |
|
|
|
page: 1, |
|
|
|
limit: 20 |
|
|
|
}, |
|
|
|
@ -394,9 +408,14 @@ export default { |
|
|
|
'往来单位类型': 'partnerType', |
|
|
|
'有效期起始': 'validStartDate', |
|
|
|
'有效期终止': 'validEndDate', |
|
|
|
'是否存档': { field: 'whetherArchive', callback: (v) => v === 'Y' ? '是' : '否' }, |
|
|
|
'存档人': { field: 'archivePerson', callback: (v) => v || '-' }, |
|
|
|
'存档日期': { field: 'archiveDate', callback: (v) => (v || '').substring(0, 10) }, |
|
|
|
'备注': 'remark' |
|
|
|
}, |
|
|
|
pageIndex: 1, |
|
|
|
sortField: '', |
|
|
|
sortOrder: '', |
|
|
|
pageSize: 20, |
|
|
|
totalPage: 0, |
|
|
|
showContractModal: false, |
|
|
|
@ -417,7 +436,6 @@ export default { |
|
|
|
previewType: '', |
|
|
|
previewName: '', |
|
|
|
showArchiveModal: false, |
|
|
|
archiveMode: 'edit', |
|
|
|
archiveModalTitle: '', |
|
|
|
currentArchiveRow: null, |
|
|
|
rowAttachmentMap: {}, |
|
|
|
@ -485,6 +503,7 @@ export default { |
|
|
|
validEndDateEnd: '', |
|
|
|
archiveDateStart: '', |
|
|
|
archiveDateEnd: '', |
|
|
|
whetherArchive: '', |
|
|
|
page: 1, |
|
|
|
limit: this.pageSize |
|
|
|
} |
|
|
|
@ -501,6 +520,8 @@ export default { |
|
|
|
this.rowAttachmentMap = {} |
|
|
|
this.searchData.page = this.pageIndex |
|
|
|
this.searchData.limit = this.pageSize |
|
|
|
this.searchData.sidx = this.sortField |
|
|
|
this.searchData.order = this.sortOrder |
|
|
|
contractData(this.searchData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.contractList = data.page.list |
|
|
|
@ -513,6 +534,12 @@ export default { |
|
|
|
console.error(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleSortChange({ prop, order }) { |
|
|
|
this.sortField = order ? prop : '' |
|
|
|
this.sortOrder = order === 'ascending' ? 'asc' : order === 'descending' ? 'desc' : '' |
|
|
|
this.pageIndex = 1 |
|
|
|
this.fetchContracts() |
|
|
|
}, |
|
|
|
searchContract() { |
|
|
|
this.pageIndex = 1 |
|
|
|
this.fetchContracts() |
|
|
|
@ -1093,7 +1120,6 @@ export default { |
|
|
|
archivePerson: this.$store.state.user.userDisplay, |
|
|
|
archiveDate: d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()) |
|
|
|
} |
|
|
|
this.archiveMode = 'edit' |
|
|
|
this.archiveModalTitle = '存档' |
|
|
|
this.showArchiveModal = true |
|
|
|
} else { |
|
|
|
@ -1121,15 +1147,17 @@ export default { |
|
|
|
|
|
|
|
// 确定存档 |
|
|
|
confirmArchive() { |
|
|
|
if (!this.archiveForm.archivePerson || !this.archiveForm.archiveDate) { |
|
|
|
const person = (this.archiveForm.archivePerson || '').trim() |
|
|
|
const date = (this.archiveForm.archiveDate || '').trim() |
|
|
|
if (!person || !date) { |
|
|
|
this.$message.error('请填写存档人和存档日期') |
|
|
|
return |
|
|
|
} |
|
|
|
contractArchive({ |
|
|
|
id: this.currentArchiveRow.id, |
|
|
|
whetherArchive: 'Y', |
|
|
|
archivePerson: this.archiveForm.archivePerson, |
|
|
|
archiveDate: this.archiveForm.archiveDate + ' 00:00:00' |
|
|
|
archivePerson: person, |
|
|
|
archiveDate: date + ' 00:00:00' |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('存档成功') |
|
|
|
@ -1143,18 +1171,6 @@ export default { |
|
|
|
this.$message.error('存档失败') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 查看存档详情 |
|
|
|
viewArchiveDetail(row) { |
|
|
|
this.archiveMode = 'view' |
|
|
|
this.currentArchiveRow = row |
|
|
|
this.archiveModalTitle = '存档详情' |
|
|
|
this.archiveForm = { |
|
|
|
archivePerson: row.archivePerson || '', |
|
|
|
archiveDate: row.archiveDate || '' |
|
|
|
} |
|
|
|
this.showArchiveModal = true |
|
|
|
}, |
|
|
|
// 操作列"取消存档"入口:复用原有取消逻辑(带二次确认) |
|
|
|
cancelArchive(row) { |
|
|
|
this.handleArchiveChange(false, row) |
|
|
|
@ -1270,4 +1286,28 @@ export default { |
|
|
|
.contract-maintenance td.op-col .cell > .el-dropdown:nth-child(4) { |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
/* 固定列克隆层没有底色(主题里 .el-table__fixed-right 只有 box-shadow,还被设成 none), |
|
|
|
主表列从它下面透出来 → 重影。补不透明背景,表格越宽越必要 */ |
|
|
|
.contract-maintenance .el-table__fixed-right, |
|
|
|
.contract-maintenance .el-table__fixed-right .el-table__fixed-header-wrapper, |
|
|
|
.contract-maintenance .el-table__fixed-right .el-table__fixed-body-wrapper { |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
/* 排序箭头:global.scss:77 已把 caret-wrapper 压到 20px,所以只能在 20px 里排布。 |
|
|
|
▲ 的可见部分在它盒子下半 → 要它在上就得让盒子往负方向挂;▼ 反之。 |
|
|
|
border-width 控大小(每 +1px → 三角宽 +2 高 +1),两条 top 之差控间隙 */ |
|
|
|
.contract-maintenance .el-table .sort-caret { |
|
|
|
border-width: 6px; |
|
|
|
left: 6px; |
|
|
|
} |
|
|
|
|
|
|
|
.contract-maintenance .el-table .sort-caret.ascending { |
|
|
|
top: -4px; |
|
|
|
bottom: auto; |
|
|
|
} |
|
|
|
|
|
|
|
.contract-maintenance .el-table .sort-caret.descending { |
|
|
|
top: 8px; |
|
|
|
bottom: auto; |
|
|
|
} |
|
|
|
</style> |