Commit 469e0519 by wangweidong

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

parents 2dfda89c 21b1bbde
......@@ -134,11 +134,26 @@ export default {
http.post('res/v1/dict/dict_query?type=' + data).then(res => res),
editBackup: data =>
http.put('soil/v1/sample_backup/' + data.id, data.obj).then(res => res),
bathUpdateBackupInfo: data =>
http
.post(
'soil/v1/sample_backup/bath_update_backup_info/?ids=' + data.id,
data.obj
)
.then(res => res),
editItem: data =>
http.post('soil/v1/experiment/bath_update_info', data).then(res => res),
// 余样编辑
editPrepare: data =>
http.put('soil/v1/prepare/' + data.id, data.obj).then(res => res),
// 批量填写余样信息
bathUpdateSurplusInfo: data =>
http
.post(
'soil/v1/prepare/bath_update_surplus_info/?ids=' + data.id,
data.obj
)
.then(res => res),
getUserList: data => http.post('/base/v1/user/page').then(res => res),
scanTakeSample: data =>
http
......
......@@ -43,13 +43,21 @@ export default {
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
Global.recordURL +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri)
let url = ''
if (process.env.NODE_ENV === 'production') {
url =
'http://record.patzn.com/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri)
} else {
url =
Global.recordURL +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri)
}
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
......@@ -62,15 +70,25 @@ export default {
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
Global.recordURL +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri) +
'&type=' +
fromType
let url = ''
if (process.env.NODE_ENV === 'production') {
url =
'http://record.patzn.com/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri) +
'&type=' +
fromType
} else {
url =
Global.recordURL +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri) +
'&type=' +
fromType
}
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
......
......@@ -325,14 +325,17 @@ export default {
// 查看原始记录
_recordView(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......
......@@ -39,7 +39,7 @@
:edit-render="item.editCell?{autofocus: 'input'}:null" sortable>
<template v-slot:edit="scope">
<div v-if="item.key==='describeDetail'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.describeDetail" @change="_inputChange(scope.row)"></el-input>
<el-input v-model="scope.row.describeDetail" @blur="_page()" @change="_inputChange(scope.row)"></el-input>
</div>
</template>
<template slot-scope="scope">
......
......@@ -3,7 +3,7 @@
<Modal v-model="showModal" :mask-closable="false">
<p slot="header">填写存放信息</p>
<div>
<Form id="storage-location-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form id="storage-location-form" ref="formObj" :model="formObj" :label-width="100">
<Form-item label="存储条件:">
<el-select :value="formObj.conditions" @change="selCondi" style="width:100%" size="small">
<el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }}
......@@ -88,9 +88,6 @@ export default {
this.getPage.records[this.currentIndex].backupUser = ''
}
this.formObj.backupUserId = data
// this.$forceUpdate()
// this.getPage.records[this.currentIndex].backupUser = data
// this.getPage.records[this.currentIndex].backupUser = data
},
// 存储条件 回调
_locChangeCondition(msg, data) {
......@@ -150,7 +147,7 @@ export default {
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.formObj
const data = this.$serializeForm(this.formObj)
this._saveInfo({ id: this.ids.join(','), obj: data })
} else {
this.$Message.error('表单验证失败!')
......@@ -159,9 +156,11 @@ export default {
})
},
_saveInfo: async function(data) {
const result = await soilSample.editBackup(data)
const result = await soilSample.bathUpdateBackupInfo(data)
if (result) {
this.$Message.success('保存成功')
this.$emit('on-result-change')
this.showModal = false
}
}
}
......
......@@ -93,7 +93,7 @@
</div>
<SampleParpareApply ref="applyModal" @on-result-change="_page"></SampleParpareApply>
<Operation ref="recordModal"></Operation>
<SampleParpareBatchEdit ref="batchEdit"></SampleParpareBatchEdit>
<SampleParpareBatchEdit ref="batchEdit" @on-result-change="_page"></SampleParpareBatchEdit>
</div>
</template>
<script>
......
<template>
<div>
<Modal v-model="showModal" :mask-closable="false">
<p slot="header">填写存放信息</p>
<div>
<Form id="storage-location-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form-item label="保存容器:" prop="keepContainer">
<AutoCompletes v-model="formObj.keepContainer" :downData="containerList"
@on-result-change="_containerChange" name="keepContainer" placeholder="输入或选择保存容器"
></AutoCompletes>
</Form-item>
<Form-item label="制备数量">
<Input v-model="formObj.quantity" clearable placeholder="请输入备样数量"></Input>
</Form-item>
<Form-item label="留存位置">
<Input v-model="formObj.keepLocation" clearable placeholder="请输入留存位置"></Input>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import { soilSample } from '../../../api'
import AutoCompletes from '../../../components/base/AutoCompletes'
export default {
components: { AutoCompletes },
data() {
return {
ids: [], // 委托ids
showModal: false,
formObj: {},
ruleValidate: {
backupLocation: [
{ required: true, message: '备样位置不能为空', trigger: 'blur' }
]
},
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
containerList: [],
locList: [],
backupUserList: [],
sampleUnit: ''
}
},
mounted() {
this._getContainerList()
},
methods: {
_getContainerList: async function() {
const result = await soilSample.getDictList('保存容器')
if (result) {
for (let i = 0; i < result.length; i++) {
this.containerList.push(result[i].name)
}
}
},
_containerChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.keepContainer = data
break
case 'query':
this.formObj.keepContainer = data
break
}
},
_locChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.backupPlace = data.backupPlace
this._getCondition(data.backupPlace)
break
case 'query':
this.formObj.backupPlace = data.backupPlace
this._getLocList(data.backupPlace)
break
}
},
selCondi(data) {
this.$forceUpdate()
this.formObj.conditions = data
},
selUser(data) {
this.$forceUpdate()
if (data) {
for (let i = 0; i < this.backupUserList.length; i++) {
if (this.backupUserList[i].id === data) {
this.formObj.backupUser = this.backupUserList[i].realname
}
}
} else {
this.getPage.records[this.currentIndex].backupUser = ''
}
this.formObj.backupUserId = data
},
// 存储条件 回调
_locChangeCondition(msg, data) {
switch (msg) {
case 'select':
this.formObj.storageCondition = data.name
this._getLocCondition(data.name)
break
case 'query':
this.formObj.storageCondition = data.name
this._getLocConditionList(data.name)
break
}
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_open(data) {
this.showModal = true
this.formObj = this.$resetFields(this.formObj)
this.sampleUnit = ''
this.$refs.footerModal._hideLoading()
this.ids = data
// 循环遍历数据
},
_getConditionList: async function() {
const result = await soilSample.getDictList('存储条件')
if (result) {
this.conditionList = result
}
},
_getUserList: async function() {
const result = await soilSample.getUserList()
if (result) {
console.log(result)
this.backupUserList = result.records
}
},
//
_dateChange(data) {
this.formObj.endDate = data
},
_cancel() {
this.showModal = false
this.$refs.footerModal._hideLoading()
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.formObj
this._saveInfo({ id: this.ids.join(','), obj: data })
} else {
this.$Message.error('表单验证失败!')
this.$refs.footerModal._hideLoading()
}
})
},
_saveInfo: async function(data) {
const result = await soilSample.bathUpdateSurplusInfo(data)
if (result) {
this.$Message.success('保存成功')
this.$emit('on-result-change')
this.showModal = false
}
}
}
}
</script>
......@@ -42,10 +42,27 @@
<div v-else-if="item.key==='keepContainer'">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-select v-model="scope.row.keepContainer" clearable style="width:100%" size="small">
<el-option v-for="item in containerList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
<AutoCompletes v-model="scope.row.keepContainer" :downData="containerList"
@on-result-change="_containerChange" name="keepContainer" placeholder="输入或选择保存容器"
></AutoCompletes>
</div>
<!-- <div v-else>-->
<!-- <el-select v-model="scope.row.keepContainer" clearable style="width:100%" size="small">-->
<!-- <el-option v-for="item in containerList" :value="item.name" :key="item.name">{{ item.name }}-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
</div>
<div v-else-if="item.key==='quantity'">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-input v-model="scope.row.quantity" placeholder="制备数量"></el-input>
</div>
</div>
<div v-else-if="item.key==='keepLocation'">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-input v-model="scope.row.keepLocation" placeholder="留存位置"></el-input>
</div>
</div>
<span v-else>{{scope.row[item.key]}}</span>
......@@ -68,18 +85,23 @@
</div>
<SampleParpareApply ref="applyModal" @on-result-change="_page"></SampleParpareApply>
<Operation ref="recordModal"></Operation>
<SampleSurplusBatchEdit ref="batchEdit" @on-result-change="_page"></SampleSurplusBatchEdit>
</div>
</template>
<script>
import SampleParpareApply from '../SurplusParpareApply'
import SampleSurplusBatchEdit from '../SampleSurplusBatchEdit'
// eslint-disable-next-line no-unused-vars
import http from '../../../../api/http'
import { soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
import AutoCompletes from '../../../../components/base/AutoCompletes'
export default {
components: {
SampleParpareApply,
Operation
Operation,
SampleSurplusBatchEdit,
AutoCompletes
},
data() {
return {
......@@ -101,6 +123,11 @@ export default {
type: 'primary',
id: '',
name: '完成处理'
},
{
type: 'primary',
id: '',
name: '批量填写存放信息'
}
// { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' },
......@@ -116,6 +143,7 @@ export default {
{ title: '状态', key: 'status', status: true, width: 100 },
{ title: '包装类型', key: 'samplePack', width: 100 },
{ title: '保存容器', key: 'keepContainer', width: 150 },
{ title: '留存位置', key: 'keepLocation', width: 150 },
{ title: '制备数量', key: 'quantity', width: 100 },
{ title: '单位', key: 'unit', width: 70 },
{ title: '制备人', key: 'preparer', width: 130 },
......@@ -176,11 +204,6 @@ export default {
},
mounted() {
this.$refs.pageTable._showLoading()
// 样品存储期限预警
// this.sampleHandleValue = Number(localStorage.getItem('sampleHandleValue'))
// this._getLocList()
// this._getConditionList()
// this._getBackUpCount()
this._getContainerList()
},
methods: {
......@@ -197,7 +220,9 @@ export default {
_getContainerList: async function() {
const result = await soilSample.getDictList('保存容器')
if (result) {
this.containerList = result
for (let i = 0; i < result.length; i++) {
this.containerList.push(result[i].name)
}
}
},
// 查询卡片备样数量
......@@ -210,6 +235,16 @@ export default {
}
})
},
_containerChange(msg, data) {
switch (msg) {
case 'select':
this.getPage.records[this.currentIndex].keepContainer = data
break
case 'query':
this.getPage.records[this.currentIndex].keepContainer = data
break
}
},
// 选择时间
_endDateChange(data) {
this.getPage.records[this.currentIndex].endDate = data
......@@ -222,7 +257,9 @@ export default {
_save() {
this.$nextTick(function() {
const tempData = {
keepContainer: this.getPage.records[this.currentIndex].keepContainer
keepContainer: this.getPage.records[this.currentIndex].keepContainer,
quantity: this.getPage.records[this.currentIndex].quantity,
keepLocation: this.getPage.records[this.currentIndex].keepLocation
}
this._saveOk({
id: this.getPage.records[this.currentIndex].id,
......@@ -333,6 +370,9 @@ export default {
case '填写存放信息':
this._batchEdit()
break
case '批量填写存放信息':
this._writeInfo()
break
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
......@@ -348,6 +388,13 @@ export default {
break
}
},
_writeInfo() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this.$refs.batchEdit._open(this.selectIds)
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
......
......@@ -214,14 +214,17 @@ export default {
},
_viewRecord(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......
......@@ -459,14 +459,17 @@ export default {
},
_viewRecord(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......
......@@ -207,14 +207,17 @@ export default {
},
_viewRecord(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......
......@@ -459,14 +459,17 @@ export default {
},
_viewRecord(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......
......@@ -39,17 +39,21 @@ export default {
this.formIdTemp = formId + this.$randomCode()
this.again = true
// this.showModal = true;
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
Global.recordURL +
recordUrl +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri)
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
......@@ -58,19 +62,23 @@ export default {
this.formIdTemp = formId + this.$randomCode()
this.again = true
// this.showModal = true;
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
Global.recordURL +
recordUrl +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri) +
'&type=' +
fromType
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
......
......@@ -287,14 +287,17 @@ export default {
// 查看原始记录
_recordView(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......
......@@ -81,6 +81,7 @@ export default {
businessTypeList: 0
},
entrustId: '',
clientList: [],
selectData: [],
itemIds: [],
footerList: [
......@@ -140,10 +141,11 @@ export default {
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open(ids, entrustId) {
_open(ids, entrustId, clientInfo) {
console.log(Global.recordURL)
this.formObj = this.$resetFields(this.formObj)
this.entrustId = entrustId
this.clientList = clientInfo
this._classTree()
this.showModal = true
this.itemIds = ids
......@@ -153,15 +155,6 @@ export default {
this._hideLoading()
count = 0
},
// _page() {
// // 只查实验室的
// console.log('page')
// // this.$refs.pageTable._page(
// // '',
// // 'ElnTemplate/page',
// // this.$serializeFormSearch(this.formObj)
// // )
// },
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.id
......@@ -195,25 +188,9 @@ export default {
this.$Message.warning('请选择一个原始记录模板!')
this._hideLoading()
} else {
console.log(this.selectData)
// 校验多样品多项目原始记录模板
const param = {
ids: '1289126946969550850',
tempId: this.selectData[0].id
}
console.log('模板', param)
this._createOriginalRecord()
// this._check(param)
// this.$store.dispatch('EnvItem/checkLimit', param).then(() => {
// const result = this.$store.state.EnvItem.success
// if (result) {
// // 不是多样品项目模板或者数量小于限值,填写原始记录
// // (3)originalTemplateId不为0也不为undefined ---- 填写过或者绑定过
// this._bindOriginalRecord()
// } else {
// this.$msgTip('warning', '所选数据超过,原始记录模板设置最大值!')
// this._hideLoading()
// }
// })
}
},
_check: async function(param) {
......@@ -221,72 +198,24 @@ export default {
console.log(result)
},
_createOriginalRecord() {
// const result = await soilTest.searchItem({ ids: this.itemIds.join(',') })
// console.log(result)
this.showModal = false
console.log('环境', process.env.NODE_ENV)
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
const url =
Global.recordURL + '/print/v1/eln/template_YT_' + this.selectData[0].id
recordUrl + '/print/v1/eln/template_meter_' + this.selectData[0].id
const params = {
ids: this.itemIds.join(',')
// allSampleCount: '',
// normalSampleCount: '',
// itemCount: '',
// parallelCount: '',
// labelSample: ''
ids: this.itemIds.join(','),
client: this.clientList[0]
}
this.$refs.iframeModal._createIframe(url, params)
console.log('原始记录', url, params)
localStorage.setItem('recordStatus', 'addLabRecord')
},
// 生成原始记录
_bindOriginalRecord() {
this.$store
.dispatch('EnvItem/allCommonSampleCount', {
ids: this.itemIds.join(',')
})
.then(() => {
const result = this.$store.state.EnvItem.list
let allSampleCount = ''
let normalSampleCount = ''
let itemCount = ''
let parallel = ''
let labelSample = ''
result.forEach(item => {
if (item.sampleCountType === 'all') {
allSampleCount = item.sampleCountInteger
} else if (item.sampleCountType === 'normal') {
normalSampleCount = item.sampleCountInteger
} else if (item.sampleCountType === 'item') {
itemCount = item.sampleCountInteger
} else if (item.sampleCountType === 'parallel') {
parallel = item.sampleCountInteger
} else if (item.sampleCountType === 'mark') {
labelSample = item.sampleCountInteger
}
})
this.showModal = false
const url =
Global.recordURL +
'/print/v1/eln/template_YT_' +
this.selectData[0].id
const params = {
ids: this.itemIds.join(','),
allSampleCount: allSampleCount,
normalSampleCount: normalSampleCount,
itemCount: itemCount,
parallelCount: parallel,
labelSample: labelSample
}
this.$refs.iframeModal._createIframe(url, params)
localStorage.setItem('recordStatus', 'addLabRecord')
// this.$layx('recordAddTemplate', '原始记录添加', Global.recordURL + '/print/v1/eln/template_YT_'
// + this.selectData[0].id
// + '?bindUri=' + encodeURIComponent(bindUri))
})
},
_recordChange() {
this.$emit('on-result-change')
},
......@@ -333,17 +262,6 @@ export default {
tempData.entrustId = this.entrustId
this._save(tempData)
}
// this.$store
// .dispatch('EnvItem/saveFormForItem', tempData)
// .then(() => {
// if (this.$store.state.EnvItem.success) {
// this.$Message.success('添加成功')
// this._recordChange()
// this.$refs.iframeModal._closeIframe()
// // 关闭所有layx弹框
// // layx.destroyAll('recordAddTemplate');
// }
// })
}
}
count = count + 1
......
......@@ -65,10 +65,6 @@
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div>
</template>
<script>
......
......@@ -15,7 +15,7 @@
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
<btn-list :msg="envPro?btnPro:btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
......@@ -90,6 +90,7 @@ export default {
testBasis: ''
},
entrustId: '',
envPro: false,
// 用户自己选中的列
userColumns: [],
currentComponent: '',
......@@ -117,14 +118,12 @@ export default {
btn: [
{ type: 'success', id: '', name: '填写原始记录' },
{ type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' }
],
btnPro: [
{ type: 'success', id: '', name: '填写原始记录' },
{ type: 'success', id: '', name: '设备' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
id: 'food-task-assign-plan-date',
name: '设置计划完成时间'
},
{ type: '', id: 'food-task-assign-maintain-info', name: '信息维护' }
{ type: 'success', id: '', name: '完成提交' }
],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
......@@ -137,9 +136,9 @@ export default {
pageColumns: [
{ title: '试验项目', key: 'name', width: 120, fixed: 'left' },
{ title: '试样编号', key: 'sampleCode', width: 180 },
{ title: '是否填写原始记录', key: 'recorded', width: 180 },
{ title: '试样深度', key: 'sampleDepth', width: 180 },
{ title: '试样包装类型', key: 'samplePack', width: 180 },
{ title: '是否填写原始记录', key: 'recorded', width: 180 },
{ title: '状态', key: 'progress', width: 180 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
......@@ -173,6 +172,9 @@ export default {
},
mounted() {
// this._dicSearch()
if (process.env.NODE_ENV === 'production') {
this.envPro = true
}
},
methods: {
_iconClick(res, data, currentComponent) {
......@@ -181,7 +183,6 @@ export default {
case '查看原始记录':
console.log(data)
if (data.recordId) {
// this._viewRecord('1309434759937146882')
this._viewRecord(data.recordId)
} else {
this.$Message.warning('未填写原始记录')
......@@ -217,11 +218,17 @@ export default {
_viewRecord(recordId) {
console.log(recordId)
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL + '/print/v1/form/' + recordId + '?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + recordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......@@ -266,22 +273,6 @@ export default {
if (result) {
this.$Message.success('添加成功')
}
// let equipIds = []
// for (let i = 0; i < res.length; i++) {
// equipIds.push(res[i].id)
// }
// this.$layxLoading()
// this.$store.dispatch('FoodItem/selectEquip', {
// ids: this.selectIds.join(','),
// equipIds: equipIds.join(',')
// }).then(() => {
// if (this.$store.state.FoodItem.success) {
// this.$Message.success('操作成功!');
// this._updateRows('selected');
// }
// this.$layxLoading(false);
// });
},
// 从字典查预警期
_dicSearch() {
......@@ -466,17 +457,23 @@ export default {
this.$message.warning('请至少选择一条数据')
} else {
const errorInfo = []
const clientInfo = []
for (let i = 0; i < this.selectData.length; i++) {
clientInfo.push(this.selectData[i].client)
console.log(this.selectData[i].recorded)
if (this.selectData[i].recorded !== '否') {
errorInfo.push(this.selectData[i].index + 1)
}
}
if (errorInfo.length !== 0) {
this.$Message.warning('第' + errorInfo + '条数据已填写原始记录')
this.$Message.warning('所选数据中有已填写原始记录的')
} else {
console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds, this.entrustId)
this.$refs.recordModal._open(
this.selectIds,
this.entrustId,
clientInfo
)
}
}
},
......@@ -535,14 +532,6 @@ export default {
return obj
},
_page: async function() {
// const saveName = []
// const saveMethod = []
// for (let i = 0; i < this.leftSelectData.length; i++) {
// saveName.push(this.leftSelectData[i].name)
// saveMethod.push(this.leftSelectData[i].testMethod)
// }
// const data = this.$serialize('task-assign-item-right')
// console.log(data)
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.entrustId
this.formObj.name = this.leftSelectData.name
......
......@@ -120,9 +120,9 @@ export default {
pageColumns: [
{ title: '试验项目', key: 'name', width: 120, fixed: 'left' },
{ title: '试样编号', key: 'sampleCode', width: 180 },
{ title: '是否填写原始记录', key: 'recorded', width: 180 },
{ title: '试样深度', key: 'sampleDepth', width: 180 },
{ title: '试样包装类型', key: 'samplePack', width: 180 },
{ title: '是否填写原始记录', key: 'recorded', width: 180 },
{ title: '状态', key: 'progress', width: 180 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
......@@ -378,7 +378,7 @@ export default {
}
}
if (errorInfo.length !== 0) {
this.$Message.warning('第' + errorInfo + '条数据已填写原始记录')
this.$Message.warning('所选数据中有已填写原始记录的')
} else {
console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds, this.entrustId)
......@@ -451,13 +451,6 @@ export default {
switch (msg) {
case 'page':
this._page()
// this.result = this.getPage.records;
// this.$nextTick(() => {
// this.$refs.pageTable._checkAll()
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break
case 'selectData':
for (let i = 0; i < data.length; i++) {
......@@ -475,7 +468,6 @@ export default {
break
case 'changeSize':
this._page()
// this.$refs.pageTable._checkAll()
break
}
},
......@@ -485,7 +477,6 @@ export default {
case '查看原始记录':
console.log(data)
if (data.recordId) {
// this._viewRecord('1309434759937146882')
this._viewRecord(data.recordId)
} else {
this.$Message.warning('未填写原始记录')
......@@ -508,11 +499,17 @@ export default {
},
_viewRecord(recordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL + '/print/v1/form/' + recordId + '?type=ENVTESTMAKE',
recordUrl + '/print/v1/form/' + recordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
......
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