|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<el-dialog class="upload-dialog" title="装盒" :visible.sync="packingVisible" :close-on-click-modal="false" :before-close="handleClose"> |
|
|
|
<el-dialog class="partPackingDialog" title="装盒" :visible.sync="packingVisible" :close-on-click-modal="false" :before-close="handleClose"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
@ -7,7 +7,7 @@ |
|
|
|
<div class="head-container packing-head"> |
|
|
|
<div class="head-search"> |
|
|
|
<!-- 搜索 --> |
|
|
|
<el-input v-model="caseQuery[inputSelect]" clearable size="small" placeholder="请输入" style="width: 245px;" class="input-prepend filter-item" @keyup.enter.native="getCaseList"> |
|
|
|
<el-input v-model="caseQuery[inputSelect]" clearable size="small" placeholder="请输入" style="width: 245px;" class="input-prepend filter-item" @keyup.enter.native="getCaseList" @clear="clearTableData"> |
|
|
|
<el-select slot="prepend" v-model="inputSelect" style="width: 90px" @change="querySelect"> |
|
|
|
<el-option |
|
|
|
v-for="item in queryOption" |
|
|
@ -25,13 +25,13 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!--表格渲染--> |
|
|
|
<!-- 装盒 --> |
|
|
|
<el-table |
|
|
|
v-if="!isPackingOrPartType" |
|
|
|
ref="table" |
|
|
|
:data="tableData" |
|
|
|
style="min-width: 100%" |
|
|
|
height="calc(100vh - 382px)" |
|
|
|
@row-click="clickRowHandler" |
|
|
|
@selection-change="selectionChangeHandler" |
|
|
|
> |
|
|
|
<el-table-column type="index" label="序号" width="80" align="center" /> |
|
|
|
<el-table-column prop="depositNum" label="已装" min-width="100" align="center" /> |
|
|
@ -44,6 +44,113 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<!-- 分卷 --> |
|
|
|
<div v-else class="part-packing-cont"> |
|
|
|
<div class="part-packing-item"> |
|
|
|
<h5 class="part-packing-title">盒列表-待选</h5> |
|
|
|
<el-table |
|
|
|
ref="table" |
|
|
|
:data="tableData" |
|
|
|
style="width: 100%" |
|
|
|
height="calc(100vh/2 - 200px)" |
|
|
|
> |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center" /> |
|
|
|
<el-table-column prop="depositNum" label="已装" width="60" align="center" /> |
|
|
|
<el-table-column prop="caseName" label="盒名称" show-overflow-tooltip align="center" /> |
|
|
|
<el-table-column prop="tid" label="TID" show-overflow-tooltip align="center" /> |
|
|
|
<el-table-column prop="barcode" label="条形码" show-overflow-tooltip align="center" /> |
|
|
|
<el-table-column prop="create_date" label="操作" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button class="packing-handle-btn iconfont" @click="handlePartParking(scope.row,scope.$index)"><svg-icon icon-class="zhuanghe" class="svg-arc-style" />装盒</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div class="part-packing-item"> |
|
|
|
<h5 class="part-packing-title">盒列表-已选</h5> |
|
|
|
<el-table |
|
|
|
ref="selectBox" |
|
|
|
:data="selectTableData" |
|
|
|
style="width: 100%" |
|
|
|
height="calc(100vh/2 - 200px)" |
|
|
|
> |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center" /> |
|
|
|
<el-table-column prop="depositNum" label="已装" width="60" align="center" /> |
|
|
|
<el-table-column prop="caseName" label="盒名称" show-overflow-tooltip align="center" /> |
|
|
|
<el-table-column prop="tid" label="TID" show-overflow-tooltip align="center" /> |
|
|
|
<el-table-column prop="barcode" label="条形码" show-overflow-tooltip align="center" /> |
|
|
|
<el-table-column prop="create_date" label="操作" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button class="packing-recall-btn iconfont" @click="cancelParking(scope.row,scope.$index)"><svg-icon icon-class="chehui" class="svg-arc-style" />撤销</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div class="part-packing-item"> |
|
|
|
<h5 class="part-packing-title">档案列表-待选</h5> |
|
|
|
<el-table |
|
|
|
ref="archivesList" |
|
|
|
class="archives-table" |
|
|
|
:data="archivesTable" |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%;" |
|
|
|
height="calc(100vh/2 - 200px)" |
|
|
|
@selection-change="selectionChangeHandler" |
|
|
|
@row-click="clickRowHandler" |
|
|
|
> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center" /> |
|
|
|
<el-table-column label="文件" prop="children_num" width="55" align="center" /> |
|
|
|
<el-table-column v-for="field in recycleMain.$refs.file.tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip> |
|
|
|
<template slot="header"> |
|
|
|
<el-tooltip |
|
|
|
class="item" |
|
|
|
effect="dark" |
|
|
|
:content="field.fieldCnName" |
|
|
|
placement="top-start" |
|
|
|
> |
|
|
|
<span>{{ field.fieldCnName }}</span> |
|
|
|
</el-tooltip> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row[field.fieldName] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div class="part-packing-item"> |
|
|
|
<h5 class="part-packing-title">档案列表-已选</h5> |
|
|
|
<el-table |
|
|
|
ref="selectArchivesList" |
|
|
|
class="archives-table" |
|
|
|
:data="selectArchivesTable" |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%;" |
|
|
|
height="calc(100vh/2 - 200px)" |
|
|
|
> |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center" /> |
|
|
|
<el-table-column label="文件" prop="children_num" width="55" align="center" /> |
|
|
|
<el-table-column v-for="field in recycleMain.$refs.file.tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip> |
|
|
|
<template slot="header"> |
|
|
|
<el-tooltip |
|
|
|
class="item" |
|
|
|
effect="dark" |
|
|
|
:content="field.fieldCnName" |
|
|
|
placement="top-start" |
|
|
|
> |
|
|
|
<span>{{ field.fieldCnName }}</span> |
|
|
|
</el-tooltip> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row[field.fieldName] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="isPackingOrPartType" slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="handleComfireCartoning">保存</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -51,14 +158,13 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
// FetchCartoning |
|
|
|
import { FetchInitCaseList } from '@/api/archivesManage/caseManage' |
|
|
|
// |
|
|
|
import { FetchInitCaseList, FetchCartoning } from '@/api/archivesManage/caseManage' |
|
|
|
import { header, form } from '@crud/crud' |
|
|
|
// import data from '../data.json' |
|
|
|
export default { |
|
|
|
name: 'Packing', |
|
|
|
components: { }, |
|
|
|
inject: ['caseData'], |
|
|
|
inject: ['caseData', 'recycleMain'], |
|
|
|
mixins: [ |
|
|
|
header(), |
|
|
|
form({}) |
|
|
@ -66,6 +172,9 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableData: [], |
|
|
|
selectTableData: [], |
|
|
|
archivesTable: [], |
|
|
|
selectArchivesTable: [], |
|
|
|
selections: [], |
|
|
|
tid: null, |
|
|
|
caseName: null, |
|
|
@ -77,7 +186,8 @@ export default { |
|
|
|
{ value: 'tid', label: 'TID' }, |
|
|
|
{ value: 'barcode', label: '条形码' } |
|
|
|
], |
|
|
|
packingVisible: false // 装盒 |
|
|
|
packingVisible: false, // 装盒 |
|
|
|
isPackingOrPartType: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -90,15 +200,25 @@ export default { |
|
|
|
this.inputSelect = val |
|
|
|
}, |
|
|
|
getCaseList() { |
|
|
|
if (!this.caseQuery[this.inputSelect]) { |
|
|
|
this.$message.error('请输入后再搜索!') |
|
|
|
return |
|
|
|
} |
|
|
|
switch (this.inputSelect) { |
|
|
|
case 'caseName': |
|
|
|
this.caseName = this.caseQuery[this.inputSelect] |
|
|
|
this.tid = null |
|
|
|
this.barcode = null |
|
|
|
break |
|
|
|
case 'tid': |
|
|
|
this.tid = this.caseQuery[this.inputSelect] |
|
|
|
this.caseName = null |
|
|
|
this.barcode = null |
|
|
|
break |
|
|
|
case 'barcode': |
|
|
|
this.barcode = this.caseQuery[this.inputSelect] |
|
|
|
this.caseName = null |
|
|
|
this.tid = null |
|
|
|
break |
|
|
|
} |
|
|
|
const params = { |
|
|
@ -109,38 +229,108 @@ export default { |
|
|
|
'size': 10 |
|
|
|
} |
|
|
|
FetchInitCaseList(params).then(res => { |
|
|
|
console.log(res) |
|
|
|
this.tableData = res.content |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleCartoning(row) { |
|
|
|
console.log(this.caseData) |
|
|
|
let packingData = [] |
|
|
|
let jnCategoryId |
|
|
|
let archivesParentsId |
|
|
|
if (this.caseData.selectedCategory.isType === 5) { |
|
|
|
packingData = this.caseData.selections |
|
|
|
jnCategoryId = this.caseData.selectedCategory.id |
|
|
|
archivesParentsId = null |
|
|
|
} else { |
|
|
|
packingData = this.recycleMain.$refs.file.junneiData |
|
|
|
if (this.caseData.selectedCategory.isType === 2) { |
|
|
|
jnCategoryId = this.caseData.selectedCategory.children[0].children[0].id |
|
|
|
} else { |
|
|
|
jnCategoryId = this.caseData.selectedCategory.children[0].id |
|
|
|
} |
|
|
|
archivesParentsId = this.caseData.selections[0].id |
|
|
|
} |
|
|
|
|
|
|
|
const arrParams = packingData.map(item => { |
|
|
|
const json = {} |
|
|
|
json.archivesId = item.id |
|
|
|
json.archivesParentsId = archivesParentsId |
|
|
|
json.caseId = row.id |
|
|
|
json.caseName = row.caseName |
|
|
|
json.categoryId = jnCategoryId |
|
|
|
return json |
|
|
|
}) |
|
|
|
this.FetchCartioning(arrParams) |
|
|
|
}, |
|
|
|
FetchCartioning(arrParams) { |
|
|
|
FetchCartoning(arrParams).then(res => { |
|
|
|
this.$message.success('装盒成功!') |
|
|
|
this.packingVisible = false |
|
|
|
this.crud.refresh() |
|
|
|
this.tableData = [] |
|
|
|
}) |
|
|
|
}, |
|
|
|
handlePartParking(row, index) { |
|
|
|
if (!this.selections.length) { |
|
|
|
this.$message.error('请选择要装盒的档案!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.selectTableData.push(row) |
|
|
|
this.tableData.splice(index, 1) |
|
|
|
|
|
|
|
this.archivesTable.splice(this.archivesTable.findIndex((item, i) => item.id === this.selections[i].id), this.selections.length) |
|
|
|
console.log(row) |
|
|
|
const params = { |
|
|
|
'archivesId': this.tid, |
|
|
|
'archivesParentsId': this.caseName, |
|
|
|
'caseId': row.id, |
|
|
|
'caseName': row.caseName, |
|
|
|
'categoryId': this.caseData.categoryId |
|
|
|
this.selections.forEach(item => { |
|
|
|
item.caseId = row.id |
|
|
|
item.caseName = row.caseName |
|
|
|
this.selectArchivesTable.push(item) |
|
|
|
}) |
|
|
|
}, |
|
|
|
cancelParking(row, index) { |
|
|
|
this.tableData.unshift(row) |
|
|
|
this.selectTableData.splice(index, 1) |
|
|
|
|
|
|
|
const returnArr = [] |
|
|
|
this.selectArchivesTable.forEach((item, i) => { |
|
|
|
if (item.caseId === row.id) { |
|
|
|
console.log(item.id) |
|
|
|
returnArr.push(item) |
|
|
|
} |
|
|
|
console.log(params) |
|
|
|
// FetchCartoning(params).then(res => { |
|
|
|
// console.log(res) |
|
|
|
// }) |
|
|
|
}) |
|
|
|
console.log(returnArr) |
|
|
|
this.selectArchivesTable.splice(this.selectArchivesTable.findIndex((item, i) => item.id === returnArr[i].id), returnArr.length) |
|
|
|
returnArr.forEach(item => { |
|
|
|
this.archivesTable.unshift(item) |
|
|
|
}) |
|
|
|
}, |
|
|
|
open() { |
|
|
|
this.$alert('装盒成功!', '提示', { |
|
|
|
showConfirmButton: false |
|
|
|
}).then(() => { |
|
|
|
console.log('then') |
|
|
|
}).catch((err) => { |
|
|
|
console.log(err) |
|
|
|
handleComfireCartoning() { |
|
|
|
if (this.archivesTable.length) { |
|
|
|
this.$message.error('左侧档案待选列表全部装盒完成才可保存') |
|
|
|
return |
|
|
|
} |
|
|
|
let jnCategoryId |
|
|
|
if (this.caseData.selectedCategory.isType === 2) { |
|
|
|
jnCategoryId = this.caseData.selectedCategory.children[0].children[0].id |
|
|
|
} else { |
|
|
|
jnCategoryId = this.caseData.selectedCategory.children[0].id |
|
|
|
} |
|
|
|
const arrParams = this.selectArchivesTable.map(item => { |
|
|
|
const json = {} |
|
|
|
json.archivesId = item.id |
|
|
|
json.archivesParentsId = this.caseData.selections[0].id |
|
|
|
json.caseId = item.caseId |
|
|
|
json.caseName = item.caseName |
|
|
|
json.categoryId = jnCategoryId |
|
|
|
return json |
|
|
|
}) |
|
|
|
console.log(arrParams) |
|
|
|
this.FetchCartioning(arrParams) |
|
|
|
}, |
|
|
|
clearTableData() { |
|
|
|
this.tableData = [] |
|
|
|
}, |
|
|
|
// table |
|
|
|
clickRowHandler(row) { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
this.$refs.archivesList.toggleRowSelection(row) |
|
|
|
}, |
|
|
|
// table |
|
|
|
selectionChangeHandler(val) { |
|
|
@ -149,6 +339,11 @@ export default { |
|
|
|
// dialog - close |
|
|
|
handleClose(done) { |
|
|
|
this.showCoverVisible = false |
|
|
|
// this.caseQuery[this.inputSelect] = '' |
|
|
|
this.tableData = [] |
|
|
|
this.selectTableData = [] |
|
|
|
this.archivesTable = [] |
|
|
|
this.selectArchivesTable = [] |
|
|
|
done() |
|
|
|
} |
|
|
|
} |
|
|
|