Commit 0f83ee75 by lichengming

修改了样品管理

parent 7c01c8e8
...@@ -21,5 +21,13 @@ export default { ...@@ -21,5 +21,13 @@ export default {
http.put('soil/v1/receive_location/' + data.id, data.obj).then(res => res), http.put('soil/v1/receive_location/' + data.id, data.obj).then(res => res),
// 试验室领样操作 // 试验室领样操作
takeSample: data => takeSample: data =>
http.post('soil/v1/sample/take_sample?ids=' + data).then(res => res) http.post('soil/v1/sample/take_sample?ids=' + data).then(res => res),
// 备样管理提交申请
appleHandle: data =>
http.post('soil/v1/sample_backup/apply_handle', data).then(res => res),
// 样品处理分页列表
pageBackupHandleCheck: data =>
http
.post('soil/v1/sample_backup/page_backup_handle_check', data)
.then(res => res)
} }
<template>
<div>
<vxe-grid
ref="xTable"
:resizable="(resizable === undefined || resizable === true)?true:false"
:column-key="tableName!==undefined?true:false"
:highlight-current-row="
hideCheckbox!==undefined|| hideCheckbox === true"
:height="newTableHeight"
:loading="loading"
:auto-resize="true"
:scroll-y="setOptimization === undefined?defOptimization:setOptimization"
:scroll-x="setXOptimization === undefined?defXOptimization:setXOptimization"
size="mini"
:checkbox-config="selectConfig"
border
@checkbox-all="_selectAll"
stripe
@checkbox-change="_selectRowChange"
show-overflow
@cell-click="_cellChange"
show-header-overflow
@cell-dblclick="_dbChange"
@radio-change="_radioChange"
:cell-class-name="_tableCellClassName"
:row-class-name="_tableRowClassName"
:edit-config="isEdit !== undefined?editConfig:null"
:radio-config="isRadio !== undefined?radioConfig:null"
:row-key="true"
:tooltip-config="{enterable:true}"
:animat="false"
@scroll="_scroll"
>
<vxe-table-column
v-if="hideCheckbox===undefined || hideCheckbox === false"
type="checkbox"
fixed="left"
width="50"
align="center"/>
<vxe-table-column
v-if="isRadio === true"
type="radio"
title="单选"
fixed="left"
align="center"
width="50"/>
<vxe-table-column
v-if="!isNoOrder"
type="seq"
fixed="left"
title="序号"
width="50"
align="center"/>
<slot></slot>
<vxe-table-column
:width="$optColWidth(iconMsg)"
v-if="$optColWidth(iconMsg)>0?true:false"
title="操作"
align="center" fixed="right">
<template slot-scope="scope">
<VXEIconList :msg="iconMsg" @on-result-change="_iconClick" :rowData="scope.row"
:rowIndex="scope.rowIndex"></VXEIconList>
</template>
</vxe-table-column>
<slot name="col"></slot>
<!--自定义插槽 pager 插槽-->
<template v-slot:pager>
<vxe-pager
v-if="hidePage === undefined"
:current-page="getPage.current"
:page-size="getPage.size"
:total="getPage.total"
:pageSizes="pageSizeOpts"
:background="true"
@page-change="_pageSizeChange">
<template v-slot:left>
<i @click="_refreshPage" class="el-icon-refresh page-refresh"></i>
</template>
</vxe-pager>
</template>
</vxe-grid>
<!--自定义表格列-->
<div style="position: absolute;right:0;top:0;z-index:2000">
<slot name="setting"></slot>
</div>
</div>
</template>
<script>
/**
* VXE-TABLE 通用 (单选,多选,双击,自定义操作列,自定义表格列)
* 临时使用,后期删除
* 最新的table
*/
import VXEIconList from '../base/VXEIconList'
export default {
name: 'PTVXETable',
components: { VXEIconList },
props: {
tableHeight: null,
getPage: null,
hidePage: null,
clickValue: null,
selectData: null,
hideCheckbox: null,
isReport: null, // 判断是否是报告
isDataInput: null, // 判断数据录入
isTask: null, // 判断是否是检测管理
isHandle: null, // 样品
tableName: null, // 该值存在,则支持自定义表格
iconMsg: null,
pageColumns: null,
isEdit: null, // 是否可编辑
setOptimization: null, // 加载滚动配置项
setXOptimization: null, // 加载滚动配置项(横向)
isRadio: null, // 是否是单选
isGC: null, // 国抽(抽样单管理)
isGroup: null, // 科室为化验室单元格变红色
isNoOrder: null, // 如果是true的话,则不显示序号这一列
pageSize: null,
rows: null,
resizable: null // 是否允许列拖动
},
data() {
return {
formId: '',
extendsData: {},
loading: false,
pageParams: {
page: 1,
rows: this.rows !== undefined ? this.rows : this.$defRow
},
rowData: {},
checkData: [], // 用于多选的高亮显示数据
sampleHandleValue: '',
// 一系列配置
pageSizeOpts:
this.pageSize !== undefined ? this.pageSize : [50, 100, 500, 1000],
// 默认的配置
defOptimization: this.$setYOptimization,
defXOptimization: this.$setXOptimization,
selectConfig: { checkField: 'checked', trigger: 'row' },
editConfig: {
trigger: 'click',
mode: 'cell',
showIcon: true,
autoClear: false,
showStatus: true
},
// 单选的配置项
radioConfig: { trigger: 'row' },
tableColCount: 0, // 执行的次数
scrollLeft: 0
}
},
computed: {
// 表格需要重新计算高度
newTableHeight: function() {
const newVal = this.tableHeight
if (typeof newVal === 'number' && this.hidePage === undefined) {
// 是数值,并且有分页的时候
return newVal - 35
} else {
// 非数值,不变
return newVal
}
}
},
watch: {
// 监听数据
'getPage.records': function(newVal, oldVal) {
this._loadData(newVal)
}
},
methods: {
// 滚动条位置
_scroll(data) {
this.scrollLeft = data.scrollLeft
},
_loadData(data) {
// 阻断 vue 对大数组的双向绑定,大数据性能翻倍提升
if (this.$refs.xTable) {
this.$refs.xTable.loadData(data)
}
},
// 更新滚动条状态
_updateScroll() {
// 纵向滚动条滚动到顶部,否则会出现固定列空白的情况
this.$refs.xTable.scrollTo(this.scrollLeft ? this.scrollLeft : 1, 1)
},
// 刷新column 和刷新数据
_refreshColumn() {
this.$refs.xTable.refreshColumn()
this.$refs.xTable.syncData()
// 滚动条错位、固定列不同步
this.$refs.xTable.refreshScroll()
},
// 重置column(使用此方法,重新渲染表格列,将会降低性能)
_loadColumn(userColumns) {
this.$nextTick(() => {
const xTable = this.$refs.xTable
// eslint-disable-next-line no-unused-vars
const { fullColumn, tableColumn } = xTable.getTableColumn()
// 1)取列的头和尾,用于最后进行拼接
const fullColumnHeader = [] // 头+操作
const fullColumnOther = [] // 除了头和尾的其他部分
for (let i = 0; i < fullColumn.length; i++) {
if (fullColumn[i].property === undefined) {
// 前几列(checkbox,radio,序号,操作等)
fullColumnHeader.push(fullColumn[i])
}
}
// 2)根据userColumns 更换列顺序
for (let i = 0; i < userColumns.length; i++) {
const itemObj = this.$searchObjByKey(
userColumns[i].key,
fullColumn,
'property'
)
if (itemObj) {
fullColumnOther.push(itemObj)
}
}
// 3)三个数组进行拼接
const fullColumnTemp = [...fullColumnHeader, ...fullColumnOther]
// 4)重载表格列
xTable.loadColumn(fullColumnTemp)
})
},
_clearSelection() {
this.$nextTick(function() {
this.$refs.xTable.clearCheckboxRow()
})
this.checkData = []
if (this.hideCheckbox === undefined || this.hideCheckbox === false) {
if (this.selectData === undefined) {
this.$emit('on-result-change', 'selectIds', [])
} else {
this.$emit('on-result-change', 'selectData', [])
}
}
},
_checkAll() {
setTimeout(() => {
// 控制checkbox状态(加0s的延时才好用)
this.$refs.xTable.setAllCheckboxRow(true)
// 全选当前界面的数据
this._selectRowChange({ selection: this.getPage.records })
}, 0)
},
_pageSizeChange(row) {
switch (row.type) {
case 'size':
this.pageParams.page = 1
this.pageParams.rows = row.pageSize
this._pageParamsChange()
break
case 'current':
this._pageChange(row.currentPage)
break
}
},
// 底部刷新page
_refreshPage() {
this._pageParamsChange()
},
_pageChange(page) {
this.pageParams.page = page
this._pageParamsChange()
},
_pageParamsChange() {
this.$emit('on-result-change', 'changeSize')
},
_searchParams() {
const data = {}
const serData = this.$serialize(this.formId)
Object.assign(data, serData, this.extendsData)
if (this.hidePage === undefined) {
return this.$extend(data, this.pageParams)
} else {
return this.$extend(data)
}
},
_page(formId, uri, extendsData) {
this.loading = true
if (this.tableName && this.tableColCount === 0) {
// tableName存在-----支持自定义表格,只执行一次
this._settingCol(formId, uri, extendsData)
this.tableColCount = this.tableColCount + 1 // 递增1
} else {
this._pageTemp(formId, uri, extendsData)
}
},
// 根据tableName 获取 column
_getColByTableName() {
this._settingCol('', '/', '', { col: true })
},
// param 为临时参数,不请求接口,但是需要返回column用
_settingCol(formId, uri, extendsData, param) {
if (uri) {
// 为了避免uri为undefined
this.$store
.dispatch('SysTableColumn/getByTableName', this.tableName)
.then(() => {
// 查询用户下的表格数据
const userTableCode = this.$store.state.SysTableColumn.model
let userColumns = this.pageColumns // 默认值
// 自定义列接口报错,不能影响其他的接口
if (userTableCode !== undefined) {
userColumns = this.$tableColumns(this.pageColumns, userTableCode)
}
this.$emit('on-result-change', 'table-col', userColumns)
// 重置表格列顺序
this._loadColumn(userColumns)
if (!param) {
this._pageTemp(formId, uri, extendsData)
}
})
}
},
// 临时
_pageTemp(formId, uri, extendsData) {
this.formId = formId
if (extendsData) {
this.extendsData = extendsData
}
this._requestPage(uri, this._searchParams())
},
// 重新请求page接口
_requestPage(uri, params) {
this.$store.dispatch(uri, params).then(() => {
this.loading = false
this.$emit('on-result-change', 'page', '')
this._refreshColumn()
// 每次请求完清空上次的选择
this._clearSelection()
// 更新滚动条的状态
this._updateScroll()
})
},
// 多选
_selectAll: function(data) {
this._selectRowChange(data)
},
_selectRowChange(data) {
if (this.hideCheckbox === undefined || this.hideCheckbox === false) {
const selData = data.selection
this.checkData = selData
// 默认返回的是id数组
if (this.selectData === undefined) {
const idList = []
for (let i = 0; i < selData.length; i++) {
idList.push(selData[i].id)
}
this.$emit('on-result-change', 'selectIds', idList)
} else {
// 有selectData参数时执行
this.$emit('on-result-change', 'selectData', selData)
}
}
},
// 整行变色
_tableRowClassName({ row, rowIndex }) {
if (this.checkData.length !== 0) {
/* 选中的进行高亮显示 */
const index = this.checkData.indexOf(row)
if (index !== -1) {
return 'high-light-row'
}
} else {
/* 没选中的根据页面逻辑变色 */
// eslint-disable-next-line no-lonely-if
if (this.isHandle !== undefined && row.endDate) {
// 样品待处理界面
if (this.$warningValue(row.endDate) <= 0) {
return 'warning-row' // 红色
} else if (
this.$warningValue(row.endDate) > 0 &&
this.$warningValue(row.endDate) <= this.sampleHandleValue
) {
return 'warn-row' // 橙色
}
}
}
},
// 单元格变色
_tableCellClassName({ row, rowIndex, column, columnIndex }) {
if (this.isReport !== undefined) {
// 报告管理
if (
column.property === 'sampleProgress' &&
row.sampleProgress &&
row.sampleProgress.indexOf('退回') !== -1
) {
// 含有退回就变红
return 'cell-red'
}
if (
column.property === 'progress' &&
row.progress &&
row.progress.indexOf('退回') !== -1
) {
// 含有退回就变红
return 'cell-red'
}
// 是否合格字体变色
if (
column.property === 'isEligible' &&
row.isEligible &&
row.isEligible === '合格'
) {
return 'cell-blue-color'
} else if (
column.property === 'isEligible' &&
row.isEligible &&
row.isEligible === '不合格'
) {
return 'cell-red-color'
}
} else if (this.isDataInput !== undefined) {
if (
column.property === 'name' &&
row.progress &&
row.progress.display.indexOf('退回') !== -1
) {
// 含有退回就变红
return 'cell-red'
}
} else if (this.isTask !== undefined) {
if (
column.property === 'serviceType' &&
row.serviceType &&
row.serviceType.indexOf('加急') !== -1
) {
return 'cell-red'
}
} else if (this.isGC !== undefined) {
// 国抽的抽样单管理
if (
column.property === 'samplingNum' &&
row.unsuccessfulCount &&
row.unsuccessfulCount > 0
) {
// 国抽对接未成功项目数量(抽样单编号变红)
return 'cell-red'
}
} else if (this.isGroup !== undefined) {
if (column.property === 'groupName' && row.groupName === '化验室') {
// 国抽的检测项目列表,科室为化验室(变红)
return 'cell-red'
}
} else {
// 其他列表状态
// eslint-disable-next-line no-lonely-if
if (column.property === 'progress') {
if (undefined === row.progress) {
return 'cell-blue-color'
} else if (
undefined !== row.progress &&
undefined !== row.progress.display
) {
if (row.progress.display.indexOf('退回') !== -1) {
return 'cell-red-color'
} else {
return 'cell-blue-color'
}
} else if (undefined !== row.progress) {
if (row.progress.indexOf('退回') !== -1) {
return 'cell-red-color'
} else {
return 'cell-blue-color'
}
} else {
return 'cell-blue-color'
}
} else if (column.property === 'status') {
if (
row.status &&
row.status.display !== undefined &&
row.status.display.indexOf('退回') !== -1
) {
return 'cell-red-color'
} else {
return 'cell-blue-color'
}
}
}
},
// 操作列回调
_iconClick(name, rowData, componentName, rowIndex, obj) {
this.$emit('on-result-change', 'iconClick', {
name: name,
rowData: rowData,
componentName: componentName,
rowIndex: rowIndex,
obj: obj
})
},
// 双击行操作
_dbChange(data, event) {
this.$emit('on-result-change', 'dbSelect', data.row)
},
// 点击单元格触发
_cellChange(data, event) {
if (this.clickValue !== undefined) {
// 有clickValue参数时执行
this.$emit('on-result-change', 'singleSelect', data.row)
}
},
// 单选操作
_radioChange({ row }) {
this.checkData = [row]
this.$emit('on-result-change', 'singleSelect', row)
},
// 关闭loading
_hideLoading() {
this.loading = false
},
// 打开loading
_showLoading() {
this.loading = true
},
// 只刷新选中行的数据
_refreshRows(rowList, scroll) {
const records = this.getPage.records
for (let i = 0; i < rowList.length; i++) {
const index = records.findIndex(item => item.id === rowList[i].id)
if (index !== -1) {
this.$set(this.getPage.records, index, rowList[i])
}
}
this._clearSelection()
if (!scroll) {
// 滚动到指定行
this.$refs.xTable.scrollToRow(rowList[0])
}
},
// 公共方法:更新选中的数据 url:请求地址, params:参数
// noScroll:true ,没有操作列的不需要更新table的滚动条,或者说没有横向滚动条
_updateRows(obj) {
this._showLoading()
const params = { page: 1, rows: this.$updateRows } // 暂定
Object.assign(params, obj.params)
const store = obj.url.split('/')[0] // 注意接口中不要有/的情况
this.$store.dispatch(obj.url, params).then(() => {
const result = this.$store.state[store].page.records
if (result && result.length) {
this._refreshRows(result, obj.noScroll)
this._hideLoading()
} else {
delete params.ids // 重新请求的时候删除ids
// 根据查询条件没有搜索到值,则重新根据查询条件请求page接口
this._requestPage(obj.url, params)
}
})
},
// 设置单选选中行数据
_setRadioRow(data) {
this.$refs.xTable.setRadioRow(data)
this.checkData = [data]
}
}
}
</script>
...@@ -268,7 +268,7 @@ export default { ...@@ -268,7 +268,7 @@ export default {
}, },
_samplePre() { _samplePre() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$message.warning('至少选择一条数据') this.$Message.warning('至少选择一条数据')
} else { } else {
this.$refs.preModal._open(this.selectIds.join(',')) this.$refs.preModal._open(this.selectIds.join(','))
} }
...@@ -334,9 +334,9 @@ export default { ...@@ -334,9 +334,9 @@ export default {
} }
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
const selectIds = []
switch (msg) { switch (msg) {
case 'selectData': case 'selectData':
const selectIds = []
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id) selectIds.push(data[i].id)
} }
......
<template> <template>
<div> <div>
<Modal v-model="showModalHandleApply" :mask-closable="false" width="700"> <Modal v-model="showModalHandleApply" :mask-closable="false" width="500">
<p slot="header">处理申请</p> <p slot="header">处理申请</p>
<div> <div>
<Form ref="formObj" :id="formId" :model="formObj" :rules="ruleValidate" :label-width="123" inline> <Form ref="formObj" :id="formId" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
<Form-item label="申请日期:" prop="applyDate" class="width-48"> <Form-item label="申请日期:" prop="applyHandleTime" style="width:100%">
<Date-picker v-model="formObj.applyDate" :editable="false" name="applyDate" <Date-picker v-model="formObj.applyHandleTime" :editable="false" name="applyHandleTime"
type="date" placeholder="请选择申请日期" style="width: 100%;" type="date" placeholder="请选择申请日期" style="width: 100%;"
></Date-picker> ></Date-picker>
</Form-item> </Form-item>
<Form-item label="申请人:" prop="applyer" class="width-48"> <Form-item label="申请人:" prop="applyHandler" style="width:100%">
<Input v-model="formObj.applyer" name="applyer" readonly></Input> <Input v-model="formObj.applyHandler" @click.native="_selectPerson()" name="applyHandler" readonly></Input>
</Form-item> </Form-item>
<Form-item label="处理样品批次/数量:" prop="handleBatch" class="width-48"> <Form-item label="处理方式:" style="width:100%">
<Input v-model="formObj.handleBatch" name="handleBatch" readonly></Input> <el-select v-model="formObj.handleWay" name="handleWay" placeholder="请选择"
</Form-item>
<Form-item label="存储期限:" class="width-48">
<div>{{formObj.retentionTime}}</div>
</Form-item>
<Form-item label="样品处理数量:" class="width-48">
<Row>
<Col span="18">
<Input v-model="formObj.handleQuantity" :maxlength="$fieldMaxLength"></Input>
</Col>
<Col span="6">
<div style="padding-left: 10px">{{formObj.sampleUnit}}</div>
</Col>
</Row>
</Form-item>
<Form-item label="处理方式:" class="width-48">
<el-select v-model="formObj.handleWay" placeholder="请选择"
size="small" size="small"
style="width:100%" style="width:100%"
clearable> clearable>
...@@ -41,34 +25,8 @@ ...@@ -41,34 +25,8 @@
</el-option> </el-option>
</el-select> </el-select>
</Form-item> </Form-item>
<Form-item label="处理原因" prop="handleReason" style="width:100%"> <Form-item label="处理原因" prop="applyRemark" style="width:100%">
<Input :rows="3" v-model="formObj.handleReason" placeholder="请输入处理原因" type="textarea" name="handleReason"/> <Input :rows="3" v-model="formObj.applyRemark" placeholder="请输入处理原因" type="textarea" name="applyRemark"/>
</Form-item>
<Form-item label="附件上传" style="width: 90%;">
<div v-for="item in formObj.lmsEquipFiles" class="file-upload-list">
<div>
<!--<img :src="item.url">-->
<div class="file-upload-list-cover">
<Icon @click.native="_handleView(item)" type="ios-eye-outline"></Icon>
<Icon @click.native="_downloadFile(item)" type="ios-cloud-download-outline"></Icon>
<Icon @click.native="_handleRemove(item)" type="ios-trash-outline"></Icon>
</div>
</div>
{{item.orginName }}
</div>
<Upload
:show-upload-list="false"
:with-credentials="true"
:on-success="_handleSuccess"
:before-upload="_handleBeforeUpload"
:action="fileAction"
:data="fileData"
type="drag"
style="display: inline-block;width:100px;">
<div style="width: 100px;height:100px;line-height: 100px;">
<Icon type="ios-cloud-upload" size="20"></Icon>
</div>
</Upload>
</Form-item> </Form-item>
</Form> </Form>
</div> </div>
...@@ -76,16 +34,15 @@ ...@@ -76,16 +34,15 @@
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer> <modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div> </div>
</Modal> </Modal>
<Modal v-model="visible" title="查看图片"> <AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
<img :src="imgSrc" style="width: 100%">
</Modal>
</div> </div>
</template> </template>
<script> <script>
import Global from '../../../api/config' import Global from '../../../api/config'
import AssignPerson from '../../../components/user-info-single/AssignPerson'
import { soilSample } from '../../../api'
export default { export default {
components: {}, components: { AssignPerson },
data() { data() {
return { return {
lengthLimitList: [{ key: 'handleQuantity', title: '样品处理数量' }], lengthLimitList: [{ key: 'handleQuantity', title: '样品处理数量' }],
...@@ -93,22 +50,19 @@ export default { ...@@ -93,22 +50,19 @@ export default {
showModalHandleApply: false, showModalHandleApply: false,
formObj: { formObj: {
id: '', id: '',
applyDate: new Date(), applyHandleTime: new Date(),
applyer: '', applyHandler: '',
applyHandlerId: '',
handleBatch: '', handleBatch: '',
retentionTime: '', retentionTime: '',
handleReason: '', applyRemark: '',
lmsEquipFiles: [], lmsEquipFiles: [],
handleWay: '', handleWay: '',
handleQuantity: '', handleQuantity: '',
sampleUnit: '' sampleUnit: ''
}, },
applyId: 0, applyId: 0,
ruleValidate: { ruleValidate: {},
applyer: [
{ required: true, message: '申请人不能为空', trigger: 'blur' }
]
},
footerList: [ footerList: [
{ id: '', name: '取消', type: '' }, { id: '', name: '取消', type: '' },
{ id: '', name: '提交', type: 'primary' } { id: '', name: '提交', type: 'primary' }
...@@ -120,7 +74,14 @@ export default { ...@@ -120,7 +74,14 @@ export default {
name: '' name: ''
}, },
formId: '', formId: '',
handleWayList: [], handleWayList: [
{
name: '到期处置'
},
{
name: '立即处置'
}
],
imgSrc: '' imgSrc: ''
} }
}, },
...@@ -128,6 +89,13 @@ export default { ...@@ -128,6 +89,13 @@ export default {
// this._dicSearch() // this._dicSearch()
}, },
methods: { methods: {
_selectPerson() {
this.$refs.personModal._openGoup('申请人', 'itemTree')
},
_assignBackData(data) {
this.formObj.applyHandler = data.realname
this.formObj.applyHandlerId = data.id
},
// 从字典中查询类别 // 从字典中查询类别
_dicSearch() { _dicSearch() {
this.$store.dispatch('LmsBaseDict/getItem', '样品处理方式').then(() => { this.$store.dispatch('LmsBaseDict/getItem', '样品处理方式').then(() => {
...@@ -153,10 +121,13 @@ export default { ...@@ -153,10 +121,13 @@ export default {
// this._getRetention(data) // this._getRetention(data)
// this._getSampleBatch(data) // this._getSampleBatch(data)
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
this.ids = data
this.formObj.lmsEquipFiles = [] this.formObj.lmsEquipFiles = []
this.showModalHandleApply = true this.showModalHandleApply = true
this.formObj.applyer = Global.getUserInfo().realname this.formObj.applyHandler = Global.getUserInfo().realname
this.formObj.applyHandlerId = Global.getUserInfo().id
this.formId = 'handleApplyEditForm' + this.$randomCode() this.formId = 'handleApplyEditForm' + this.$randomCode()
this.formObj.applyHandleTime = new Date()
}, },
_getSampleBatch(data) { _getSampleBatch(data) {
this.formObj.handleBatch = data.length this.formObj.handleBatch = data.length
...@@ -268,34 +239,49 @@ export default { ...@@ -268,34 +239,49 @@ export default {
this.$refs.formObj.validate(valid => { this.$refs.formObj.validate(valid => {
if (valid) { if (valid) {
const data = this.$serialize(this.formId) const data = this.$serialize(this.formId)
data.handleBatch = this.formObj.handleBatch data.applyHandlerId = this.formObj.applyHandlerId
data.id = this.applyId data.ids = this.ids.join(',')
data.handleWay = this.formObj.handleWay console.log(data)
data.applyer = this.formObj.applyer this._submitDispose(data)
data.handleQuantity = this.formObj.handleQuantity // data.handleBatch = this.formObj.handleBatch
// let returnData = {ids: this.ids, obj: data}; // data.id = this.applyId
this.$extend(data, { backupIds: this.ids.join(',') }) // data.handleWay = this.formObj.handleWay
if (this.$lengthLimitVal(this.lengthLimitList, data) === false) { // data.applyHandler = this.formObj.applyHandler
this._hideLoading() // data.handleQuantity = this.formObj.handleQuantity
return // // let returnData = {ids: this.ids, obj: data};
} // this.$extend(data, { backupIds: this.ids.join(',') })
this.$store // if (this.$lengthLimitVal(this.lengthLimitList, data) === false) {
.dispatch('FoodSampleHandleApply/handleApplySubmit', data) // this._hideLoading()
.then(() => { // return
if (this.$store.state.FoodSampleHandleApply.success) { // }
this._cancel() // this.$store
this.$Message.success('提交成功') // .dispatch('FoodSampleHandleApply/handleApplySubmit', data)
this.$emit('on-result-change') // .then(() => {
} else { // if (this.$store.state.FoodSampleHandleApply.success) {
this.$refs.footerModal._hideLoading() // this._cancel()
} // this.$Message.success('提交成功')
}) // this.$emit('on-result-change')
// } else {
// this.$refs.footerModal._hideLoading()
// }
// })
} else { } else {
this.$Message.error('表单验证失败!') this.$Message.error('表单验证失败!')
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
} }
}) })
}, },
_submitDispose: async function(data) {
const result = await soilSample.appleHandle(data)
if (result) {
this._resultChange('提交成功')
}
},
_resultChange(msg) {
this.$Message.success(msg)
this.showModalHandleApply = false
this.$emit('on-result-change')
},
_cancel() { _cancel() {
this.showModalHandleApply = false this.showModalHandleApply = false
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<!--样品数量--> <!--样品数量-->
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight <PTVXETableTemp
id="samplePreManage" id="samplePreManage"
ref="pageTable" ref="pageTable"
:tableHeight="tableHeight" :tableHeight="tableHeight"
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
show-key="backupPlace"></AutoCompletes> show-key="backupPlace"></AutoCompletes>
</div> </div>
</div> </div>
<div v-else-if="item.key==='storageCondition'" @click.stop="_handleIndex(scope)"> <div v-else-if="item.key==='conditions'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div> <div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else> <div v-else>
<el-select v-model="scope.row.storageCondition" clearable style="width:100%" size="small"> <el-select v-model="scope.row.conditionList" clearable style="width:100%" size="small">
<el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }} <el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }}
</el-option> </el-option>
</el-select> </el-select>
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
</div> </div>
<div v-else-if="item.key==='handleQuantity'" @click.stop="_handleIndex(scope)"> <div v-else-if="item.key==='handleQuantity'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex"> <div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}{{scope.row['sampleUnit'] && {{scope.row[item.key]}}{{scope.row['sampleUnit'] &&
scope.row['handleQuantity']?scope.row['sampleUnit']:''}} scope.row['handleQuantity']?scope.row['sampleUnit']:''}}
</div> </div>
<div v-else> <div v-else>
<Row> <Row>
<Col span="18"> <Col span="18">
...@@ -84,13 +84,29 @@ ...@@ -84,13 +84,29 @@
</Row> </Row>
</div> </div>
</div> </div>
<div v-else-if="item.key==='quantity'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.quantity" clearable></el-input>
</div>
</div>
<div v-else-if="item.key==='backupLocation'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.backupLocation" clearable></el-input>
</div>
</div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}} <div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</div> </div>
<div v-else>{{scope.row[item.key]}}</div> <div v-else>{{scope.row[item.key]}}</div>
</template> </template>
</vxe-table-column> </vxe-table-column>
<template slot="col">
<vxe-table-column <vxe-table-column
slot="col"
:width="80" :width="80"
title="操作" title="操作"
align="center" align="center"
...@@ -100,13 +116,12 @@ ...@@ -100,13 +116,12 @@
:rowData="scope.row" :rowIndex="scope.rowIndex"></VXEIconList> :rowData="scope.row" :rowIndex="scope.rowIndex"></VXEIconList>
</template> </template>
</vxe-table-column> </vxe-table-column>
</template> </PTVXETableTemp>
</PTVXETableHeight>
</Col> </Col>
</Row> </Row>
</div> </div>
</div> </div>
<SampleParpareApply ref="applyModal"></SampleParpareApply> <SampleParpareApply ref="applyModal" @on-result-change="_page"></SampleParpareApply>
</div> </div>
</template> </template>
<script> <script>
...@@ -133,7 +148,7 @@ export default { ...@@ -133,7 +148,7 @@ export default {
{ {
type: 'primary', type: 'primary',
id: '', id: '',
name: '处理申请' name: '申请处理'
}, },
{ {
type: 'primary', type: 'primary',
...@@ -360,7 +375,7 @@ export default { ...@@ -360,7 +375,7 @@ export default {
}, },
_btnClick(msg) { _btnClick(msg) {
switch (msg) { switch (msg) {
case '处理申请': case '申请处理':
this._applyDispose() this._applyDispose()
break break
case '制备': case '制备':
...@@ -375,9 +390,6 @@ export default { ...@@ -375,9 +390,6 @@ export default {
case '填写存放信息': case '填写存放信息':
this._batchEdit() this._batchEdit()
break break
case '申请处理':
this._handle()
break
case '导出': case '导出':
if (this.getPage.records.length === 0) { if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出') this.$Message.warning('暂无数据,不可导出')
...@@ -397,7 +409,7 @@ export default { ...@@ -397,7 +409,7 @@ export default {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!') this.$Message.warning('请选择一条或多条数据!')
} else { } else {
this.$refs.applyModal._open(this.selectData) this.$refs.applyModal._open(this.selectIds)
} }
}, },
// 制备 // 制备
...@@ -422,104 +434,105 @@ export default { ...@@ -422,104 +434,105 @@ export default {
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page': case 'page':
this.getPage.records = [] this._page()
this.getPage = { // this.getPage.records = []
total: this.$store.state.LmsFoodSamplePrepare.page.total, // this.getPage = {
pages: this.$store.state.LmsFoodSamplePrepare.page.pages, // total: this.$store.state.LmsFoodSamplePrepare.page.total,
current: this.$store.state.LmsFoodSamplePrepare.page.current, // pages: this.$store.state.LmsFoodSamplePrepare.page.pages,
size: this.$store.state.LmsFoodSamplePrepare.page.size, // current: this.$store.state.LmsFoodSamplePrepare.page.current,
records: [] // size: this.$store.state.LmsFoodSamplePrepare.page.size,
} // records: []
const tableList = this.$store.state.LmsFoodSamplePrepare.page.records // }
for (let i = 0; i < tableList.length; i++) { // const tableList = this.$store.state.LmsFoodSamplePrepare.page.records
this.getPage.records.push({ // for (let i = 0; i < tableList.length; i++) {
sampleId: // this.getPage.records.push({
tableList[i].sampleId !== undefined // sampleId:
? tableList[i].sampleId // tableList[i].sampleId !== undefined
: '', // ? tableList[i].sampleId
sampleSn: // : '',
tableList[i].sampleSn !== undefined // sampleSn:
? tableList[i].sampleSn // tableList[i].sampleSn !== undefined
: '', // ? tableList[i].sampleSn
sampleName: // : '',
tableList[i].sampleName !== undefined // sampleName:
? tableList[i].sampleName // tableList[i].sampleName !== undefined
: '', // ? tableList[i].sampleName
backupPlace: // : '',
tableList[i].backupPlace !== undefined // backupPlace:
? tableList[i].backupPlace // tableList[i].backupPlace !== undefined
: '', // ? tableList[i].backupPlace
cname: tableList[i].cname !== undefined ? tableList[i].cname : '', // : '',
storageCondition: // cname: tableList[i].cname !== undefined ? tableList[i].cname : '',
tableList[i].storageCondition !== undefined // storageCondition:
? tableList[i].storageCondition // tableList[i].storageCondition !== undefined
: '', // ? tableList[i].storageCondition
quantity: // : '',
tableList[i].quantity !== undefined // quantity:
? tableList[i].quantity // tableList[i].quantity !== undefined
: '', // ? tableList[i].quantity
sampleQuantity: // : '',
tableList[i].sampleQuantity !== undefined // sampleQuantity:
? tableList[i].sampleQuantity // tableList[i].sampleQuantity !== undefined
: '', // ? tableList[i].sampleQuantity
handleQuantity: // : '',
tableList[i].handleQuantity !== undefined // handleQuantity:
? tableList[i].handleQuantity // tableList[i].handleQuantity !== undefined
: '', // ? tableList[i].handleQuantity
sampleUnit: // : '',
tableList[i].sampleUnit !== undefined // sampleUnit:
? tableList[i].sampleUnit // tableList[i].sampleUnit !== undefined
: '', // ? tableList[i].sampleUnit
endDate: // : '',
tableList[i].endDate !== undefined // endDate:
? new Date(tableList[i].endDate) // tableList[i].endDate !== undefined
: '', // ? new Date(tableList[i].endDate)
handleMethod: // : '',
tableList[i].handleMethod !== undefined // handleMethod:
? tableList[i].handleMethod // tableList[i].handleMethod !== undefined
: '', // ? tableList[i].handleMethod
id: tableList[i].id !== undefined ? tableList[i].id : '', // : '',
contractName: // id: tableList[i].id !== undefined ? tableList[i].id : '',
tableList[i].contractName !== undefined // contractName:
? tableList[i].contractName // tableList[i].contractName !== undefined
: '', // ? tableList[i].contractName
code: tableList[i].code !== undefined ? tableList[i].code : '', // : '',
contractSn: // code: tableList[i].code !== undefined ? tableList[i].code : '',
tableList[i].contractSn !== undefined // contractSn:
? tableList[i].contractSn // tableList[i].contractSn !== undefined
: '', // ? tableList[i].contractSn
progress: // : '',
tableList[i].progress !== undefined // progress:
? tableList[i].progress // tableList[i].progress !== undefined
: '', // ? tableList[i].progress
type: tableList[i].type !== undefined ? tableList[i].type : '', // : '',
issueDate: // type: tableList[i].type !== undefined ? tableList[i].type : '',
tableList[i].issueDate !== undefined // issueDate:
? tableList[i].issueDate // tableList[i].issueDate !== undefined
: '', // ? tableList[i].issueDate
sampleRemark: // : '',
tableList[i].sampleRemark !== undefined // sampleRemark:
? tableList[i].sampleRemark // tableList[i].sampleRemark !== undefined
: '', // ? tableList[i].sampleRemark
contractRemark: // : '',
tableList[i].contractRemark !== undefined // contractRemark:
? tableList[i].contractRemark // tableList[i].contractRemark !== undefined
: '', // ? tableList[i].contractRemark
isEligible: // : '',
tableList[i].isEligible !== undefined // isEligible:
? tableList[i].isEligible // tableList[i].isEligible !== undefined
: '', // ? tableList[i].isEligible
remark: // : '',
tableList[i].remark !== undefined ? tableList[i].remark : '', // remark:
contractId: // tableList[i].remark !== undefined ? tableList[i].remark : '',
tableList[i].contractId !== undefined // contractId:
? tableList[i].contractId // tableList[i].contractId !== undefined
: '' // ? tableList[i].contractId
}) // : ''
} // })
this.selectIds = [] // }
this.selectData = [] // this.selectIds = []
this.selectSampleIds = [] // this.selectData = []
// this.selectSampleIds = []
break break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
......
...@@ -25,14 +25,6 @@ ...@@ -25,14 +25,6 @@
</btn-list> </btn-list>
</Col> </Col>
<!--样品数量--> <!--样品数量-->
<Col span="24">
<div style="display: flex;padding-bottom: 10px;">
<div v-for="(item,index) in contList" :key="index" class="reimbursement-item">
<p :class="item.color?item.color:''">{{item.value}}</p>
<p>{{item.name}}</p>
</div>
</div>
</Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
...@@ -120,7 +112,7 @@ ...@@ -120,7 +112,7 @@
import AutoCompletes from '../../../../components/base/AutoCompletes' import AutoCompletes from '../../../../components/base/AutoCompletes'
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
import http from '../../../../api/http' import http from '../../../../api/http'
import { soilEntrust } from '../../../../api' import { soilSample } from '../../../../api'
export default { export default {
components: { components: {
AutoCompletes AutoCompletes
...@@ -530,8 +522,7 @@ export default { ...@@ -530,8 +522,7 @@ export default {
_page: async function() { _page: async function() {
this.editIndex = -1 this.editIndex = -1
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) const result = await soilSample.pageBackupHandleCheck(
const result = await soilEntrust.pageBackup(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
......
...@@ -25,14 +25,6 @@ ...@@ -25,14 +25,6 @@
</btn-list> </btn-list>
</Col> </Col>
<!--样品数量--> <!--样品数量-->
<Col span="24">
<div style="display: flex;padding-bottom: 10px;">
<div v-for="(item,index) in contList" :key="index" class="reimbursement-item">
<p :class="item.color?item.color:''">{{item.value}}</p>
<p>{{item.name}}</p>
</div>
</div>
</Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
......
...@@ -10,6 +10,7 @@ import elementTable from '../components/table/elementTable' ...@@ -10,6 +10,7 @@ import elementTable from '../components/table/elementTable'
import modalFooter from '../components/base/modalFooter' import modalFooter from '../components/base/modalFooter'
import PTVXETable from '../components/table/PTVXETable' import PTVXETable from '../components/table/PTVXETable'
import PTVXETableHeight from '../components/table/PTVXETableHeight' import PTVXETableHeight from '../components/table/PTVXETableHeight'
import PTVXETableTemp from '../components/table/PTVXETableTemp'
import PTVXETableData from '../components/base/PTVXETableData' import PTVXETableData from '../components/base/PTVXETableData'
import VXEIconList from '../components/base/VXEIconList' import VXEIconList from '../components/base/VXEIconList'
import FileManage from '../components/file/file-manage/FileManage' import FileManage from '../components/file/file-manage/FileManage'
...@@ -26,6 +27,7 @@ Vue.component('element-table-height', elementTableHeight) ...@@ -26,6 +27,7 @@ Vue.component('element-table-height', elementTableHeight)
Vue.component('modal-footer', modalFooter) Vue.component('modal-footer', modalFooter)
Vue.component('PTVXETable', PTVXETable) Vue.component('PTVXETable', PTVXETable)
Vue.component('PTVXETableHeight', PTVXETableHeight) Vue.component('PTVXETableHeight', PTVXETableHeight)
Vue.component('PTVXETableTemp', PTVXETableTemp)
Vue.component('PTVXETableData', PTVXETableData) Vue.component('PTVXETableData', PTVXETableData)
Vue.component('VXEIconList', VXEIconList) Vue.component('VXEIconList', VXEIconList)
Vue.component('VXESettingCol', VXESettingCol) Vue.component('VXESettingCol', VXESettingCol)
......
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