Browse Source

移除归档模块中多余的代码

master
李磊 3 years ago
parent
commit
32b45e30e0
  1. 292
      src/views/archive/archive_new.vue
  2. 301
      src/views/archive/archive_old.vue
  3. 233
      src/views/archive/archive_scan.vue
  4. 28
      src/views/archive/list.vue

292
src/views/archive/archive_new.vue

@ -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>

301
src/views/archive/archive_old.vue

@ -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>

233
src/views/archive/archive_scan.vue

@ -1,5 +1,5 @@
<template>
<el-dialog :visible.sync="dialog" append-to-body :title="isEdit ? '追加归档' : '扫码归档'" width="50%" @close="closeDialog">
<el-dialog :visible.sync="dialog" append-to-body :title="isAppend ? '追加归档' : '扫码归档'" width="50%" @close="closeDialog">
<el-alert title="请将光标移动到“扫码框”内,并用扫码枪扫描纸质报告右上方条形码进行归档,请勿手动输入。" style="margin-top: -10px; margin-bottom: 5px;" type="warning" :closable="false" />
<el-form ref="archive" :model="archive" size="small" label-width="100px">
<el-row :gutter="16">
@ -12,19 +12,19 @@
<el-row :gutter="16">
<el-col :span="8">
<el-form-item label="归档架号" required>
<AutoComplete ref="autoComplete" :frame-nums="frameNums" :frame-num="archive.frameNum" :is-edit="isEdit" @getFrameNum="setValMethod" />
<AutoComplete ref="autoComplete" :frame-nums="frameNums" :frame-num="archive.frameNum" :is-edit="isAppend" @getFrameNum="setValMethod" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="列" prop="columnNum" required>
<el-input v-model="archive.columnNum" :disabled="isEdit" style="width: 150px;" />
<el-input v-model="archive.columnNum" :disabled="isAppend" 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="archive.boxNum" :disabled="isEdit" style="width: 150px;" />
<el-input v-model="archive.boxNum" :disabled="isAppend" style="width: 150px;" />
</el-form-item>
</el-col>
</el-row>
@ -65,7 +65,7 @@ export default {
type: Array,
required: true
},
isEdit: {
isAppend: {
type: Boolean,
default: false
},
@ -89,7 +89,7 @@ export default {
doInit() {
this.$nextTick(() => {
this.jianyijiahao = this.frameNums
if (this.isEdit) {
if (this.isAppend) {
this.server({
url: '/archive/archive/getArchiveInfo/' + this.id,
method: 'get'
@ -102,159 +102,46 @@ export default {
},
//
handleKeyUpEnter() {
//
if (this.paramList.length === 0) {
this.unknownScan()
//
if (this.paramList.every(param => param.baogaobianhao !== this.baogaobianhao)) {
//
this.getYsjlByBgbh()
} else {
// ------
//
const bgbhArray = []
this.paramList.forEach(data => bgbhArray.push(data.baogaobianhao))
//
// 116 218 3
if (bgbhArray.indexOf(this.baogaobianhao) < 0) {
if (this.isJd) {
// 16
this.server.defaults.headers.common['projectMark'] = 'OLD'
this.server({
url: '/archive/report/getReportByBgbh/' + this.baogaobianhao,
method: 'get'
}).then(data => {
this.server.defaults.headers.common['projectMark'] = ''
if (data != null && data !== '') {
this.addJdData()
} else {
// 18
this.server({
url: '/archive/ysjl/getYsjlByBgbh/' + this.baogaobianhao,
method: 'get'
}).then(data => {
if (data != null && data !== '') {
this.$message.error('请选择机电类纸质报告进行扫描!')
this.baogaobianhao = ''
} else {
this.addUnknownData()
}
})
}
}).catch(() => {
this.baogaobianhao = ''
this.server.defaults.headers.common['projectMark'] = ''
})
} else if (this.isCy) {
// 18
this.server({
url: '/archive/ysjl/getYsjlByBgbh/' + this.baogaobianhao,
method: 'get'
}).then(data => {
if (data != null && data !== '') {
this.addCyData()
} else {
// 16
this.server.defaults.headers.common['projectMark'] = 'OLD'
this.server({
url: '/archive/report/getReportByBgbh/' + this.baogaobianhao,
method: 'get'
}).then(data => {
this.server.defaults.headers.common['projectMark'] = ''
if (data != null && data !== '') {
this.$message.error('请选择承压类纸质报告进行扫描!')
this.baogaobianhao = ''
} else {
this.addUnknownData()
}
}).catch(() => {
this.baogaobianhao = ''
this.server.defaults.headers.common['projectMark'] = ''
})
}
}).catch(() => {
this.baogaobianhao = ''
})
} else {
this.unknownScan()
}
} else {
this.baogaobianhao = ''
}
this.baogaobianhao = ''
}
},
//
unknownScan() {
/**
* 查询报告
*/
getYsjlByBgbh() {
// 18
this.server({
url: '/archive/ysjl/getYsjlByBgbh/' + this.baogaobianhao,
method: 'get'
}).then(data => {
if (data != null && data !== '') {
this.isCy = true
this.addCyData(data)
} else {
// 16
this.server.defaults.headers.common['projectMark'] = 'OLD'
this.server({
url: '/archive/report/getReportByBgbh/' + this.baogaobianhao,
method: 'get'
}).then(data => {
this.server.defaults.headers.common['projectMark'] = ''
if (data != null && data !== '') {
this.isJd = true
this.addJdData(data)
} else {
this.addUnknownData()
}
}).catch(() => {
this.server.defaults.headers.common['projectMark'] = ''
this.baogaobianhao = ''
this.paramList.unshift({
id: data.id,
baogaobianhao: data.baogaobianhao,
shebeizhonglei: data.shebeizhonglei,
shiyongdanwei: data.shiyongdanwei,
zhucedaima: data.zhucedaima,
shiyongdengjibianhao: data.shiyongdengjibianhao,
chanpinbianhao: data.chanpinbianhao
})
}
}).catch(() => {
this.baogaobianhao = ''
})
this.baogaobianhao = ''
},
//
handlePaste() {
return false
},
addUnknownData() {
this.server({
url: '/archive/archive/checkArchiveState/' + this.baogaobianhao,
method: 'get'
}).then(() => {
this.paramList.unshift({ baogaobianhao: this.baogaobianhao })
this.baogaobianhao = ''
}).catch(() => {
this.baogaobianhao = ''
})
},
addCyData(data) {
this.paramList.unshift({
id: data.id,
baogaobianhao: data.baogaobianhao,
shebeizhonglei: data.shebeizhonglei,
shiyongdanwei: data.shiyongdanwei,
zhucedaima: data.zhucedaima,
shiyongdengjibianhao: data.shiyongdengjibianhao,
chanpinbianhao: data.chanpinbianhao
})
this.baogaobianhao = ''
},
addJdData(data) {
this.paramList.unshift({
annalid: data.annalid,
baogaobianhao: data.baogaobianhao,
shebeizhonglei: data.shebeizhonglei,
shiyongdanwei: data.shiyongdanwei,
zhucedaima: data.zhucedaima,
shiyongdengjibianhao: data.shiyongdengjibianhao,
chanpinbianhao: data.chanpinbianhao
})
this.baogaobianhao = ''
},
//
doSubmit() {
let archiveParamList = Object.assign([], this.paramList)
if (this.isEdit) {
if (this.isAppend) {
archiveParamList = archiveParamList.filter(archiveParam => !archiveParam.archiveId)
}
if (!this.archive.frameNum) {
@ -269,62 +156,20 @@ export default {
if (valid) {
this.archive.archiveUser = this.$store.getters.nickname
this.archive.archiveCount = this.paramList.length
if (this.isCy) {
this.server({
url: '/archive/archive/addNew',
method: 'post',
data: {
archive: this.archive,
params: archiveParamList,
isEdit: this.isEdit
}
}).then(() => {
this.$message.success('添加成功。')
Utils.$emit('archive-list')
this.dialog = false
})
} else if (this.isJd) {
this.server({
url: '/archive/archive/addOld',
method: 'post',
data: {
archive: this.archive,
params: archiveParamList,
isEdit: this.isEdit
}
}).then(() => {
this.server.defaults.headers.common['projectMark'] = 'OLD'
archiveParamList = archiveParamList.filter(archiveParam => archiveParam.annalid)
this.server({
url: '/archive/report/updateReportState',
method: 'post',
data: {
params: archiveParamList
}
}).then(() => {
this.$message.success('添加成功。')
this.dialog = false
this.$nextTick(() => {
this.server.defaults.headers.common['projectMark'] = ''
Utils.$emit('archive-list')
})
})
})
} else {
this.server({
url: '/archive/archive/addOld',
method: 'post',
data: {
archive: this.archive,
params: archiveParamList,
isEdit: this.isEdit
}
}).then(() => {
this.$message.success('添加成功。')
this.dialog = false
Utils.$emit('archive-list')
})
}
this.server({
url: '/archive/archive/addNew',
method: 'post',
data: {
archive: this.archive,
params: archiveParamList,
isAppend: this.isAppend
}
}).then(() => {
this.$message.success('添加成功。')
Utils.$emit('archive-list')
this.dialog = false
})
} else {
return false
}

28
src/views/archive/list.vue

@ -3,19 +3,11 @@
<div class="filter-container">
<sticky style="margin-bottom: 10px;">
<div class="sub-navbar">
<el-button type="primary" icon="el-icon-collection" @click="showCyDialog">
承压类归档
</el-button>
<el-button type="primary" icon="el-icon-collection" @click="showJdDialog">
机电类归档
</el-button>
<el-button type="primary" @click="showScanDialog">
<svg-icon icon-class="scan" />
扫码归档
</el-button>
<ArchiveNew ref="archive_new" :frame-nums="jianyijiahao" :sbzl-list="sbzlList" />
<ArchiveOld ref="archive_old" :frame-nums="jianyijiahao" :sbzl-list="sbzlList" />
<ArchiveScan :id="archiveId" ref="archive_scan" :frame-nums="jianyijiahao" :is-edit="isEdit" />
<ArchiveScan :id="archiveId" ref="archive_scan" :frame-nums="jianyijiahao" :is-append="isAppend" />
<ArchiveInfo :id="archiveId" ref="archive_info" />
</div>
</sticky>
@ -85,13 +77,11 @@
<script>
import Sticky from '@/components/Sticky'
import Pagination from '@/components/Pagination'
import ArchiveNew from './archive_new'
import ArchiveOld from './archive_old'
import ArchiveInfo from './archive_info'
import ArchiveScan from './archive_scan'
export default {
name: 'ArchiveReport',
components: { Sticky, Pagination, ArchiveNew, ArchiveOld, ArchiveInfo, ArchiveScan },
components: { Sticky, Pagination, ArchiveInfo, ArchiveScan },
data() {
return {
totalCount: 0,
@ -104,7 +94,7 @@ export default {
sbzlList: [],
archiveId: 0,
jianyijiahao: [],
isEdit: false
isAppend: false
}
},
created() {
@ -161,16 +151,8 @@ export default {
handleSelectionChange: function(val) {
this.multipleSelection = val
},
showCyDialog() {
this.$refs.archive_new.dialog = true
this.$refs.archive_new.doInit()
},
showJdDialog() {
this.$refs.archive_old.dialog = true
this.$refs.archive_old.doInit()
},
showScanDialog() {
this.isEdit = false
this.isAppend = false
this.$refs.archive_scan.dialog = true
this.$refs.archive_scan.doInit()
},
@ -180,7 +162,7 @@ export default {
this.$refs.archive_info.doInit()
},
showAddDialog(id) {
this.isEdit = true
this.isAppend = true
this.archiveId = id
this.$refs.archive_scan.dialog = true
this.$refs.archive_scan.doInit()

Loading…
Cancel
Save