Commit aa0dc916 by wangweidong

土工试验Lims

parent 3156d3cb
...@@ -33,6 +33,10 @@ export default { ...@@ -33,6 +33,10 @@ export default {
http http
.post('soil/v1/sample_backup/page_backup_handle_check', data) .post('soil/v1/sample_backup/page_backup_handle_check', data)
.then(res => res), .then(res => res),
pageBackupHandleCheckHis: data =>
http
.post('soil/v1/sample_backup/page_backup_handle_check_his', data)
.then(res => res),
// 样品处理审批通过 // 样品处理审批通过
disposalOk: data => disposalOk: data =>
http.post('soil/v1/sample_backup/disposal_ok?ids=' + data).then(res => res), http.post('soil/v1/sample_backup/disposal_ok?ids=' + data).then(res => res),
......
...@@ -268,8 +268,8 @@ export default { ...@@ -268,8 +268,8 @@ export default {
// 导入 // 导入
_import() { _import() {
const data = { const data = {
importUrl: '/meter/v1/aptitude/import_aptitude', importUrl: '/soil/v1/aptitude_exp/import_aptitude/',
downloadUrl: '/soil/v1/excel/template/SoilEntrustImport', downloadUrl: '/soil/v1/excel/template/SoilAptExpImport',
title: '授权资质导入' title: '授权资质导入'
} }
this.$refs.importModal._open(data, '授权资质导入') this.$refs.importModal._open(data, '授权资质导入')
......
...@@ -142,6 +142,7 @@ export default { ...@@ -142,6 +142,7 @@ export default {
], ],
pageColumns: [ pageColumns: [
{ title: '试验名称', key: 'name', width: 160 }, { title: '试验名称', key: 'name', width: 160 },
{ title: '试样编号', key: 'sampleCode', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 }, { title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '试验科室', key: 'groupName', width: 140 }, { title: '试验科室', key: 'groupName', width: 140 },
{ title: '大类', key: 'mainType', width: 140 }, { title: '大类', key: 'mainType', width: 140 },
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<!-- :value="item.name"--> <!-- :value="item.name"-->
<!-- />--> <!-- />-->
<!-- </el-select>--> <!-- </el-select>-->
<AutoCompletes v-model="scope.row.groupName" :handle-obj="scope.row" :down-data="groupoptions" <AutoCompletes style="editable:false" v-model="scope.row.groupName" :handle-obj="scope.row" :down-data="groupoptions"
@on-result-change="_selGroup" clearable @on-result-change="_selGroup" clearable
placeholder="输入或选择试验室" show-key="name"></AutoCompletes> placeholder="输入或选择试验室" show-key="name"></AutoCompletes>
</div> </div>
...@@ -143,6 +143,7 @@ export default { ...@@ -143,6 +143,7 @@ export default {
], ],
pageColumns: [ pageColumns: [
{ title: '试验名称', key: 'name', width: 160 }, { title: '试验名称', key: 'name', width: 160 },
{ title: '试样编号', key: 'sampleCode', width: 160 },
{ {
title: '试验项目英文简写', title: '试验项目英文简写',
key: 'shortName', key: 'shortName',
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-if="item.status">{{scope.row[item.key].display}}</span> <span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
......
...@@ -6,213 +6,625 @@ ...@@ -6,213 +6,625 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24"> <Col span="24">
<Form id="search-form-query" :label-width="80" v-show="searchOpen" inline onsubmit="return false"> <Form v-show="searchOpen" id="search-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="样品编号:"> <Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" name="sampleSn" placeholder="请输入样品编号" clearable/> <Input v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-item" label="样品名称:"> <Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" name="sampleName" placeholder="请输入样品名称" clearable/> <Input v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入样品名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="存储位置:">
<Input @on-enter="_formSearch" name="backupPlace" placeholder="请输入存储位置" clearable/>
</Form-item>
<Form-item class="search-item" label="存储期限:">
<Date-picker @on-change="_dateChange" :editable="false" type="daterange" split-panels
style="width:100%;" placeholder="请选择存储期限"></Date-picker>
<input v-model="endDateBegin" type="hidden" name="endDateBegin">
<input v-model="endDateEnd" type="hidden" name="endDateEnd">
</Form-item>
<Form-item class="search-item" label="委托单位:" style="margin-left: 8px;">
<Input @on-enter="_formSearch" name="cname" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托名称:">
<Input @on-enter="_formSearch" name="contractName" placeholder="请输入委托名称" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick">
</btn-list>
</Col> </Col>
<!--样品数量-->
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<!--<ElementTable :tableHeight="tableHeight" @on-result-change="_tableResultChange"--> <PTVXETable
<!--ref="pageTable" :getPage="getPage" id="perSampleQuery" selectData>--> id="samplePreManage"
<!--<el-table-column--> ref="pageTable"
<!--show-overflow-tooltip--> :table-height="tableHeight"
<!--sortable--> :get-page="getPage"
<!--:prop="item.key"--> select-data
<!--:label="item.title"--> @on-result-change="_tableResultChange">
<!--:width="item.width"-->
<!--:min-width="200"-->
<!--:fixed="item.fixed?item.fixed:undefined"-->
<!--v-for="item in pageColumns" :key="item.key">-->
<!--<template slot-scope="scope">-->
<!--<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>-->
<!--<a v-else-if="item.key==='sampleSn'"-->
<!--@click.stop="_sampleDetailModal(scope.row)">{{scope.row[item.key]}}</a>-->
<!--<div v-else-if="item.key==='progress'">-->
<!--{{scope.row[item.key]===undefined?'':scope.row[item.key].display}}-->
<!--</div>-->
<!--<div v-else>{{scope.row[item.key]}}</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</ElementTable>-->
<PTVXETable id="perSampleQuery" ref="pageTable"
:tableHeight="tableHeight" @on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key" :field="item.key"
:title="item.title" :title="item.title"
:min-width="item.width?item.width:200" :width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined" :fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" sortable
:key="item.key" sortable> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div> <div v-if="item.key==='status'">
{{scope.row[item.key]===undefined?'':scope.row[item.key].display}}
</div>
<a v-else-if="item.key==='code'" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<a v-else-if="item.key==='sampleSn'" <a v-else-if="item.key==='sampleSn'"
@click.stop="_sampleDetailModal(scope.row)">{{scope.row[item.key]}}</a> @click.stop="_sampleDetailModal(scope.row)">{{scope.row[item.key]}}</a>
<div v-else-if="item.key==='progress'"> <div v-else-if="item.key==='backupPlace'" @click.stop="_handleIndex(scope)">
{{scope.row[item.key]===undefined?'':scope.row[item.key].display}} <div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<AutoCompletes :value="scope.row.backupPlace" :down-data="locList" name="backupPlace"
placeholder="请输入或选择存储位置" focus show-key="backupPlace"
@on-result-change="_locChange"></AutoCompletes>
</div>
</div>
<div v-else-if="item.key==='storageCondition'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-select v-model="scope.row.storageCondition" clearable style="width:100%" size="small">
<el-option v-for="item in conditionList" :key="item.name" :value="item.name">{{ item.name }}
</el-option>
</el-select>
</div>
</div>
<div v-else-if="item.key==='handleQuantity'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}{{scope.row['sampleUnit'] &&
scope.row['handleQuantity']?scope.row['sampleUnit']:''}}
</div>
<div v-else>
<Row>
<Col span="18">
<el-input v-model="scope.row.handleQuantity" placeholder="处理数量" clearable size="small"/>
</Col>
<Col span="6">
<div style="line-height: 32px">{{scope.row['sampleUnit']?scope.row['sampleUnit']:''}}</div>
</Col>
</Row>
</div>
</div>
<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
:width="80"
title="操作"
align="center"
fixed="right">
<template slot-scope="scope">
<VXEIconList :msg="editIndex===scope.rowIndex?iconMsgSave:iconMsg" :row-data="scope.row"
:row-index="scope.rowIndex" @on-result-change="_iconClick"></VXEIconList>
</template>
</vxe-table-column>
</template>
</PTVXETable> </PTVXETable>
</Col> </Col>
</Row> </Row>
</div> </div>
</div> </div>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../../api' import AutoCompletes from '../../../../components/base/AutoCompletes'
import Reason from '../../../../components/base/Reason'
// eslint-disable-next-line no-unused-vars
import http from '../../../../api/http'
import { soilSample } from '../../../../api'
export default { export default {
components: {}, components: {
AutoCompletes,
Reason
},
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
selectIds: [], searchOpen: false,
formObj: {}, formObj: {},
selectData: [],
selectIds: [],
selectSampleIds: [],
getPage: {},
btn: [ btn: [
{
type: 'primary',
id: '',
name: '通过'
},
{
type: '',
id: '',
name: '驳回'
},
{
type: 'primary',
id: 'food-sample-preparation-his-all',
name: '制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-no-pre',
name: '无需制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-scan-pre',
name: '扫码制备'
},
// { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' },
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{ {
type: '', type: '',
id: 'food-sample-handle-already-export-sample-store', id: 'food-sample-prepare-record-export',
name: '导出样品贮存表' name: '导出备样记录'
} }
], ],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit
],
iconMsgSave: [{ type: 'ios-checkmark', id: '', name: '保存' }],
pageColumns: [ pageColumns: [
{ title: '样品编号', key: 'sampleSn', width: 180 }, { title: '委托商', key: 'client', width: 180 },
{ title: '样品名称', key: 'sampleName', width: 140 }, { title: '委托编号', key: 'entrustCode', width: 180 },
{ title: '状态', key: 'progress', width: 110, status: true }, { title: '试样编号', key: 'sampleCode', width: 180 },
{ title: '存储期限', key: 'endDate', width: 120, date: true }, { title: '试样深度', key: 'sampleDepth', width: 180 },
{ title: '委托单位', key: 'cname', width: 140 }, { title: '样品包装类型', key: 'samplePack', width: 180 },
{ title: '委托名称', key: 'contractName', width: 170 }, { title: '现场编号', key: 'siteNo', width: 180 },
{ title: '处置方式', key: 'handleMethod', width: 120 }, { title: '存储条件', key: 'conditions', width: 180 },
{ title: '处理人', key: 'handlePerson', width: 100 }, { title: '备样位置', key: 'backupLocation', width: 180 },
{ title: '处理时间', key: 'handleTime', width: 120, date: true }, { title: '备样数量', key: 'quantity', width: 180 },
{ title: '处理申请人', key: 'applyer', width: 120 }, { title: '备样人', key: 'backupUser', width: 140 },
{ title: '申请时间', key: 'applyDate', width: 120, date: true }, { title: '钻孔位置', key: 'boreholeLocation', width: 110 },
{ title: '存储位置', key: 'backupPlace', width: 100 }, { title: '钻孔名称', key: 'boreholeName', width: 160 },
{ title: '存储条件', key: 'storageCondition', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 160 },
{ title: '样品数量', key: 'quantity', width: 100 }, { title: '状态', key: 'status', width: 160 }
{ title: '备样数量', key: 'sampleQuantity', width: 100 }, /* {title: '处置方式', key: 'handleMethod', width: 120,}, */
{ title: '样品备注', key: 'sampleRemark' },
{ title: '委托备注', key: 'contractRemark' }
], ],
searchOpen: false, conditionList: [],
getPage: {}, locList: [],
selectData: [], currentIndex: -1,
editIndex: -1,
endDateBegin: '', endDateBegin: '',
endDateEnd: '' endDateEnd: '',
contList: [
{ key: 'backupCount', name: '今日新增数量', value: 0 },
{
key: 'backupCountOver',
name: '超期数量',
value: 0,
color: 'red-color'
},
{
key: 'backupCountWarn',
name: '预警数量',
value: 0,
color: 'warning-color'
}
],
// 只看预警和超期样品
warnAndOver: 0,
sampleHandleValue: '',
issueDateBegin: '',
issueDateEnd: '',
isEligible: ''
} }
}, },
computed: { computed: {
tableHeight: function() { tableHeight: function() {
if (this.searchOpen) { if (this.searchOpen) {
return this.$tableHeight('tabSearchTwo') return this.$tableHeight('', 385)
} else { } else {
return this.$tableHeight('tabNoSearch') return this.$tableHeight('', 300)
}
},
colorComputed() {
return function(date) {
if (this.$warningValue(date) < 0) {
return '#eb6877' // 红色
} else if (
this.$warningValue(date) >= 0 &&
this.$warningValue(date) <= this.sampleHandleValue
) {
return '#f90' // 橙色
} }
} }
}
},
mounted() {
// 样品存储期限预警
// this.sampleHandleValue = Number(localStorage.getItem('sampleHandleValue'))
// this._getLocList()
// this._getConditionList()
// this._getBackUpCount()
}, },
methods: { methods: {
_page: async function() { // 签发日期
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) _issueDateChange(date) {
console.log('this.formObj', this.formObj) this.issueDateBegin = date[0]
const result = await soilEntrust.pageSampleReceive( this.issueDateEnd = date[1]
this.$serializeForm(this.formObj) },
) // 重新请求page以及备样数量
_relPage() {
this._page()
// this._getBackUpCount()
},
// 查询卡片备样数量
_getBackUpCount() {
this.$store.dispatch('FoodSampleBackup/backUpCount').then(() => {
const result = this.$store.state.FoodSampleBackup.model
const length = this.contList.length
for (let i = 0; i < length; i++) {
this.$set(this.contList[i], 'value', result[this.contList[i].key])
}
})
},
// 选择时间
_endDateChange(data) {
this.getPage.records[this.currentIndex].endDate = data
},
// 查询-接收日期
_dateChange(data) {
this.endDateBegin = data[0]
this.endDateEnd = data[1]
},
_save() {
this.$nextTick(function() {
const data = {
ids: this.getPage.records[this.currentIndex].id,
backupPlace: this.getPage.records[this.currentIndex].backupPlace,
storageCondition: this.getPage.records[this.currentIndex]
.storageCondition,
endDate: this.getPage.records[this.currentIndex].endDate,
handleQuantity: this.getPage.records[this.currentIndex].handleQuantity
}
this.$store.dispatch('FoodSampleBackup/batchEdit', data).then(() => {
if (this.$store.state.FoodSampleBackup.success) {
} else {
this.$msgTip('error', '保存失败!')
}
this._relPage()
})
})
},
_iconClick(res, data, componentName, index) {
this.currentIndex = index
switch (res) {
case '编辑':
this.editIndex = index
break
case '保存':
console.log('保存')
// if (data.endDate !== '') {
// // 非空情况下格式化赋值,如果不判断会格式化为当天的日期
// this._endDateChange(this.$dateformat(data.endDate, 'yyyy-mm-dd'))
// }
// this._save()
this.editIndex = -1
break
}
},
_locChange(msg, data) {
switch (msg) {
case 'select':
this.getPage.records[this.currentIndex].backupPlace = data.backupPlace
break
case 'query':
this.getPage.records[this.currentIndex].backupPlace = data.backupPlace
this._getLocList(data.backupPlace)
break
case 'focus':
this._getLocList()
break
}
},
_getLocList(data) {
const obj = {}
if (data) {
obj.backupPlace = data
}
this.$store.dispatch('FoodSampleBackup/getPositionList', obj).then(() => {
this.locList = this.$store.state.FoodSampleBackup.list
})
},
_getConditionList() {
this.$store.dispatch('LmsBaseDict/getItem', '保存方式').then(() => {
this.conditionList = this.$store.state.LmsBaseDict.item
})
},
_exportReceiveRecord() {
// 导出备样记录
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条数据!')
} else {
const obj = {
param: 'ids',
ids: this.selectIds,
url: ''
}
this.$store
.dispatch('ReportExport/getById', 'food-sample-prepare-record-export')
.then(() => {
const result = this.$store.state.ReportExport.model
obj.url = result
this.$exportByQuery(obj)
})
}
},
// 操作的序号
_handleIndex(data) {
this.currentIndex = data.rowIndex
},
_btnClick(msg) {
switch (msg) {
case '通过':
this._dispose()
break
case '驳回':
this._disposeBack()
break
case '制备':
this._preMethod()
break
case '无需制备':
this._noPreMethod()
break
case '扫码制备':
this._scanPreMethod()
break
case '填写存放信息':
this._batchEdit()
break
case '申请处理':
this._handle()
break
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case '导出备样记录':
this._exportReceiveRecord()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
// 通过
_dispose() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定通过这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
this._disposeOk(this.selectIds.join(','))
}
})
}
},
_disposeBack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条委托!')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_reasonResult(data) {
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilSample.disposalFail({
ids: this.selectIds,
remark: data
})
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$Message.success('退回成功!')
this.getPage = result console.log('退回成功')
await this._page()
} }
}, },
_disposeOk: async function(ids) {
const result = await soilSample.disposalOk(ids)
if (result) {
this._resultChange('提交成功')
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
// 制备
_preMethod() {
if (this.selectSampleIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.preModal._open(this.selectSampleIds)
}
},
// 无需制备
_noPreMethod() {
if (this.selectSampleIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.noPreModal._open(this.selectSampleIds)
}
},
_scanPreMethod() {
this.$refs.scanPreModal._open()
},
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page': case 'page':
this.getPage.records = []
this.getPage = {
total: this.$store.state.LmsFoodSamplePrepare.page.total,
pages: this.$store.state.LmsFoodSamplePrepare.page.pages,
current: this.$store.state.LmsFoodSamplePrepare.page.current,
size: this.$store.state.LmsFoodSamplePrepare.page.size,
records: []
}
const tableList = this.$store.state.LmsFoodSamplePrepare.page.records
for (let i = 0; i < tableList.length; i++) {
this.getPage.records.push({
sampleId:
tableList[i].sampleId !== undefined
? tableList[i].sampleId
: '',
sampleSn:
tableList[i].sampleSn !== undefined
? tableList[i].sampleSn
: '',
sampleName:
tableList[i].sampleName !== undefined
? tableList[i].sampleName
: '',
backupPlace:
tableList[i].backupPlace !== undefined
? tableList[i].backupPlace
: '',
cname: tableList[i].cname !== undefined ? tableList[i].cname : '',
storageCondition:
tableList[i].storageCondition !== undefined
? tableList[i].storageCondition
: '',
quantity:
tableList[i].quantity !== undefined
? tableList[i].quantity
: '',
sampleQuantity:
tableList[i].sampleQuantity !== undefined
? tableList[i].sampleQuantity
: '',
handleQuantity:
tableList[i].handleQuantity !== undefined
? tableList[i].handleQuantity
: '',
sampleUnit:
tableList[i].sampleUnit !== undefined
? tableList[i].sampleUnit
: '',
endDate:
tableList[i].endDate !== undefined
? new Date(tableList[i].endDate)
: '',
handleMethod:
tableList[i].handleMethod !== undefined
? tableList[i].handleMethod
: '',
id: tableList[i].id !== undefined ? tableList[i].id : '',
contractName:
tableList[i].contractName !== undefined
? tableList[i].contractName
: '',
code: tableList[i].code !== undefined ? tableList[i].code : '',
contractSn:
tableList[i].contractSn !== undefined
? tableList[i].contractSn
: '',
progress:
tableList[i].progress !== undefined
? tableList[i].progress
: '',
type: tableList[i].type !== undefined ? tableList[i].type : '',
issueDate:
tableList[i].issueDate !== undefined
? tableList[i].issueDate
: '',
sampleRemark:
tableList[i].sampleRemark !== undefined
? tableList[i].sampleRemark
: '',
contractRemark:
tableList[i].contractRemark !== undefined
? tableList[i].contractRemark
: '',
isEligible:
tableList[i].isEligible !== undefined
? tableList[i].isEligible
: '',
remark:
tableList[i].remark !== undefined ? tableList[i].remark : '',
contractId:
tableList[i].contractId !== undefined
? tableList[i].contractId
: ''
})
}
this.selectIds = [] this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page this.selectData = []
this.selectSampleIds = []
break break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
this.selectIds = [] this.selectIds = []
this.selectSampleIds = []
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id) this.selectIds.push(data[i].id)
this.selectSampleIds.push(data[i].sampleId)
} }
break break
case 'changeSize': case 'changeSize':
this._page() this._page()
break break
// default :
// this._page();
} }
}, },
_formSearch() { _formSearch() {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
// this._getBackUpCount()
}, },
_dateChange(data) { _page: async function() {
this.endDateBegin = data[0] this.editIndex = -1
this.endDateEnd = data[1] Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageBackupHandleCheckHis(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
}, },
_btnClick(msg) { _batchEdit() {
switch (msg) { if (this.selectIds.length === 0) {
case '导出': this.$Message.warning('请选择一条或多条数据!')
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else { } else {
this._export() this.$refs.editModal._open(this.selectData)
} }
break },
case '导出样品贮存表': _handle() {
this._exportSampleStore() if (this.selectIds.length === 0) {
break this.$Message.warning('请选择一条或多条数据!')
case 'search': } else {
this.searchOpen = !this.searchOpen this.$refs.applyModal._open(this.selectData)
break
} }
}, },
_exportSampleStore() { // 委托详情
const obj = { _detailModal(data) {
param: 'ids', // 查看
ids: this.selectIds, this.$store.dispatch('FoodContract/getById', data.contractId).then(() => {
url: '', if (data.type === 0) {
queryObj: this.$serialize('search-form-query') // 企业委托 ’0‘
this.currentComponent = 'FoodContractCompanyDetail'
} else {
// 政府委托 ’1‘
this.currentComponent = 'FoodContractGovernDetail'
} }
this.$store this.$nextTick(() => {
.dispatch( this.$refs.refModal._open(this.$store.state.FoodContract.model)
'ReportExport/getById', })
'food-sample-handle-already-export-sample-store'
)
.then(() => {
const result = this.$store.state.ReportExport.model
obj.url = result
this.$exportByQuery(obj)
}) })
}, },
// 样品详情 // 样品详情
...@@ -248,9 +660,9 @@ export default { ...@@ -248,9 +660,9 @@ export default {
if (this.selectData.length === 0) { if (this.selectData.length === 0) {
// 导出全部数据 // 导出全部数据
this.$store this.$store
.dispatch('FoodSampleBackup/perSampleQuery', this._searchParams()) .dispatch('LmsFoodSamplePrepare/page', this._searchParams())
.then(() => { .then(() => {
result = this.$store.state.FoodSampleBackup.page.records result = this.$store.state.LmsFoodSamplePrepare.page.records
this.$Modal.confirm({ this.$Modal.confirm({
title: '提示', title: '提示',
content: content:
...@@ -259,8 +671,8 @@ export default { ...@@ -259,8 +671,8 @@ export default {
: '确定导出这' + result.length + ' 条数据?', : '确定导出这' + result.length + ' 条数据?',
onOk: () => { onOk: () => {
this.$exportExcel( this.$exportExcel(
'perSampleQuery', 'samplePreManage',
'样品处理', '备样记录',
this.pageColumns, this.pageColumns,
result result
) )
...@@ -278,8 +690,8 @@ export default { ...@@ -278,8 +690,8 @@ export default {
: '确定导出这' + result.length + ' 条数据?', : '确定导出这' + result.length + ' 条数据?',
onOk: () => { onOk: () => {
this.$exportExcel( this.$exportExcel(
'perSampleQuery', 'samplePreManage',
'样品处理', '备样记录',
this.pageColumns, this.pageColumns,
result result
) )
...@@ -289,10 +701,33 @@ export default { ...@@ -289,10 +701,33 @@ export default {
}, },
// 参数 // 参数
_searchParams() { _searchParams() {
const data = this.$serialize('search-form-query') const data = this.$serialize('search-form')
return this.$extend(data, { page: 1, rows: 5000 }) return this.$extend(data, { page: 1, rows: 5000 })
} }
/** *********************************导出样品台账-end*********************************************/ /** *********************************导出样品台账-end*********************************************/
} }
} }
</script> </script>
<style scoped>
/******副样、备样卡片********/
.reimbursement-item {
flex: 1;
border-radius: 5px;
border: 1px solid #e8e8e8;
padding-bottom: 10px;
}
.reimbursement-item + .reimbursement-item {
margin-left: 20px;
}
.reimbursement-item p {
text-align: center;
margin: 0;
}
.reimbursement-item > p:first-child {
font-size: 22px;
line-height: 40px;
}
</style>
...@@ -114,16 +114,6 @@ export default { ...@@ -114,16 +114,6 @@ export default {
id: '', id: '',
name: '附件' name: '附件'
}, },
// {
// type: 'md-document',
// id: '',
// name: '导出委托单'
// },
{
type: 'md-remove-circle',
id: '',
name: '删除'
},
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
......
...@@ -105,7 +105,6 @@ export default { ...@@ -105,7 +105,6 @@ export default {
// name: '编辑协议' // name: '编辑协议'
// }, // },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
......
...@@ -91,18 +91,7 @@ export default { ...@@ -91,18 +91,7 @@ export default {
id: '', id: '',
name: '管理样品' name: '管理样品'
}, },
// {
// type: 'ios-list',
// id: '',
// name: '项目管理'
// },
// {
// type: 'md-create',
// id: '',
// name: '编辑协议'
// },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
......
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