Commit 0417f9ea by wangweidong

Merge remote-tracking branch 'origin/dev' into dev

parents 7ca1d7dd 32ec1717
......@@ -14,5 +14,9 @@ export default {
http.post('soil/v1/entrust/page_report_check_his', data).then(res => res),
// 报告签发 历史任务分页列表
pageReportIssueHis: data =>
http.post('soil/v1/entrust/page_report_issue_his', data).then(res => res)
http.post('soil/v1/entrust/page_report_issue_his', data).then(res => res),
getExcelOriginalRecord: data =>
http
.post('soil/v1/original_record/get_excel_original_record?expId=' + data)
.then(res => res)
}
......@@ -9,8 +9,8 @@
</Spin>
</div>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="80">
<Form-item label="类别" prop="classType">
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95" inline class="inputBox">
<Form-item label="类别" prop="classType" style="width: 100%">
<!-- <Input v-model="formObj.classType" @on-keyup="_onKeyUp" name="classType" placeholder="请选择类别" icon="plus-circled"-->
<!-- ></Input>-->
<el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
......@@ -18,11 +18,51 @@
:key="index"></el-option>
</el-select>
</Form-item>
<Form-item label="别名" prop="alias">
<Input v-model="formObj.alias" name="alias" placeholder="请输入别名"></Input>
<Form-item label="原始记录名称" prop="alias" style="width: 100%">
<Input v-model="formObj.alias" name="alias" placeholder="请输入原始记录名称"></Input>
</Form-item>
<Form-item label="项目代号" prop="remark">
<Input v-model="formObj.remark" name="remark" placeholder="请输入项目代号"></Input>
<Form-item label="备注" prop="remark" style="width: 100%">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注"></Input>
</Form-item>
<Form-item label="样品开始行" prop="sampleBeginRow" class="width-48">
<el-input
v-model="formObj.sampleBeginRow"
@keydown.native="channelInputLimit"
name="sampleBeginRow"
type="number"
onmousewheel="return false"
placeholder="请输入样品开始行"
/>
</Form-item>
<Form-item label="样品开始列" prop="sampleBeginCol" class="width-48">
<el-input
v-model="formObj.sampleBeginCol"
@keydown.native="channelInputLimit"
name="sampleBeginCol"
type="number"
onmousewheel="return false"
placeholder="请输入样品开始列"
/>
</Form-item>
<Form-item label="样品合并数" prop="sampleMergerNum" class="width-48">
<el-input
v-model="formObj.sampleMergerNum"
@keydown.native="channelInputLimit"
name="sampleMergerNum"
type="number"
onmousewheel="return false"
placeholder="请输入样品合并数"
/>
</Form-item>
<Form-item label="模板样品数" prop="templateSampleNum" class="width-48">
<el-input
v-model="formObj.templateSampleNum"
@keydown.native="channelInputLimit"
name="templateSampleNum"
type="number"
onmousewheel="return false"
placeholder="请输入模板样品数"
/>
</Form-item>
</Form>
</div>
......@@ -62,19 +102,82 @@ const defVal = {
alias: '',
classType: '',
remark: '',
sampleBeginRow: '',
sampleBeginCol: '',
sampleMergerNum: '',
templateSampleNum: '',
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
const validatesampleBeginRow = (rule, value, callback) => {
if (this.formObj.sampleBeginRow === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
const validatesampleMergerNum = (rule, value, callback) => {
if (this.formObj.sampleMergerNum === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
const validatetemplateSampleNum = (rule, value, callback) => {
if (this.formObj.templateSampleNum === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
const validatesampleBeginCol = (rule, value, callback) => {
if (this.formObj.sampleBeginCol === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
return {
modalTitle: '添加',
modalTitle: '编辑',
formObj: defVal,
ruleValidate: {
alias: [{ required: true, message: '别名不能为空', trigger: 'blur' }],
remark: [
{ required: true, message: '项目代号不能为空', trigger: 'blur' }
alias: [
{ required: true, message: '模板名称不能为空', trigger: 'blur' }
],
sampleBeginRow: [
{
required: true,
validator: validatesampleBeginRow,
message: '样品开始行不能为空',
trigger: 'blur'
}
],
sampleBeginCol: [
{
required: true,
validator: validatesampleBeginCol,
message: '样品开始列不能为空',
trigger: 'blur'
}
],
sampleMergerNum: [
{
required: true,
validator: validatesampleMergerNum,
message: '样品合并数不能为空',
trigger: 'blur'
}
],
templateSampleNum: [
{
required: true,
validator: validatetemplateSampleNum,
message: '模板样品数不能为空',
trigger: 'blur'
}
],
classType: [
{ required: true, message: '类别不能为空', trigger: 'blur' }
......@@ -82,10 +185,10 @@ export default {
},
typeList: [
{
value: '检定证书'
value: '力学'
},
{
value: '校准证书'
value: '物性'
}
],
id: '',
......@@ -102,11 +205,7 @@ export default {
},
methods: {
_onKeyUp() {
if (
this.formObj.alias === '' ||
this.formObj.classType === '' ||
this.formObj.remark === ''
) {
if (this.formObj.alias === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
......@@ -120,13 +219,32 @@ export default {
this.formObj.remark
}
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
_selectZtree() {
// this.$refs.ztreeModal._openZtree()
},
_cancel() {
this.showEditModal = false
},
_ok: async function() {
_ok() {
this.$refs.formObj.validate(valid => {
console.log('valid', valid)
if (valid) {
this._editOk()
} else {
this.$Message.error('请输入必填值')
}
})
},
_editOk: async function() {
const result = await soilAptitude.originalTemplateEdit({
id: this.id,
formObj: this.formObj
......@@ -145,6 +263,10 @@ export default {
this.formObj.alias = data.alias
this.formObj.remark = data.remark
this.formObj.classType = data.classType
this.formObj.sampleBeginRow = data.sampleBeginRow
this.formObj.sampleBeginCol = data.sampleBeginCol
this.formObj.sampleMergerNum = data.sampleMergerNum
this.formObj.templateSampleNum = data.templateSampleNum
this.modalTitle = '编辑模板'
console.log(this.id)
},
......@@ -196,4 +318,11 @@ export default {
clear: both;
display: block;
}
.inputBox >>> input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
.inputBox >>> input[type='number'] {
-moz-appearance: textfield !important;
}
</style>
......@@ -289,13 +289,15 @@ export default {
this.$nextTick(() => {
switch (res) {
case '编辑':
this.$refs.recordEditModal._openWithType(
data.originalRecordId,
'ENVTESTMAKEEDIT'
)
// this.$refs.recordEditModal._openWithType(
// data.originalRecordId,
// 'ENVTESTMAKEEDIT'
// )
this._recordEdit(data)
break
case '查看原始记录':
this._recordView(data.originalRecordId)
this._recordLook(data)
// this._recordView(data.originalRecordId)
break
case '查看试验项目':
this._itemView(data.id)
......@@ -318,6 +320,41 @@ export default {
}
})
},
_recordLook(data) {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this._recordView(data.originalRecordId)
}
},
_recordEdit(data) {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this.$refs.recordEditModal._openWithType(
data.originalRecordId,
'ENVTESTMAKEEDIT'
)
}
},
_reportMakeLook(data) {
console.log(data)
this._viewReport(data)
// const result = await soilReport.getExcelOriginalRecord(data.id)
// if (result) {
// this._viewReport(result)
// }
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
// 查看试验项目
_itemView(id) {
this.$refs.itemViewModal._open(id)
......
......@@ -55,11 +55,12 @@
<CollectManage ref="collectModal" @on-result-change="_page"></CollectManage>
<CollectFileManage ref="collectFileModal" @on-result-change="_page"></CollectFileManage>
<SelEquip ref="selEquip" @on-result-change="_equipResult"></SelEquip>
<CreateReport ref="createModal" @on-result-change="_certificateSelectExcelBack"></CreateReport>
</div>
</template>
<script>
import Global from '../../../../api/config'
import { soilTest } from '../../../../api'
import { soilReport, soilSample, soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/assignPerson'
import SelectOriTempRecord from '../SelectOriTempRecord'
import OriginalRecordEdit from '../OriginalRecordEdit'
......@@ -68,6 +69,7 @@ import SelEquip from '../../../../components/select-equip/SelEquip'
import EquipManage from '../EquipManage'
import CollectManage from '../CollectManage'
import CollectFileManage from '../CollectFileManage'
import CreateReport from '../../../soil-test-manage/test-input/item-tabs/CreateReport'
export default {
components: {
AssignPerson,
......@@ -77,7 +79,8 @@ export default {
SelEquip,
EquipManage,
CollectManage,
CollectFileManage
CollectFileManage,
CreateReport
},
data() {
return {
......@@ -117,6 +120,7 @@ export default {
],
btn: [
{ type: 'success', id: '', name: '填写原始记录' },
{ type: 'success', id: '', name: '原始记录填写' },
{ type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' }
],
......@@ -182,14 +186,15 @@ export default {
switch (res) {
case '查看原始记录':
console.log(data)
if (data.recordId) {
this.$refs.editModal._openWithType(
data.recordId,
'ENVTESTMAKEEDIT'
)
} else {
this.$Message.warning('未填写原始记录')
}
this._reportView(data)
// if (data.recordId) {
// this.$refs.editModal._openWithType(
// data.recordId,
// 'ENVTESTMAKEEDIT'
// )
// } else {
// this.$Message.warning('未填写原始记录')
// }
break
case '查看指标':
this._indexManage(data)
......@@ -206,6 +211,17 @@ export default {
}
})
},
_reportView(data) {
if (data.recorded === '是') {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this.$refs.editModal._openWithType(data.recordId, 'ENVTESTMAKEEDIT')
}
} else {
this.$Message.warning('未填写原始记录')
}
},
_collectManage(data) {
this.$refs.collectModal._open(data)
},
......@@ -401,6 +417,9 @@ export default {
case '填写原始记录':
this._addRecord()
break
case '原始记录填写':
this._makeCertificateExcelByTemp()
break
case '完成提交':
this._submitItem(this.selectData)
break
......@@ -432,6 +451,57 @@ export default {
break
}
},
_makeCertificateExcelByTemp(data) {
// this.$refs.SelectOriTempRecordExcel._open(data.id, data)
this.$refs.createModal._open()
},
_certificateSelectExcelBack(data) {
if (data) {
this.$refs.pageTable._showLoading()
this._makeCodeExcel(data)
} else {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
// this._appendOriginalRecord()
}
}
},
_makeCodeExcel: async function(data) {
console.log(this.selectIds)
console.log('----dddd---', data)
this.$refs.pageTable._hideLoading()
const result = await soilSample.generateExcelReport(data)
if (result) {
await this._page()
if (result === null || result === undefined) {
this.$Message.warning('证书编制失败,请联系管理员!')
this.$refs.pageTable._hideLoading()
return false
} else {
this.$emit('on-result-change')
this._viewReport(result)
}
}
},
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.getExcelOriginalRecord(data.id)
if (result) {
this._viewReport(result)
}
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
_selectEquipment() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
......
......@@ -152,7 +152,8 @@ export default {
)
break
case '查看原始记录':
this._recordView(data.originalRecordId)
this._reportView(data)
// this._recordView(data.originalRecordId)
break
case '查看试验项目':
this._itemView(data.id)
......@@ -167,6 +168,31 @@ export default {
_itemView(id) {
this.$refs.itemViewModal._open(id)
},
_reportView(data) {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this._recordView(data.originalRecordId)
}
},
_reportMakeLook(data) {
console.log(data)
this._viewReport(data)
// const result = await soilReport.getExcelOriginalRecord(data.id)
// if (result) {
// this._viewReport(result)
// }
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
// 查看原始记录
_recordView(originalRecordId) {
let recordUrl = ''
......
......@@ -2,7 +2,7 @@
<div>
<Modal v-model="showBatchModal" :mask-closable="false" width="900">
<p slot="header">
生成报告
原始记录填写
</p>
<div>
<!--内容-->
......
......@@ -60,7 +60,7 @@
</template>
<script>
import Global from '../../../../api/config'
import { soilSample, soilTest } from '../../../../api'
import { soilReport, soilSample, soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/assignPerson'
import SelectOriTempRecord from '../SelectOriTempRecord'
import OriginalRecordEdit from '../OriginalRecordEdit'
......@@ -131,6 +131,7 @@ export default {
],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
// { type: 'md-eye', id: '', name: '原始记录查看/编辑' },
{ type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-bookmarks', id: '', name: '查看采集数据' },
{ type: 'ios-browsers', id: '', name: '查看采集文件' },
......@@ -185,19 +186,23 @@ export default {
this.$nextTick(() => {
switch (res) {
case '查看原始记录':
console.log(data)
if (data.recordId) {
this.$refs.editModal._openWithType(
data.recordId,
'ENVTESTMAKEEDIT'
)
} else {
this.$Message.warning('未填写原始记录')
}
this._reportView(data)
// console.log(data)
// if (data.recorded === '是') {
// this.$refs.editModal._openWithType(
// data.recordId,
// 'ENVTESTMAKEEDIT'
// )
// } else {
// this.$Message.warning('未填写原始记录')
// }
break
case '查看指标':
this._indexManage(data)
break
case '原始记录查看/编辑':
this._reportMakeLook(data)
break
case '查看采集数据':
this._collectManage(data)
break
......@@ -210,6 +215,24 @@ export default {
}
})
},
_reportView(data) {
if (data.recorded === '是') {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this.$refs.editModal._openWithType(data.recordId, 'ENVTESTMAKEEDIT')
}
} else {
this.$Message.warning('未填写原始记录')
}
},
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.getExcelOriginalRecord(data.id)
if (result) {
this._viewReport(result)
}
},
_certificateSelectExcelBack(data) {
if (data) {
this.$refs.pageTable._showLoading()
......
......@@ -56,17 +56,19 @@
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<EquipManage ref="equipModal" @on-result-change="_page"></EquipManage>
<OriginalRecordEdit ref="editModal"></OriginalRecordEdit>
<CreateReport ref="createModal" @on-result-change="_certificateSelectExcelBack"></CreateReport>
</div>
</template>
<script>
import Global from '../../../../api/config'
import { soilTest } from '../../../../api'
import { soilReport, soilSample, soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/assignPerson'
import SelectOriTempRecord from '../SelectOriTempRecord'
import SelEquip from '../../../../components/select-equip/SelEquip'
import IndexManage from '../IndexManage'
import EquipManage from '../EquipManage'
import OriginalRecordEdit from '../OriginalRecordEdit'
import CreateReport from '../item-tabs/CreateReport'
export default {
components: {
AssignPerson,
......@@ -74,7 +76,8 @@ export default {
SelEquip,
IndexManage,
EquipManage,
OriginalRecordEdit
OriginalRecordEdit,
CreateReport
},
data() {
return {
......@@ -107,15 +110,9 @@ export default {
],
btn: [
{ type: 'success', id: '', name: '填写原始记录' },
{ type: 'success', id: '', name: '原始记录填写' },
{ type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
id: 'food-task-assign-plan-date',
name: '设置计划完成时间'
},
{ type: '', id: 'food-task-assign-maintain-info', name: '信息维护' }
{ type: 'success', id: '', name: '设备' }
],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
......@@ -318,6 +315,9 @@ export default {
case '填写原始记录':
this._addRecord()
break
case '原始记录填写':
this._makeCertificateExcelByTemp()
break
case '完成提交':
this._submitItem(this.selectData)
break
......@@ -349,6 +349,40 @@ export default {
break
}
},
_makeCertificateExcelByTemp(data) {
// this.$refs.SelectOriTempRecordExcel._open(data.id, data)
this.$refs.createModal._open()
},
_certificateSelectExcelBack(data) {
if (data) {
this.$refs.pageTable._showLoading()
this._makeCodeExcel(data)
} else {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
// this._appendOriginalRecord()
}
}
},
_makeCodeExcel: async function(data) {
console.log(this.selectIds)
console.log('----dddd---', data)
this.$refs.pageTable._hideLoading()
const result = await soilSample.generateExcelReport(data)
if (result) {
await this._page()
if (result === null || result === undefined) {
this.$Message.warning('证书编制失败,请联系管理员!')
this.$refs.pageTable._hideLoading()
return false
} else {
this.$emit('on-result-change')
this._viewReport(result)
}
}
},
_selectEquipment() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
......@@ -488,14 +522,15 @@ export default {
switch (res) {
case '查看原始记录':
console.log(data)
if (data.recordId) {
this.$refs.editModal._openWithType(
data.recordId,
'ENVTESTMAKEEDIT'
)
} else {
this.$Message.warning('未填写原始记录')
}
this._reportView(data)
// if (data.recordId) {
// this.$refs.editModal._openWithType(
// data.recordId,
// 'ENVTESTMAKEEDIT'
// )
// } else {
// this.$Message.warning('未填写原始记录')
// }
break
case '查看指标':
this._indexManage(data)
......@@ -506,6 +541,34 @@ export default {
}
})
},
_reportView(data) {
if (data.recorded === '是') {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this.$refs.editModal._openWithType(data.recordId, 'ENVTESTMAKEEDIT')
}
} else {
this.$Message.warning('未填写原始记录')
}
},
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.getExcelOriginalRecord(data.id)
if (result) {
this._viewReport(result)
}
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
_indexManage(data) {
this.$refs.indexModal._open(data)
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment