Commit 70a3977e by wangweidong

土工试验Lims

parent 10982838
<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>
...@@ -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
...@@ -269,26 +266,6 @@ export default { ...@@ -269,26 +266,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)
......
...@@ -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
......
...@@ -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) {
......
...@@ -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
......
...@@ -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
...@@ -373,30 +360,6 @@ export default { ...@@ -373,30 +360,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) {
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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(
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24"> <Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="80" inline onsubmit="return false"> <Form v-show="searchOpen" id="search-sample-company" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item"> <Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样品编号" clearable /> <Input v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable @on-enter="_formSearch" />
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_page" type="primary"> <Button type="primary" @click="_page">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list> <btn-list :msg="btn" :open="searchOpen" class="contHide" show-search-btn="true" @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange" select-data> :get-page="getPage" select-data @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../../api/http'
import { soilEntrust, soilSample } from '../../../api' import { soilEntrust, soilSample } from '../../../api'
import { getLodop } from '../../../plugins/clodop/LodopFuncs' import { getLodop } from '../../../plugins/clodop/LodopFuncs'
let LODOP let LODOP
...@@ -162,14 +161,6 @@ export default { ...@@ -162,14 +161,6 @@ export default {
this._importItemOk({ sampleIds: this.selectIds, drugItemList: data }) this._importItemOk({ sampleIds: this.selectIds, drugItemList: data })
}, },
// _importItemOk: async function(data) {
// const result = await drugSample.importSampleItemDTO(data)
// if (result) {
// this.$Message.success('导入成功!')
// await this._page()
// }
// },
_modalResult(data1, data2) { _modalResult(data1, data2) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'CopyModal': case 'CopyModal':
...@@ -221,12 +212,6 @@ export default { ...@@ -221,12 +212,6 @@ export default {
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
...@@ -248,23 +233,6 @@ export default { ...@@ -248,23 +233,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)
}, },
...@@ -396,17 +364,6 @@ export default { ...@@ -396,17 +364,6 @@ export default {
this.$refs.refModal._open('', this.entrustId) this.$refs.refModal._open('', this.entrustId)
} }
}, },
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.entrustId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.entrustId)
}
},
_search() { _search() {
this._page() this._page()
}, },
......
...@@ -251,9 +251,6 @@ export default { ...@@ -251,9 +251,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
......
...@@ -191,9 +191,6 @@ export default { ...@@ -191,9 +191,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
...@@ -228,14 +225,6 @@ export default { ...@@ -228,14 +225,6 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.refModal._open(id) this.$refs.refModal._open(id)
}) })
// this.$refs.operation._open(id)
},
_resultChange(msg) {
if (this.$store.state.FoodContract.success) {
this._page()
this.$Message.success(msg)
this.selectIds = []
}
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
...@@ -243,7 +232,6 @@ export default { ...@@ -243,7 +232,6 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId') this.$refs.refModal._open(id, 'entrustId')
}) })
// this.$refs.FileManage._open(id, 'entrustId')
} }
} }
} }
......
...@@ -237,9 +237,6 @@ export default { ...@@ -237,9 +237,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSample.page
break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
this.selectIds = [] this.selectIds = []
......
...@@ -47,17 +47,6 @@ ...@@ -47,17 +47,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==='groupName'" @click="_handleRow(scope)"> <div v-else-if="item.key==='groupName'" @click="_handleRow(scope)">
<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
...@@ -72,40 +61,6 @@ ...@@ -72,40 +61,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>
...@@ -122,7 +77,6 @@ ...@@ -122,7 +77,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../../../api/http'
import AutoCompletes from '../../../../components/base/AutoCompletes' import AutoCompletes from '../../../../components/base/AutoCompletes'
import { soilAptitude, soilEntrust } from '../../../../api' import { soilAptitude, soilEntrust } from '../../../../api'
export default { export default {
...@@ -211,20 +165,6 @@ export default { ...@@ -211,20 +165,6 @@ export default {
this.$Message.warning('修改失败') this.$Message.warning('修改失败')
} }
}, },
_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 '取消':
...@@ -246,13 +186,6 @@ export default { ...@@ -246,13 +186,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()
} }
...@@ -269,18 +202,9 @@ export default { ...@@ -269,18 +202,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 '导入样品': case '导入样品':
this._importSample() this._importSample()
break break
...@@ -290,129 +214,15 @@ export default { ...@@ -290,129 +214,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._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() {
...@@ -427,9 +237,6 @@ export default { ...@@ -427,9 +237,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
...@@ -530,17 +337,6 @@ export default { ...@@ -530,17 +337,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()
}, },
...@@ -572,13 +368,6 @@ export default { ...@@ -572,13 +368,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)
......
...@@ -307,106 +307,6 @@ export default { ...@@ -307,106 +307,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 = []
......
...@@ -370,12 +370,6 @@ export default { ...@@ -370,12 +370,6 @@ export default {
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
...@@ -389,107 +383,6 @@ export default { ...@@ -389,107 +383,6 @@ export default {
this.$refs.batchEdit._open(this.selectIds) this.$refs.batchEdit._open(this.selectIds)
} }
}, },
_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('取消分包成功')
}
},
_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.sampleId) this.$refs.refModal._open(this.sampleId)
}, },
...@@ -508,9 +401,6 @@ export default { ...@@ -508,9 +401,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
...@@ -630,17 +520,6 @@ export default { ...@@ -630,17 +520,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()
}, },
......
...@@ -115,9 +115,6 @@ export default { ...@@ -115,9 +115,6 @@ export default {
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
console.log(msg, data) console.log(msg, data)
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
break
case 'selectData': case 'selectData':
this.$emit('on-result-change', data) this.$emit('on-result-change', data)
break break
......
...@@ -246,9 +246,6 @@ export default { ...@@ -246,9 +246,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
......
...@@ -91,14 +91,6 @@ ...@@ -91,14 +91,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>
...@@ -122,7 +114,6 @@ ...@@ -122,7 +114,6 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../../api/http'
import { soilAptitude, soilEntrust } from '../../../api' import { soilAptitude, soilEntrust } from '../../../api'
import AutoCompletes from '../../../components/base/AutoCompletes' import AutoCompletes from '../../../components/base/AutoCompletes'
import PrepareItemBatchEdit from './PrepareItemBatchEdit' import PrepareItemBatchEdit from './PrepareItemBatchEdit'
...@@ -217,20 +208,6 @@ export default { ...@@ -217,20 +208,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 '取消':
...@@ -252,13 +229,6 @@ export default { ...@@ -252,13 +229,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()
} }
...@@ -343,39 +313,18 @@ export default { ...@@ -343,39 +313,18 @@ export default {
case '批量填写试验项目信息': case '批量填写试验项目信息':
this._writeInfo() this._writeInfo()
break break
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
...@@ -389,111 +338,6 @@ export default { ...@@ -389,111 +338,6 @@ export default {
this.$refs.batchEdit._open(this.selectIds) this.$refs.batchEdit._open(this.selectIds)
} }
}, },
_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('取消分包成功')
}
},
_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() {
...@@ -665,13 +509,6 @@ export default { ...@@ -665,13 +509,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)
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,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'
...@@ -216,13 +215,6 @@ export default { ...@@ -216,13 +215,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()
} }
...@@ -262,27 +254,6 @@ export default { ...@@ -262,27 +254,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() {
this.$refs.refModal._open(this.entrustId)
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
......
...@@ -115,9 +115,6 @@ export default { ...@@ -115,9 +115,6 @@ export default {
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
console.log(msg, data) console.log(msg, data)
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
break
case 'selectData': case 'selectData':
this.$emit('on-result-change', data) this.$emit('on-result-change', data)
break break
......
...@@ -293,10 +293,6 @@ export default { ...@@ -293,10 +293,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
this.selectIds = []
break
case 'selectData': case 'selectData':
const selectIds = [] const selectIds = []
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
...@@ -401,12 +397,10 @@ export default { ...@@ -401,12 +397,10 @@ export default {
}) })
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodItem.success) {
this._page() this._page()
this.$Message.success(msg) this.$Message.success(msg)
this.selectIds = [] this.selectIds = []
this.$emit('on-result-change') this.$emit('on-result-change')
}
}, },
_formSearch() { _formSearch() {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
......
...@@ -216,9 +216,6 @@ export default { ...@@ -216,9 +216,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
break break
...@@ -256,11 +253,9 @@ export default { ...@@ -256,11 +253,9 @@ export default {
// this.$refs.operation._open(id) // this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) {
this._page() this._page()
this.$Message.success(msg) this.$Message.success(msg)
this.selectIds = [] this.selectIds = []
}
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
......
...@@ -298,9 +298,6 @@ export default { ...@@ -298,9 +298,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
...@@ -508,17 +505,6 @@ export default { ...@@ -508,17 +505,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()
}, },
......
...@@ -35,11 +35,6 @@ ...@@ -35,11 +35,6 @@
</Col> </Col>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :show-search-btn="true" class="contHide"> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :show-search-btn="true" class="contHide">
<!--<template slot="processTask">-->
<!--<div class="fr process-task">-->
<!--<Button @click="_exportReceiveRecord">导出交接记录</Button>-->
<!--</div>-->
<!--</template>-->
</btn-list> </btn-list>
</Col> </Col>
<Col span="24"> <Col span="24">
...@@ -530,20 +525,6 @@ export default { ...@@ -530,20 +525,6 @@ export default {
this.$Message.success(msg) this.$Message.success(msg)
this.selectIds = [] this.selectIds = []
}, },
_exportReceiveRecord() {
// 导出交接记录
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择数据进行导出')
} else {
// eslint-disable-next-line no-undef
http.open(
'/food/report/excel/sheet?_u=db样品来源.report.xml&ids=' + ids
)
}
},
_deleteById(id) { _deleteById(id) {
// 删除一条记录 // 删除一条记录
this.$Modal.confirm({ this.$Modal.confirm({
...@@ -562,9 +543,6 @@ export default { ...@@ -562,9 +543,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSample.page
break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
this.selectIds = [] this.selectIds = []
......
...@@ -272,106 +272,6 @@ export default { ...@@ -272,106 +272,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 = []
......
...@@ -73,19 +73,9 @@ export default { ...@@ -73,19 +73,9 @@ export default {
console.log(result) console.log(result)
this.num = '' this.num = ''
this.$Message.success('领样成功') this.$Message.success('领样成功')
// this._resultChange(' 领样')
} }
this._autoFocus() this._autoFocus()
}, },
_resultChange(msg) {
const returnNum = this.$store.state.FoodSample.success
if (returnNum) {
this.scanInfo.push('编号 ' + returnNum + msg + '成功!')
this.num = ''
} else {
this.num = ''
}
},
// 关闭弹框,刷新界面 // 关闭弹框,刷新界面
_visibleChange(data) { _visibleChange(data) {
this.$emit('on-result-change') this.$emit('on-result-change')
......
...@@ -166,10 +166,6 @@ export default { ...@@ -166,10 +166,6 @@ export default {
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSample.page
break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
this.selectIds = [] this.selectIds = []
......
...@@ -111,7 +111,6 @@ ...@@ -111,7 +111,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: {},
...@@ -174,20 +173,6 @@ export default { ...@@ -174,20 +173,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 '取消':
...@@ -209,13 +194,6 @@ export default { ...@@ -209,13 +194,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()
} }
...@@ -232,150 +210,24 @@ export default { ...@@ -232,150 +210,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() {
...@@ -492,17 +344,6 @@ export default { ...@@ -492,17 +344,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()
}, },
...@@ -534,13 +375,6 @@ export default { ...@@ -534,13 +375,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)
......
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,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'
...@@ -172,23 +171,8 @@ export default { ...@@ -172,23 +171,8 @@ export default {
this._importItemOk({ sampleIds: this.selectIds, drugItemList: data }) this._importItemOk({ sampleIds: this.selectIds, drugItemList: data })
}, },
// _importItemOk: async function(data) {
// const result = await drugSample.importSampleItemDTO(data)
// if (result) {
// this.$Message.success('导入成功!')
// await this._page()
// }
// },
_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()
} }
...@@ -204,12 +188,6 @@ export default { ...@@ -204,12 +188,6 @@ export default {
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
...@@ -225,18 +203,9 @@ export default { ...@@ -225,18 +203,9 @@ export default {
case '批量填写土质描述详情': case '批量填写土质描述详情':
this._writeDetail(this.selectIds) this._writeDetail(this.selectIds)
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
...@@ -258,27 +227,6 @@ export default { ...@@ -258,27 +227,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() {
this.$refs.refModal._open(this.entrustId)
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -408,17 +356,6 @@ export default { ...@@ -408,17 +356,6 @@ export default {
this.$refs.refModal._open('', this.entrustId) this.$refs.refModal._open('', this.entrustId)
} }
}, },
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.entrustId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.entrustId)
}
},
_search() { _search() {
this._page() this._page()
}, },
...@@ -501,14 +438,6 @@ export default { ...@@ -501,14 +438,6 @@ export default {
LODOP.PRINT_DESIGN() LODOP.PRINT_DESIGN()
}, },
_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)
......
...@@ -262,9 +262,6 @@ export default { ...@@ -262,9 +262,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
......
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