xiaobai
3 years ago
4 changed files with 44 additions and 810 deletions
@ -1,292 +0,0 @@ |
|||||
<template> |
|
||||
<el-dialog :visible.sync="dialog" append-to-body title="承压类归档" width="80%" @close="closeParentDialog"> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.baogaobianhao" placeholder="报告编号" clearable style="width: 180px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.shebeizhonglei" placeholder="请选择设备种类" style="width: 165px" size="small" clearable> |
|
||||
<el-option v-for="item in sbzlList" :key="item.label" :label="item.label" :value="item.label" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位" clearable style="width: 260px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.zhucedaima" placeholder="注册代码" clearable style="width: 200px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.shiyongdengjibianhao" placeholder="使用登记证号" clearable style="width: 180px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.chanpinbianhao" placeholder="产品编号" clearable style="width: 180px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="warning" icon="el-icon-shopping-cart-1" size="small" @click="insertCart"> |
|
||||
加入购物车 |
|
||||
</el-button> |
|
||||
<el-badge :value="shoppingSize" :max="999" class="item"> |
|
||||
<el-popover placement="bottom" width="600" trigger="hover"> |
|
||||
<div class="filter-container" style="padding-bottom: 3px;"> |
|
||||
<el-button icon="el-icon-sold-out" type="primary" size="mini" @click="showArchiveDialog"> |
|
||||
归档所选报告 |
|
||||
</el-button> |
|
||||
<el-button type="danger" icon="el-icon-remove-outline" size="mini" @click="clearCart"> |
|
||||
清空购物车 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
<el-table :data="shoppingCartData" border style="width: 100%;" size="mini" height="350"> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" /> |
|
||||
<el-table-column align="center" label="操作" min-width="65"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="danger" icon="el-icon-delete" @click="removeCart(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<el-button slot="reference" icon="el-icon-shopping-cart-full" size="small" type="primary" /> |
|
||||
</el-popover> |
|
||||
</el-badge> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
<el-table |
|
||||
ref="newList" |
|
||||
:data="newList" |
|
||||
size="small" |
|
||||
height="500px" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" /> |
|
||||
<el-table-column type="index" align="center" label="序号" /> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" /> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" /> |
|
||||
<el-table-column align="center" label="产品编号" prop="chanpinbianhao" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" /> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyanjieshuriqi" width="120" /> |
|
||||
<el-table-column align="center" label="检验结论" prop="jianyanjielun" width="120" /> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageSize" @pagination="getList" /> |
|
||||
<!--Form表单--> |
|
||||
<el-dialog :visible.sync="archiveDialog" title="归档报告" append-to-body width="50%" @close="closeDialog"> |
|
||||
<el-form ref="archiveForm" :model="archiveForm" size="small" label-width="100px"> |
|
||||
<el-row :gutter="16"> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="归档架号" required> |
|
||||
<AutoComplete ref="autoComplete" :frame-nums="frameNums" :frame-num="archiveForm.frameNum" @getFrameNum="setValMethod" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="列" prop="columnNum" required> |
|
||||
<el-input v-model="archiveForm.columnNum" style="width: 150px;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="16"> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="归档盒号" prop="boxNum" required> |
|
||||
<el-input v-model="archiveForm.boxNum" style="width: 150px;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="报告数量" prop="archiveCount"> |
|
||||
<el-input v-model="archiveForm.archiveCount" disabled style="width: 150px;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-table :data="shoppingCartData" size="mini" height="400px" border fit highlight-current-row stripe width="100%"> |
|
||||
<el-table-column type="index" align="center" label="序号" /> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" /> |
|
||||
<el-table-column align="center" label="使用登记证编号" prop="shiyongdengjibianhao" /> |
|
||||
<el-table-column align="center" label="产品编号" prop="chanpinbianhao" /> |
|
||||
</el-table> |
|
||||
</el-form> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button type="text" @click="archiveDialog = false"> |
|
||||
取消 |
|
||||
</el-button> |
|
||||
<el-button type="primary" @click="doSubmit"> |
|
||||
确认 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
</el-dialog> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import AutoComplete from './components/AutoComplete/index' |
|
||||
import Utils from '../../utils/contact.js' |
|
||||
export default { |
|
||||
components: { Pagination, AutoComplete }, |
|
||||
props: { |
|
||||
sbzlList: { |
|
||||
type: Array, |
|
||||
required: true |
|
||||
}, |
|
||||
frameNums: { |
|
||||
type: Array, |
|
||||
required: true |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
newList: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, |
|
||||
pageSize: 20 |
|
||||
}, |
|
||||
dialog: false, |
|
||||
multipleSelection: [], |
|
||||
shoppingSize: 0, |
|
||||
shoppingCartData: [], |
|
||||
archiveForm: {}, |
|
||||
archiveDialog: false, |
|
||||
jianyijiahao: [] |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
// 初始化页面 |
|
||||
doInit() { |
|
||||
this.$nextTick(() => { |
|
||||
this.getList() |
|
||||
this.jianyijiahao = this.frameNums |
|
||||
}) |
|
||||
}, |
|
||||
// 获取待归档列表 |
|
||||
getList() { |
|
||||
this.server({ |
|
||||
url: '/archive/ysjl/list', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.newList = data.list |
|
||||
this.totalCount = data.total |
|
||||
}) |
|
||||
}, |
|
||||
// 查询事件 |
|
||||
handleFilter() { |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
// 行点击事件 |
|
||||
onRowClick(row) { |
|
||||
this.$refs.newList.toggleRowSelection(row) |
|
||||
}, |
|
||||
// 列表每行单选框改变事件 |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
// 加入购物车方法 |
|
||||
insertCart() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message.warning('请选择要加入购物车的数据。') |
|
||||
return false |
|
||||
} |
|
||||
if (this.shoppingCartData.length === 0) { |
|
||||
this.multipleSelection.forEach(value => { |
|
||||
this.shoppingCartData.push({ |
|
||||
id: value.id, |
|
||||
baogaobianhao: value.baogaobianhao, |
|
||||
shebeizhonglei: value.shebeizhonglei, |
|
||||
shiyongdanwei: value.shiyongdanwei, |
|
||||
zhucedaima: value.zhucedaima, |
|
||||
shiyongdengjibianhao: value.shiyongdengjibianhao, |
|
||||
chanpinbianhao: value.chanpinbianhao |
|
||||
}) |
|
||||
}) |
|
||||
this.shoppingSize += this.multipleSelection.length |
|
||||
} else { |
|
||||
const idArray = [] |
|
||||
this.shoppingCartData.forEach(data => idArray.push(data.id)) |
|
||||
this.multipleSelection.forEach(value => { |
|
||||
if (idArray.indexOf(value.id) < 0) { |
|
||||
this.shoppingCartData.push({ |
|
||||
id: value.id, |
|
||||
baogaobianhao: value.baogaobianhao, |
|
||||
shebeizhonglei: value.shebeizhonglei, |
|
||||
shiyongdanwei: value.shiyongdanwei, |
|
||||
zhucedaima: value.zhucedaima, |
|
||||
shiyongdengjibianhao: value.shiyongdengjibianhao, |
|
||||
chanpinbianhao: value.chanpinbianhao |
|
||||
}) |
|
||||
this.shoppingSize++ |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
// 清空单条购物车数据 |
|
||||
removeCart($index) { |
|
||||
if ($index === 0) { |
|
||||
this.shoppingCartData.splice($index, $index + 1) |
|
||||
} else { |
|
||||
this.shoppingCartData.splice($index, 1) |
|
||||
} |
|
||||
this.shoppingSize-- |
|
||||
}, |
|
||||
// 清空购物车 |
|
||||
clearCart() { |
|
||||
this.shoppingCartData = [] |
|
||||
this.shoppingSize = 0 |
|
||||
}, |
|
||||
// 弹出归档对话框 |
|
||||
showArchiveDialog() { |
|
||||
if (this.shoppingCartData.length === 0) { |
|
||||
this.$message.warning('请选择要归档的数据。') |
|
||||
return false |
|
||||
} |
|
||||
this.archiveDialog = true |
|
||||
this.archiveForm.archiveCount = this.shoppingSize |
|
||||
}, |
|
||||
// 执行归档报告 |
|
||||
doSubmit() { |
|
||||
if (!this.archiveForm.frameNum) { |
|
||||
this.$message.warning('请填写归档架号') |
|
||||
return false |
|
||||
} |
|
||||
this.$refs['archiveForm'].validate(valid => { |
|
||||
if (valid) { |
|
||||
this.archiveForm.archiveUser = this.$store.getters.nickname |
|
||||
this.server({ |
|
||||
url: '/archive/archive/addNew', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
archive: this.archiveForm, |
|
||||
params: this.shoppingCartData |
|
||||
} |
|
||||
}).then(() => { |
|
||||
this.resetForm() |
|
||||
this.$message.success('添加成功。') |
|
||||
this.getList() |
|
||||
Utils.$emit('archive-list') |
|
||||
this.clearCart() |
|
||||
this.archiveDialog = false |
|
||||
}) |
|
||||
} else { |
|
||||
return false |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
// 关闭归档报告窗口触发事件 |
|
||||
closeDialog() { |
|
||||
this.resetForm() |
|
||||
this.$refs.autoComplete.cleanNum() |
|
||||
}, |
|
||||
// 关闭父类窗口触发事件 |
|
||||
closeParentDialog() { |
|
||||
this.clearCart() |
|
||||
}, |
|
||||
// 重设归档报告表单 |
|
||||
resetForm() { |
|
||||
this.$refs['archiveForm'].resetFields() |
|
||||
this.archiveForm = {} |
|
||||
}, |
|
||||
// AutoComplete组件通信 |
|
||||
setValMethod(data) { |
|
||||
this.archiveForm.frameNum = data |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
@ -1,301 +0,0 @@ |
|||||
<template> |
|
||||
<el-dialog :visible.sync="dialog" append-to-body title="机电类归档" width="88%"> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.baogaobianhao" placeholder="报告编号" clearable style="width: 180px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.shebeizhonglei" placeholder="请选择设备种类" style="width: 165px" size="small" clearable> |
|
||||
<el-option v-for="item in sbzlList" :key="item.label" :label="item.label" :value="item.label" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位" clearable style="width: 260px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.zhucedaima" placeholder="注册代码" clearable style="width: 200px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.shiyongdengjibianhao" placeholder="使用登记证号" clearable style="width: 180px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.chanpinbianhao" placeholder="产品编号" clearable style="width: 180px" size="small" @keyup.enter.native="handleFilter" /> |
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="warning" icon="el-icon-shopping-cart-1" size="small" @click="insertCart"> |
|
||||
加入购物车 |
|
||||
</el-button> |
|
||||
<el-badge :value="shoppingSize" :max="999" class="item"> |
|
||||
<el-popover placement="bottom" width="600" trigger="hover"> |
|
||||
<div class="filter-container" style="padding-bottom: 3px;"> |
|
||||
<el-button icon="el-icon-sold-out" type="primary" size="mini" @click="showArchiveDialog"> |
|
||||
归档所选报告 |
|
||||
</el-button> |
|
||||
<el-button type="danger" icon="el-icon-remove-outline" size="mini" @click="clearCart"> |
|
||||
清空购物车 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
<el-table :data="shoppingCartData" border style="width: 100%;" size="mini" height="350"> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" /> |
|
||||
<el-table-column align="center" label="操作" min-width="65"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="danger" icon="el-icon-delete" @click="removeCart(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<el-button slot="reference" icon="el-icon-shopping-cart-full" size="small" type="primary" /> |
|
||||
</el-popover> |
|
||||
</el-badge> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
<el-table |
|
||||
ref="oldList" |
|
||||
:data="oldList" |
|
||||
size="small" |
|
||||
height="500px" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" /> |
|
||||
<el-table-column type="index" align="center" label="序号" /> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" /> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" /> |
|
||||
<el-table-column align="center" label="产品编号" prop="chanpinbianhao" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" /> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyanriqi" width="120" /> |
|
||||
<el-table-column align="center" label="检验结论" prop="jianyanjielun" width="120" /> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
<!--Form表单--> |
|
||||
<el-dialog :visible.sync="archiveDialog" title="归档报告" append-to-body width="50%" @close="closeDialog"> |
|
||||
<el-form ref="archiveForm" :model="archiveForm" size="small" label-width="100px"> |
|
||||
<el-row :gutter="16"> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="归档架号" required> |
|
||||
<AutoComplete ref="autoComplete" :frame-nums="frameNums" :frame-num="archiveForm.frameNum" @getFrameNum="setValMethod" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="列" prop="columnNum" required> |
|
||||
<el-input v-model="archiveForm.columnNum" style="width: 150px;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="16"> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="归档盒号" prop="boxNum" required> |
|
||||
<el-input v-model="archiveForm.boxNum" style="width: 150px;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="报告数量" prop="archiveCount"> |
|
||||
<el-input v-model="archiveForm.archiveCount" disabled style="width: 150px;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-table :data="shoppingCartData" size="mini" height="400px" border fit highlight-current-row stripe width="100%"> |
|
||||
<el-table-column type="index" align="center" label="序号" /> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" /> |
|
||||
<el-table-column align="center" label="使用登记证编号" prop="shiyongdengjibianhao" /> |
|
||||
<el-table-column align="center" label="产品编号" prop="chanpinbianhao" /> |
|
||||
</el-table> |
|
||||
</el-form> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button type="text" @click="archiveDialog = false"> |
|
||||
取消 |
|
||||
</el-button> |
|
||||
<el-button type="primary" @click="doSubmit"> |
|
||||
确认 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
</el-dialog> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import AutoComplete from './components/AutoComplete/index' |
|
||||
import Utils from '../../utils/contact.js' |
|
||||
export default { |
|
||||
components: { Pagination, AutoComplete }, |
|
||||
props: { |
|
||||
sbzlList: { |
|
||||
type: Array, |
|
||||
required: true |
|
||||
}, |
|
||||
frameNums: { |
|
||||
type: Array, |
|
||||
required: true |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
oldList: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, |
|
||||
pageSize: 20 |
|
||||
}, |
|
||||
dialog: false, |
|
||||
multipleSelection: [], |
|
||||
shoppingSize: 0, |
|
||||
shoppingCartData: [], |
|
||||
archiveForm: {}, |
|
||||
archiveDialog: false, |
|
||||
jianyijiahao: [] |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
doInit() { |
|
||||
this.$nextTick(() => { |
|
||||
this.getList() |
|
||||
this.jianyijiahao = this.frameNums |
|
||||
}) |
|
||||
}, |
|
||||
getList() { |
|
||||
this.server.defaults.headers.common['projectMark'] = 'OLD' |
|
||||
this.server({ |
|
||||
url: '/archive/report/list', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.oldList = data.list |
|
||||
this.totalCount = data.total |
|
||||
this.server.defaults.headers.common['projectMark'] = '' |
|
||||
}) |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.oldList.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
// 加入购物车方法 |
|
||||
insertCart() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message.warning('请选择要加入购物车的数据。') |
|
||||
return false |
|
||||
} |
|
||||
if (this.shoppingCartData.length === 0) { |
|
||||
this.multipleSelection.forEach(value => { |
|
||||
this.shoppingCartData.push({ |
|
||||
annalid: value.annalid, |
|
||||
baogaobianhao: value.baogaobianhao, |
|
||||
shebeizhonglei: value.shebeizhonglei, |
|
||||
shiyongdanwei: value.shiyongdanwei, |
|
||||
zhucedaima: value.zhucedaima, |
|
||||
shiyongdengjibianhao: value.shiyongdengjibianhao, |
|
||||
chanpinbianhao: value.chanpinbianhao |
|
||||
}) |
|
||||
}) |
|
||||
this.shoppingSize += this.multipleSelection.length |
|
||||
} else { |
|
||||
const idArray = [] |
|
||||
this.shoppingCartData.forEach(data => idArray.push(data.annalid)) |
|
||||
this.multipleSelection.forEach(value => { |
|
||||
if (idArray.indexOf(value.annalid) < 0) { |
|
||||
this.shoppingCartData.push({ |
|
||||
annalid: value.annalid, |
|
||||
baogaobianhao: value.baogaobianhao, |
|
||||
shebeizhonglei: value.shebeizhonglei, |
|
||||
shiyongdanwei: value.shiyongdanwei, |
|
||||
zhucedaima: value.zhucedaima, |
|
||||
shiyongdengjibianhao: value.shiyongdengjibianhao, |
|
||||
chanpinbianhao: value.chanpinbianhao |
|
||||
}) |
|
||||
this.shoppingSize++ |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
// 清空单条购物车数据 |
|
||||
removeCart($index) { |
|
||||
if ($index === 0) { |
|
||||
this.shoppingCartData.splice($index, $index + 1) |
|
||||
} else { |
|
||||
this.shoppingCartData.splice($index, 1) |
|
||||
} |
|
||||
this.shoppingSize-- |
|
||||
}, |
|
||||
// 清空购物车 |
|
||||
clearCart() { |
|
||||
this.shoppingCartData = [] |
|
||||
this.shoppingSize = 0 |
|
||||
}, |
|
||||
// 弹出归档对话框 |
|
||||
showArchiveDialog() { |
|
||||
if (this.shoppingCartData.length === 0) { |
|
||||
this.$message.warning('请选择要归档的数据。') |
|
||||
return false |
|
||||
} |
|
||||
this.archiveDialog = true |
|
||||
this.archiveForm.archiveCount = this.shoppingSize |
|
||||
}, |
|
||||
// 执行归档报告 |
|
||||
doSubmit() { |
|
||||
if (!this.archiveForm.frameNum) { |
|
||||
this.$message.warning('请填写归档架号') |
|
||||
return false |
|
||||
} |
|
||||
this.$refs['archiveForm'].validate(valid => { |
|
||||
if (valid) { |
|
||||
this.archiveForm.archiveUser = this.$store.getters.nickname |
|
||||
this.server({ |
|
||||
url: '/archive/archive/addOld', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
archive: this.archiveForm, |
|
||||
params: this.shoppingCartData |
|
||||
} |
|
||||
}).then(() => { |
|
||||
this.server.defaults.headers.common['projectMark'] = 'OLD' |
|
||||
this.server({ |
|
||||
url: '/archive/report/updateReportState', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
params: this.shoppingCartData |
|
||||
} |
|
||||
}).then(() => { |
|
||||
this.resetForm() |
|
||||
this.$message.success('添加成功。') |
|
||||
this.getList() |
|
||||
this.clearCart() |
|
||||
this.archiveDialog = false |
|
||||
this.$nextTick(() => { |
|
||||
this.server.defaults.headers.common['projectMark'] = '' |
|
||||
Utils.$emit('archive-list') |
|
||||
}) |
|
||||
}) |
|
||||
}) |
|
||||
} else { |
|
||||
return false |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
// 关闭归档报告窗口触发事件 |
|
||||
closeDialog() { |
|
||||
this.resetForm() |
|
||||
this.$refs.autoComplete.cleanNum() |
|
||||
}, |
|
||||
// 关闭父类窗口触发事件 |
|
||||
closeParentDialog() { |
|
||||
this.clearCart() |
|
||||
}, |
|
||||
// 重设归档报告表单 |
|
||||
resetForm() { |
|
||||
this.$refs['archiveForm'].resetFields() |
|
||||
this.archiveForm = {} |
|
||||
}, |
|
||||
// AutoComplete组件通信 |
|
||||
setValMethod(data) { |
|
||||
this.archiveForm.frameNum = data |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
Loading…
Reference in new issue