Commit 846d55c6 by lichengming

修改了留存位置查询

parent 11453f3c
......@@ -67,6 +67,8 @@ export default {
http.post('soil/v1/sample/page_send_his', data).then(res => res),
receiveSample: data =>
http.post('soil/v1/sample/receive_sample', data).then(res => res),
sampleRetain: data =>
http.post('soil/v1/sample/sample_retain', data).then(res => res),
sendSample: data =>
http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data =>
......
......@@ -9,6 +9,8 @@ export default {
// page
locationPage: data =>
http.post('soil/v1/receive_location/page', data).then(res => res),
pageRetain: data =>
http.post('soil/v1/sample/page_retain', data).then(res => res),
locationList: data =>
http.post('soil/v1/receive_location/list', data).then(res => res),
locationGetById: data =>
......
......@@ -69,7 +69,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
code: '',
name: ''
......
......@@ -18,7 +18,7 @@
</Form-item>
<Form-item label="备样人:">
<el-select :value="formObj.backupUser" @change="selUser" style="width:100%" size="small">
<el-option v-for="item in backupUserList" :value="item.id" :label="item.realname" :key="item.realname">{{ item.realname }}
<el-option v-for="item in backupUserList" :value="item.id" :label="item.realname" :key="item.id">{{ item.realname }}
</el-option>
</el-select>
</Form-item>
......
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<Col span="24" class="margin-top-10">
<!--搜索表单-->
<Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!--表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.key==='status'">{{scope.row[item.key]===0?'现行':scope.row[item.key]===1?'即将实施':
scope.row[item.key]===2?'部分被代替':scope.row[item.key]===3?'被代替':scope.row[item.key]===4?'作废':''}}
</div>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-else-if="item.key==='classify'">
{{scope.row[item.key]===0?'判定依据':scope.row[item.key]===1?'检测依据':scope.row[item.key]===2?'其他':''}}
</div>
<div v-else-if="item.key==='type'">
{{scope.row[item.key]===0?'国家标准':scope.row[item.key]===1?'地方标准':scope.row[item.key]===2?'行业标准':scope.row[item.key]===3?'企业标准': ''}}
</div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</div>
<div v-else-if="item.key==='fileUrl'">
<span v-if="scope.row['fileUrl']" class="green-color"></span>
<span v-else class="red-color"></span>
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!--组件加载-->
<ViewSample ref="viewSample"></ViewSample>
<StandardsManageEdit ref="editModal" @on-result-change="_page"></StandardsManageEdit>
<DownloadTemplateImport ref="importModal" @on-result-change="_page"></DownloadTemplateImport>
<!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>-->
</div>
</template>
<script>
import http from '../../../api/http'
import { soilSample } from '../../../api'
import global from '../../../api/config'
import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入
import StandardsManageEdit from './AddressManageEdit' // 添加、编辑
import ViewSample from './ViewSample'
export default {
components: {
StandardsManageEdit,
DownloadTemplateImport,
ViewSample
},
data() {
return {
currentComponent: '',
formObj: {
entrustCode: undefined,
name: undefined
},
btn: [
// {
// type: 'success',
// id: '',
// name: '添加',
// componentName: 'StandardsManageEdit'
// },
// { type: 'error', id: '', name: '删除' }
// { id: '', name: '导入', componentName: 'DownloadTemplateImport' },
// { id: '', name: '导出' }
],
// 表格
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
],
// 操作
iconMsg: [
{
type: 'md-create',
id: '',
name: '编辑',
componentName: 'StandardsManageEdit'
},
{
type: 'md-apps',
id: '',
name: '查看试样'
},
{ type: 'md-remove-circle', id: '', name: '删除' }
],
searchOpen: true,
getPage: {},
// 选中的内容
selectIds: [],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
classifyList: [
{ value: 0, name: '判定标准' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
]
}
},
computed: {
// 表格的高度
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
// 操作按钮
_btnClick(msg, currentComponent) {
this.currentComponent = currentComponent
switch (msg) {
case '添加':
this.$nextTick(() => {
this._editModal(false)
})
break
case '删除':
this._deleteSelected()
break
case '导入':
this.$nextTick(() => {
this._import()
})
break
case '导出':
// this._export()
break
// 收起搜索
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
// 表格中操作
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
this.$nextTick(() => {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '查看试样':
this._viewSample(data.name)
break
case '上传':
this._upload(data.id)
break
case '下载':
this._download(data)
break
case '预览':
this._viewReport(data)
break
case '查看替代关系':
this.$refs.relationModal._open(data.id)
break
case '删除':
this._deleteById(data.id)
break
}
})
},
_upload(id) {
const obj = {
importUrl: '/soil/v1/standard_annex/upload/' + id
}
this.$refs.uploadModal._open(obj)
},
_viewSample(data) {
console.log(data)
this.$refs.viewSample._openHis(data)
},
_editModal: async function(edit, id) {
if (edit) {
// 编辑
// this.$store.dispatch('StandardInfo/getById', id).then(() => {
// this.$refs.refModal._open(this.$store.state.StandardInfo.model)
// })
const result = await soilSample.locationGetById(id)
if (result) {
this.$refs.editModal._open(result)
}
} else {
// 添加
this.$refs.editModal._open()
}
},
// 获取数据
_page: async function() {
// this.$refs.pageTable._page('search-form', 'StandardInfo/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageRetain(
this.$serializeForm(this.formObj)
)
if (result) {
console.log(result)
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
// 查询
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除一条记录
_deleteById(id) {
this._deleteByIds([id])
},
// 批量删除
_deleteSelected() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(
this.selectIds,
'确定删除这 ' + this.selectIds.length + ' 条记录?'
)
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
loading: true,
content: content || '确定删除该记录?',
onOk: () => {
this._delOk(ids)
}
})
},
_delOk: async function(ids) {
const result = await soilSample.locationDeleteById(ids)
if (result) {
this._page()
this.$Modal.remove()
this.$Message.success('删除成功')
}
},
// 表格内容
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
// this.getPage = this.$store.state.StandardInfo.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
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) {
const fileUrl = encodeURIComponent(
global.baseURL + '/soil/v1/standard_annex/preview/' + data.id
)
console.log(fileUrl)
window.open(
global.staticURL + '/pdf/PDFJS/pdfjs/web/viewer.html?file=' + fileUrl
)
},
// 下载
_download(data) {
console.log(data)
this.$Modal.confirm({
title: '提示',
content: '确定要下载文件?',
onOk: () => {
if (!data.fileUrl) {
this.$Message.error('附件未上传,请上传附件!')
return
}
window.open(
global.baseURL + '/soil/v1/standard_annex/download/' + data.id,
'_blank'
)
}
})
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="位置编号" prop="code" style="width: 100%">
<Input v-model="formObj.code" name="code" placeholder="请输入位置编号"/>
</Form-item>
<Form-item label="收样存储位置" prop="name" style="width: 100%">
<Input v-model="formObj.name" name="name" placeholder="请输入收样存储位置"/>
</Form-item>
<Form-item label="位置管理人" prop="manager" style="width: 100%">
<Input v-model="formObj.manager" @click.native="_selectStaff" name="manager" readonly/>
</Form-item>
<Form-item prop="managerId" style="width: 100%;display: none">
<Input v-model="formObj.managerId" @click.native="_selectStaff" name="managerId" readonly/>
</Form-item>
<Form-item label="备注说明" prop="remark" style="width: 100%">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注说明"/>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
<UserInfo ref="userModal" @on-result-change="_userData" is-change></UserInfo>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilSample } from '../../../api'
import Global from '../../../api/config'
import UserInfo from '../../../components/user-info-single/assignPerson'
export default {
components: {
ModalFooter,
UserInfo
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '收样位置选择',
formObj: {
name: '',
code: '',
remark: '',
manager: '',
managerId: ''
},
options: [
{
name: '国家标准'
},
{
name: '地方标准'
},
{
name: '行业标准'
},
{
name: '企业标准'
}
],
ruleValidate: {
code: [
{ required: true, message: '检测依据不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '检测依据名称不能为空', trigger: 'blur' }
]
},
showEditModal: false,
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
_getUser() {
const user = Global.getUserInfo()
this.formObj.manager = user.realname
this.formObj.managerId = user.id
console.log(user)
},
_selectStaff() {
this.$refs.userModal._open()
},
_userData(data, msg, contractTempData) {
console.log(data, msg)
},
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
if (this.formObj.publishDate && this.formObj.effectDate) {
if (this.formObj.publishDate > this.formObj.effectDate) {
this.$Message.error('发布日期应早于实施日期')
this._hideLoading()
return
}
}
const data = this.$serialize('edit-form')
if (this.$string(this.formObj.id).isEmpty()) {
// 添加
this._save(data)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
}
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_save: async function(data) {
const result = await soilSample.locationSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilSample.locationEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(formObj) {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) {
this.modalTitle = '添加'
this.formObj.id = ''
this._getUser()
} else {
this.formObj = formObj
this.formObj.id = formObj.id
this.formObj.effectDate = this.formObj.effectDate
? new Date(formObj.effectDate)
: ''
this.formObj.publishDate = this.formObj.publishDate
? new Date(formObj.publishDate)
: ''
this.modalTitle = '编辑'
}
this.showEditModal = true
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" width="980" class="modal-footer-none">
<p slot="header">
{{ modalTitle }}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样品编号" clearable />
</Form-item>
<Form-item class="search-btn">
<Button @click="_page" type="primary">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div>
<div v-else-if="item.status">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<div v-else>
{{ scope.row[item.key] }}
</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import http from '../../../api/http'
import { soilEntrust, soilSample } from '../../../api'
import { getLodop } from '../../../plugins/clodop/LodopFuncs'
let LODOP
export default {
components: {},
data() {
return {
formId: 'soilSampleManage',
currentComponent: '',
btn: [
{
type: 'success',
id: 'ZBC',
name: '打印标签'
}
],
itemList: [],
indexList: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
entrustId: '', // 委托id
showModal: false,
recordHis: false,
searchOpen: true,
modalTitle: '管理样品',
selectIds: [],
selectData: {},
getPage: {},
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 },
{ title: '现场编号', key: 'siteNo', width: 100 },
{ title: '委托编号', key: 'entrustCode', width: 100 },
{ title: '收样位置', key: 'receiveLocation', width: 100 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '土质描述详情', key: 'describeDetail', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }
],
sampleId: '',
dateList: [],
formObj: {
receiveLocation: undefined,
sampleCode: undefined
}
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
methods: {
_inputChange: async function(info) {
const result = await soilEntrust.sampleEdit({
id: info.id,
describeDetail: info.describeDetail
})
if (result) {
this._resultChange('修改成功')
}
},
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_ok() {
this.showModal = false
this.$refs.footerModal._hideLoading()
console.log(this.getPage)
},
_itemImportBack(data) {
if (this.selectIds === undefined || this.selectIds.length === 0) {
return false
}
if (data === undefined || data.length === 0) {
return false
}
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) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '打印标签':
this._printLabel()
break
case '试样制备':
this._samplePre()
break
case '批量填写土质描述详情':
this._writeDetail(this.selectIds)
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_samplePre() {
if (this.selectIds.length === 0) {
this.$message.warning('至少选择一条数据')
} else {
this.$refs.preModal._open(this.selectIds.join(','))
}
},
_writeDetail(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
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) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '管理检测项目':
this._itemManage(data.id)
break
case '制备详情':
this._preEdit(data.id)
break
case '编辑':
this._editModal(true, data)
break
case '复制':
this._copy(data)
break
case '删除':
console.log(index)
this._deleteById(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_preEdit(id) {
this.$refs.preHisModal._open(id)
},
_itemManage(data) {
// 管理检测项目
if (this.recordHis) {
this.$refs.sampleItemManage._openRecord(data)
} else {
this.$refs.sampleItemManage._open(data)
}
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'allSelect':
console.log('123465798', data)
this.allSelect(data)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
allSelect(data) {
this.indexList = []
for (let i = 0; i < data.length; i++) {
this.indexList.push(data[i].index)
}
console.log('索引', this.indexList)
},
_open(id) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.entrustId = id // 委托id
console.log(this.entrustId)
this.$refs.pageTable._hideLoading()
this._page()
},
_openHis(adress) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.receiveLocation = adress // 委托id
this.$refs.pageTable._hideLoading()
this.recordHis = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
const result = await soilSample.pageLocationSample(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
// this.$store.dispatch('FoodSample/deleteByIds', ids).then(() => {
// this._resultChange('删除成功!')
// })
this._deleteOk(ids)
}
})
},
// _deleteOk: async function(ids) {
// const result = await drugSample.deleteById(ids)
// if (result) {
// this._resultChange('删除成功')
// }
// },
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(data) {},
_editModal(edit, data) {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
} else {
// 添加
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() {
this._page()
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.sampleItemModal._open()
this.$refs.pageTable.checkedData()
}
},
// 导入检测项目包
_importItemPackage() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
// this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
this.$refs.itemPackageModal._open(
this.selectIds,
'sample-rel-package-item'
)
}
},
_printLabel() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
for (let m = 0; m < this.selectData.length; m++) {
const row = this.selectData[m]
this._printLabelOk(row)
}
}
},
_printLabelOk(row) {
LODOP = getLodop()
if (LODOP === 'undefined' || LODOP === undefined) {
this._pluginDownload()
return false
}
if (LODOP.GET_PRINTER_COUNT() === 0) {
this.$Messager.warning('系统未关联打印机,请确认....')
return false
}
LODOP.PRINT_INITA('0mm', '0mm', '70.01mm', '50.01mm', '样品标签打印')
LODOP.ADD_PRINT_LINE(36, 15, 35, 251, 0, 1)
LODOP.ADD_PRINT_LINE(74, 15, 73, 251, 0, 1)
LODOP.ADD_PRINT_LINE(107, 15, 106, 251, 0, 1)
LODOP.ADD_PRINT_LINE(140, 15, 139, 251, 0, 1)
LODOP.ADD_PRINT_LINE(175, 15, 174, 251, 0, 1)
LODOP.ADD_PRINT_LINE(35, 15, 174, 16, 0, 1)
LODOP.ADD_PRINT_LINE(35, 74, 174, 75, 0, 1)
LODOP.ADD_PRINT_LINE(35, 251, 174, 252, 0, 1)
LODOP.ADD_PRINT_TEXT(49, 17, 59, 20, '样品名称')
LODOP.ADD_PRINT_TEXT(82, 18, 59, 20, '样品编号')
LODOP.ADD_PRINT_TEXT(116, 17, 59, 20, '样品状态')
LODOP.ADD_PRINT_TEXT(151, 27, 39, 20, '备注')
LODOP.ADD_PRINT_TEXT(16, 95, 100, 20, '检测样品标签')
LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
LODOP.ADD_PRINT_TEXT(49, 78, 135, 20, row.name)
LODOP.ADD_PRINT_TEXT(82, 77, 136, 20, row.sampleCode)
LODOP.ADD_PRINT_TEXT(117, 76, 176, 20, '□未检 □在检 □已检 □留样')
if (row.surplus === '取回') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '☑"取回 □服务方处理')
} else if (row.surplus === '服务方处理') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 ☑服务方处理')
} else {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 □服务方处理')
}
LODOP.PRINT_DESIGN()
},
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
......@@ -9,7 +9,7 @@
<Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="位置编号:">
<Input @on-enter="_formSearch" v-model="formObj.code" name="code" placeholder="请输入检测依据" clearable/>
<Input @on-enter="_formSearch" v-model="formObj.code" name="code" placeholder="请输入位置编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......
......@@ -51,7 +51,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
name: '',
code: '',
......
......@@ -35,7 +35,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
detail: ''
},
......
......@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
receiveLocation: '',
locationId: ''
......@@ -112,6 +112,7 @@ export default {
if (result) {
this._resultChange('收样成功!')
}
this._hideLoading()
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
......
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="收样位置" prop="name" style="width: 100%">
<el-select v-model="formObj.locationId" @change="selectLocation($event)" name="locationId">
<el-option v-for="(item) in options" :label="item.name" :key="item.id" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '留存位置选择',
formObj: {
receiveLocation: '',
locationId: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
selectLocation(data) {
this._getLocationById(data)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_receive: async function(data) {
const result = await soilEntrust.sampleRetain(data)
if (result) {
this._resultChange('留存成功!')
}
this.$refs.footerModal._hideLoading()
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.receiveLocation = ''
this.formObj.locationId = ''
this._getLocation()
this.ids = ids
this.showEditModal = true
},
_getLocation: async function() {
const result = await soilSample.locationList()
if (result) {
console.log(result)
this.options = result
console.log(this.options)
}
},
_getLocationById: async function(id) {
console.log(id)
const result = await soilSample.locationGetById(id)
if (result) {
this.formObj.receiveLocation = result.name
}
console.log(this.formObj.receiveLocation)
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
......@@ -5,11 +5,16 @@
<Row>
<!--查询-->
<Col span="24" style="padding-bottom: 5px">
<Form id="search-wait" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<Form id="search-wait" :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable></Input>
</Form-item>
<Form-item label="是否有试验项目:" class="search-item">
<Select v-model="formObj.haveExp" clearable name="groupId" style="width:150px" placeholder="请选择检测科室">
<Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option>
</Select>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
......@@ -52,19 +57,34 @@
<!--选择领样人-->
<SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
<KeepAdress ref="keepAdressModal" @on-result-change="_page"></KeepAdress>
</div>
</template>
<script>
import { soilEntrust } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal'
import SoilSampleItemManage from './SoilSampleItemManage'
import KeepAdress from './KeepAdress'
export default {
components: { SampleReceiveModal, SoilSampleItemManage },
components: { SampleReceiveModal, SoilSampleItemManage, KeepAdress },
data() {
return {
btn: [{ type: 'primary', id: '', name: '收样室收样' }],
btn: [
{ type: 'primary', id: '', name: '收样室收样' },
{ type: 'primary', id: '', name: '样品留存' }
],
selectIds: [],
getPage: {},
itemData: [
{
name: '是',
value: 1
},
{
name: '否',
value: 0
}
],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 120, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 },
......@@ -85,7 +105,8 @@ export default {
num: '',
detectType: '',
standard: '',
samplingLinkList: []
samplingLinkList: [],
haveExp: undefined
},
stdList: [],
sampleLinkList: [
......@@ -269,6 +290,9 @@ export default {
case '收样室收样':
this._sampleReceive(this.selectIds)
break
case '样品留存':
this._sampleKeep(this.selectIds)
break
case '打印标签':
this._selectPrinter('print-label')
break
......@@ -502,7 +526,14 @@ export default {
break
}
},
_sampleKeep(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.keepAdressModal._open(ids)
}
},
// 样品接收
_sampleReceive(id) {
if (this.selectIds.length === 0) {
......
......@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
receiveLocation: '',
locationId: ''
......
......@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
receiveLocation: '',
locationId: ''
......
......@@ -10,6 +10,7 @@ import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust'
import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/SampleReceiveIndex'
import SamplePreparationIndex from '../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex'
import AddressManage from '../pages/soil-sample-manage/sample-address/AddressManage'
import KeepAdress from '../pages/soil-sample-manage/keep-address/AddressManage'
import BackupsManage from '../pages/soil-sample-manage/backups-manage/SampleBackupsIndex'
import SampleTakeIndex from '../pages/soil-sample-manage/sample-take/SampleTakeIndex'
import SurplusManage from '../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex'
......@@ -79,6 +80,11 @@ export default [
meta: { title: '备样管理' }
},
{
path: 'keep',
component: KeepAdress,
meta: { title: '留存位置查询' }
},
{
path: 'surplus',
component: SurplusManage,
meta: { title: '余样管理' }
......
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