Commit 70e422db by lichengming

修改了报告编制

parent 5edd0b93
......@@ -154,5 +154,11 @@ export default {
http.post('/meter/v1/contract_attachment/preview/' + data).then(res => res),
// 委托附件预览
entrustPreview: data =>
http.post('/meter/v1/entrust_attachment/preview/' + data).then(res => res)
http.post('/meter/v1/entrust_attachment/preview/' + data).then(res => res),
// 余样操作日志分页列表
prepareRecordPage: data =>
http.post('soil/v1/prepare_record/page', data).then(res => res),
// 备样操作日志分页列表
backupRecordPage: data =>
http.post('soil/v1/sample_backup_record/page', data).then(res => res)
}
......@@ -88,6 +88,16 @@ export default {
this.formObj.entrustId = undefined
this._pageTask()
},
_openSurplus(samplePrepareId) {
this.showModal = true
this.formObj.samplePrepareId = samplePrepareId
this._pageSurplus()
},
_openBcakup(sampleBackupId) {
this.showModal = true
this.formObj.sampleBackupId = sampleBackupId
this._pageBackup()
},
_page: async function() {
console.log('要传的参数')
console.log(this.formObj)
......@@ -102,6 +112,22 @@ export default {
// this.$serializeFormSearch(this.formObj)
// )
},
_pageSurplus: async function() {
const result = await meterEntrust.prepareRecordPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
}
},
_pageBackup: async function() {
const result = await meterEntrust.backupRecordPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
}
},
_pageTask: async function() {
console.log('要传的参数')
console.log(this.formObj)
......
......@@ -21,7 +21,7 @@
</Col>
<!--操作-->
<Col span="24">
<btn-list :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
<btn-list :open="searchOpen" :msg="btn" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!-- 表格 -->
......@@ -60,6 +60,7 @@
</Modal>
<ItemOriginalRecordEdit ref="recordEditModal"></ItemOriginalRecordEdit>
<ItemView ref="itemViewModal"></ItemView>
<ReportTemplateModal ref="templateModal" @on-result-change="_page"></ReportTemplateModal>
</div>
</template>
<script>
......@@ -70,27 +71,20 @@ import Global from '../../../api/config'
import { soilTest } from '../../../api'
import ItemOriginalRecordEdit from './OriginalRecordEdit'
import ItemView from './ItemView'
import ReportTemplateModal from './ReportTemplateModal'
export default {
components: {
ItemOriginalRecordEdit,
ItemView
ItemView,
ReportTemplateModal
},
data() {
return {
currentComponent: '',
getPage: {},
showModal: false,
btn: [
{
type: '',
id: '',
name: '纠正填写时间',
componentName: 'EditDateModal'
},
{ type: '', id: '', name: '设置填写人乙' },
{ type: 'error', id: '', name: '删除' }
],
btn: [{ type: 'primary', id: '', name: '生成报告' }],
selectIds: [],
iconMsg: [
{
......@@ -223,6 +217,9 @@ export default {
case '设置填写人乙':
this._setAnotherTester()
break
case '生成报告':
this._reportMake()
break
case '删除':
this._batchDelete()
break
......@@ -232,6 +229,13 @@ export default {
}
})
},
_reportMake(data) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.templateModal._open(this.selectIds)
}
},
// 设置填写人乙
_setAnotherTester() {
if (this.selectIds.length === 0) {
......
<template>
<div>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" is-radio>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</template>
<script>
import global from '../../../api/config'
export default {
components: {},
data() {
return {
tableHeight: '400',
pageColumns: [{ title: '报告模板名称', key: 'name' }],
getPage: {},
modalTitle: '报告模板',
tempId: ''
}
},
methods: {
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.SysFileTemplate.page
if (this.tempId) {
this.$refs.pageTable.templateRadio = this.tempId
this.$emit('on-result-change', { id: this.tempId })
}
break
case 'radioSelect':
this.$emit('on-result-change', data)
break
default:
this._page()
}
},
_open(tempId) {
this.tempId = tempId || ''
// this._page()
},
_page() {
this.$refs.pageTable._page(
'report-template-list',
'SysFileTemplate/page',
{
classifyName: '食品报告模板',
service: global.getCode()
}
)
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="900" class="zIndex-1200">
<p slot="header">选择报告模板</p>
<div>
<ReportTemplate ref="reportTemplate" @on-result-change="_templateResultChange"></ReportTemplate>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import ReportTemplate from './ReportTemplate'
/**
* 重新生成的报告选择模板
*/
export default {
components: {
ReportTemplate
},
data() {
return {
showModal: false,
selectData: {},
footerList: [
{ type: '', id: '', name: '取消' },
{ type: 'primary', id: '', name: '确定' }
],
data: {}
}
},
methods: {
_open(data) {
this.showModal = true
this.$refs.footerModal._hideLoading()
this.data = data
this.$refs.reportTemplate._open(data.tempId)
},
_templateResultChange(selectData) {
this.selectData = selectData
},
_footerResult(name) {
switch (name) {
case '确定':
this.$emit('on-result-change', {
id: this.data.id,
tempId: this.selectData.id,
reportBatch: this.data.reportBatch
})
this.showModal = false
break
case '取消':
this.showModal = false
break
}
}
}
}
</script>
......@@ -122,6 +122,7 @@
</div>
</div>
<SampleParpareApply ref="applyModal" @on-result-change="_page"></SampleParpareApply>
<Operation ref="recordModal"></Operation>
</div>
</template>
<script>
......@@ -130,10 +131,12 @@ import SampleParpareApply from '../SampleParpareApply'
// eslint-disable-next-line no-unused-vars
import http from '../../../../api/http'
import { soilEntrust, soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
export default {
components: {
AutoCompletes,
SampleParpareApply
SampleParpareApply,
Operation
},
data() {
return {
......@@ -180,9 +183,13 @@ export default {
}
],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit
{ type: 'md-create', id: '', name: '编辑' }, // food-sample-prepare-edit
{ type: 'ios-clock', id: '', name: '操作日志' } // food-sample-prepare-edit
],
iconMsgSave: [
{ type: 'ios-checkmark', id: '', name: '保存' },
{ type: 'ios-clock', id: '', name: '操作日志' }
],
iconMsgSave: [{ type: 'ios-checkmark', id: '', name: '保存' }],
pageColumns: [
{ title: '委托商', key: 'client', width: 180 },
{ title: '委托编号', key: 'entrustCode', width: 180 },
......@@ -315,6 +322,9 @@ export default {
case '编辑':
this.editIndex = index
break
case '操作日志':
this._record(data.id)
break
case '保存':
console.log('保存')
// if (data.endDate !== '') {
......@@ -326,6 +336,9 @@ export default {
break
}
},
_record(id) {
this.$refs.recordModal._openBcakup(id)
},
_locChange(msg, data) {
switch (msg) {
case 'select':
......
......@@ -8,26 +8,14 @@
<Col span="24">
<Form id="search-form-query" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="样品编号:">
<Input @on-enter="_formSearch" name="sampleSn" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-item" label="样品名称:">
<Input @on-enter="_formSearch" name="sampleName" placeholder="请输入样品名称" clearable/>
</Form-item>
<Form-item class="search-item" label="存储位置:">
<Input @on-enter="_formSearch" name="backupPlace" placeholder="请输入存储位置" clearable/>
</Form-item>
<Form-item class="search-item" label="存储期限:">
<Date-picker @on-change="_dateChange" :editable="false" type="daterange" split-panels
style="width:100%;" placeholder="请选择存储期限"></Date-picker>
<input v-model="endDateBegin" type="hidden" name="endDateBegin">
<input v-model="endDateEnd" type="hidden" name="endDateEnd">
<Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-item" label="委托单位:" style="margin-left: 8px;">
<Input @on-enter="_formSearch" name="cname" placeholder="请输入委托单位" clearable/>
<Input @on-enter="_formSearch" v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托名称:">
<Input @on-enter="_formSearch" name="contractName" placeholder="请输入委托名称" clearable/>
<Form-item class="search-item" label="委托编号:" style="margin-left: 8px;">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -40,30 +28,8 @@
</Col>
<!-- 表格 -->
<Col span="24">
<!--<ElementTable :tableHeight="tableHeight" @on-result-change="_tableResultChange"-->
<!--ref="pageTable" :getPage="getPage" id="perSampleQuery" selectData>-->
<!--<el-table-column-->
<!--show-overflow-tooltip-->
<!--sortable-->
<!--:prop="item.key"-->
<!--:label="item.title"-->
<!--:width="item.width"-->
<!--:min-width="200"-->
<!--:fixed="item.fixed?item.fixed:undefined"-->
<!--v-for="item in pageColumns" :key="item.key">-->
<!--<template slot-scope="scope">-->
<!--<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>-->
<!--<a v-else-if="item.key==='sampleSn'"-->
<!--@click.stop="_sampleDetailModal(scope.row)">{{scope.row[item.key]}}</a>-->
<!--<div v-else-if="item.key==='progress'">-->
<!--{{scope.row[item.key]===undefined?'':scope.row[item.key].display}}-->
<!--</div>-->
<!--<div v-else>{{scope.row[item.key]}}</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</ElementTable>-->
<PTVXETable id="perSampleQuery" ref="pageTable"
:tableHeight="tableHeight" @on-result-change="_tableResultChange" :getPage="getPage" select-data>
:tableHeight="tableHeight" :icon-msg="iconMsg" @on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
:field="item.key"
:title="item.title"
......@@ -89,18 +55,23 @@
</Row>
</div>
</div>
<Operation ref="recordModal"></Operation>
</div>
</template>
<script>
import { soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
export default {
components: {},
components: { Operation },
data() {
return {
currentComponent: '',
selectIds: [],
formObj: {},
formObj: {
entrustCode: '',
client: '',
sampleCode: ''
},
btn: [
// { type: '', id: '', name: '导出' },
{
......@@ -109,6 +80,13 @@ export default {
name: '导出样品贮存表'
}
],
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
pageColumns: [
{ title: '委托商', key: 'client', width: 180 },
{ title: '委托编号', key: 'entrustCode', width: 180 },
......@@ -144,7 +122,6 @@ export default {
methods: {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilSample.pageBackupHis(
this.$serializeForm(this.formObj)
)
......@@ -159,6 +136,9 @@ export default {
this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'selectData':
this.selectData = data
this.selectIds = []
......@@ -173,6 +153,19 @@ export default {
// this._page();
}
},
_iconClick(res, data, componentName, index) {
this.currentIndex = index
switch (res) {
case '操作日志':
this._record(data.id)
break
default:
this._page()
}
},
_record(id) {
this.$refs.recordModal._openBcakup(id)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
......
......@@ -107,6 +107,7 @@
</div>
</div>
<SampleParpareApply ref="applyModal" @on-result-change="_page"></SampleParpareApply>
<Operation ref="recordModal"></Operation>
</div>
</template>
<script>
......@@ -115,10 +116,12 @@ import AutoCompletes from '../../../../components/base/AutoCompletes'
// eslint-disable-next-line no-unused-vars
import http from '../../../../api/http'
import { soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
export default {
components: {
AutoCompletes,
SampleParpareApply
SampleParpareApply,
Operation
},
data() {
return {
......@@ -166,7 +169,8 @@ export default {
}
],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit
{ type: 'md-create', id: '', name: '编辑' }, // food-sample-prepare-edit
{ type: 'ios-clock', id: '', name: '操作日志' }
],
iconMsgSave: [{ type: 'ios-checkmark', id: '', name: '保存' }],
pageColumns: [
......@@ -288,6 +292,9 @@ export default {
_iconClick(res, data, componentName, index) {
this.currentIndex = index
switch (res) {
case '操作日志':
this._record(data.id)
break
case '编辑':
this.editIndex = index
break
......@@ -302,6 +309,9 @@ export default {
break
}
},
_record(id) {
this.$refs.recordModal._openSurplus(id)
},
_locChange(msg, data) {
switch (msg) {
case 'select':
......
......@@ -8,26 +8,14 @@
<Col span="24">
<Form id="search-form-query" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="样品编号:">
<Input @on-enter="_formSearch" name="sampleSn" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-item" label="样品名称:">
<Input @on-enter="_formSearch" name="sampleName" placeholder="请输入样品名称" clearable/>
</Form-item>
<Form-item class="search-item" label="存储位置:">
<Input @on-enter="_formSearch" name="backupPlace" placeholder="请输入存储位置" clearable/>
</Form-item>
<Form-item class="search-item" label="存储期限:">
<Date-picker @on-change="_dateChange" :editable="false" type="daterange" split-panels
style="width:100%;" placeholder="请选择存储期限"></Date-picker>
<input v-model="endDateBegin" type="hidden" name="endDateBegin">
<input v-model="endDateEnd" type="hidden" name="endDateEnd">
</Form-item>
<Form-item class="search-item" label="委托单位:" style="margin-left: 8px;">
<Input @on-enter="_formSearch" name="cname" placeholder="请输入委托单位" clearable/>
<Input @on-enter="_formSearch" v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托名称:">
<Input @on-enter="_formSearch" name="contractName" placeholder="请输入委托名称" clearable/>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托名称" clearable/>
</Form-item>
<Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入委托名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -63,7 +51,7 @@
<!--</el-table-column>-->
<!--</ElementTable>-->
<PTVXETable id="perSampleQuery" ref="pageTable"
:tableHeight="tableHeight" @on-result-change="_tableResultChange" :getPage="getPage" select-data>
:tableHeight="tableHeight" :icon-msg="iconMsg" @on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
:field="item.key"
:title="item.title"
......@@ -89,18 +77,30 @@
</Row>
</div>
</div>
<Operation ref="recordModal"></Operation>
</div>
</template>
<script>
import { soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
export default {
components: {},
components: { Operation },
data() {
return {
currentComponent: '',
selectIds: [],
formObj: {},
formObj: {
client: '',
entrustCode: '',
sampleCode: ''
},
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
btn: [
// { type: '', id: '', name: '导出' },
{
......@@ -150,6 +150,9 @@ export default {
this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'selectData':
this.selectData = data
this.selectIds = []
......@@ -164,6 +167,19 @@ export default {
// this._page();
}
},
_iconClick(res, data, componentName, index) {
this.currentIndex = index
switch (res) {
case '操作日志':
this._record(data.id)
break
default:
this._page()
}
},
_record(id) {
this.$refs.recordModal._openSurplus(id)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
......
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