Commit eb9a56bf by zhangmengqi

Merge branch 'dev'

parents c38bd9e8 1e9c5c4f
...@@ -34,5 +34,25 @@ export default { ...@@ -34,5 +34,25 @@ export default {
reportDelete: data => reportDelete: data =>
http.delete('soil/v1/report/?ids=' + data).then(res => res), http.delete('soil/v1/report/?ids=' + data).then(res => res),
generateAppendix: data => generateAppendix: data =>
http.post('soil/v1/exp_report/generate_appendix', data).then(res => res) http.post('soil/v1/exp_report/generate_appendix', data).then(res => res),
itemReportMerge: data =>
http.post('soil/v1/exp_report/item_report_merge', data).then(res => res),
backExpReportCheckBack: data =>
http
.post(
'soil/v1/exp_report/back_exp_report_check?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
backExpReportIssueBack: data =>
http
.post(
'soil/v1/exp_report/back_exp_report_issue?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res)
} }
...@@ -226,6 +226,10 @@ export default { ...@@ -226,6 +226,10 @@ export default {
http http
.post('soil/v1/experiment/save_excel_original_record', data) .post('soil/v1/experiment/save_excel_original_record', data)
.then(res => res), .then(res => res),
saveSeniorExcelOriginalRecord: data =>
http
.post('soil/v1/experiment/save_senior_excel_original_record', data)
.then(res => res),
saveExcelOpenSoilRecord: data => saveExcelOpenSoilRecord: data =>
http http
.post('soil/v1/experiment/save_excel_open_soil_record', data) .post('soil/v1/experiment/save_excel_open_soil_record', data)
......
...@@ -65,6 +65,8 @@ export default { ...@@ -65,6 +65,8 @@ export default {
http.post('soil/v1/experiment/page_exp_allot_his', data).then(res => res), http.post('soil/v1/experiment/page_exp_allot_his', data).then(res => res),
pageTestByExp: data => pageTestByExp: data =>
http.post('soil/v1/experiment/page_test_by_exp', data).then(res => res), http.post('soil/v1/experiment/page_test_by_exp', data).then(res => res),
pageDocumentByExp: data =>
http.post('soil/v1/experiment/page_document_by_exp', data).then(res => res),
pagePrepareByExp: data => pagePrepareByExp: data =>
http.post('soil/v1/experiment/page_prepare_by_exp', data).then(res => res), http.post('soil/v1/experiment/page_prepare_by_exp', data).then(res => res),
pageExperimentTest: data => pageExperimentTest: data =>
...@@ -81,6 +83,16 @@ export default { ...@@ -81,6 +83,16 @@ export default {
JSON.stringify(data.obj) JSON.stringify(data.obj)
) )
.then(res => res), .then(res => res),
pageDocumentTestBath: data =>
https
.post(
'soil/v1/experiment/page_document_test_bath?page=' +
data.page +
'&rows=' +
data.rows,
JSON.stringify(data.obj)
)
.then(res => res),
pageExperimentCheckBath: data => pageExperimentCheckBath: data =>
https https
.post( .post(
......
<template>
<div>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24" style="margin-bottom: -10px">
<Form :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="文件名称:">
<Input v-model="fileName" @on-enter="_pageChange(1)" placeholder="请输入文件名称" style="width:200px" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<FilesListView ref="fileModal" @on-result-change="_fileData"></FilesListView>
</Col>
</Row>
</div>
</div>
</template>
<script>
import global from '../../../api/config'
import FilesListView from './FilesListView'
export default {
components: {
FilesListView
},
data() {
return {
selectIds: [],
getPage: {},
pageParams: {
page: 1,
rows: 20
},
downloadFileUrl: '',
fileName: '',
// id
salesId: '',
contractId: '',
sampleId: '',
subcontractorId: '',
// 用于区分是哪种附件(合同、委托、样品)
idKey: ''
}
},
methods: {
_open(data, key) {
this.fileName = ''
switch (key) {
case 'contractId':
this.salesId = ''
this.contractId = data.id
this.sampleId = ''
this.subcontractorId = ''
this.idKey = 'contractId'
break
}
this.$emit('on-result-change')
this.downloadFileUrl = data.downloadFileUrl
this.$refs.fileModal._fileViewData(data, this.idKey)
},
_openFile(pageData) {
this.getPage = pageData
this.$refs.fileModal._open(pageData, '300')
},
_page(uri) {
this.$store.dispatch(uri, this._searchParams()).then(() => {
this.$emit('on-result-change', 'file-page', '')
})
},
_pageChange(page) {
this.pageParams.page = page
this.$emit('on-result-change')
},
_pageSizeChange(rows) {
this.pageParams.rows = rows
this.$emit('on-result-change')
},
_search() {
this.$emit('on-result-change')
},
_searchParams() {
const data = {
page: this.pageParams.page,
rows: this.pageParams.rows
}
if (this.fileName) {
Object.assign(data, { fileName: this.fileName })
}
// 委托id
if (this.contractId) {
Object.assign(data, { contractId: this.contractId })
}
return data
},
// 下载
_download(id) {
window.open(global.baseURL + this.downloadFileUrl + id, '_blank')
},
_fileData(msg, data) {
switch (msg) {
case 'down':
this._download(data)
break
case 'page':
this._pageChange(data)
break
case 'rows':
this._pageSizeChange(data)
break
}
}
}
}
</script>
<template>
<div>
<Row>
<!--操作-->
<Col span="24" style="margin-bottom: 10px">
<div class="btns-menu">
<!--表格-->
<Button v-for="item in menusList" :key="item.name" @click="_tableChange(item.value)"
v-if="viewStyle === 1" type="ghost" style="margin-right: 5px">&nbsp;{{item.name}}
</Button>
</div>
</Col>
<Col span="24">
<!-- 默认是详细模式 -->
<div v-if="viewStyle === 1">
<el-table
ref="moveTable"
:data="getPage.records"
:height="tableHeight"
v-loading="loading"
@select-all="_selectAll"
@selection-change="_selectRowChange"
@cell-click="_cellClick"
:row-class-name="_tableRowClassName"
stripe
border
size="small"
style="width: 100%"
>
<el-table-column
type="selection"
width="55"
fixed="left"
align="center">
</el-table-column>
<el-table-column
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
v-for="item in pageColumns"
:key="item.key" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
<el-table-column
title="操作"
align="center"
width="100"
fixed="right">
<template slot-scope="scope">
<IconList :msg="(scope.row['type'] === 'jpg' || scope.row['type'] === 'png')?iconMsg:iconMsgDis"
@on-result-change="_iconClick" :rowData="scope.row"></IconList>
</template>
</el-table-column>
</el-table>
<Page :total="getPage.total" :page-size="getPage.size" :current="getPage.current" @on-change="_pageChange"
@on-page-size-change='_pageSizeChange'
placement="top" show-elevator show-total show-sizer style="margin-top: 10px;"></Page>
</div>
<!--/-->
<!--缩略图 模式-->
<div v-else-if="viewStyle === 2">
<ul :style="{ 'height': tableHeight + 'px' }" class="thumbnailStyle">
<CheckboxGroup @on-change="_chkVal" v-model="selectIds">
<li v-for="item in getPage.records" :key="item.id">
<div class="thumbnailStyleImg">
<Tooltip placement="top">
<img :src=" bigUrl+item.type+'.png' "/>
<div slot="content" style="white-space: normal">
<p>名称:{{item.fileName}}</p>
</div>
</Tooltip>
</div>
<div class="thumbnailStyleCheck clearCheck">
<Checkbox :label="item.id"><span class="inline-span" style="display: inline">{{item.fileName}}</span>
</Checkbox>
</div>
</li>
</CheckboxGroup>
</ul>
<div style="margin-top: 10px">共 {{getPage.total}} 条</div>
</div>
<!--/-->
<!--列表 模式-->
<div v-else="viewStyle === 3">
<ul :style="{ 'height': tableHeight + 'px' }" class="listStyle">
<CheckboxGroup @on-change="_chkVal" v-model="selectIds">
<li v-for="item in getPage.records" :key="item.id">
<div class="listStyleCheck clearCheck">
<Tooltip placement="top">
<span class="spanImg">
<img :src=" smallUrl+item.type+'.png' "/>
</span>
<span>
<Checkbox :label="item.id"><span>{{item.fileName}}</span></Checkbox>
</span>
<div slot="content" style="white-space: normal">
<p>名称:{{item.fileName}}</p>
</div>
</Tooltip>
</div>
</li>
</CheckboxGroup>
</ul>
<div style="margin-top: 10px">共 {{getPage.total}} 条</div>
</div>
<!--/-->
</Col>
</Row>
<!--图片预览-->
<div>
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex"
@close="imgViewIndex = null"></vue-gallery-slideshow>
</div>
</div>
</template>
<script>
import VueGallerySlideshow from 'vue-gallery-slideshow'
import IconList from '../../base/IconList'
import global from '../../../api/config'
/* 样品附件--只读-附属 */
export default {
components: { IconList, VueGallerySlideshow },
data() {
return {
loading: false,
iconMsg: [
{ type: 'ios-download', id: '', name: '下载' },
{ type: 'images', id: '', name: '预览' }
],
iconMsgDis: [
{ type: 'ios-download', id: '', name: '下载' },
{ type: 'images', id: '', name: '预览', disabled: true }
],
selectIds: [],
getPage: {},
pageParams: {
rows: 20
},
pageColumns: [
{ title: '文件名', key: 'fileName' },
{ title: '类型', key: 'type', width: 120 },
{ title: '上传时间', key: 'ctime', width: 140, dateTime: true }
// {title: '上传人', key: 'cname', width: 120},
],
viewVal: 1,
viewStyle: 1,
menusList: [{ name: '下载', value: 'down' }],
checkList: [
{ name: '详细模式', value: 1 },
{ name: '缩略图模式', value: 2 },
{ name: '列表模式', value: 3 }
],
Ids: [],
smallUrl: global.staticURL + '/img/smallfile/',
bigUrl: global.staticURL + '/img/bigfile/',
imgViewList: [],
imgViewIndex: null,
id: '',
objectKey: [],
idKey: '', // 判断是哪种附件(合同、委托、样品)
checkData: []
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
// 点击单元格触发
_cellClick(row, event, column) {
if (event.label !== '操作') {
this.checkData = [row]
this.$refs.moveTable.toggleRowSelection(row)
}
},
_iconClick(res, data) {
switch (res) {
case '下载':
this._download(data.id)
break
case '预览':
this._viewImg(data)
break
}
},
// 预览图片(该合同下所有的)
_viewImg(data) {
const uri = 'FoodSampleAttachment/getPicByContractId'
const viewUri = 'sample_attachment/view'
this.$store.dispatch(uri, this.id).then(() => {
const result = this.$store.state.FoodSampleAttachment.list
const imgViewList = []
for (let i = 0; i < result.length; i++) {
imgViewList.push(
global.baseURL +
'/food/v1/' +
viewUri +
'?id=' +
result[i].id +
'&objectKey=' +
result[i].objectKey
)
}
this.imgViewList = imgViewList
// 打开的是当前第几张图片
const salesUri =
global.baseURL +
'/food/v1/' +
viewUri +
'?id=' +
data.id +
'&objectKey=' +
data.objectKey
const index = this.imgViewList.findIndex(item => item === salesUri)
if (index === -1) {
this.imgViewIndex = 0
} else {
this.imgViewIndex = index
}
})
},
_fileViewData(data, idKey) {
this.idKey = idKey
this.id = data.id
},
_open(data, height) {
this.getPage = data
this.tableHeight = height
this.selectIds = []
this.imgViewIndex = null
},
_pageChange(page) {
this.$emit('on-result-change', 'page', page)
},
_selectRowChange(data) {
this.checkData = data
const idList = []
const objectKey = []
for (let i = 0; i < data.length; i++) {
idList.push(data[i].id)
objectKey.push(data[i].objectKey)
}
this.Ids = idList
this.objectKey = objectKey
},
_selectAll: function(data) {
this._selectRowChange(data)
},
_pageSizeChange(rows) {
this.$emit('on-result-change', 'rows', rows)
},
// 下载
_download(id) {
this.$emit('on-result-change', 'down', id)
},
// 查看方式改变
_view(val) {
this.viewStyle = val
this.selectIds = []
},
_chkVal(val) {
this.selectIds = val
},
// 一系列操作返回的值
_tableChange(val) {
if (val === 'down') {
if (this.objectKey.length === 0) {
this.$Message.warning('请选择一条数据!')
} else {
this._downloadAll(this.objectKey)
}
}
},
// 批量打包下载
_downloadAll(ids) {
const uri = '/food/v1/sample_attachment/download_batch'
window.open(global.baseURL + uri + '?objectKeys=' + ids)
}
}
}
</script>
<template>
<div>
<Modal v-model="showUploadModal" :width="800" class="modal-footer-none zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24" style="margin-bottom: -10px">
<Form :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="文件名称:">
<Input v-model="fileName" @on-enter="_pageChange(1)" placeholder="请输入文件名称" style="width:200px" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<FilesListView ref="fileModal" @on-result-change="_fileData"></FilesListView>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
import global from '../../../api/config'
import FilesListView from './FilesListView'
export default {
components: {
FilesListView
},
data() {
return {
showUploadModal: false,
modalTitle: '查看附件',
selectIds: [],
getPage: {},
pageParams: {
page: 1,
rows: 20
},
downloadFileUrl: '',
fileName: '',
// id
salesId: '',
contractId: '',
sampleId: '',
subcontractorId: '',
// 用于区分是哪种附件(合同、委托、样品)
idKey: ''
}
},
methods: {
_open(data, key) {
this.showUploadModal = true
this.fileName = ''
switch (key) {
case 'contractId':
this.salesId = ''
this.contractId = data.id
this.sampleId = ''
this.subcontractorId = ''
this.idKey = 'contractId'
break
case 'sampleId':
this.salesId = ''
this.contractId = ''
this.sampleId = data.id
this.subcontractorId = ''
this.idKey = 'sampleId'
break
}
this.$emit('on-result-change')
this.downloadFileUrl = data.downloadFileUrl
this.$refs.fileModal._fileViewData(data, this.idKey)
},
_openFile(pageData) {
this.getPage = pageData
this.$refs.fileModal._open(pageData, '300')
},
_page(uri) {
this.$store.dispatch(uri, this._searchParams()).then(() => {
this.$emit('on-result-change', 'file-page', '')
})
},
_pageChange(page) {
this.pageParams.page = page
this.$emit('on-result-change')
},
_pageSizeChange(rows) {
this.pageParams.rows = rows
this.$emit('on-result-change')
},
_search() {
this.$emit('on-result-change')
},
_searchParams() {
const data = {
page: this.pageParams.page,
rows: this.pageParams.rows
}
if (this.fileName) {
Object.assign(data, { fileName: this.fileName })
}
// 委托id
if (this.contractId) {
Object.assign(data, { contractId: this.contractId })
}
// 样品id
if (this.sampleId) {
Object.assign(data, { sampleId: this.sampleId })
}
return data
},
// 下载
_download(id) {
window.open(global.baseURL + this.downloadFileUrl + id, '_blank')
},
_fileData(msg, data) {
switch (msg) {
case 'down':
this._download(data)
break
case 'page':
this._pageChange(data)
break
case 'rows':
this._pageSizeChange(data)
break
}
}
}
}
</script>
// docker测试环境 请求地址 // docker测试环境 请求地址
WEB_URL=http://soil.docker.com WEB_URL=http://soil.docker.com:9000
BASE_URL=http://api.docker.com BASE_URL=http://api.docker.com:9000
SSO_URL=http://sso.docker.com SSO_URL=http://sso.docker.com:9000
STATIC_URL=http://static.docker.com STATIC_URL=http://static.docker.com:9000
RECORD_URL=http://record.patzn.com RECORD_URL=http://record.patzn.com:9000
NC_URL=http://123.133.38.68:8088 NC_URL=http://123.133.38.68:8088
// 请求地址 // 请求地址
WEB_URL=http://sys.devtest.patzn.com WEB_URL=http://soil.ys.patzn.com
BASE_URL=http://api.devtest.patzn.com BASE_URL=http://api.ys.patzn.com
SSO_URL=http://sso.devtest.patzn.com SSO_URL=http://sso.ys.patzn.com
STATIC_URL=http://static.patzn.com STATIC_URL=http://static.patzn.com
NC_URL=http://123.133.38.68:8088 NC_URL=http://123.133.38.68:8088
...@@ -5,3 +5,4 @@ SSO_URL=http://sso.lims.com ...@@ -5,3 +5,4 @@ SSO_URL=http://sso.lims.com
STATIC_URL=http://static.lims.com STATIC_URL=http://static.lims.com
RECORD_URL=http://record.patzn.com RECORD_URL=http://record.patzn.com
NC_URL=http://123.133.38.68:8088 NC_URL=http://123.133.38.68:8088
NODE_ENV=zhyf
...@@ -139,6 +139,15 @@ module.exports = { ...@@ -139,6 +139,15 @@ module.exports = {
/* /*
** You can extend webpack config here ** You can extend webpack config here
*/ */
optimization: {
splitChunks: {
minSize: 10000,
maxSize: 250000
}
},
productionSourceMap: false,
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
extend(config, ctx) { extend(config, ctx) {
// Run ESLint on save // Run ESLint on save
if (ctx.isDev && ctx.isClient) { if (ctx.isDev && ctx.isClient) {
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
"build": "nuxt build", "build": "nuxt build",
"start": "cross-env NODE_ENV=production node server/index.js", "start": "cross-env NODE_ENV=production node server/index.js",
"zhyf": "cross-env NODE_ENV=zhyf STATIC_URL=http://static.lims.com nuxt build", "zhyf": "cross-env NODE_ENV=zhyf STATIC_URL=http://static.lims.com nuxt build",
"dockertest": "cross-env NODE_ENV=dockertest STATIC_URL=http://static.docker.com nuxt build", "dockertest": "cross-env NODE_ENV=dockertest STATIC_URL=http://static.docker.com:9000 nuxt build",
"test": "cross-env NODE_ENV=testing node server/index.js", "pertest": "cross-env NODE_ENV=pertest nuxt build",
"pertest": "cross-env NODE_ENV=pertesting node server/index.js", "test": "cross-env NODE_ENV=test nuxt build",
"devtest": "cross-env NODE_ENV=devtest node server/index.js", "ys": "cross-env NODE_ENV=ys nuxt build",
"generate": "nuxt generate", "generate": "nuxt generate",
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .", "lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint" "precommit": "npm run lint"
......
...@@ -167,14 +167,7 @@ export default { ...@@ -167,14 +167,7 @@ export default {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?') this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
} }
}, },
_detailModal(id) { _detailModal(id) {},
// 查看
this.$store.dispatch('LmsEnvNormalMonitor/getById', id).then(() => {
this.$refs.detailModal._open(
this.$store.state.LmsEnvNormalMonitor.model
)
})
},
_editModal(edit, id) { _editModal(edit, id) {
if (edit) { if (edit) {
// 编辑 // 编辑
...@@ -262,9 +255,6 @@ export default { ...@@ -262,9 +255,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.LmsEnvNormalMonitor.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -97,44 +97,9 @@ export default { ...@@ -97,44 +97,9 @@ export default {
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.LmsEnvNormalMonitor.success) { this.showEditModal = false
this.showEditModal = false this.$Message.success(msg)
this.$Message.success(msg) this.$emit('on-result-change')
this.$emit('on-result-change')
} else {
this._hideLoading()
}
},
// 字典
_dicSearch() {
this.$store
.dispatch('LmsBaseDict/getItem', '环境监测管理日期格式')
.then(() => {
const result = this.$store.state.LmsBaseDict.item
if (result) {
switch (result[0].name) {
case '年月日':
this.format = 'yyyy-MM-dd'
this.monitorFormat = 'yyyy-mm-dd'
break
case '年月日时':
this.format = 'yyyy-MM-dd HH'
this.monitorFormat = 'yyyy-mm-dd HH'
break
case '年月日时分':
this.format = 'yyyy-MM-dd HH:mm'
this.monitorFormat = 'yyyy-mm-dd HH:MM'
break
case '年月日时分秒':
this.format = 'yyyy-MM-dd HH:mm:ss'
this.monitorFormat = 'yyyy-mm-dd HH:MM:ss'
break
default:
this.format = 'yyyy-MM-dd'
this.monitorFormat = 'yyyy-mm-dd'
}
}
})
}, },
_ok() { _ok() {
this.$refs.formObj.validate(valid => { this.$refs.formObj.validate(valid => {
......
...@@ -178,9 +178,6 @@ export default { ...@@ -178,9 +178,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.LmsProductManage.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -137,9 +137,6 @@ export default { ...@@ -137,9 +137,6 @@ export default {
case '导入': case '导入':
this._import() this._import()
break break
case '导出':
this._export()
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
...@@ -175,18 +172,7 @@ export default { ...@@ -175,18 +172,7 @@ export default {
this.$Message.warning('暂无图片!') this.$Message.warning('暂无图片!')
} }
}, },
_uploadPic(id) {
const action = '/meter/v1/aptitude/upload_?aptitudeId=' + id
const data = {
importUrl: action,
downloadUrl: '',
title: '上传'
}
this.$refs.imageTemplateImport._open(data, '上传图片')
},
_page: async function() { _page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.page(this.formObj) const result = await soilAptitude.page(this.formObj)
if (result) { if (result) {
...@@ -269,26 +255,6 @@ export default { ...@@ -269,26 +255,6 @@ export default {
title: '授权资质导入' title: '授权资质导入'
} }
this.$refs.importModal._open(data, '授权资质导入') this.$refs.importModal._open(data, '授权资质导入')
},
// 导出
_export() {
console.log('.this.selectIds', this.selectIds)
if (this.selectIds.length === 0) {
this.$Message.warning('请选择需要导出的数据')
} else {
const content = '确定导出 ' + this.selectIds.length + ' 条记录?'
this.$Modal.confirm({
title: '提示',
content: content,
onOk: () => {
// eslint-disable-next-line no-undef
http.open(
'/food/v1/food_aptitude_judge_basis/food_aptitude_judge_export?ids=' +
this.selectIds
)
}
})
}
} }
} }
} }
......
...@@ -68,11 +68,9 @@ ...@@ -68,11 +68,9 @@
<SubstitutionalRelation ref="relationModal" @on-result-change="_page"></SubstitutionalRelation> <SubstitutionalRelation ref="relationModal" @on-result-change="_page"></SubstitutionalRelation>
<UploadModal ref="uploadModal" @on-result-change="_page"></UploadModal> <UploadModal ref="uploadModal" @on-result-change="_page"></UploadModal>
<StanardFileManage ref="stanardFileManage"></StanardFileManage> <StanardFileManage ref="stanardFileManage"></StanardFileManage>
<!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>-->
</div> </div>
</template> </template>
<script> <script>
import http from '../../../api/http'
import { soilAptitude } from '../../../api' import { soilAptitude } from '../../../api'
import global from '../../../api/config' import global from '../../../api/config'
import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入 import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入
...@@ -103,20 +101,12 @@ export default { ...@@ -103,20 +101,12 @@ export default {
componentName: 'StandardsManageEdit' componentName: 'StandardsManageEdit'
}, },
{ type: 'error', id: 'test-basis-deletes', name: '删除' } { type: 'error', id: 'test-basis-deletes', name: '删除' }
// { id: '', name: '导入', componentName: 'DownloadTemplateImport' },
// { id: '', name: '导出' }
], ],
// 表格 // 表格
pageColumns: [ pageColumns: [
{ title: '检测依据', key: 'code' }, { title: '检测依据', key: 'code' },
{ title: '检测依据名称', key: 'name' }, { title: '检测依据名称', key: 'name' },
{ title: '附件是否已上传', key: 'uploaded' } { title: '附件是否已上传', key: 'uploaded' }
// { title: '标准状态', key: 'status', width: 120 },
// { title: '标准分类', key: 'classify' },
// { title: '标准类型', key: 'type' },
// { title: '发布单位', key: 'publishUnit' },
// { title: '发布日期', key: 'publishDate', date: true, width: 140 },
// { title: '文件是否上传', key: 'fileUrl', width: 120 }
], ],
// 操作 // 操作
iconMsg: [ iconMsg: [
...@@ -194,15 +184,6 @@ export default { ...@@ -194,15 +184,6 @@ export default {
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
case '导入':
this.$nextTick(() => {
this._import()
})
break
case '导出':
// this._export()
break
// 收起搜索
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
...@@ -305,7 +286,6 @@ export default { ...@@ -305,7 +286,6 @@ export default {
switch (msg) { switch (msg) {
case 'page': case 'page':
this._page() this._page()
// this.getPage = this.$store.state.StandardInfo.page
break break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
...@@ -318,15 +298,6 @@ export default { ...@@ -318,15 +298,6 @@ export default {
break break
} }
}, },
// 导入
_import() {
const data = {
importUrl: '/food/v1/food_standard_info/import_standard',
downloadUrl: '/food/v1/excel/template/FoodStandardInfo',
title: '导入食品标准管理'
}
this.$refs.importModal._open(data)
},
// 导出 // 导出
_export() { _export() {
const ids = this.selectIds const ids = this.selectIds
...@@ -337,19 +308,6 @@ export default { ...@@ -337,19 +308,6 @@ export default {
: '确定导出 ' + ids.length + ' 条记录?' : '确定导出 ' + ids.length + ' 条记录?'
) )
}, },
_exportByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content,
onOk: () => {
if (ids.length === 0) {
http.open('/food/v1/food_standard_info/export_standard')
} else {
http.open('/food/v1/food_standard_info/export_standard?ids=' + ids)
}
}
})
},
// 预览 // 预览
_viewReport(data) { _viewReport(data) {
const fileUrl = encodeURIComponent( const fileUrl = encodeURIComponent(
......
...@@ -65,7 +65,6 @@ export default { ...@@ -65,7 +65,6 @@ export default {
switch (msg) { switch (msg) {
case 'page': case 'page':
this._page() this._page()
// this.getPage = this.$store.state.StandardInstead.page
break break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
......
...@@ -43,17 +43,6 @@ ...@@ -43,17 +43,6 @@
<div v-if="item.detail"> <div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a> <a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div> </div>
<div v-else-if="item.key==='epibolyItem'" @click.stop="_handleRow(scope)">
<el-select v-if="showOption" v-model="scope.row.epibolyItem" @change="_optionChange(scope.row)" placeholder="请选择">
<el-option
v-for="(item,index) in subOptions"
:key="index"
:label="item.label"
:value="index"
/>
</el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div>
<div v-else-if="item.key==='status'"> <div v-else-if="item.key==='status'">
{{ scope.row[item.key].display }} {{ scope.row[item.key].display }}
</div> </div>
...@@ -63,40 +52,6 @@ ...@@ -63,40 +52,6 @@
<div v-else-if="item.date"> <div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }} {{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div> </div>
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.code"
@blur="_codeEdit({id:scope.row.id, obj :{code:scope.row.code}})"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i @click.stop="_selectjudgeBasis(scope.row.id,scope.$index)" style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search"></i>
</div>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.compareSymbol"
@blur="_compareSymbolEdit({id:scope.row.id, obj :{compareSymbol:scope.row.compareSymbol}})"
blur
placeholder="请输入比较符"
/>
</div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.limitValue"
@blur="_limitValueEdit({id:scope.row.id, obj :{limitValue:scope.row.limitValue}})"
blur
placeholder="请输入限值"
/>
</div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.unit"
@blur="_unitEdit({id:scope.row.id, obj :{unit:scope.row.unit}})"
blur
placeholder="请输入单位"
/>
</div>
<div v-else> <div v-else>
{{ scope.row[item.key] }} {{ scope.row[item.key] }}
</div> </div>
...@@ -113,7 +68,6 @@ ...@@ -113,7 +68,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../api/http'
import { soilEntrust } from '../../api' import { soilEntrust } from '../../api'
export default { export default {
components: {}, components: {},
...@@ -181,14 +135,6 @@ export default { ...@@ -181,14 +135,6 @@ export default {
this.index = index this.index = index
this.$refs.EditModal._open() this.$refs.EditModal._open()
}, },
_optionChange(data) {
console.log(data)
if (data.epibolyItem === 1) {
this._submit(data.id)
} else {
this._cancelSub(data.id)
}
},
_footerResult(name) { _footerResult(name) {
switch (name) { switch (name) {
case '取消': case '取消':
...@@ -210,13 +156,6 @@ export default { ...@@ -210,13 +156,6 @@ export default {
}, },
_modalResult(data1, data2) { _modalResult(data1, data2) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default: default:
this._search() this._search()
} }
...@@ -233,150 +172,24 @@ export default { ...@@ -233,150 +172,24 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
case '提交分包':
this._submitOutPack()
break
case '取消分包':
this._cancelOutPack()
break
case '添加': case '添加':
this._editModal(false) this._editModal(false)
break break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目': case '导入检测项目':
this._importItem() this._importItem()
break break
case '导入检测项目包': case '导入检测项目包':
this._importItemPackage() this._importItemPackage()
break break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}) })
}, },
_backData(data) {
this.getPage.records[this.index].code = data.code
this._codeEdit({ id: this.itemId, obj: { code: data.code } })
},
_codeEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_compareSymbolEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_limitValueEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_unitEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_submitOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定分包这' + this.selectIds.length + '条',
onOk: () => {
this._submit()
}
})
}
},
_cancelOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定取消这' + this.selectIds.length + '条分包',
onOk: () => {
this._cancelSub()
}
})
}
},
_submit: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.submitOutPack(this.selectIds)
if (result) {
this._resultChange('分包成功')
}
},
_cancelSub: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.cancelOutPack(this.selectIds)
if (result) {
this._resultChange('取消分包成功')
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() {
this.$refs.refModal._open(this.sampleId)
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -391,9 +204,6 @@ export default { ...@@ -391,9 +204,6 @@ export default {
console.log(index) console.log(index)
this._deleteById(data.id) this._deleteById(data.id)
break break
case '导出样品委托协议':
this._exportAgreement(data.id)
break
case '附件': case '附件':
this.$refs.refModal._open(data.id, 'sampleId') this.$refs.refModal._open(data.id, 'sampleId')
break break
...@@ -511,17 +321,6 @@ export default { ...@@ -511,17 +321,6 @@ export default {
this.$refs.refModal._open('', this.sampleId) this.$refs.refModal._open('', this.sampleId)
} }
}, },
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.sampleId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.sampleId)
}
},
_search() { _search() {
this._page() this._page()
}, },
...@@ -554,13 +353,6 @@ export default { ...@@ -554,13 +353,6 @@ export default {
this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item') this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
} }
}, },
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.recordModal._open(id) this.$refs.recordModal._open(id)
......
...@@ -44,17 +44,6 @@ ...@@ -44,17 +44,6 @@
<div v-if="item.detail"> <div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a> <a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div> </div>
<div v-else-if="item.key==='epibolyItem'" @click.stop="_handleRow(scope)">
<el-select v-if="showOption" v-model="scope.row.epibolyItem" @change="_optionChange(scope.row)" placeholder="请选择">
<el-option
v-for="(item,index) in subOptions"
:key="index"
:label="item.label"
:value="index"
/>
</el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div>
<div v-else-if="item.key==='status'"> <div v-else-if="item.key==='status'">
{{ scope.row[item.key].display }} {{ scope.row[item.key].display }}
</div> </div>
...@@ -83,14 +72,6 @@ ...@@ -83,14 +72,6 @@
</el-input> </el-input>
</div> </div>
<div v-if="item.key==='groupName'" @click="_handleRow(scope)"> <div v-if="item.key==='groupName'" @click="_handleRow(scope)">
<!-- <el-select @change="_selGroup" v-model="scope.row.groupName" placeholder="请选择" name="groupName" style="width: 100%">-->
<!-- <el-option-->
<!-- v-for="(item,index) in groupoptions"-->
<!-- :key="index"-->
<!-- :label="item.name"-->
<!-- :value="item.name"-->
<!-- />-->
<!-- </el-select>-->
<AutoCompletes v-model="scope.row.groupName" :handle-obj="scope.row" :down-data="groupoptions" @on-result-change="_selGroup" <AutoCompletes v-model="scope.row.groupName" :handle-obj="scope.row" :down-data="groupoptions" @on-result-change="_selGroup"
style="editable:false" clearable style="editable:false" clearable
placeholder="请选择试验室" show-key="name"></AutoCompletes> placeholder="请选择试验室" show-key="name"></AutoCompletes>
...@@ -196,20 +177,6 @@ export default { ...@@ -196,20 +177,6 @@ export default {
} }
}, },
methods: { methods: {
_selectjudgeBasis(id, index) {
console.log(id)
this.itemId = id
this.index = index
this.$refs.EditModal._open()
},
_optionChange(data) {
console.log(data)
if (data.epibolyItem === 1) {
this._submit(data.id)
} else {
this._cancelSub(data.id)
}
},
_writeInfo() { _writeInfo() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!') this.$Message.warning('请选择一条或多条数据!')
...@@ -238,13 +205,6 @@ export default { ...@@ -238,13 +205,6 @@ export default {
}, },
_modalResult(data1, data2) { _modalResult(data1, data2) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default: default:
this._search() this._search()
} }
...@@ -326,21 +286,9 @@ export default { ...@@ -326,21 +286,9 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
case '提交分包':
this._submitOutPack()
break
case '取消分包':
this._cancelOutPack()
break
case '添加': case '添加':
this._editModal(false) this._editModal(false)
break break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目': case '导入检测项目':
this._importItem() this._importItem()
break break
...@@ -350,112 +298,15 @@ export default { ...@@ -350,112 +298,15 @@ export default {
case '导入检测项目包': case '导入检测项目包':
this._importItemPackage() this._importItemPackage()
break break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}) })
}, },
_backData(data) {
this.getPage.records[this.index].code = data.code
this._codeEdit({ id: this.itemId, obj: { code: data.code } })
},
_codeEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._pageByEntrustId()
} else {
this.$message.warning('保存失败')
}
},
_compareSymbolEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._pageByEntrustId()
} else {
this.$message.warning('保存失败')
}
},
_limitValueEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._pageByEntrustId()
} else {
this.$message.warning('保存失败')
}
},
_unitEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._pageByEntrustId()
} else {
this.$message.warning('保存失败')
}
},
_submitOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定分包这' + this.selectIds.length + '条',
onOk: () => {
this._submit()
}
})
}
},
_cancelOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定取消这' + this.selectIds.length + '条分包',
onOk: () => {
this._cancelSub()
}
})
}
},
_submit: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.submitOutPack(this.selectIds)
if (result) {
this._resultChange('分包成功')
}
},
_cancelSub: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.cancelOutPack(this.selectIds)
if (result) {
this._resultChange('取消分包成功')
}
},
_copyHisSample() {
this.$refs.refModal._open(this.sampleId)
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -589,17 +440,6 @@ export default { ...@@ -589,17 +440,6 @@ export default {
this.$refs.refModal._open('', this.sampleId) this.$refs.refModal._open('', this.sampleId)
} }
}, },
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.sampleId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.sampleId)
}
},
_search() { _search() {
this._pageByEntrustId() this._pageByEntrustId()
}, },
...@@ -631,13 +471,6 @@ export default { ...@@ -631,13 +471,6 @@ export default {
this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item') this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
} }
}, },
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.recordModal._open(id) this.$refs.recordModal._open(id)
......
...@@ -257,10 +257,8 @@ export default { ...@@ -257,10 +257,8 @@ export default {
return this.$extend(data, this.pageParams) return this.$extend(data, this.pageParams)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodSample.success) { this._page()
this._page() this.$Message.success(msg)
this.$Message.success(msg)
}
}, },
_copy(sampleId, type) { _copy(sampleId, type) {
this.$refs.refModal._open(sampleId, type) this.$refs.refModal._open(sampleId, type)
......
...@@ -147,7 +147,6 @@ export default { ...@@ -147,7 +147,6 @@ export default {
} }
}, },
_page: async function() { _page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilEntrust.pageItem( const result = await soilEntrust.pageItem(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
......
...@@ -150,7 +150,6 @@ export default { ...@@ -150,7 +150,6 @@ export default {
} }
}, },
_page: async function() { _page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.page(this.$serializeForm(this.formObj)) const result = await soilAptitude.page(this.$serializeForm(this.formObj))
if (result) { if (result) {
......
...@@ -153,15 +153,7 @@ export default { ...@@ -153,15 +153,7 @@ export default {
formId: '' formId: ''
} }
}, },
mounted() { mounted() {},
// 检测科室
// this._getUserGroup()
// 检测依据
// this._getTestBasisList()
// 资质
// this._getAptitudeList()
// this._getType()
},
methods: { methods: {
channelInputLimit(e) { channelInputLimit(e) {
const key = e.key const key = e.key
......
...@@ -255,9 +255,6 @@ export default { ...@@ -255,9 +255,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
// this.getPage = this.$store.state.SysFileTemplate.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
<div> <div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95" inline class="inputBox"> <Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95" inline class="inputBox">
<Form-item label="类别" prop="classType" style="width: 100%"> <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> <el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
<el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList" <el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList"
:key="index"></el-option> :key="index"></el-option>
...@@ -185,21 +183,6 @@ export default { ...@@ -185,21 +183,6 @@ export default {
} }
}, },
methods: { methods: {
_onKeyUp() {
if (this.formObj.alias === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/meter/v1/file_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
channelInputLimit(e) { channelInputLimit(e) {
const key = e.key const key = e.key
// 不允许输入'e'和'.' // 不允许输入'e'和'.'
...@@ -258,18 +241,6 @@ export default { ...@@ -258,18 +241,6 @@ export default {
_handelprogress(event, file, fileList) { _handelprogress(event, file, fileList) {
this.isLoad = true this.isLoad = true
}, },
// _handelsuccess(response, file, fileList) {
// // 上传成功
// if (response.success) {
// this.isLoad = false
// this.$Message.success('上传成功!')
// this.$emit('on-result-change')
// this.showEditModal = false
// } else {
// this.isLoad = true
// this.$Message.error(response.msg)
// }
// },
_formatError(file) { _formatError(file) {
this.$Notice.error({ this.$Notice.error({
title: '文件格式不正确', title: '文件格式不正确',
......
<template>
<div>
<Modal v-model="showModal" @on-visible-change="_visibleChange"
width="1200" class="zIndex-900 modal-footer-none">
<div slot="header"><p>查看原始记录</p></div>
<Row>
<!--查询-->
<Col span="24">
<Form :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="模板名称:">
<Input v-model="formObj.title" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :open="searchOpen" :msg="btn" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :icon-msg="iconMsg" :getPage="getPage">
<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">
<div v-if="item.dateTime">
{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM'):''}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</Modal>
<ItemOriginalRecordEdit ref="recordEditModal"></ItemOriginalRecordEdit>
<ItemView ref="itemViewModal"></ItemView>
<ReportTemplateModal ref="templateModal" @on-result-change="_page"></ReportTemplateModal>
</div>
</template>
<script>
/**
* 原始记录查看
*/
import Global from '../../api/config'
import { soilSample, soilTest } from '../../api'
import ItemOriginalRecordEdit from '../soil-report-manage/report-make/OriginalRecordEdit'
import ItemView from '../soil-report-manage/report-make/ItemView'
import ReportTemplateModal from '../soil-report-manage/report-make/ReportTemplateModal'
export default {
components: {
ItemOriginalRecordEdit,
ItemView,
ReportTemplateModal
},
data() {
return {
currentComponent: '',
getPage: {},
showModal: false,
btn: [],
selectIds: [],
iconMsg: [
{
type: 'ios-book',
id: '',
name: '查看原始记录'
}
],
pageColumns: [
{ title: '模板名称', key: 'title' },
{ title: '委托编号', key: 'entrustCode' },
{ title: '钻孔编号', key: 'boreholeName' },
{ title: '填写人', key: 'uname' },
{ title: '创建时间', key: 'ctime', dateTime: true }
],
formObj: {
entrustId: '',
batchNos: '',
sampleNums: '',
templateTitle: '',
fillInTimeBegin: '',
fillInTimeEnd: '',
cusNames: '',
codes: '',
itemNames: '',
testAccordings: '',
title: undefined
},
searchOpen: false
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 340)
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
methods: {
_componentResult(data) {
switch (this.currentComponent) {
default:
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '生成报告':
this._reportMake()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_visibleChange(data) {
if (data === false) {
this.$emit('on-result-change')
}
},
_reportMake(data) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定这' + this.selectIds.length + '条数据生成报告',
onOk: () => {
this.openTooltip()
this.$refs.pageTable._showLoading()
this._reportMakeOk()
}
})
}
},
_reportMakeOk: async function() {
const result = await soilSample.reportMake({
entrustId: this.formObj.entrustId,
originalList: this.selectIds
})
if (result) {
this.$Message.success('报告成功生成')
await this._page()
this.$emit('on-result-change')
}
this.$refs.pageTable._hideLoading()
},
openTooltip() {
this.$notify.info({
title: '提示',
message: '正在生成,请稍后',
duration: 3000
})
},
_dateChange(data) {
this.formObj.fillInTimeBegin = data[0]
this.formObj.fillInTimeEnd = data[1]
},
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
this.$nextTick(() => {
switch (res) {
case '编辑':
this._recordEdit(data)
break
case '查看原始记录':
this._recordLook(data)
break
case '查看试验项目':
this._itemView(data.id)
break
case '查看检测项目':
this.$refs.refModal._open(data)
break
}
})
},
_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)
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
// 查看试验项目
_itemView(id) {
this.$refs.itemViewModal._open(id)
},
// 查看原始记录
_recordView(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
after: function(layxWindow, winform) {
// eslint-disable-next-line no-undef
layx.max(winform.id)
}
}
}
}
)
},
_open(entrustId) {
this.showModal = true
this.formObj.entrustId = entrustId
this._page()
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.recordPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
}
}
}
</script>
...@@ -9,21 +9,21 @@ ...@@ -9,21 +9,21 @@
<Form id="search-contract-record" :label-width="70" inline onsubmit="return false"> <Form id="search-contract-record" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="项目名称:"> <Form-item label="项目名称:">
<Input v-model="formObj.expName" name="expName" placeholder="请输入项目名称" style="width: 200px" <Input v-model="formObj.expName" @on-enter="_search" name="expName" placeholder="请输入项目名称"
clearable @on-enter="_search"/> style="width: 200px" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_search">搜索</Button> <Button @click="_search" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick" /> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" <PTVXETable ref="pageTable" :table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" show-check-box @on-result-change="_tableResultChange"> :get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" show-check-box>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</Row> </Row>
</div> </div>
</Modal> </Modal>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
</div> </div>
</template> </template>
<script> <script>
...@@ -53,7 +53,9 @@ ...@@ -53,7 +53,9 @@
*/ */
import { meterEntrust, soilReport, soilStatistics } from '../../../api' import { meterEntrust, soilReport, soilStatistics } from '../../../api'
import Global from '../../../api/config' import Global from '../../../api/config'
import Reason from '../../../components/base/Reason'
export default { export default {
components: { Reason },
data() { data() {
return { return {
showModal: false, showModal: false,
...@@ -68,12 +70,20 @@ export default { ...@@ -68,12 +70,20 @@ export default {
{ title: '创建人', key: 'uname' }, { title: '创建人', key: 'uname' },
{ title: '创建时间', key: 'ctime', dateTime: true } { title: '创建时间', key: 'ctime', dateTime: true }
], ],
btn: [{ id: 'item-check-submit', type: 'primary', name: '提交至复核' }], btn: [
{ id: 'item-check-submit', type: 'primary', name: '提交至复核' },
{ id: '', type: 'primary', name: '驳回' }
],
iconMsg: [ iconMsg: [
{ {
type: 'ios-book', type: 'ios-book',
id: 'item-check-view', id: 'item-check-view',
name: '查看项目报告' name: '查看项目报告'
},
{
type: 'md-albums',
id: '',
name: '查看附录'
} }
], ],
formObj: { formObj: {
...@@ -100,12 +110,41 @@ export default { ...@@ -100,12 +110,41 @@ export default {
case '提交至复核': case '提交至复核':
this._submitExpReportCheck() this._submitExpReportCheck()
break break
case '驳回':
this._goBack()
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}, },
_goBack() {
// 退回
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条委托!')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_reasonResult(data) {
this.$refs.pageTable._showLoading()
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilReport.backExpReportCheckBack({
ids: this.selectIds.join(','),
remark: data
})
if (result) {
this.$Message.success('退回成功!')
await this._page()
this.$emit('on-result-change')
this.$refs.pageTable._hideLoading()
}
},
_iconClick(res, data) { _iconClick(res, data) {
this.$nextTick(() => { this.$nextTick(() => {
switch (res) { switch (res) {
...@@ -116,12 +155,27 @@ export default { ...@@ -116,12 +155,27 @@ export default {
case '查看试验项目': case '查看试验项目':
this._itemView(data.id) this._itemView(data.id)
break break
case '查看附录':
this._viewAppendix(data)
break
case '删除': case '删除':
this._deleteByIds([data.id]) this._deleteByIds([data.id])
break break
} }
}) })
}, },
_viewAppendix(data) {
if (data.appendixKey) {
this.$openWindowModeless({
objectKey: data.appendixKey,
idType: 13,
id: data.id,
isReport: 5
})
} else {
this.$Message.warning('未生成附录')
}
},
_reportView(data) { _reportView(data) {
if (data.objectKey) { if (data.objectKey) {
this._reportMakeLook(data) this._reportMakeLook(data)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div> <div>
<Row> <Row>
<Form <Form
v-show="searchOpen"
id="lab-sample-form" id="lab-sample-form"
v-show="searchOpen"
:label-width="70" :label-width="70"
inline inline
onsubmit="return false" onsubmit="return false"
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
> >
<label class="label-sign" /> <label class="label-sign" />
<Form-item class="search-item" label="委托方:"> <Form-item class="search-item" label="委托方:">
<Input name="client" placeholder="请输入委托方" clearable @on-enter="_formSearch" /> <Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item> </Form-item>
<Form-item class="search-item" label="委托编号:"> <Form-item class="search-item" label="委托编号:">
<Input name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch" /> <Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch"> <Button @click="_formSearch" type="primary">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
</Form> </Form>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick" /> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col> </Col>
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
:table-height="tableHeight" :table-height="tableHeight"
:get-page="getPage" :get-page="getPage"
:icon-msg="iconMsg" :icon-msg="iconMsg"
@on-result-change="_tableResultChange"
show-check-box show-check-box
select-data select-data
@on-result-change="_tableResultChange"
> >
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<Reason ref="reasonModal" @on-result-change="_reasonResult" /> <Reason ref="reasonModal" @on-result-change="_reasonResult" />
<SoilGroupExpReportMake ref="soilGroupExpReportMakeModal" @on-result-change="_page" /> <SoilGroupExpReportMake ref="soilGroupExpReportMakeModal" @on-result-change="_page" />
<OperationModal ref="operationModal" /> <OperationModal ref="operationModal" />
<OriginalRecordView ref="OriginalRecordView" @on-result-change="_page" />
</div> </div>
</template> </template>
...@@ -75,9 +76,15 @@ import global from '../../../../api/config' ...@@ -75,9 +76,15 @@ import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason' import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation' import OperationModal from '../../../../components/operation/Operation'
import SoilGroupExpReportMake from '../../report-check/SoilGroupExpReportCheck' import SoilGroupExpReportMake from '../../report-check/SoilGroupExpReportCheck'
import OriginalRecordView from '../../OriginalRecordView'
export default { export default {
name: 'PreparationManage', name: 'PreparationManage',
components: { Reason, OperationModal, SoilGroupExpReportMake }, components: {
Reason,
OperationModal,
SoilGroupExpReportMake,
OriginalRecordView
},
data() { data() {
return { return {
name: '', name: '',
...@@ -109,6 +116,7 @@ export default { ...@@ -109,6 +116,7 @@ export default {
selectData: [], selectData: [],
iconMsg: [ iconMsg: [
// { id: '', type: 'md-image', name: '预览报告' }, // { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-beaker', name: '查看原始记录' },
{ id: 'item-check-report', type: 'md-image', name: '项目报告' }, { id: 'item-check-report', type: 'md-image', name: '项目报告' },
{ id: 'item-check-upload', type: 'ios-cloud', name: '附件' }, { id: 'item-check-upload', type: 'ios-cloud', name: '附件' },
{ id: 'item-check-record', type: 'ios-clock', name: '操作日志' } { id: 'item-check-record', type: 'ios-clock', name: '操作日志' }
...@@ -311,8 +319,14 @@ export default { ...@@ -311,8 +319,14 @@ export default {
case '项目报告': case '项目报告':
this._expReport(data) this._expReport(data)
break break
case '查看原始记录':
this._viewRecord(data.id)
break
} }
}, },
_viewRecord(id) {
this.$refs.OriginalRecordView._open(id)
},
_viewReport(data) { _viewReport(data) {
this._getObjectKey(data) this._getObjectKey(data)
}, },
......
...@@ -74,6 +74,11 @@ export default { ...@@ -74,6 +74,11 @@ export default {
type: 'ios-book', type: 'ios-book',
id: 'end-view', id: 'end-view',
name: '查看项目报告' name: '查看项目报告'
},
{
type: 'md-albums',
id: '',
name: '查看附录'
} }
], ],
formObj: { formObj: {
...@@ -116,12 +121,27 @@ export default { ...@@ -116,12 +121,27 @@ export default {
case '查看试验项目': case '查看试验项目':
this._itemView(data.id) this._itemView(data.id)
break break
case '查看附录':
this._viewAppendix(data)
break
case '删除': case '删除':
this._deleteByIds([data.id]) this._deleteByIds([data.id])
break break
} }
}) })
}, },
_viewAppendix(data) {
if (data.appendixKey) {
this.$openWindowModeless({
objectKey: data.appendixKey,
idType: 13,
id: data.id,
isReport: 5
})
} else {
this.$Message.warning('未生成附录')
}
},
_reportView(data) { _reportView(data) {
if (data.objectKey) { if (data.objectKey) {
this._reportMakeLook(data) this._reportMakeLook(data)
......
...@@ -9,21 +9,21 @@ ...@@ -9,21 +9,21 @@
<Form id="search-contract-record" :label-width="70" inline onsubmit="return false"> <Form id="search-contract-record" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="项目名称:"> <Form-item label="项目名称:">
<Input v-model="formObj.expName" name="expName" placeholder="请输入项目名称" style="width: 200px" <Input v-model="formObj.expName" @on-enter="_search" name="expName" placeholder="请输入项目名称"
clearable @on-enter="_search"/> style="width: 200px" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_search">搜索</Button> <Button @click="_search" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick" /> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" <PTVXETable ref="pageTable" :table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" show-check-box @on-result-change="_tableResultChange"> :get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" show-check-box>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</Row> </Row>
</div> </div>
</Modal> </Modal>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
</div> </div>
</template> </template>
<script> <script>
...@@ -53,7 +53,9 @@ ...@@ -53,7 +53,9 @@
*/ */
import { meterEntrust, soilReport, soilStatistics } from '../../../api' import { meterEntrust, soilReport, soilStatistics } from '../../../api'
import Global from '../../../api/config' import Global from '../../../api/config'
import Reason from '../../../components/base/Reason'
export default { export default {
components: { Reason },
data() { data() {
return { return {
showModal: false, showModal: false,
...@@ -68,12 +70,20 @@ export default { ...@@ -68,12 +70,20 @@ export default {
{ title: '创建人', key: 'uname' }, { title: '创建人', key: 'uname' },
{ title: '创建时间', key: 'ctime', dateTime: true } { title: '创建时间', key: 'ctime', dateTime: true }
], ],
btn: [{ id: 'issue-pass', type: 'primary', name: '通过' }], btn: [
{ id: 'issue-pass', type: 'primary', name: '通过' },
{ id: '', type: 'primary', name: '驳回' }
],
iconMsg: [ iconMsg: [
{ {
type: 'ios-book', type: 'ios-book',
id: 'issue-view', id: 'issue-view',
name: '查看项目报告' name: '查看项目报告'
},
{
type: 'md-albums',
id: '',
name: '查看附录'
} }
], ],
formObj: { formObj: {
...@@ -100,11 +110,41 @@ export default { ...@@ -100,11 +110,41 @@ export default {
case '通过': case '通过':
this._submitExpReportIssue() this._submitExpReportIssue()
break break
case '驳回':
this._goBack()
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}, },
_goBack() {
// 退回
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条委托!')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_reasonResult(data) {
this.$refs.pageTable._showLoading()
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilReport.backExpReportIssueBack({
ids: this.selectIds.join(','),
remark: data
})
if (result) {
this.$Message.success('退回成功!')
await this._page()
this.$emit('on-result-change')
this.$refs.pageTable._hideLoading()
}
},
_iconClick(res, data) { _iconClick(res, data) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -116,12 +156,27 @@ export default { ...@@ -116,12 +156,27 @@ export default {
case '查看试验项目': case '查看试验项目':
this._itemView(data.id) this._itemView(data.id)
break break
case '查看附录':
this._viewAppendix(data)
break
case '删除': case '删除':
this._deleteByIds([data.id]) this._deleteByIds([data.id])
break break
} }
}) })
}, },
_viewAppendix(data) {
if (data.appendixKey) {
this.$openWindowModeless({
objectKey: data.appendixKey,
idType: 13,
id: data.id,
isReport: 5
})
} else {
this.$Message.warning('未生成附录')
}
},
_reportView(data) { _reportView(data) {
if (data.objectKey) { if (data.objectKey) {
this._reportMakeLook(data) this._reportMakeLook(data)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div> <div>
<Row> <Row>
<Form <Form
v-show="searchOpen"
id="lab-sample-form" id="lab-sample-form"
v-show="searchOpen"
:label-width="70" :label-width="70"
inline inline
onsubmit="return false" onsubmit="return false"
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
> >
<label class="label-sign" /> <label class="label-sign" />
<Form-item class="search-item" label="委托方:"> <Form-item class="search-item" label="委托方:">
<Input name="client" placeholder="请输入委托方" clearable @on-enter="_formSearch" /> <Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item> </Form-item>
<Form-item class="search-item" label="委托编号:"> <Form-item class="search-item" label="委托编号:">
<Input name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch" /> <Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch"> <Button @click="_formSearch" type="primary">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
</Form> </Form>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick" /> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col> </Col>
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
:table-height="tableHeight" :table-height="tableHeight"
:get-page="getPage" :get-page="getPage"
:icon-msg="iconMsg" :icon-msg="iconMsg"
@on-result-change="_tableResultChange"
show-check-box show-check-box
select-data select-data
@on-result-change="_tableResultChange"
> >
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<Reason ref="reasonModal" @on-result-change="_reasonResult" /> <Reason ref="reasonModal" @on-result-change="_reasonResult" />
<SoilGroupExpReportMake ref="soilGroupExpReportMakeModal" @on-result-change="_page" /> <SoilGroupExpReportMake ref="soilGroupExpReportMakeModal" @on-result-change="_page" />
<OperationModal ref="operationModal" /> <OperationModal ref="operationModal" />
<OriginalRecordView ref="OriginalRecordView" @on-result-change="_page" />
</div> </div>
</template> </template>
...@@ -75,9 +76,15 @@ import global from '../../../../api/config' ...@@ -75,9 +76,15 @@ import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason' import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation' import OperationModal from '../../../../components/operation/Operation'
import SoilGroupExpReportMake from '../../report-issue/SoilGroupExpReportIssue' import SoilGroupExpReportMake from '../../report-issue/SoilGroupExpReportIssue'
import OriginalRecordView from '../../OriginalRecordView'
export default { export default {
name: 'PreparationManage', name: 'PreparationManage',
components: { Reason, OperationModal, SoilGroupExpReportMake }, components: {
Reason,
OperationModal,
SoilGroupExpReportMake,
OriginalRecordView
},
data() { data() {
return { return {
name: '', name: '',
...@@ -109,6 +116,7 @@ export default { ...@@ -109,6 +116,7 @@ export default {
selectData: [], selectData: [],
iconMsg: [ iconMsg: [
// { id: '', type: 'md-image', name: '预览报告' }, // { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-beaker', name: '查看原始记录' },
{ id: 'issue-report', type: 'md-image', name: '项目报告' }, { id: 'issue-report', type: 'md-image', name: '项目报告' },
{ id: 'issue-upload', type: 'ios-cloud', name: '附件' }, { id: 'issue-upload', type: 'ios-cloud', name: '附件' },
{ id: 'issue-record', type: 'ios-clock', name: '操作日志' } { id: 'issue-record', type: 'ios-clock', name: '操作日志' }
...@@ -311,8 +319,14 @@ export default { ...@@ -311,8 +319,14 @@ export default {
case '项目报告': case '项目报告':
this._expReport(data) this._expReport(data)
break break
case '查看原始记录':
this._viewRecord(data.id)
break
} }
}, },
_viewRecord(id) {
this.$refs.OriginalRecordView._open(id)
},
_viewReport(data) { _viewReport(data) {
this._getObjectKey(data) this._getObjectKey(data)
}, },
......
...@@ -73,6 +73,11 @@ export default { ...@@ -73,6 +73,11 @@ export default {
type: 'ios-book', type: 'ios-book',
id: 'make-report-view-item-report', id: 'make-report-view-item-report',
name: '查看项目报告' name: '查看项目报告'
},
{
type: 'md-albums',
id: '',
name: '查看附录'
} }
], ],
formObj: { formObj: {
...@@ -109,6 +114,21 @@ export default { ...@@ -109,6 +114,21 @@ export default {
case '查看项目报告': case '查看项目报告':
this._viewReport(data) this._viewReport(data)
break break
case '查看附录':
this._viewAppendix(data)
break
}
},
_viewAppendix(data) {
if (data.appendixKey) {
this.$openWindowModeless({
objectKey: data.appendixKey,
idType: 13,
id: data.id,
isReport: 5
})
} else {
this.$Message.warning('未生成附录')
} }
}, },
_viewReport(data) { _viewReport(data) {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div> <div>
<Row> <Row>
<Form <Form
v-show="searchOpen"
id="lab-sample-form" id="lab-sample-form"
v-show="searchOpen"
:label-width="70" :label-width="70"
inline inline
onsubmit="return false" onsubmit="return false"
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
> >
<label class="label-sign" /> <label class="label-sign" />
<Form-item class="search-item" label="委托方:"> <Form-item class="search-item" label="委托方:">
<Input name="client" placeholder="请输入委托方" clearable @on-enter="_formSearch" /> <Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item> </Form-item>
<Form-item class="search-item" label="委托编号:"> <Form-item class="search-item" label="委托编号:">
<Input name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch" /> <Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch"> <Button @click="_formSearch" type="primary">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
</Form> </Form>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick" /> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col> </Col>
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
:table-height="tableHeight" :table-height="tableHeight"
:get-page="getPage" :get-page="getPage"
:icon-msg="iconMsg" :icon-msg="iconMsg"
@on-result-change="_tableResultChange"
show-check-box show-check-box
select-data select-data
@on-result-change="_tableResultChange"
> >
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<Reason ref="reasonModal" @on-result-change="_reasonResult" /> <Reason ref="reasonModal" @on-result-change="_reasonResult" />
<SoilGroupExpReportMake ref="soilGroupExpReportMakeModal" @on-result-change="_page" /> <SoilGroupExpReportMake ref="soilGroupExpReportMakeModal" @on-result-change="_page" />
<OperationModal ref="operationModal" /> <OperationModal ref="operationModal" />
<OriginalRecordView ref="OriginalRecordView" @on-result-change="_page" />
</div> </div>
</template> </template>
...@@ -75,9 +76,15 @@ import global from '../../../../api/config' ...@@ -75,9 +76,15 @@ import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason' import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation' import OperationModal from '../../../../components/operation/Operation'
import SoilGroupExpReportMake from '../../report-make/SoilGroupExpReportMake' import SoilGroupExpReportMake from '../../report-make/SoilGroupExpReportMake'
import OriginalRecordView from '../../OriginalRecordView'
export default { export default {
name: 'PreparationManage', name: 'PreparationManage',
components: { Reason, OperationModal, SoilGroupExpReportMake }, components: {
Reason,
OperationModal,
SoilGroupExpReportMake,
OriginalRecordView
},
data() { data() {
return { return {
name: '', name: '',
...@@ -109,6 +116,7 @@ export default { ...@@ -109,6 +116,7 @@ export default {
selectData: [], selectData: [],
iconMsg: [ iconMsg: [
// { id: '', type: 'md-image', name: '预览报告' }, // { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-beaker', name: '查看原始记录' },
{ id: 'make-report', type: 'md-image', name: '项目报告' }, { id: 'make-report', type: 'md-image', name: '项目报告' },
{ id: 'make-upload', type: 'ios-cloud', name: '附件' }, { id: 'make-upload', type: 'ios-cloud', name: '附件' },
{ id: 'make-record', type: 'ios-clock', name: '操作日志' } { id: 'make-record', type: 'ios-clock', name: '操作日志' }
...@@ -311,8 +319,14 @@ export default { ...@@ -311,8 +319,14 @@ export default {
case '项目报告': case '项目报告':
this._expReport(data) this._expReport(data)
break break
case '查看原始记录':
this._viewRecord(data.id)
break
} }
}, },
_viewRecord(id) {
this.$refs.OriginalRecordView._open(id)
},
_viewReport(data) { _viewReport(data) {
this._getObjectKey(data) this._getObjectKey(data)
}, },
......
...@@ -316,16 +316,6 @@ export default { ...@@ -316,16 +316,6 @@ export default {
this.$pdfView(data.pdfObjectKey) this.$pdfView(data.pdfObjectKey)
} else { } else {
console.log(123456) console.log(123456)
// window.open(
// 'http://api.pertest.patzn.com/food/v1/sample_report/generate_pdf_auto?id=' +
// data.id
// )
// this.autoPdf(data)
// window.open(
// global.baseURL +
// '/food/v1/sample_report/generate_pdf_auto?id=' +
// data.id
// )
} }
}, },
_viewReport(data) { _viewReport(data) {
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
<div> <div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95" inline class="inputBox"> <Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95" inline class="inputBox">
<Form-item label="类别" prop="classType" style="width: 100%"> <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> <el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
<el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList" <el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList"
:key="index"></el-option> :key="index"></el-option>
...@@ -204,21 +202,6 @@ export default { ...@@ -204,21 +202,6 @@ export default {
} }
}, },
methods: { methods: {
_onKeyUp() {
if (this.formObj.alias === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/meter/v1/file_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
channelInputLimit(e) { channelInputLimit(e) {
const key = e.key const key = e.key
// 不允许输入'e'和'.' // 不允许输入'e'和'.'
......
...@@ -269,9 +269,6 @@ export default { ...@@ -269,9 +269,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
// this.getPage = this.$store.state.SysFileTemplate.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -209,20 +209,22 @@ export default { ...@@ -209,20 +209,22 @@ export default {
}, },
_reportView(data) { _reportView(data) {
if (data.objectKey) { if (data.objectKey) {
this._reportMakeLook(data) // this._reportMakeLook(data)
this._viewReport(data)
} else { } else {
this._recordView(data.originalRecordId) this._reportMakeLook(data)
// this._recordView(data.originalRecordId)
} }
}, },
_reportMakeLook: async function(data) { _reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.reportGetById(data.id) const result = await soilReport.reportGetById(data.id)
if (result) { if (result) {
console.log('result') console.log('objectKey', result)
this._viewReport(result) this._viewReport(result)
} }
}, },
_viewReport(data) { _viewReport(data) {
console.log('objectKey', data)
if (data) { if (data) {
this.$openWindowModeless({ this.$openWindowModeless({
objectKey: data.objectKey, objectKey: data.objectKey,
......
...@@ -111,11 +111,11 @@ export default { ...@@ -111,11 +111,11 @@ export default {
selectIds: [], selectIds: [],
selectData: [], selectData: [],
iconMsg: [ iconMsg: [
{ id: 'report-audit-view', type: 'md-image', name: '预览报告' }, // { id: 'report-audit-view', type: 'md-image', name: '预览报告' },
{ {
id: 'report-audit-view-report', id: 'report-audit-view-report',
type: 'ios-book', type: 'ios-book',
name: '查看汇总报告' name: '管理汇总报告'
}, },
{ id: 'report-audit-upload', type: 'ios-cloud', name: '附件' }, { id: 'report-audit-upload', type: 'ios-cloud', name: '附件' },
{ id: 'report-audit-record', type: 'ios-clock', name: '操作日志' } { id: 'report-audit-record', type: 'ios-clock', name: '操作日志' }
...@@ -278,7 +278,7 @@ export default { ...@@ -278,7 +278,7 @@ export default {
case '预览报告': case '预览报告':
this._viewReport(data) this._viewReport(data)
break break
case '查看汇总报告': case '管理汇总报告':
this._viewSummary(data) this._viewSummary(data)
break break
case '操作日志': case '操作日志':
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../../api/http'
import { soilReport, soilSample, soilStatistics, soilTest } from '../../../api' import { soilReport, soilSample, soilStatistics, soilTest } from '../../../api'
import Global from '../../../api/config' import Global from '../../../api/config'
import Reason from '../../../components/base/Reason' import Reason from '../../../components/base/Reason'
...@@ -162,15 +161,6 @@ export default { ...@@ -162,15 +161,6 @@ export default {
}, },
_modalResult(data) { _modalResult(data) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'Reason':
this._overdueReason(data)
break
case 'ReportTemplateModal':
this._regenerate(data)
break
case 'AssignPerson':
this._auditorResult(data)
break
default: default:
this._page() this._page()
} }
...@@ -188,9 +178,6 @@ export default { ...@@ -188,9 +178,6 @@ export default {
case '操作记录': case '操作记录':
this._record(data.id) this._record(data.id)
break break
case '项目台账':
this.$refs.refModal._open(data.id)
break
case '历史版本': case '历史版本':
this.$refs.refModal._open(data.id, this.reportType) this.$refs.refModal._open(data.id, this.reportType)
break break
...@@ -211,9 +198,11 @@ export default { ...@@ -211,9 +198,11 @@ export default {
}, },
_reportView(data) { _reportView(data) {
if (data.objectKey) { if (data.objectKey) {
this._reportMakeLook(data) this._viewReport(data)
// this._reportMakeLook(data)
} else { } else {
this._recordView(data.originalRecordId) // this._recordView(data.originalRecordId)
this._reportMakeLook(data)
} }
}, },
_reportMakeLook: async function(data) { _reportMakeLook: async function(data) {
...@@ -373,30 +362,6 @@ export default { ...@@ -373,30 +362,6 @@ export default {
this.showIssueModal = false this.showIssueModal = false
this._createOk() this._createOk()
}, },
_downloadBatch() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要下载这 ' + ids.length + ' 个报告?',
onOk: () => {
const obj = {
ids: ids.join(','),
contractId: this.formObj.contractId,
flag: 0
}
http.open(
Global.baseURL +
'/food/v1/sample_report/download_batch_by_sampleIds',
obj,
'_blank'
)
}
})
}
},
_submit() { _submit() {
const ids = this.selectIds const ids = this.selectIds
if (ids.length === 0) { if (ids.length === 0) {
......
...@@ -135,11 +135,11 @@ export default { ...@@ -135,11 +135,11 @@ export default {
selectIds: [], selectIds: [],
selectData: [], selectData: [],
iconMsg: [ iconMsg: [
{ id: 'report-issue-view', type: 'md-image', name: '预览报告' }, // { id: 'report-issue-view', type: 'md-image', name: '预览报告' },
{ {
id: 'report-issue-view-report', id: 'report-issue-view-report',
type: 'ios-book', type: 'ios-book',
name: '查看汇总报告' name: '管理汇总报告'
}, },
{ id: 'report-issue-upload', type: 'ios-cloud', name: '附件' }, { id: 'report-issue-upload', type: 'ios-cloud', name: '附件' },
{ id: 'report-issue-record', type: 'ios-clock', name: '操作日志' } { id: 'report-issue-record', type: 'ios-clock', name: '操作日志' }
...@@ -336,7 +336,7 @@ export default { ...@@ -336,7 +336,7 @@ export default {
case '预览报告': case '预览报告':
this._viewReport(data) this._viewReport(data)
break break
case '查看汇总报告': case '管理汇总报告':
this._viewSummary(data) this._viewSummary(data)
break break
case '操作日志': case '操作日志':
......
...@@ -344,9 +344,6 @@ export default { ...@@ -344,9 +344,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.EnvItem.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -257,9 +257,6 @@ export default { ...@@ -257,9 +257,6 @@ export default {
case '导出': case '导出':
this._exportSample() this._exportSample()
break break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
...@@ -465,17 +462,6 @@ export default { ...@@ -465,17 +462,6 @@ export default {
this.$refs.refModal._open('', this.sampleId) this.$refs.refModal._open('', this.sampleId)
} }
}, },
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.sampleId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.sampleId)
}
},
_search() { _search() {
this._page() this._page()
}, },
......
...@@ -34,13 +34,6 @@ export default { ...@@ -34,13 +34,6 @@ export default {
methods: { methods: {
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { 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': case 'radioSelect':
this.$emit('on-result-change', data) this.$emit('on-result-change', data)
break break
......
...@@ -139,16 +139,16 @@ export default { ...@@ -139,16 +139,16 @@ export default {
id: 'make-report-upload-report', id: 'make-report-upload-report',
name: '上传报告' name: '上传报告'
}, },
{ // {
type: 'md-image', // type: 'md-image',
id: 'make-report-view-report', // id: 'make-report-view-report',
name: '预览报告' // name: '预览报告'
}, // },
{ // {
type: 'ios-book', // type: 'ios-book',
id: 'make-report-edit-report', // id: 'make-report-edit-report',
name: '编辑报告' // name: '编辑报告'
}, // },
// { // {
// type: 'ios-document-outline', // type: 'ios-document-outline',
// id: '', // id: '',
...@@ -352,10 +352,6 @@ export default { ...@@ -352,10 +352,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
this.selectIds = []
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../../../api/http'
import { soilReport, soilStatistics, soilTest } from '../../../../api' import { soilReport, soilStatistics, soilTest } from '../../../../api'
import Global from '../../../../api/config' import Global from '../../../../api/config'
...@@ -160,15 +159,6 @@ export default { ...@@ -160,15 +159,6 @@ export default {
}, },
_modalResult(data) { _modalResult(data) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'Reason':
this._overdueReason(data)
break
case 'ReportTemplateModal':
this._regenerate(data)
break
case 'AssignPerson':
this._auditorResult(data)
break
default: default:
this._page() this._page()
} }
...@@ -360,31 +350,6 @@ export default { ...@@ -360,31 +350,6 @@ export default {
// 选择时间ok // 选择时间ok
_issueOk() { _issueOk() {
this.showIssueModal = false this.showIssueModal = false
this._createOk()
},
_downloadBatch() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要下载这 ' + ids.length + ' 个报告?',
onOk: () => {
const obj = {
ids: ids.join(','),
contractId: this.formObj.contractId,
flag: 0
}
http.open(
Global.baseURL +
'/food/v1/sample_report/download_batch_by_sampleIds',
obj,
'_blank'
)
}
})
}
}, },
_submit() { _submit() {
const ids = this.selectIds const ids = this.selectIds
......
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="task-assign-item-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list @on-result-change="_btnClick" :msg="btn" class="contHide" style="margin-bottom: 6px;"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-name="tableName"
:table-height="tableHeight"
:get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable>
<template slot-scope="scope">
<a v-if="item.detail" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { soilTest } from '../../../api'
export default {
components: {},
props: {
rightSelectData: null
},
data() {
return {
currentComponent: '',
formObj: {
name: undefined
},
formObjSample: {
name: undefined,
entrustId: undefined
},
formObjBatchSample: {
obj: {
entrustId: '',
nameList: []
}
},
sampleIds: [],
batchSampleIds: [],
itemName: '',
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
selectDataName: [],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
getPage: {},
iconMsg: [],
btn: [],
id: '',
selectId: '',
pageColumns: [{ title: '检测项目', key: 'name', width: 120 }]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
_modalResult() {
if (this.currentComponent === 'AutoAssignModal') {
this._formSearch()
}
},
_selInputResult1(msg, data) {
switch (msg) {
case 'search':
this._formSearch()
break
}
},
_open(id) {
this.id = id
this.selectId = ''
this._page()
},
_searchParams() {
const obj = {}
const obj1 = this.$refs.selInput1._getFormObj()
Object.assign(obj, obj1)
return obj
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.id
const result = await soilTest.pageDocumentByExp(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectData':
this.selectDataName = []
for (let i = 0; i < data.length; i++) {
this.selectDataName.push(data[i].name)
}
this.$emit('on-result-change', this.selectDataName)
break
case 'changeSize':
this._page()
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_btnClick(msg) {
switch (msg) {
case '生成项目报告':
// this.$emit('on-result-change', data)
this._itemReportMakeBatch()
break
case '自动分配':
this._autoAssign()
break
}
},
_iconClick(res, data, currentComponent) {
this.$nextTick(() => {
switch (res) {
case '生成项目报告':
// this.$emit('on-result-change', data)
this._itemReportMake(data)
break
}
})
}
}
}
</script>
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="task-assign-item-right" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="试样编号:">
<Input v-model="formObj.specimenNum" @on-enter="_formSearch" name="specimenNum" placeholder="请输入试样编号" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" :table-name="tableName" @on-result-change="_tableResultChange" is-task select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable>
<template slot-scope="scope">
<div v-if="item.key === 'name'" :style="{color:colorComputed(scope.row.planEndDate)}">
{{scope.row[item.key]}}
</div>
<a v-else-if="item.key==='code'" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<a v-else-if="item.key==='num'" @click.stop="_sampleDetail(scope.row)">{{scope.row[item.key]}}</a>
<span
v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.datetime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM'):''}}</span>
<span v-else-if="item.key==='progress'">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { soilReport, soilTest } from '../../../api'
export default {
components: {},
data() {
return {
// 定义表格名称----英文
tableName: 'food-task-assign-item-right',
formObj: {
entrustId: '',
name: '',
testMethod: '',
testBasis: '',
specimenNum: undefined,
obj: {
entrustId: '',
nameList: [],
sampleCode: undefined
}
},
entrustId: '',
envPro: false,
// 用户自己选中的列
userColumns: [],
currentComponent: '',
btn: [],
iconMsg: [
{
type: 'ios-book',
id: '',
name: '查看原始记录'
}
],
getPage: {},
pageColumns: [
{ title: '试验项目', key: 'name', width: 120, fixed: 'left' },
{ title: '缩写', key: 'shortName', width: 90 },
{ title: '钻孔编号', key: 'boreholeName', width: 120 },
{ title: '现场编号', key: 'siteNo', width: 110 },
{ title: '试样编号', key: 'sampleCode', width: 140 },
{ title: '原始记录填写', key: 'recorded', width: 120 },
{ title: '试样深度', key: 'sampleDepth', width: 110 },
{ title: '土质描述', key: 'describeDetail', width: 110 },
{ title: '含水率', key: 'haveWater', width: 110 },
{ title: '密度', key: 'density', width: 110 },
{ title: '土粒比重', key: 'bulkDensity', width: 110 },
{ title: '检测方法', key: 'testMethod', width: 140 },
{ title: '检测依据', key: 'testBasis', width: 140 },
{ title: '试样包装类型', key: 'samplePack', width: 160 },
{ title: '检测科室', key: 'groupName', width: 150 },
{ title: '状态', key: 'progress', width: 180 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 }
],
leftSelectData: [],
selectIds: [], // 检测项目id
selectData: [], // 检测项目data
selectSampleIds: [], // 样品ids
result: [],
sampleNames: '', // 没有计划完成时间的样品名
defaultPlanDate: null, // 是否有字典
warningValue: ''
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
},
colorComputed() {
return function(val) {
return val - new Date().getTime() > this.warningValue * 86400000
? '#606266'
: val - new Date().getTime() <= 0
? '#eb6877'
: '#f90'
}
}
},
mounted() {
// this._dicSearch()
if (process.env.NODE_ENV === 'production') {
this.envPro = true
}
},
methods: {
_iconClick(res, data, currentComponent) {
this.$nextTick(() => {
switch (res) {
case '查看原始记录':
this._reportView(data)
break
}
})
},
_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) {
const result = await soilReport.getExcelOriginalRecord(data.id)
if (result) {
this._viewReport(result)
}
},
_viewReport(data) {
this.$refs.pageTable._hideLoading()
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
_btnClick(msg) {
switch (msg) {
case '填写原始记录':
this._addRecord()
break
}
},
_getEntrustId(id) {
this.entrustId = id
},
_open(id, data) {
this.leftSelectData = data
this.entrustId = id
if (data.length === 0) {
this.$set(this.getPage, 'records', [])
this.$set(this.getPage, 'total', 0)
this.$set(this.getPage, 'current', 1)
this.selectSampleIds = []
this.selectIds = []
this.selectData = []
this.result = []
} else {
this._formSearch()
}
},
_refresh() {
this.$emit('on-result-change')
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
this.formObj.obj.nameList = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.obj.entrustId = this.entrustId
this.formObj.obj.nameList = this.leftSelectData
this.formObj.obj.sampleCode = this.formObj.specimenNum
// this.formObj.entrustId = this.entrustId
// this.formObj.nameList = this.leftSelectData.join(',')
const result = await soilTest.pageDocumentTestBath(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.$refs.pageTable._checkAll()
this.getPage = result
}
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'page':
this._page()
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.currentComponent)
break
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
this.$emit('child-data', data)
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
case 'changeSize':
this._page()
// this.$refs.pageTable._checkAll()
break
}
},
_clearAll() {
this.getPage.records = []
this.selectIds = []
this.formObj.specimenNum = undefined
}
}
}
</script>
<template>
<div>
<TwoColumnPage>
<template slot="left">
<ItemLeftList ref="leftModal" :rightSelectData =rightSelectData @on-result-change="_leftResult"></ItemLeftList>
</template>
<template slot="right">
<ItemRightList ref="rightModal" :entrustIds = id @child-data="_rightSelectData" @on-result-change="_rightResult"></ItemRightList>
</template>
</TwoColumnPage>
</div>
</template>
<script>
import TwoColumnPage from '../../../components/base/TwoColumnPage'
import ItemLeftList from './ItemLeftList'
import ItemRightList from './ItemRightList'
export default {
components: {
TwoColumnPage,
ItemLeftList,
ItemRightList
},
data() {
return {
id: '',
rightSelectData: []
}
},
methods: {
_leftResult(data) {
console.log('ItemTabs', data)
this.$refs.rightModal._open(this.id, data)
},
_rightResult() {
this.$refs.leftModal._page()
},
_rightSelectData(data) {
this.rightSelectData = []
if (data.length > 0) {
const rightSelectId = []
for (let i = 0; i < data.length; i++) {
rightSelectId.push(data[i].id)
}
this.rightSelectData = rightSelectId
}
},
_open(id) {
this.id = id
this.$refs.leftModal._open(this.id)
this.$refs.rightModal._getEntrustId(this.id)
this.$refs.rightModal._clearAll()
// this.$refs.rightModal._getColumn()
},
_clearTable() {
this.$refs.rightModal._clearAll()
}
}
}
</script>
...@@ -365,9 +365,6 @@ export default { ...@@ -365,9 +365,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.EnvItem.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
<template>
<div>
<Modal v-model="showSampleModal" v-drag @on-visible-change="_visibleChange" width="1330"
class="zIndex-900 modal-footer-none">
<p slot="header"> 按样品查看原始记录</p>
<div>
<WaitReceive ref="waitReceiveModal"></WaitReceive>
</div>
</Modal>
</div>
</template>
<script>
import WaitReceive from './ItemTabs'
export default {
components: {
WaitReceive
},
data() {
return {
contractId: '', // 合同id
entrustId: '',
showSampleModal: false,
modalTitle: '',
selectIds: [],
name: '',
currentComponent: ''
}
},
mounted() {
// this.currentComponent = 'waitScan'
},
methods: {
_open(entrustId) {
this.showSampleModal = true
this.entrustId = entrustId // 委托id
// this.currentComponent = 'waitScan'
this.selectIds = []
this._waitPage()
},
// 待接收
_waitPage() {
this.$refs.waitReceiveModal._open(this.entrustId)
},
_search() {
this.$emit('on-result-change')
},
// 关闭弹框的时候刷新上个界面
_visibleChange(data) {
if (data === false) {
this._search()
}
}
}
}
</script>
...@@ -250,12 +250,6 @@ export default { ...@@ -250,12 +250,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.selectIds = []
this.reportBatch = false
this.reportBatchData = {}
this.getPage = this.$store.state.FoodSampleReport.page
break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
this.selectIds = [] this.selectIds = []
......
...@@ -345,10 +345,6 @@ export default { ...@@ -345,10 +345,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
this.selectIds = []
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -83,9 +83,18 @@ import { soilReport } from '../../../../api' ...@@ -83,9 +83,18 @@ import { soilReport } from '../../../../api'
import Operation from '../../../../components/operation/Operation' import Operation from '../../../../components/operation/Operation'
import SampleByMakeModal from '../../report-manage/SampleByMakeModal' import SampleByMakeModal from '../../report-manage/SampleByMakeModal'
import OriginalRecordView from '../OriginalRecordView' import OriginalRecordView from '../OriginalRecordView'
import SampleManage from '../SampleManage'
export default { export default {
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
components: { Operation, SampleByMakeModal, OriginalRecordView }, components: {
Operation,
// eslint-disable-next-line vue/no-unused-components
SampleByMakeModal,
// eslint-disable-next-line vue/no-unused-components
OriginalRecordView,
// eslint-disable-next-line vue/no-unused-components
SampleManage
},
props: { props: {
reportStatus: null reportStatus: null
}, },
...@@ -124,6 +133,11 @@ export default { ...@@ -124,6 +133,11 @@ export default {
id: 'report-manage-view-record', id: 'report-manage-view-record',
name: '查看原始记录' name: '查看原始记录'
}, },
{
type: 'ios-list-box',
id: '',
name: '按样品查看原始记录'
},
{ type: 'ios-cloud', id: 'report-manage-upload', name: '附件' }, { type: 'ios-cloud', id: 'report-manage-upload', name: '附件' },
{ {
type: 'ios-clock', type: 'ios-clock',
...@@ -182,6 +196,9 @@ export default { ...@@ -182,6 +196,9 @@ export default {
case '查看原始记录': case '查看原始记录':
this._viewRecord(data.id) this._viewRecord(data.id)
break break
case '按样品查看原始记录':
this._viewRecordBySample(data.id)
break
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
break break
...@@ -191,6 +208,12 @@ export default { ...@@ -191,6 +208,12 @@ export default {
} }
}) })
}, },
_viewRecordBySample(id) {
this.currentComponent = 'SampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
},
_upload(id) { _upload(id) {
this.currentComponent = 'FileManage' this.currentComponent = 'FileManage'
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -252,9 +252,6 @@ export default { ...@@ -252,9 +252,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
// this.getPage = this.$store.state.SysFileTemplate.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -152,21 +152,6 @@ export default { ...@@ -152,21 +152,6 @@ export default {
} }
}, },
methods: { methods: {
_onKeyUp() {
if (this.formObj.alias === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/meter/v1/file_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
channelInputLimit(e) { channelInputLimit(e) {
const key = e.key const key = e.key
// 不允许输入'e'和'.' // 不允许输入'e'和'.'
......
...@@ -129,6 +129,12 @@ export default { ...@@ -129,6 +129,12 @@ export default {
}, },
{ {
value: '物性' value: '物性'
},
{
value: '高级'
},
{
value: '土工'
} }
], ],
id: '', id: '',
...@@ -144,21 +150,6 @@ export default { ...@@ -144,21 +150,6 @@ export default {
} }
}, },
methods: { methods: {
_onKeyUp() {
if (this.formObj.alias === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/meter/v1/file_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
channelInputLimit(e) { channelInputLimit(e) {
const key = e.key const key = e.key
// 不允许输入'e'和'.' // 不允许输入'e'和'.'
......
...@@ -81,6 +81,12 @@ export default { ...@@ -81,6 +81,12 @@ export default {
}, },
{ {
value: '物性' value: '物性'
},
{
value: '高级'
},
{
value: '土工'
} }
], ],
showEditModal: false, showEditModal: false,
......
...@@ -249,9 +249,6 @@ export default { ...@@ -249,9 +249,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
// this.getPage = this.$store.state.SysFileTemplate.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
......
...@@ -40,17 +40,6 @@ ...@@ -40,17 +40,6 @@
<div v-if="item.detail"> <div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a> <a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div> </div>
<div v-else-if="item.key==='epibolyItem'" @click.stop="_handleRow(scope)">
<el-select v-if="showOption" v-model="scope.row.epibolyItem" @change="_optionChange(scope.row)" placeholder="请选择">
<el-option
v-for="(item,index) in subOptions"
:key="index"
:label="item.label"
:value="index"
/>
</el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span> <span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-else-if="item.judged"> <div v-else-if="item.judged">
{{ scope.row[item.key]===0? '否':'是' }} {{ scope.row[item.key]===0? '否':'是' }}
...@@ -58,40 +47,6 @@ ...@@ -58,40 +47,6 @@
<div v-else-if="item.date"> <div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }} {{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div> </div>
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.code"
@blur="_codeEdit({id:scope.row.id, obj :{code:scope.row.code}})"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i @click.stop="_selectjudgeBasis(scope.row.id,scope.$index)" style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search"></i>
</div>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.compareSymbol"
@blur="_compareSymbolEdit({id:scope.row.id, obj :{compareSymbol:scope.row.compareSymbol}})"
blur
placeholder="请输入比较符"
/>
</div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.limitValue"
@blur="_limitValueEdit({id:scope.row.id, obj :{limitValue:scope.row.limitValue}})"
blur
placeholder="请输入限值"
/>
</div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.unit"
@blur="_unitEdit({id:scope.row.id, obj :{unit:scope.row.unit}})"
blur
placeholder="请输入单位"
/>
</div>
<div v-else> <div v-else>
{{ scope.row[item.key] }} {{ scope.row[item.key] }}
</div> </div>
...@@ -109,7 +64,6 @@ ...@@ -109,7 +64,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../api/http'
import { soilEntrust } from '../../api' import { soilEntrust } from '../../api'
import ImportItem from './sample-preparation/ImportItem' import ImportItem from './sample-preparation/ImportItem'
export default { export default {
...@@ -178,20 +132,6 @@ export default { ...@@ -178,20 +132,6 @@ export default {
} }
}, },
methods: { methods: {
_selectjudgeBasis(id, index) {
console.log(id)
this.itemId = id
this.index = index
this.$refs.EditModal._open()
},
_optionChange(data) {
console.log(data)
if (data.epibolyItem === 1) {
this._submit(data.id)
} else {
this._cancelSub(data.id)
}
},
_footerResult(name) { _footerResult(name) {
switch (name) { switch (name) {
case '取消': case '取消':
...@@ -211,19 +151,6 @@ export default { ...@@ -211,19 +151,6 @@ export default {
_ok() { _ok() {
console.log(this.getPage.records) console.log(this.getPage.records)
}, },
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_handleRow(data) { _handleRow(data) {
this.currentRow = data.row this.currentRow = data.row
this.currentIndex = data.rowIndex this.currentIndex = data.rowIndex
...@@ -236,150 +163,24 @@ export default { ...@@ -236,150 +163,24 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
case '提交分包':
this._submitOutPack()
break
case '取消分包':
this._cancelOutPack()
break
case '添加': case '添加':
this._editModal(false) this._editModal(false)
break break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目': case '导入检测项目':
this._importItem() this._importItem()
break break
case '导入检测项目包': case '导入检测项目包':
this._importItemPackage() this._importItemPackage()
break break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}) })
}, },
_backData(data) {
this.getPage.records[this.index].code = data.code
this._codeEdit({ id: this.itemId, obj: { code: data.code } })
},
_codeEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_compareSymbolEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_limitValueEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_unitEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_submitOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定分包这' + this.selectIds.length + '条',
onOk: () => {
this._submit()
}
})
}
},
_cancelOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定取消这' + this.selectIds.length + '条分包',
onOk: () => {
this._cancelSub()
}
})
}
},
_submit: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.submitOutPack(this.selectIds)
if (result) {
this._resultChange('分包成功')
}
},
_cancelSub: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.cancelOutPack(this.selectIds)
if (result) {
this._resultChange('取消分包成功')
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() {
this.$refs.refModal._open(this.sampleId)
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -393,9 +194,6 @@ export default { ...@@ -393,9 +194,6 @@ export default {
case '删除': case '删除':
this._deleteById(data.id) this._deleteById(data.id)
break break
case '导出样品委托协议':
this._exportAgreement(data.id)
break
case '附件': case '附件':
this.$refs.refModal._open(data.id, 'sampleId') this.$refs.refModal._open(data.id, 'sampleId')
break break
...@@ -495,17 +293,6 @@ export default { ...@@ -495,17 +293,6 @@ export default {
this.$refs.refModal._open('', this.sampleId) this.$refs.refModal._open('', this.sampleId)
} }
}, },
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.sampleId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.sampleId)
}
},
_search() { _search() {
this._page() this._page()
}, },
...@@ -529,13 +316,6 @@ export default { ...@@ -529,13 +316,6 @@ export default {
this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item') this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
} }
}, },
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.recordModal._open(id) this.$refs.recordModal._open(id)
......
...@@ -40,17 +40,6 @@ ...@@ -40,17 +40,6 @@
<div v-if="item.detail"> <div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a> <a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div> </div>
<div v-else-if="item.key==='epibolyItem'" @click.stop="_handleRow(scope)">
<el-select v-if="showOption" v-model="scope.row.epibolyItem" @change="_optionChange(scope.row)" placeholder="请选择">
<el-option
v-for="(item,index) in subOptions"
:key="index"
:label="item.label"
:value="index"
/>
</el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div>
<span v-else-if="item.status">{{scope.row[item.key]}}</span> <span v-else-if="item.status">{{scope.row[item.key]}}</span>
<div v-else-if="item.judged"> <div v-else-if="item.judged">
{{ scope.row[item.key]===0? '否':'是' }} {{ scope.row[item.key]===0? '否':'是' }}
...@@ -58,40 +47,6 @@ ...@@ -58,40 +47,6 @@
<div v-else-if="item.date"> <div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }} {{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div> </div>
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.code"
@blur="_codeEdit({id:scope.row.id, obj :{code:scope.row.code}})"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i @click.stop="_selectjudgeBasis(scope.row.id,scope.$index)" style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search"></i>
</div>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.compareSymbol"
@blur="_compareSymbolEdit({id:scope.row.id, obj :{compareSymbol:scope.row.compareSymbol}})"
blur
placeholder="请输入比较符"
/>
</div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.limitValue"
@blur="_limitValueEdit({id:scope.row.id, obj :{limitValue:scope.row.limitValue}})"
blur
placeholder="请输入限值"
/>
</div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.unit"
@blur="_unitEdit({id:scope.row.id, obj :{unit:scope.row.unit}})"
blur
placeholder="请输入单位"
/>
</div>
<div v-else> <div v-else>
{{ scope.row[item.key] }} {{ scope.row[item.key] }}
</div> </div>
...@@ -170,20 +125,6 @@ export default { ...@@ -170,20 +125,6 @@ export default {
} }
}, },
methods: { methods: {
_selectjudgeBasis(id, index) {
console.log(id)
this.itemId = id
this.index = index
this.$refs.EditModal._open()
},
_optionChange(data) {
console.log(data)
if (data.epibolyItem === 1) {
this._submit(data.id)
} else {
this._cancelSub(data.id)
}
},
_footerResult(name) { _footerResult(name) {
switch (name) { switch (name) {
case '取消': case '取消':
...@@ -205,13 +146,6 @@ export default { ...@@ -205,13 +146,6 @@ export default {
}, },
_modalResult(data1, data2) { _modalResult(data1, data2) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default: default:
this._search() this._search()
} }
...@@ -228,133 +162,24 @@ export default { ...@@ -228,133 +162,24 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
case '提交分包':
this._submitOutPack()
break
case '取消分包':
this._cancelOutPack()
break
case '添加': case '添加':
this._editModal(false) this._editModal(false)
break break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目': case '导入检测项目':
this._importItem() this._importItem()
break break
case '导入检测项目包': case '导入检测项目包':
this._importItemPackage() this._importItemPackage()
break break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}) })
}, },
_backData(data) {
this.getPage.records[this.index].code = data.code
this._codeEdit({ id: this.itemId, obj: { code: data.code } })
},
_codeEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_compareSymbolEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_limitValueEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_unitEdit: async function(data) {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
} else {
this.$message.warning('保存失败')
}
},
_submitOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定分包这' + this.selectIds.length + '条',
onOk: () => {
this._submit()
}
})
}
},
_cancelOutPack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定取消这' + this.selectIds.length + '条分包',
onOk: () => {
this._cancelSub()
}
})
}
},
_submit: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.submitOutPack(this.selectIds)
if (result) {
this._resultChange('分包成功')
}
},
_cancelSub: async function(data) {
if (data !== undefined) {
this.selectIds = data
}
const result = await soilEntrust.cancelOutPack(this.selectIds)
if (result) {
this._resultChange('取消分包成功')
}
},
_copyHisSample() {
this.$refs.refModal._open(this.sampleId)
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -369,9 +194,6 @@ export default { ...@@ -369,9 +194,6 @@ export default {
console.log(index) console.log(index)
this._deleteById(data.id) this._deleteById(data.id)
break break
case '导出样品委托协议':
this._exportAgreement(data.id)
break
case '附件': case '附件':
this.$refs.refModal._open(data.id, 'sampleId') this.$refs.refModal._open(data.id, 'sampleId')
break break
...@@ -388,9 +210,6 @@ export default { ...@@ -388,9 +210,6 @@ export default {
this.selectIds = selectIds this.selectIds = selectIds
this.selectData = data this.selectData = data
break break
// case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName)
// break
case 'page': case 'page':
this._page() this._page()
break break
...@@ -471,17 +290,6 @@ export default { ...@@ -471,17 +290,6 @@ export default {
this.$refs.refModal._open('', this.sampleId) this.$refs.refModal._open('', this.sampleId)
} }
}, },
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.sampleId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.sampleId)
}
},
_search() { _search() {
this._page() this._page()
}, },
...@@ -513,13 +321,6 @@ export default { ...@@ -513,13 +321,6 @@ export default {
this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item') this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
} }
}, },
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.recordModal._open(id) this.$refs.recordModal._open(id)
......
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../api/http'
import { soilEntrust } from '../../api' import { soilEntrust } from '../../api'
import { getLodop } from '../../plugins/clodop/LodopFuncs' import { getLodop } from '../../plugins/clodop/LodopFuncs'
import SoilSampleItemManage from './SoilSampleItemManageHis' import SoilSampleItemManage from './SoilSampleItemManageHis'
...@@ -270,23 +269,6 @@ export default { ...@@ -270,23 +269,6 @@ export default {
this.$refs.writeDetailModal._open(ids) this.$refs.writeDetailModal._open(ids)
} }
}, },
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() { _copyHisSample() {
this.$refs.refModal._open(this.entrustId) this.$refs.refModal._open(this.entrustId)
}, },
......
...@@ -68,7 +68,6 @@ export default { ...@@ -68,7 +68,6 @@ export default {
{ id: '', name: '提交', type: 'primary' } { id: '', name: '提交', type: 'primary' }
], ],
visible: false, visible: false,
fileAction: Global.baseURL + '/food/v1/sample_handle_apply/uploadFile',
fileData: { fileData: {
id: 0, id: 0,
name: '' name: ''
...@@ -85,9 +84,7 @@ export default { ...@@ -85,9 +84,7 @@ export default {
imgSrc: '' imgSrc: ''
} }
}, },
mounted() { mounted() {},
// this._dicSearch()
},
methods: { methods: {
_selectPerson() { _selectPerson() {
this.$refs.personModal._openGoup('申请人', 'itemTree') this.$refs.personModal._openGoup('申请人', 'itemTree')
...@@ -111,8 +108,6 @@ export default { ...@@ -111,8 +108,6 @@ export default {
this.applyId = 0 this.applyId = 0
this.fileData.id = 0 this.fileData.id = 0
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
// this._getRetention(data)
// this._getSampleBatch(data)
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
this.ids = data this.ids = data
this.formObj.lmsEquipFiles = [] this.formObj.lmsEquipFiles = []
...@@ -125,80 +120,6 @@ export default { ...@@ -125,80 +120,6 @@ export default {
_getSampleBatch(data) { _getSampleBatch(data) {
this.formObj.handleBatch = data.length this.formObj.handleBatch = data.length
}, },
// 计算存储期限
_getRetention(data) {
const handleQuantityList = []
const sampleUnitList = []
let lastTime = ''
const ids = []
for (let i = 0; i < data.length; i++) {
ids.push(data[i].id)
// 样品处理数量和单位
handleQuantityList.push(data[i].handleQuantity)
sampleUnitList.push(data[i].sampleUnit)
if (lastTime === '') {
lastTime = data[i].endDate
} else if (lastTime !== '' && lastTime < data[i].endDate) {
lastTime = data[i].endDate
}
}
this.ids = ids
this.formObj.retentionTime = this.$dateformat(lastTime, 'yyyy-mm-dd')
// 若勾选的样品处理数量、单位一样则显示
// 通过for循环来判断数组的每一元素(若有不重复的,则返回false)
this.formObj.handleQuantity =
this.$duplicates(handleQuantityList) && handleQuantityList.length > 0
? handleQuantityList[0]
: ''
this.formObj.sampleUnit =
this.$duplicates(sampleUnitList) && sampleUnitList.length > 0
? sampleUnitList[0]
: ''
},
// 附件
_handleView(data) {
const filePath = data.filePath
const index1 = filePath.lastIndexOf('.')
const index2 = filePath.length
const suffix = filePath.substring(index1 + 1, index2) // 后缀名
if (
suffix.toLowerCase() === 'png' ||
suffix.toLowerCase() === 'jpg' ||
suffix.toLowerCase() === 'jpeg'
) {
this.visible = true
this.imgSrc =
Global.baseURL +
'/food/v1/sample_handle_apply_attachment/view' +
'?id=' +
data.id +
'&objectKey=' +
data.filePath
} else {
this.$Message.warning({
content: '非图片文件无法查看,请下载查看',
duration: 3
})
this.visible = false
}
},
// 下载文件
_downloadFile(file) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载?',
onOk: () => {
const url =
Global.baseURL +
'/food/v1/sample_handle_apply/downLoadFile?id=' +
file.id
window.open(url)
}
})
},
_handleSuccess(response, file, fileList) { _handleSuccess(response, file, fileList) {
if (response.success) { if (response.success) {
this.fileData.id = response.data.applyId this.fileData.id = response.data.applyId
......
...@@ -120,10 +120,6 @@ export default { ...@@ -120,10 +120,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
......
...@@ -68,7 +68,6 @@ export default { ...@@ -68,7 +68,6 @@ export default {
{ id: '', name: '提交', type: 'primary' } { id: '', name: '提交', type: 'primary' }
], ],
visible: false, visible: false,
fileAction: Global.baseURL + '/food/v1/sample_handle_apply/uploadFile',
fileData: { fileData: {
id: 0, id: 0,
name: '' name: ''
...@@ -132,80 +131,6 @@ export default { ...@@ -132,80 +131,6 @@ export default {
_getSampleBatch(data) { _getSampleBatch(data) {
this.formObj.handleBatch = data.length this.formObj.handleBatch = data.length
}, },
// 计算存储期限
_getRetention(data) {
const handleQuantityList = []
const sampleUnitList = []
let lastTime = ''
const ids = []
for (let i = 0; i < data.length; i++) {
ids.push(data[i].id)
// 样品处理数量和单位
handleQuantityList.push(data[i].handleQuantity)
sampleUnitList.push(data[i].sampleUnit)
if (lastTime === '') {
lastTime = data[i].endDate
} else if (lastTime !== '' && lastTime < data[i].endDate) {
lastTime = data[i].endDate
}
}
this.ids = ids
this.formObj.retentionTime = this.$dateformat(lastTime, 'yyyy-mm-dd')
// 若勾选的样品处理数量、单位一样则显示
// 通过for循环来判断数组的每一元素(若有不重复的,则返回false)
this.formObj.handleQuantity =
this.$duplicates(handleQuantityList) && handleQuantityList.length > 0
? handleQuantityList[0]
: ''
this.formObj.sampleUnit =
this.$duplicates(sampleUnitList) && sampleUnitList.length > 0
? sampleUnitList[0]
: ''
},
// 附件
_handleView(data) {
const filePath = data.filePath
const index1 = filePath.lastIndexOf('.')
const index2 = filePath.length
const suffix = filePath.substring(index1 + 1, index2) // 后缀名
if (
suffix.toLowerCase() === 'png' ||
suffix.toLowerCase() === 'jpg' ||
suffix.toLowerCase() === 'jpeg'
) {
this.visible = true
this.imgSrc =
Global.baseURL +
'/food/v1/sample_handle_apply_attachment/view' +
'?id=' +
data.id +
'&objectKey=' +
data.filePath
} else {
this.$Message.warning({
content: '非图片文件无法查看,请下载查看',
duration: 3
})
this.visible = false
}
},
// 下载文件
_downloadFile(file) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载?',
onOk: () => {
const url =
Global.baseURL +
'/food/v1/sample_handle_apply/downLoadFile?id=' +
file.id
window.open(url)
}
})
},
_handleSuccess(response, file, fileList) { _handleSuccess(response, file, fileList) {
if (response.success) { if (response.success) {
this.fileData.id = response.data.applyId this.fileData.id = response.data.applyId
......
...@@ -351,106 +351,6 @@ export default { ...@@ -351,106 +351,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage.records = []
this.getPage = {
total: this.$store.state.LmsFoodSamplePrepare.page.total,
pages: this.$store.state.LmsFoodSamplePrepare.page.pages,
current: this.$store.state.LmsFoodSamplePrepare.page.current,
size: this.$store.state.LmsFoodSamplePrepare.page.size,
records: []
}
const tableList = this.$store.state.LmsFoodSamplePrepare.page.records
for (let i = 0; i < tableList.length; i++) {
this.getPage.records.push({
sampleId:
tableList[i].sampleId !== undefined
? tableList[i].sampleId
: '',
sampleSn:
tableList[i].sampleSn !== undefined
? tableList[i].sampleSn
: '',
sampleName:
tableList[i].sampleName !== undefined
? tableList[i].sampleName
: '',
backupPlace:
tableList[i].backupPlace !== undefined
? tableList[i].backupPlace
: '',
cname: tableList[i].cname !== undefined ? tableList[i].cname : '',
storageCondition:
tableList[i].storageCondition !== undefined
? tableList[i].storageCondition
: '',
quantity:
tableList[i].quantity !== undefined
? tableList[i].quantity
: '',
sampleQuantity:
tableList[i].sampleQuantity !== undefined
? tableList[i].sampleQuantity
: '',
handleQuantity:
tableList[i].handleQuantity !== undefined
? tableList[i].handleQuantity
: '',
sampleUnit:
tableList[i].sampleUnit !== undefined
? tableList[i].sampleUnit
: '',
endDate:
tableList[i].endDate !== undefined
? new Date(tableList[i].endDate)
: '',
handleMethod:
tableList[i].handleMethod !== undefined
? tableList[i].handleMethod
: '',
id: tableList[i].id !== undefined ? tableList[i].id : '',
contractName:
tableList[i].contractName !== undefined
? tableList[i].contractName
: '',
code: tableList[i].code !== undefined ? tableList[i].code : '',
contractSn:
tableList[i].contractSn !== undefined
? tableList[i].contractSn
: '',
progress:
tableList[i].progress !== undefined
? tableList[i].progress
: '',
type: tableList[i].type !== undefined ? tableList[i].type : '',
issueDate:
tableList[i].issueDate !== undefined
? tableList[i].issueDate
: '',
sampleRemark:
tableList[i].sampleRemark !== undefined
? tableList[i].sampleRemark
: '',
contractRemark:
tableList[i].contractRemark !== undefined
? tableList[i].contractRemark
: '',
isEligible:
tableList[i].isEligible !== undefined
? tableList[i].isEligible
: '',
remark:
tableList[i].remark !== undefined ? tableList[i].remark : '',
contractId:
tableList[i].contractId !== undefined
? tableList[i].contractId
: ''
})
}
this.selectIds = []
this.selectData = []
this.selectSampleIds = []
break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
this.selectIds = [] this.selectIds = []
......
...@@ -119,10 +119,6 @@ export default { ...@@ -119,10 +119,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
</template> </template>
<script> <script>
import http from '../../../api/http'
import { soilSample } from '../../../api' import { soilSample } from '../../../api'
import global from '../../../api/config' import global from '../../../api/config'
import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入 import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入
...@@ -100,15 +99,6 @@ export default { ...@@ -100,15 +99,6 @@ export default {
id: 'keep-callout', id: 'keep-callout',
name: '调出' name: '调出'
} }
// {
// type: 'success',
// id: '',
// name: '添加',
// componentName: 'StandardsManageEdit'
// },
// { type: 'error', id: '', name: '删除' }
// { id: '', name: '导入', componentName: 'DownloadTemplateImport' },
// { id: '', name: '导出' }
], ],
// 表格 // 表格
pageColumns: [ pageColumns: [
...@@ -172,14 +162,6 @@ export default { ...@@ -172,14 +162,6 @@ export default {
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
case '导入':
this.$nextTick(() => {
this._import()
})
break
case '导出':
// this._export()
break
case '调出': case '调出':
this._callout() this._callout()
break break
...@@ -209,9 +191,6 @@ export default { ...@@ -209,9 +191,6 @@ export default {
case '预览': case '预览':
this._viewReport(data) this._viewReport(data)
break break
case '查看替代关系':
this.$refs.relationModal._open(data.id)
break
case '删除': case '删除':
this._deleteById(data.id) this._deleteById(data.id)
break break
...@@ -264,7 +243,6 @@ export default { ...@@ -264,7 +243,6 @@ export default {
}, },
// 获取数据 // 获取数据
_page: async function() { _page: async function() {
// this.$refs.pageTable._page('search-form', 'StandardInfo/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageRetain( const result = await soilSample.pageRetain(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
...@@ -307,7 +285,7 @@ export default { ...@@ -307,7 +285,7 @@ export default {
_delOk: async function(ids) { _delOk: async function(ids) {
const result = await soilSample.locationDeleteById(ids) const result = await soilSample.locationDeleteById(ids)
if (result) { if (result) {
this._page() await this._page()
this.$Modal.remove() this.$Modal.remove()
this.$Message.success('删除成功') this.$Message.success('删除成功')
} }
...@@ -317,7 +295,6 @@ export default { ...@@ -317,7 +295,6 @@ export default {
switch (msg) { switch (msg) {
case 'page': case 'page':
this._page() this._page()
// this.getPage = this.$store.state.StandardInfo.page
break break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
...@@ -330,38 +307,6 @@ export default { ...@@ -330,38 +307,6 @@ export default {
break break
} }
}, },
// 导入
_import() {
const data = {
importUrl: '/food/v1/food_standard_info/import_standard',
downloadUrl: '/food/v1/excel/template/FoodStandardInfo',
title: '导入食品标准管理'
}
this.$refs.importModal._open(data)
},
// 导出
_export() {
const ids = this.selectIds
this._exportByIds(
ids,
ids.length === 0
? '确定导出全部记录?'
: '确定导出 ' + ids.length + ' 条记录?'
)
},
_exportByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content,
onOk: () => {
if (ids.length === 0) {
http.open('/food/v1/food_standard_info/export_standard')
} else {
http.open('/food/v1/food_standard_info/export_standard?ids=' + ids)
}
}
})
},
// 预览 // 预览
_viewReport(data) { _viewReport(data) {
const fileUrl = encodeURIComponent( const fileUrl = encodeURIComponent(
......
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