Browse Source

提取打印回执单功能

master
李磊 3 years ago
parent
commit
219abf188d
  1. 36
      src/service/bjdService.js
  2. 20
      src/views/bjd/dj_input.vue
  3. 30
      src/views/bjd/dj_list.vue
  4. 10
      src/views/bjd/jj_input.vue
  5. 30
      src/views/bjd/jj_list.vue

36
src/service/bjdService.js

@ -1,5 +1,7 @@
import XLSX from 'xlsx' import XLSX from 'xlsx'
import common from '@/utils/common' import common from '@/utils/common'
import qs from 'qs'
import preview from '@/utils/preview'
export default { export default {
/** /**
@ -101,5 +103,39 @@ export default {
} }
reader.readAsArrayBuffer(file) reader.readAsArrayBuffer(file)
loading.close() loading.close()
},
/**
* 批量打印回执单
*
* @param bjdIds 报检单主键数组
* @return {Promise<AxiosResponse<any>>}
*/
batchPrintHzd(bjdIds) {
return new Promise(resolve => {
preview({
url: '/print/batchGeneratePdfHzd',
method: 'get',
params: {
bjdIds: bjdIds
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
preview({
url: '/print/createXmlOther',
method: 'post',
params: {
ids: bjdIds,
type: 'HZD'
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
resolve(data)
})
})
})
} }
} }

20
src/views/bjd/dj_input.vue

@ -2352,25 +2352,7 @@ export default {
Utils.$emit('allot-list') Utils.$emit('allot-list')
if (audit) { if (audit) {
this.$message({ message: '审核成功', type: 'success' }) this.$message({ message: '审核成功', type: 'success' })
// this.deleteCurrentView()
if (this.$store.getters.departmentId !== 75) {
this.$confirm('是否打印回执单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.printHzd()
})
.catch(() => {
this.$store.dispatch('delCurrentViews', {
view: this.$route,
$router: this.$router
})
})
} else {
this.deleteCurrentView()
}
// //
this.apisjse({ this.apisjse({
url: '/baseInfo/updateStateAndRiqiByIds', url: '/baseInfo/updateStateAndRiqiByIds',

30
src/views/bjd/dj_list.vue

@ -527,33 +527,9 @@ export default {
}) })
return false return false
} }
const arr = this.$refs.bjdList.selection.map((bjd) => { const bjdIds = this.$refs.bjdList.selection.map(bjd => bjd.id)
return bjd.id this.bjdService.batchPrintHzd(bjdIds).then((data) => {
}) this.printbutton = 'ReportPrintApp://' + data
console.log(arr)
this.preview({
url: '/print/batchGeneratePdfHzd',
method: 'get',
params: {
bjdIds: arr
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
this.preview({
url: '/print/createXmlOther',
method: 'post',
params: {
ids: arr,
type: 'HZD'
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
this.printbutton = 'ReportPrintApp://' + data
})
}) })
}, },
// //

10
src/views/bjd/jj_input.vue

@ -1411,16 +1411,8 @@ export default {
Utils.$emit('bjd-list') Utils.$emit('bjd-list')
Utils.$emit('allot-list') Utils.$emit('allot-list')
if (audit) { if (audit) {
this.$store.dispatch('delCurrentViews', { this.deleteCurrentView()
view: this.$route,
$router: this.$router
})
this.$message({ message: '审核成功', type: 'success' }) this.$message({ message: '审核成功', type: 'success' })
if (this.bjd.dataSource === 1) {
this.smsSendResult('已通过', '根据施工进度', '【申请现场检验】')
// ${project}${status}${action}${action1}${phone}
// 43[]:89738113
}
} else { } else {
this.tableData = data.renwus this.tableData = data.renwus
for (const tableObj of this.tableData) { for (const tableObj of this.tableData) {

30
src/views/bjd/jj_list.vue

@ -413,33 +413,9 @@ export default {
this.$message({ message: '请选择至少一条数据进行打印!', type: 'error' }) this.$message({ message: '请选择至少一条数据进行打印!', type: 'error' })
return false return false
} }
const arr = this.$refs.bjdList.selection.map((bjd) => { const bjdIds = this.$refs.bjdList.selection.map((bjd) => bjd.id)
return bjd.id this.bjdService.batchPrintHzd(bjdIds).then((data) => {
}) this.printbutton = 'ReportPrintApp://' + data
console.log(arr)
this.preview({
url: '/print/batchGeneratePdfHzd',
method: 'get',
params: {
bjdIds: arr
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
this.preview({
url: '/print/createXmlOther',
method: 'post',
params: {
ids: arr,
type: 'HZD'
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then((data) => {
this.printbutton = 'ReportPrintApp://' + data
})
}) })
}, },
// //

Loading…
Cancel
Save