Commit 8abc2808 by wangweidong

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

parents 8b869e4f 5bf063d1
......@@ -12,6 +12,8 @@ export default {
http.post('soil/v1/entrust/page_review', data).then(res => res),
pageSampleReceive: data =>
http.post('soil/v1/entrust/page_sample_receive', data).then(res => res),
pageSamplePrepare: data =>
http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res),
getById: data => http.get('soil/v1/entrust/' + data).then(res => res),
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data =>
......@@ -42,5 +44,19 @@ export default {
http.post('soil/v1/entrust/review_pass?ids=' + data).then(res => res),
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageReceive: data =>
http.post('soil/v1/sample/page_receive', data).then(res => res)
http.post('soil/v1/sample/page_receive', data).then(res => res),
pageSend: data =>
http.post('soil/v1/sample/page_send', data).then(res => res),
receiveSample: data =>
http.post('soil/v1/sample/receive_sample', data).then(res => res),
sendSample: data =>
http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data =>
http.post('soil/v1/sample/page_prepare', data).then(res => res),
sampleEdit: data =>
http.put(
'soil/v1/sample/' + data.id + '?describeDetail=' + data.describeDetail
),
weiteSoilDetail: data =>
http.post('soil/v1/sample/write_soil_detail', data).then(res => res)
}
......@@ -9,6 +9,8 @@ export default {
// page
locationPage: data =>
http.post('soil/v1/receive_location/page', data).then(res => res),
locationList: data =>
http.post('soil/v1/receive_location/list', data).then(res => res),
locationGetById: data =>
http.get('soil/v1/receive_location/' + data).then(res => res),
locationSave: data =>
......
......@@ -43,7 +43,7 @@
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange">
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -61,6 +61,9 @@
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<div v-else-if="item.key==='describeDetail'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.describeDetail" @change="_inputChange(scope.row)"></el-input>
</div>
<div v-else>
{{ scope.row[item.key] }}
</div>
......@@ -75,6 +78,7 @@
</div>
</Modal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
<DescribeDetailModal ref="writeDetailModal" @on-result-change="_page"></DescribeDetailModal>
</div>
</template>
<script>
......@@ -82,9 +86,10 @@ import http from '../../api/http'
import { soilEntrust } from '../../api'
import { getLodop } from '../../plugins/clodop/LodopFuncs'
import SoilSampleItemManage from './SoilSampleItemManage'
import DescribeDetailModal from './sample-preparation/DescribeDetailModal'
let LODOP
export default {
components: { SoilSampleItemManage },
components: { SoilSampleItemManage, DescribeDetailModal },
data() {
return {
formId: 'soilSampleManage',
......@@ -104,6 +109,11 @@ export default {
type: 'success',
id: '',
name: '打印标签'
},
{
type: 'success',
id: '',
name: '批量填写土质描述详情'
}
],
itemList: [],
......@@ -129,15 +139,9 @@ export default {
selectData: {},
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述详情', key: 'describeDetail', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 160 },
{ title: '现场编号', key: 'siteNo', width: 130 }
......@@ -156,6 +160,19 @@ export default {
}
},
methods: {
_inputChange: async function(info) {
const result = await soilEntrust.sampleEdit({
id: info.id,
describeDetail: info.describeDetail
})
if (result) {
this._resultChange('修改成功')
}
},
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
_footerResult(name) {
switch (name) {
case '取消':
......@@ -231,6 +248,9 @@ export default {
case '打印标签':
this._printLabel()
break
case '批量填写土质描述详情':
this._writeDetail(this.selectIds)
break
case '复制历史样品检测项目':
this._copyHisItem()
break
......@@ -249,6 +269,14 @@ export default {
}
})
},
_writeDetail(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.writeDetailModal._open(ids)
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
......@@ -355,7 +383,7 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.contractId
const result = await soilEntrust.samplePage(
const result = await soilEntrust.pagePrepare(
this.$serializeForm(this.formObj)
)
if (result) {
......@@ -421,8 +449,8 @@ export default {
this._page()
},
_resultChange(msg) {
this._page()
this.$Message.success(msg)
this._page()
},
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
......
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="备样管理" name="wait">
<SampleBackupsManage ref="waitTabs"></SampleBackupsManage>
</el-tab-pane>
<el-tab-pane label="备样查询" name="query">
<SampleBackupsQuery ref="queryTabs"></SampleBackupsQuery>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import SampleBackupsManage from './tab/SampleBackupsManage'
import SampleBackupsQuery from './tab/SampleBackupsQuery'
export default {
components: {
SampleBackupsManage,
SampleBackupsQuery
},
data() {
return {
activeName: 'wait'
}
},
mounted() {
this.activeName = 'wait'
this.$refs.waitTabs._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this.$refs.waitTabs._page()
} else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page()
} else {
this.$refs.queryTabs._page()
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="样品编号:">
<Input @on-enter="_formSearch" name="sampleSn" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-item" label="样品名称:">
<Input @on-enter="_formSearch" name="sampleName" placeholder="请输入样品名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
class="contHide">
<template slot="processTask">
<div class="fr process-task">
<el-checkbox v-model="warnAndOver" style="margin-right: 80px;margin-top: 7px;" @change="_relPage" :true-label="1"
:false-label="0" size="medium">只看预警和超期样品
</el-checkbox>
</div>
</template>
</btn-list>
</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">
<PTVXETable
id="samplePreManage"
ref="pageTable"
:tableHeight="tableHeight"
:getPage="getPage"
@on-result-change="_tableResultChange"
select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<div v-if="item.key==='progress'">
{{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'"
@click.stop="_sampleDetailModal(scope.row)">{{scope.row[item.key]}}</a>
<div v-else-if="item.key==='backupPlace'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<AutoCompletes :value="scope.row.backupPlace" :downData="locList" @on-result-change="_locChange"
name="backupPlace" placeholder="请输入或选择存储位置" focus
show-key="backupPlace"></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" :value="item.name" :key="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 v-else>{{scope.row[item.key]}}</div>
</template>
</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" @on-result-change="_iconClick"
:rowData="scope.row" :rowIndex="scope.rowIndex"></VXEIconList>
</template>
</vxe-table-column>
</template>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import AutoCompletes from '../../../../components/base/AutoCompletes'
// eslint-disable-next-line no-unused-vars
import http from '../../../../api/http'
import { soilEntrust } from '../../../../api'
export default {
components: {
AutoCompletes
},
data() {
return {
currentComponent: '',
searchOpen: false,
formObj: {},
selectData: [],
selectIds: [],
selectSampleIds: [],
getPage: {},
btn: [
{
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: 'food-sample-prepare-record-export',
name: '导出备样记录'
}
],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit
],
iconMsgSave: [{ type: 'ios-checkmark-empty', id: '', name: '保存' }],
pageColumns: [
{ title: '样品编号', key: 'sampleSn', width: 180 },
{ title: '样品名称', key: 'sampleName', width: 140 },
{ title: '状态', key: 'progress', width: 110 },
{ title: '委托单位', key: 'cname', width: 160 },
{ title: '委托名称', key: 'contractName', width: 170 },
{ title: '委托编号', key: 'code', width: 170 },
{ title: '是否合格', key: 'isEligible', width: 170 },
{ title: '报告签发日期', key: 'issueDate', width: 120, date: true },
{ title: '存储期限', key: 'endDate', width: 140 },
{ title: '存储位置', key: 'backupPlace', width: 140 },
{ title: '存储条件', key: 'storageCondition', width: 120 },
{ title: '样品数量', key: 'quantity', width: 100 },
{ title: '备样数量', key: 'sampleQuantity', width: 100 },
{ title: '样品处理数量', key: 'handleQuantity', width: 200 },
{ title: '备注', key: 'remark' },
{ title: '样品备注', key: 'sampleRemark' },
{ title: '委托备注', key: 'contractRemark' }
/* {title: '处置方式', key: 'handleMethod', width: 120,}, */
],
conditionList: [],
locList: [],
currentIndex: -1,
editIndex: -1,
endDateBegin: '',
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: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 385)
} else {
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: {
// 签发日期
_issueDateChange(date) {
this.issueDateBegin = date[0]
this.issueDateEnd = date[1]
},
// 重新请求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 '保存':
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._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
}
},
// 制备
_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) {
switch (msg) {
case 'page':
this.getPage.records = []
this.getPage = {
total: this.$store.state.LmsFoodSamplePrepare.page.total,
pages: this.$store.state.LmsFoodSamplePrepare.page.pages,
current: this.$store.state.LmsFoodSamplePrepare.page.current,
size: this.$store.state.LmsFoodSamplePrepare.page.size,
records: []
}
const tableList = this.$store.state.LmsFoodSamplePrepare.page.records
for (let i = 0; i < tableList.length; i++) {
this.getPage.records.push({
sampleId:
tableList[i].sampleId !== undefined
? tableList[i].sampleId
: '',
sampleSn:
tableList[i].sampleSn !== undefined
? tableList[i].sampleSn
: '',
sampleName:
tableList[i].sampleName !== undefined
? tableList[i].sampleName
: '',
backupPlace:
tableList[i].backupPlace !== undefined
? tableList[i].backupPlace
: '',
cname: tableList[i].cname !== undefined ? tableList[i].cname : '',
storageCondition:
tableList[i].storageCondition !== undefined
? tableList[i].storageCondition
: '',
quantity:
tableList[i].quantity !== undefined
? tableList[i].quantity
: '',
sampleQuantity:
tableList[i].sampleQuantity !== undefined
? tableList[i].sampleQuantity
: '',
handleQuantity:
tableList[i].handleQuantity !== undefined
? tableList[i].handleQuantity
: '',
sampleUnit:
tableList[i].sampleUnit !== undefined
? tableList[i].sampleUnit
: '',
endDate:
tableList[i].endDate !== undefined
? new Date(tableList[i].endDate)
: '',
handleMethod:
tableList[i].handleMethod !== undefined
? tableList[i].handleMethod
: '',
id: tableList[i].id !== undefined ? tableList[i].id : '',
contractName:
tableList[i].contractName !== undefined
? tableList[i].contractName
: '',
code: tableList[i].code !== undefined ? tableList[i].code : '',
contractSn:
tableList[i].contractSn !== undefined
? tableList[i].contractSn
: '',
progress:
tableList[i].progress !== undefined
? tableList[i].progress
: '',
type: tableList[i].type !== undefined ? tableList[i].type : '',
issueDate:
tableList[i].issueDate !== undefined
? tableList[i].issueDate
: '',
sampleRemark:
tableList[i].sampleRemark !== undefined
? tableList[i].sampleRemark
: '',
contractRemark:
tableList[i].contractRemark !== undefined
? tableList[i].contractRemark
: '',
isEligible:
tableList[i].isEligible !== undefined
? tableList[i].isEligible
: '',
remark:
tableList[i].remark !== undefined ? tableList[i].remark : '',
contractId:
tableList[i].contractId !== undefined
? tableList[i].contractId
: ''
})
}
this.selectIds = []
this.selectData = []
this.selectSampleIds = []
break
case 'selectData':
this.selectData = data
this.selectIds = []
this.selectSampleIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
this.selectSampleIds.push(data[i].sampleId)
}
break
case 'changeSize':
this._page()
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
this._getBackUpCount()
},
_page: async function() {
this.editIndex = -1
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageSampleReceive(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_batchEdit() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this.$refs.editModal._open(this.selectData)
}
},
_handle() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this.$refs.applyModal._open(this.selectData)
}
},
// 委托详情
_detailModal(data) {
// 查看
this.$store.dispatch('FoodContract/getById', data.contractId).then(() => {
if (data.type === 0) {
// 企业委托 ’0‘
this.currentComponent = 'FoodContractCompanyDetail'
} else {
// 政府委托 ’1‘
this.currentComponent = 'FoodContractGovernDetail'
}
this.$nextTick(() => {
this.$refs.refModal._open(this.$store.state.FoodContract.model)
})
})
},
// 样品详情
_sampleDetailModal(data) {
if (data.type === 1) {
// 政府
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleCompanyDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel
)
})
})
}
},
/** *********************************导出-begin*********************************************/
_export() {
let result = []
if (this.selectData.length === 0) {
// 导出全部数据
this.$store
.dispatch('LmsFoodSamplePrepare/page', this._searchParams())
.then(() => {
result = this.$store.state.LmsFoodSamplePrepare.page.records
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'samplePreManage',
'备样记录',
this.pageColumns,
result
)
}
})
})
} else {
// 只导出选中的数据
result = this.selectData
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'samplePreManage',
'备样记录',
this.pageColumns,
result
)
}
})
}
},
// 参数
_searchParams() {
const data = this.$serialize('search-form')
return this.$extend(data, { page: 1, rows: 5000 })
}
/** *********************************导出样品台账-end*********************************************/
}
}
</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>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form-query" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="样品编号:">
<Input @on-enter="_formSearch" name="sampleSn" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-item" label="样品名称:">
<Input @on-enter="_formSearch" name="sampleName" placeholder="请输入样品名称" clearable/>
</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 class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<!--<ElementTable :tableHeight="tableHeight" @on-result-change="_tableResultChange"-->
<!--ref="pageTable" :getPage="getPage" id="perSampleQuery" selectData>-->
<!--<el-table-column-->
<!--show-overflow-tooltip-->
<!--sortable-->
<!--:prop="item.key"-->
<!--:label="item.title"-->
<!--: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
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.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>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import { soilEntrust } from '../../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
selectIds: [],
formObj: {},
btn: [
// { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-handle-already-export-sample-store',
name: '导出样品贮存表'
}
],
pageColumns: [
{ title: '样品编号', key: 'sampleSn', width: 180 },
{ title: '样品名称', key: 'sampleName', width: 140 },
{ title: '状态', key: 'progress', width: 110, status: true },
{ title: '存储期限', key: 'endDate', width: 120, date: true },
{ title: '委托单位', key: 'cname', width: 140 },
{ title: '委托名称', key: 'contractName', width: 170 },
{ title: '处置方式', key: 'handleMethod', width: 120 },
{ title: '处理人', key: 'handlePerson', width: 100 },
{ title: '处理时间', key: 'handleTime', width: 120, date: true },
{ title: '处理申请人', key: 'applyer', width: 120 },
{ title: '申请时间', key: 'applyDate', width: 120, date: true },
{ title: '存储位置', key: 'backupPlace', width: 100 },
{ title: '存储条件', key: 'storageCondition', width: 120 },
{ title: '样品数量', key: 'quantity', width: 100 },
{ title: '备样数量', key: 'sampleQuantity', width: 100 },
{ title: '样品备注', key: 'sampleRemark' },
{ title: '委托备注', key: 'contractRemark' }
],
searchOpen: false,
getPage: {},
selectData: [],
endDateBegin: '',
endDateEnd: ''
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('tabSearchTwo')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
methods: {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageSampleReceive(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'changeSize':
this._page()
break
// default :
// this._page();
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_dateChange(data) {
this.endDateBegin = data[0]
this.endDateEnd = data[1]
},
_btnClick(msg) {
switch (msg) {
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case '导出样品贮存表':
this._exportSampleStore()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_exportSampleStore() {
const obj = {
param: 'ids',
ids: this.selectIds,
url: '',
queryObj: this.$serialize('search-form-query')
}
this.$store
.dispatch(
'ReportExport/getById',
'food-sample-handle-already-export-sample-store'
)
.then(() => {
const result = this.$store.state.ReportExport.model
obj.url = result
this.$exportByQuery(obj)
})
},
// 样品详情
_sampleDetailModal(data) {
if (data.type === 1) {
// 政府
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleCompanyDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel
)
})
})
}
},
/** *********************************导出-begin*********************************************/
_export() {
let result = []
if (this.selectData.length === 0) {
// 导出全部数据
this.$store
.dispatch('FoodSampleBackup/perSampleQuery', this._searchParams())
.then(() => {
result = this.$store.state.FoodSampleBackup.page.records
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'perSampleQuery',
'样品处理',
this.pageColumns,
result
)
}
})
})
} else {
// 只导出选中的数据
result = this.selectData
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'perSampleQuery',
'样品处理',
this.pageColumns,
result
)
}
})
}
},
// 参数
_searchParams() {
const data = this.$serialize('search-form-query')
return this.$extend(data, { page: 1, rows: 5000 })
}
/** *********************************导出样品台账-end*********************************************/
}
}
</script>
......@@ -121,7 +121,6 @@ export default {
{ title: '位置编号', key: 'code' },
{ title: '位置管理人', key: 'manager' },
{ title: '收样存储位置', key: 'name' },
{ title: '位置分类', key: 'type' },
{ title: '备注说明', key: 'remark' }
// { title: '标准状态', key: 'status', width: 120 },
// { title: '标准分类', key: 'classify' },
......
......@@ -10,13 +10,6 @@
<Form-item label="收样存储位置" prop="name" style="width: 100%">
<Input v-model="formObj.name" name="name" placeholder="请输入收样存储位置"/>
</Form-item>
<Form-item label="位置分类" prop="type" style="width: 100%">
<Select v-model="formObj.type" name="type">
<Option v-for="(item,index) in options" :key="item.name" :value="index">
{{ item.name }}
</Option>
</Select>
</Form-item>
<Form-item label="位置管理人" prop="manager" style="width: 100%">
<Input v-model="formObj.manager" @click.native="_selectStaff" name="manager" readonly/>
</Form-item>
......@@ -62,7 +55,6 @@ export default {
formObj: {
name: '',
code: '',
type: '',
remark: '',
manager: '',
managerId: ''
......
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="土质描述详情" prop="detail " style="width: 100%">
<el-input v-model="formObj.detail " name="detail "></el-input>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
formObj: {
detail: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
selectLocation(data) {
this._getLocationById(data)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_receive: async function(data) {
const result = await soilEntrust.weiteSoilDetail(data)
if (result) {
this._resultChange('填写成功!')
}
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.detail = ''
this.ids = ids
this.showEditModal = true
},
_getLocation: async function() {
const result = await soilSample.locationList()
if (result) {
console.log(result)
this.options = result
console.log(this.options)
}
},
_getLocationById: async function(id) {
console.log(id)
const result = await soilSample.locationGetById(id)
if (result) {
this.formObj.receiveLocation = result.name
}
console.log(this.formObj.receiveLocation)
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
......@@ -100,6 +100,11 @@ export default {
// name: '管理样品'
// },
{
type: 'ios-camera-outline',
id: '',
name: '试样照片'
},
{
type: 'md-cloud',
id: '',
name: '附件'
......@@ -187,6 +192,9 @@ export default {
case '试样列表':
this._sampleManage(data.id)
break
case '试样照片':
this._upload(data.id)
break
case '附件':
this._upload(data.id)
break
......@@ -278,7 +286,9 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.page(this.formObj)
const result = await soilEntrust.pageSamplePrepare(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......
......@@ -135,39 +135,11 @@ export default {
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
sampleDetail: true,
fixed: 'left'
},
{ title: '样品名称', key: 'name', width: 160, fixed: 'left' },
{ title: '执行标准', key: 'standard', width: 160 },
{ title: '大类', key: 'firstClass', width: 130 },
{ title: '细类', key: 'detectType', width: 200 },
{ title: '抽样单编号', key: 'samplingNum', width: 200 },
{ title: '检测项目', key: 'itemName', width: 160 },
{ title: '规格型号', key: 'specification', width: 160 },
{ title: '质量等级', key: 'qualityGrade', width: 160 },
{ title: '样品数量', key: 'quantity', width: 160 },
{ title: '单位', key: 'unit', width: 100 },
{ title: '抽样环节', key: 'samplingLink', width: 160 },
{ title: '备样数量', key: 'backupQuanity', width: 100 },
{ title: '保存条件', key: 'keepCondition', width: 160 },
{ title: '抽样地点', key: 'samplingPlace', width: 160 },
{ title: '抽样地点(其他)', key: 'samplingPlaceRemark', width: 200 },
{ title: '抽样日期', key: 'samplingDate', width: 200, date: true },
{ title: '日期类型', key: 'dateType', width: 160 },
{ title: '日期', key: 'dateTimeString', width: 120 },
{ title: '委托单位', key: 'cname' },
{ title: '委托编号', key: 'code', width: 180, detail: true },
{ title: '检测类型', key: 'contractDetectType', width: 130 },
{ title: '签订日期', key: 'signDate', date: true, width: 120 },
{ title: '制单人', key: 'contractUname', width: 120 },
{ title: '制单日期', key: 'contractCtime', date: true, width: 120 },
{ title: '样品备注', key: 'remark' },
{ title: '委托备注', key: 'contractRemark' }
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 160 },
{ title: '现场编号', key: 'siteNo', width: 130 }
],
searchOpen: false,
btn: [
......
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="收样位置" prop="name" style="width: 100%">
<el-select v-model="formObj.locationId" @change="selectLocation($event)" name="locationId">
<el-option v-for="(item) in options" :label="item.name" :key="item.id" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
formObj: {
receiveLocation: '',
locationId: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
selectLocation(data) {
this._getLocationById(data)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_receive: async function(data) {
const result = await soilEntrust.receiveSample(data)
if (result) {
this._resultChange('收样成功!')
}
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.receiveLocation = ''
this.formObj.locationId = ''
this._getLocation()
this.ids = ids
this.showEditModal = true
},
_getLocation: async function() {
const result = await soilSample.locationList()
if (result) {
console.log(result)
this.options = result
console.log(this.options)
}
},
_getLocationById: async function(id) {
console.log(id)
const result = await soilSample.locationGetById(id)
if (result) {
this.formObj.receiveLocation = result.name
}
console.log(this.formObj.receiveLocation)
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
......@@ -59,26 +59,21 @@
</Row>
</div>
<!--选择领样人-->
<SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal>
</div>
</template>
<script>
import { soilEntrust } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal'
export default {
components: {},
components: { SampleReceiveModal },
data() {
return {
btn: [{ type: 'primary', id: '', name: '收样室收样' }],
selectIds: [],
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
......@@ -278,7 +273,7 @@ export default {
this._copyHisItem()
break
case '收样室收样':
this._sampleReceive()
this._sampleReceive(this.selectIds)
break
case '打印标签':
this._selectPrinter('print-label')
......@@ -515,20 +510,22 @@ export default {
},
// 样品接收
_sampleReceive() {
_sampleReceive(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const tempData = {
ids: this.selectIds.join(',')
}
this.$Modal.confirm({
title: '提示',
content: '确定要接收这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
console.log(tempData)
}
})
const ids = id.join(',')
this.$refs.locationModal._open(ids)
// const tempData = {
// ids: this.selectIds.join(',')
// }
// this.$Modal.confirm({
// title: '提示',
// content: '确定要接收这 ' + this.selectIds.length + ' 条数据?',
// onOk: () => {
// console.log(tempData)
// }
// })
}
},
......
......@@ -68,37 +68,15 @@ export default {
components: {},
data() {
return {
btn: [{ type: 'primary', id: 'ZBC', name: '发放' }],
btn: [{ type: 'primary', id: '', name: '发放' }],
selectIds: [],
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '样品名称', key: 'name', width: 160, fixed: 'left' },
{ title: '执行标准', key: 'standard', width: 160 },
{ title: '大类', key: 'firstClass', width: 130 },
{ title: '细类', key: 'detectType', width: 200 },
{ title: '抽样单编号', key: 'samplingNum', width: 200 },
{ title: '检测项目', key: 'itemName', width: 160 },
{ title: '规格型号', key: 'specification', width: 160 },
{ title: '质量等级', key: 'qualityGrade', width: 160 },
{ title: '样品数量', key: 'quantity', width: 100 },
{ title: '单位', key: 'unit', width: 90 },
{ title: '抽样环节', key: 'samplingLink', width: 160 },
{ title: '备样数量', key: 'backupQuanity', width: 100 },
{ title: '保存条件', key: 'keepCondition', width: 160 },
{ title: '抽样地点', key: 'samplingPlace', width: 160 },
{ title: '抽样地点(其他)', key: 'samplingPlaceRemark', width: 200 },
{ title: '抽样日期', key: 'samplingDate', width: 200, date: true },
{ title: '日期类型', key: 'dateType', width: 160 },
{ title: '日期', key: 'dateTime', width: 120, date: true },
{ title: '样品形态', key: 'shape', width: 100 },
{ title: '备注', key: 'remark' }
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 160 },
{ title: '现场编号', key: 'siteNo', width: 130 }
],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' },
......@@ -212,7 +190,7 @@ export default {
_open(contractId, type) {
this.formObj = this.$resetFields(this.formObj)
$('input[name=contractId]').val(contractId)
this.contractId = contractId
this.entrustId = contractId
this.type = type
this.selectIds = []
this.$nextTick(() => {
......@@ -221,8 +199,10 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.page(this.$serializeForm(this.formObj))
this.formObj.entrustId = this.entrustId
const result = await soilEntrust.pageSend(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......@@ -326,7 +306,7 @@ export default {
// 发放
_submitSend() {
if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!')
this.$message.warning('请至少选择一条数据!')
} else {
// 一键发放判断是否选人
// eslint-disable-next-line no-lonely-if
......@@ -345,19 +325,26 @@ export default {
const data = {
ids: this.selectIds.join(',')
}
// 发放
this.$store.dispatch('FoodSample/submitSend', data).then(() => {
this._resultChange('发放成功')
this.$Modal.confirm({
title: '提示',
content: '确定要发放这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
this._sendSample(data)
}
})
}
}
},
_sendSample: async function(data) {
const result = await soilEntrust.sendSample(data)
if (result) {
this._resultChange('发放成功')
}
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this._page()
this.$Message.success(msg)
this.selectIds = []
}
},
_exportReceiveRecord() {
......
......@@ -10,6 +10,7 @@ import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust'
import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/SampleReceiveIndex'
import SamplePreparationIndex from '../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex'
import AddressManage from '../pages/soil-sample-manage/sample-address/AddressManage'
import BackupsManage from '../pages/soil-sample-manage/backups-manage/SampleBackupsIndex'
import Blank from '~/pages/blank'
export default [
{
......@@ -54,7 +55,7 @@ export default [
},
{
path: 'backups',
component: workbench,
component: BackupsManage,
meta: { title: '备样管理' }
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment