Commit 5d282ed6 by zhangmengqi

Merge branch 'dev'

parents 02fb2bdd a44a1334
......@@ -152,5 +152,26 @@ export default {
submitToInstock: data =>
http
.post('soil/v1/alone_sample/submit_to_out_storage', data)
.then(res => res),
// 登记历史记录
pageRegisterHis: data =>
http.post('soil/v1/alone_sample/page_register_his', data).then(res => res),
// 出库历史记录
pageWaitDeliveryHis: data =>
http
.post('soil/v1/alone_sample/page_wait_delivery_his', data)
.then(res => res),
// 入库历史记录
pageWaitStorageHis: data =>
http
.post('soil/v1/alone_sample/page_wait_storage_his', data)
.then(res => res),
bathChangeStorehouse: data =>
http
.post('soil/v1/alone_sample/bath_change_storehouse', data)
.then(res => res),
pageSampleOfStorehouse: data =>
http
.post('soil/v1/alone_sample/page_sample_of_storehouse', data)
.then(res => res)
}
......@@ -23,5 +23,6 @@ export default {
originalRecordGetById: data =>
http.get('soil/v1/original_record/' + data).then(res => res),
expReportGetById: data =>
http.get('soil/v1/exp_report/' + data).then(res => res)
http.get('soil/v1/exp_report/' + data).then(res => res),
reportGetById: data => http.get('soil/v1/report/' + data).then(res => res)
}
......@@ -207,18 +207,22 @@ export default {
http
.post('soil/v1/experiment/save_excel_original_record', data)
.then(res => res),
// saveExcelExpReport: data =>
// http
// .post(
// 'soil/v1/experiment/save_excel_exp_report?ids=' +
// data.ids +
// '&templateId=' +
// data.templateId +
// '&expName=' +
// data.expName +
// '&entrustId=' +
// data.entrustId
// )
// .then(res => res),
saveExcelExpReport: data =>
http
.post(
'soil/v1/experiment/save_excel_exp_report?ids=' +
data.ids +
'&templateId=' +
data.templateId +
'&expName=' +
data.expName +
'&entrustId=' +
data.entrustId
)
.post('soil/v1/experiment/save_excel_exp_report', data)
.then(res => res),
generateReport: data =>
http
......@@ -254,5 +258,11 @@ export default {
pageWaitDelivery: data =>
http.post('soil/v1/alone_sample/page_wait_delivery', data).then(res => res),
outStorageSubmit: data =>
http.post('soil/v1/alone_sample/out_storage_submit', data).then(res => res)
http.post('soil/v1/alone_sample/out_storage_submit', data).then(res => res),
pageStorehouseSample: data =>
http
.post('soil/v1/alone_sample/page_storehouse_sample', data)
.then(res => res),
aloneSampleDelete: data =>
http.delete('soil/v1/alone_sample/?ids=' + data).then(res => res)
}
......@@ -47,5 +47,11 @@ export default {
pageGroupExpStatistics: data =>
http
.post('soil/v1/statistics/page_group_exp_statistics', data)
.then(res => res)
.then(res => res),
listExperimentProgress: data =>
http
.post('soil/v1/experiment/list_experiment_progress', data)
.then(res => res),
listSampleProgress: data =>
http.post('soil/v1/sample/list_sample_progress', data).then(res => res)
}
......@@ -159,5 +159,6 @@ export default {
pageExperimentReport: data =>
http.post('soil/v1/exp_report/page', data).then(res => res),
deleteReport: data =>
http.delete('soil/v1/exp_report/?ids=' + data).then(res => res)
http.delete('soil/v1/exp_report/?ids=' + data).then(res => res),
reportPage: data => http.post('soil/v1/report/page', data).then(res => res)
}
<template>
<div :id="refName" :ref="refName" class="mescroll">
<div :class="emptyCls" v-show="showEmptySlot">
<slot name="empty"></slot>
</div>
<div>
<slot></slot>
</div>
</div>
</template>
<script>
/**
* 上拉加载,下拉刷新
*/
import MeScroll from 'mescroll.js'
import 'mescroll.js/mescroll.min.css'
export default {
props: {
pageSize: {
type: Number,
default: 10
},
downOptions: Object,
upOptions: Object
},
data() {
return {
showEmptySlot: false,
refName: 'mescroll_' + Date.now(),
instance: null
}
},
computed: {
emptyCls() {
return this.refName + '_empty'
}
},
mounted() {
this.$nextTick(this.$_init())
},
methods: {
$_init() {
this.showEmptySlot = false
if (this.instance) this.instance.destroy()
this.instance = new MeScroll(this.refName, {
down: Object.assign(
{
use: true,
auto: false // 默认不执行下拉刷新的回调
},
this.downOptions
),
up: Object.assign(
{
callback: this.$_upCallback,
use: true,
isBounce: false,
offset: 100,
// 如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据
noMoreSize: 1,
htmlNodata: '<p class="upwarp-nodata">-- 到底啦 --</p>',
loadFull: {
// 不满一屏自动加载
use: false,
delay: 500
},
page: {
num: 0,
size: this.pageSize,
time: null
},
scrollbar: {
use: false
}
},
this.upOptions
)
})
const _this = this
this.instance.showEmpty = function() {
_this.showEmptySlot = true
}
this.instance.removeEmpty = function() {
_this.showEmptySlot = false
}
},
// 上拉回调
$_upCallback(page) {
this.$emit('load', page.num)
},
getInstance() {
return this.instance
},
endByPage(curPagelen, totalPage) {
// curPagelen 当前界面已加载 完成的数据条数
// totalPage 总的分页数
this.instance && this.instance.endByPage(curPagelen, totalPage)
}
}
}
</script>
<style>
.mescroll-upwarp {
min-height: 10px !important;
padding: 5px 0 !important;
}
</style>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" width="600">
<p slot="header">{{modalTitle}}</p>
<div>
<Upload
:action="action"
:show-upload-list="false"
:before-upload="_beupload"
multiple
>
<Button type="dashed" icon="ios-cloud-upload-outline">上传文件(小于50MB)</Button>
</Upload>
<div>
<Card :dis-hover="true" style="width: 100%;height: 400px;overflow: auto;">
<p slot="title">已上传文件列表</p>
<div v-for="(item,index) in fileList" :key="index" class="file-upload-list">
<div>
<div class="file-upload-list-cover">
<Icon @click.native.stop="_handleRemove(item)" type="md-trash" style="color: white;font-size: 20px;"></Icon>
</div>
</div>
{{item.fileName }}
</div>
</Card>
</div>
</div>
<div slot="footer" class="btn-width">
<Button @click="showEditModal = false">取消</Button>
<Button @click="_mutipleUpload" :loading="isLoading" type="primary">{{btnName}}</Button>
</div>
</Modal>
</div>
</template>
<script>
/**
* 上传文件,在文件夹下
*/
import axios from 'axios'
import global from '../../../api/config'
import loading from '../../../api/loading'
export default {
data() {
return {
id: '',
ID: '',
action: '',
modalTitle: '',
showEditModal: false,
name: '',
isLoading: false,
btnName: '上传',
fileList: []
}
},
methods: {
_open(obj) {
this.fileList = []
this.showEditModal = true
this.ID = obj
this.modalTitle = '文件上传'
},
_beupload(file) {
// 单个文件上传超过50M时,取消上传
const isLt50M = file.size / 1024 / 1024 < 50
const fileName = file.name.split('.')[0]
if (!isLt50M) {
this.$Message.warning({
content: '文件 ' + fileName + ' 大小超多50M,请重新上传!',
duration: 3
})
this.isLoading = false
} else {
// 动态循环给文件命名
const temObj = {
file: file,
fileName: fileName
}
this.fileList.push(temObj)
}
return false
},
_mutipleUpload() {
if (this.fileList.length > 0 && this.btnName === '上传') {
this.isLoading = true
this.btnName = '上传中...'
// 创建formula对象
const formData = new FormData()
formData.append('entrustId', this.ID)
// 多个文件
for (let i = 0; i < this.fileList.length; i++) {
formData.append('file' + i, this.fileList[i].file)
}
const config = {
headers: {
'Content-Type': 'multipart/form-data'
}
}
const instanceFile = axios.create()
instanceFile.defaults.withCredentials = true
// 发起请求
instanceFile
.post(
global.baseURL +
'/soil/v1/alone_sample_annex/upload_bath/' +
this.ID,
formData,
{
headers: config
}
)
.then(res => {
if (res.data.code === '1') {
this.$Message.success('上传成功!')
this.showEditModal = false
this.$emit('on-result-change')
} else if (res.data.code === '0') {
loading.toast.show(res.data.code, res.data.msg)
this.$Message.error('操作失败')
}
this._resetLoading()
})
.catch(err => {
console.log(err)
this._resetLoading()
})
} else {
this.$Message.warning('请至少上传一个文件')
this._resetLoading()
}
},
_resetLoading() {
this.isLoading = false
this.btnName = '上传'
},
// 删除对应的上传的文件
_handleRemove(data) {
const index = this.fileList.findIndex(item => item === data)
this.fileList.splice(index, 1)
}
}
}
</script>
<style>
.file-upload-list {
display: inline-block;
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
margin-right: 4px;
}
.file-upload-list:hover .file-upload-list-cover {
display: block;
}
.file-upload-list-cover {
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
}
</style>
......@@ -111,15 +111,15 @@ export default {
viewUri: '/soil/v1/standard_annex/preview/'
}
break
case 'sampleId':
case 'aloneSampleId':
// 样品
this.sampleId = id
this.entrustId = id
this.urlData = {
msg: 'FoodSampleAttachment',
pageUrl: 'soil/v1/alone_sample_annex/page',
deleteUrl: 'soil/v1/alone_sample_annex/?ids=',
uploadFileUrl: '/food/v1/sample_attachment/upload/',
downloadFileUrl: '/food/v1/sample_attachment/download/',
deleteUrl: '/soil/v1/alone_sample_annex/?ids=',
uploadFileUrl: '/soil/v1/alone_sample_annex/upload/',
downloadFileUrl: '/soil/v1/alone_sample_annex/download/',
downloadBatch: '/food/v1/sample_attachment/download_batch',
uri: 'FoodSampleAttachment/getBySampleId',
viewUri: '/food/v1/sample_attachment/view'
......
......@@ -117,6 +117,7 @@
</Col>
</Row>
<BatchUpload ref="batchUpload" @on-result-change="_page"></BatchUpload>
<BatchUploadSample ref="batchUploadSample" @on-result-change="_page"></BatchUploadSample>
<!--上传loading-->
<div v-show="isLoad">
<Spin fix>
......@@ -137,11 +138,12 @@
import global from '../../../api/config'
import { meterEntrust } from '../../../api'
import BatchUpload from './BatchUpload'
import BatchUploadSample from './BatchUploadSample'
/**
* 公共组件modal 弹框(支持上传,下载,预览,删除附件等操作)
*/
export default {
components: { BatchUpload },
components: { BatchUpload, BatchUploadSample },
props: {
fileName: null
},
......@@ -206,7 +208,11 @@ export default {
},
methods: {
_batchUpload() {
this.$refs.batchUpload._open(this.id)
if (this.formObj.aloneSampleId) {
this.$refs.batchUploadSample._open(this.id)
} else {
this.$refs.batchUpload._open(this.id)
}
},
_setUploadData(data, idsObj, idKey) {
this.selectIds = []
......
<template>
<div>
<div style="padding-left: 20px;padding-top: 40px;padding-bottom: 10px">
<ul class="ul-progress">
<li v-for="(item,index) in progressList" :key="index">
<!--进度条 start-->
<div style="position: relative">
<label class="view-progress fl">
<!-- <Progress :percent="45" :stroke-width="20" status="active" text-inside />-->
<Progress :percent="state >= index ? 99.9: 0" status="active" hide-info></Progress>
<!-- <Progress :percent="30" status="active" hide-info></Progress>-->
</label>
<label :class="{'process-actives':state >= index}" class="progress-bg-gray fl">
<label class="progress-bg-white" style="display: inline-block;max-width: 100%;margin-bottom: 4px;font-weight: 700;"></label>
</label>
<div class="clear"></div>
</div>
<!--进度条 end-->
<!--内容 start-->
<div class="ul-progress-cont">
<p>{{item.name}}</p>
<p style="color: #b0b0b0;font-size:12px">{{item.time !==undefined? $dateformat(item.time, "yyyy-mm-dd"):''}}</p>
<p style="color: #b0b0b0;font-size:12px">{{item.user === undefined ? '' : item.user}}</p>
</div>
<!--进度条 end-->
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
props: {
progressList: null,
state: null
}
}
</script>
<style>
.ul-progress li {
float: left;
position: relative;
padding: 0 0 70px 0;
}
.fl {
float: left;
}
.ul-progress li:first-child .view-progress {
width: 140px;
}
.view-progress {
width: 180px;
}
.ul-progress li .progress-bg-gray {
background: #b5b5b5;
border-radius: 50%;
width: 40px;
height: 40px;
border: 3px solid #fff;
text-align: center;
line-height: 45px;
position: absolute;
right: -10px;
top: -10px;
z-index: 100;
}
.process-actives {
background: #00a1e8 !important;
}
.ul-progress-cont {
text-align: center;
margin-top: 15px;
position: absolute;
right: -15px;
}
.ul-progress li .progress-bg-white {
background: #fff !important;
width: 10px;
height: 10px;
border-radius: 50%;
}
</style>
......@@ -30,6 +30,7 @@
"form-serialize": "^0.7.2",
"iview": "^3.3.3",
"koa": "^2.6.2",
"mescroll.js": "^1.4.2",
"node-schedule": "^1.3.0",
"nuxt": "^2.4.0",
"nuxt-start": "^2.5.1",
......
......@@ -6,24 +6,24 @@
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
<Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable/>
<Input v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
......@@ -49,7 +49,7 @@
</div>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<component :is="currentComponent" ref="refModal" @on-result-change="_componentResult"></component>
</keep-alive>
</div>
</template>
......@@ -142,6 +142,7 @@ export default {
pageColumns: [
{ title: '委托商', key: 'client', width: 230 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '项目名称', key: 'projectName', width: 120 },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
......
......@@ -8,9 +8,6 @@
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item class="search-item" label="项目名称:">
<Input v-model="formObj.projectName" @on-enter="_formSearch" name="projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
......@@ -103,6 +100,16 @@ export default {
name: '查看'
},
{
type: 'ios-cloud-download',
id: '',
name: '导出入库资料'
},
{
type: 'ios-camera',
id: '',
name: '照片'
},
{
type: 'md-cloud',
id: '',
name: '附件'
......@@ -231,6 +238,9 @@ export default {
case '试验项目列表':
this._itemManage(data.id)
break
case '照片':
this._uploadPhoto(data)
break
case '附件':
this._upload(data.id)
break
......@@ -243,7 +253,14 @@ export default {
}
})
},
_uploadPhoto(data) {
// 上传照片文件
this.currentComponent = 'PhotoManage'
this.$nextTick(() => {
this.$refs.refModal._open(data.id, 'entrustId')
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_sampleManage(data) {
// 管理样品
this.currentComponent = 'SoilSampleManage'
......
......@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托单号" clearable/>
<Form-item class="search-item" label="项目名称:">
<Input v-model="formObj.projectName" @on-enter="_formSearch" name="projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -56,9 +53,10 @@
<script>
import { soilAptitude, soilEntrust } from '../../api'
import MeterEntrustRecord from '../../components/operation/Operation'
import ViewDetail from './ViewDetail'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord },
components: { MeterEntrustRecord, ViewDetail },
data() {
return {
currentComponent: '',
......@@ -75,7 +73,7 @@ export default {
{
type: 'ios-list',
id: '',
name: '试样列表'
name: '查看'
},
{
type: 'ios-clock',
......@@ -90,20 +88,11 @@ export default {
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '项目名称', key: 'projectName', width: 120 },
{ title: '项目负责人', key: 'projectLeader', width: 150, detail: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
},
......@@ -140,6 +129,9 @@ export default {
case '编辑':
this._editModal(true, data.id)
break
case '查看':
this._viewModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
......@@ -161,6 +153,28 @@ export default {
}
})
},
_viewModal(edit, id) {
this.currentComponent = 'ViewDetail'
if (edit) {
this.$refs.pageTable._showLoading()
// 编辑
this._getDetailById(id)
} else {
// 添加
this.$nextTick(() => {
this.$refs.refModal._open()
})
}
},
_getDetailById: async function(id) {
const result = await soilEntrust.aloneSampleGetById(id)
if (result) {
this.$refs.refModal._open(result)
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
_sampleManage(data) {
// 管理样品
this.currentComponent = 'SoilSampleManage'
......@@ -189,7 +203,9 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageRegHis(this.formObj)
const result = await soilEntrust.pageWaitStorageHis(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......
......@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托单号" clearable/>
<Form-item class="search-item" label="项目名称:">
<Input v-model="formObj.projectName" @on-enter="_formSearch" name="projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -56,9 +53,10 @@
<script>
import { soilAptitude, soilEntrust } from '../../../api'
import MeterEntrustRecord from '../../../components/operation/Operation'
import ViewDetail from './ViewDetail'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord },
components: { MeterEntrustRecord, ViewDetail },
data() {
return {
currentComponent: '',
......@@ -75,7 +73,7 @@ export default {
{
type: 'ios-list',
id: '',
name: '试样列表'
name: '查看'
},
{
type: 'ios-clock',
......@@ -90,20 +88,11 @@ export default {
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '项目名称', key: 'projectName', width: 120 },
{ title: '项目负责人', key: 'projectLeader', width: 150, detail: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
},
......@@ -140,6 +129,9 @@ export default {
case '编辑':
this._editModal(true, data.id)
break
case '查看':
this._viewModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
......@@ -161,6 +153,28 @@ export default {
}
})
},
_viewModal(edit, id) {
this.currentComponent = 'ViewDetail'
if (edit) {
this.$refs.pageTable._showLoading()
// 编辑
this._getDetailById(id)
} else {
// 添加
this.$nextTick(() => {
this.$refs.refModal._open()
})
}
},
_getDetailById: async function(id) {
const result = await soilEntrust.aloneSampleGetById(id)
if (result) {
this.$refs.refModal._open(result)
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
_sampleManage(data) {
// 管理样品
this.currentComponent = 'SoilSampleManage'
......@@ -189,7 +203,7 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageRegHis(this.formObj)
const result = await soilEntrust.pageWaitDeliveryHis(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......
......@@ -170,7 +170,7 @@ export default {
this.formObj.outStocker = data.realname
this.formObj.outStockerId = data.id
}
console.log(data, msg)
console.log(this.formObj.outStocker, this.formObj.outStockerId)
},
_ctimeChange(data) {
this.formObj.outStock = data
......
......@@ -33,10 +33,8 @@
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.key==='status'">{{scope.row[item.key]===0?'现行':scope.row[item.key]===1?'即将实施':
scope.row[item.key]===2?'部分被代替':scope.row[item.key]===3?'被代替':scope.row[item.key]===4?'作废':''}}
<div v-if="item.key==='status'">{{scope.row[item.key].display}}
</div>
<div v-else-if="item.key==='classify'">
{{scope.row[item.key]===0?'判定依据':scope.row[item.key]===1?'检测依据':scope.row[item.key]===2?'其他':''}}
</div>
......@@ -168,7 +166,7 @@ export default {
this._editModal(true, data.id)
break
case '查看试样':
this._viewSample(data.name)
this._viewSample(data)
break
case '删除':
this._deleteById(data.id)
......
......@@ -11,8 +11,8 @@
<Col span="24">
<Form v-show="searchOpen" id="search-sample-company" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="委托编号:" class="search-item">
<Input v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch" />
<Form-item label="钻孔名称:" class="search-item">
<Input v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_page">
......@@ -28,7 +28,7 @@
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" select-data @on-result-change="_tableResultChange">
:get-page="getPage" select-data @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -106,20 +106,22 @@ export default {
selectData: {},
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 230 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
{ title: '项目名称', key: 'projectName', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '收样时间', key: 'receiveTime', width: 120, date: true },
{ title: '收样人', key: 'receiver', width: 120 },
{ title: '登记时间', key: 'registTime', width: 120, date: true },
{ title: '登记人', key: 'registrant', width: 120 },
{ title: '入库日期', key: 'instockTime', width: 120, date: true },
{ title: '留存日期', key: 'keepLimitTime', width: 120, date: true },
{ title: '项目负责人', key: 'projectLeader', width: 120 }
],
formObj: {
receiveLocation: undefined,
entrustCode: undefined,
client: undefined
client: undefined,
warehouse: undefined
},
receiveLocation: ''
}
......@@ -216,10 +218,13 @@ export default {
break
}
},
_open(name) {
_open(data) {
console.log(data)
this.formObj = this.$resetFields(this.formObj)
this.formObj.receiveLocation = name
this.receiveLocation = name
// this.formObj.receiveLocation = name
// this.receiveLocation = name
this.formObj.storehouse = data.warehouse
this.formObj.shelfCode = data.name
this.showModal = true
this.$refs.pageTable._hideLoading()
this._page()
......@@ -229,8 +234,8 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.contractId
const result = await soilEntrust.pageLocationEntrust(
// this.formObj.entrustId = this.contractId
const result = await soilEntrust.pageSampleOfStorehouse(
this.$serializeForm(this.formObj)
)
if (result) {
......
<template>
<div>
<Modal v-model="showEditModal" v-drag :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="warehouse" style="width: 100%">
<Input v-model="formObj.warehouse" name="warehouse" placeholder="请输入库房号"/>
</Form-item>
<Form-item label="货架号" prop="name" style="width: 100%">
<Input v-model="formObj.name" name="name" placeholder="请输入货架号"/>
</Form-item>
<Form-item label="位置分类:" prop="type" style="width: 100%">
<Select v-model="formObj.type" clearable name="type" placeholder="请选择类别">
<Option v-for="(item,index) in typeData" :value="item.value" :key="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>
<Form-item prop="managerId" style="width: 100%;display: none">
<Input v-model="formObj.managerId" @click.native="_selectStaff" name="managerId" readonly/>
</Form-item>
<Form-item label="备注说明" prop="remark" style="width: 100%">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注说明"/>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
<UserInfo ref="userModal" @on-result-change="_userData" is-change></UserInfo>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilSample } from '../../../api'
import Global from '../../../api/config'
import UserInfo from '../../../components/user-info-single/assignPerson'
export default {
components: {
ModalFooter,
UserInfo
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '收样位置选择',
formObj: {
name: '',
warehouse: '',
type: '',
remark: '',
manager: '',
managerId: ''
},
options: [
{
name: '国家标准'
},
{
name: '地方标准'
},
{
name: '行业标准'
},
{
name: '企业标准'
}
],
typeData: [
{
name: '待检',
value: 0
},
{
name: '备样',
value: 1
},
{
name: '备用',
value: 2
}
],
ruleValidate: {
warehouse: [
{ required: true, message: '库房号不能为空', trigger: 'blur' }
]
},
showEditModal: false,
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
_getUser() {
const user = Global.getUserInfo()
this.formObj.manager = user.realname
this.formObj.managerId = user.id
console.log(user)
},
_selectStaff() {
this.$refs.userModal._open()
},
_userData(data, msg, contractTempData) {
this.formObj.manager = data.realname
this.formObj.managerId = data.id
console.log(data, msg)
},
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
if (this.formObj.publishDate && this.formObj.effectDate) {
if (this.formObj.publishDate > this.formObj.effectDate) {
this.$Message.error('发布日期应早于实施日期')
this._hideLoading()
return
}
}
const data = this.$serialize('edit-form')
if (this.$string(this.formObj.id).isEmpty()) {
// 添加
console.log('data', data)
this._save(data)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
}
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_save: async function(data) {
const result = await soilSample.aloneWarehouseLocationAdd(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilSample.aloneWarehouseLocationEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(formObj) {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) {
this.modalTitle = '添加'
this.formObj.id = ''
this._getUser()
} else {
this.formObj = formObj
this.formObj.id = formObj.id
this.formObj.effectDate = this.formObj.effectDate
? new Date(formObj.effectDate)
: ''
this.formObj.publishDate = this.formObj.publishDate
? new Date(formObj.publishDate)
: ''
this.modalTitle = '编辑'
}
this.showEditModal = true
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" v-drag :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="storehouse " style="width: 100%">
<Input v-model="formObj.storehouse " name="storehouse" placeholder="请输入库房号"></Input>
</Form-item>
<Form-item label="架位号" prop="shelfCode " style="width: 100%">
<Input v-model="formObj.shelfCode " name="shelfCode" placeholder="请输入架位号"></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: '',
modalTitle: '批量填写存放架位',
formObj: {
detail: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
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.bathChangeStorehouse(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.storehouse = ''
this.formObj.shelfCode = ''
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>
<template>
<div>
<Modal v-model="showModal" v-drag width="1030" class="modal-footer-none">
<p slot="header">
{{ modalTitle }}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form v-show="searchOpen" id="search-sample-company" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="委托编号:" class="search-item">
<Input v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_page">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" class="contHide" show-search-btn="true" @on-result-change="_btnClick"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" select-data @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.status">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
</div>
</template>
<script>
import { soilEntrust } from '../../../api'
import SoilSampleItemManage from './ViewSample'
export default {
components: { SoilSampleItemManage },
data() {
return {
formId: 'soilSampleManage',
currentComponent: '',
btn: [
// {
// type: 'success',
// id: '',
// name: '导入检测项目'
// }
// {
// type: 'success',
// id: '',
// name: '导入检测项目包'
// },
// {
// type: 'success',
// id: '',
// name: '打印标签'
// }
],
itemList: [],
indexList: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
iconMsg: [
{
type: 'ios-beaker',
id: '',
name: '查看试样'
}
],
contractId: '', // 委托id
showModal: false,
searchOpen: true,
modalTitle: '管理样品',
selectIds: [],
selectData: {},
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 230 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
],
formObj: {
receiveLocation: undefined,
entrustCode: undefined,
client: undefined
},
receiveLocation: ''
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_ok() {
this.showModal = false
this.$refs.footerModal._hideLoading()
console.log(this.getPage)
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case '删除':
this._deleteSelected()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_copyHisSample() {
this.$refs.refModal._open(this.contractId)
},
_iconClick(res, data, componentName, index) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '查看试样':
this._itemManage(data.id)
break
case '编辑':
this._editModal(true, data)
break
case '复制':
this._copy(data)
break
case '删除':
console.log(index)
this._deleteById(data.id)
break
}
})
},
_itemManage(data) {
this.$refs.sampleItemManage._open(data, this.receiveLocation)
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'allSelect':
this.allSelect(data)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_open(name) {
this.formObj = this.$resetFields(this.formObj)
this.formObj.receiveLocation = name
this.receiveLocation = name
this.showModal = true
this.$refs.pageTable._hideLoading()
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.contractId
const result = await soilEntrust.pageLocationEntrust(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._deleteOk(ids)
}
})
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_editModal(edit, data) {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
} else {
// 添加
this.$refs.refModal._open('', this.contractId)
}
},
_search() {
this._page()
},
_resultChange(msg) {
this._page()
this.$Message.success(msg)
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag width="980" class="modal-footer-none">
<p slot="header">
{{ modalTitle }}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样品编号" clearable />
</Form-item>
<Form-item class="search-btn">
<Button @click="_page" type="primary">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :rows="500" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.status">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<div v-else>
{{ scope.row[item.key] }}
</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import { soilSample } from '../../../api'
export default {
components: {},
data() {
return {
formId: 'soilSampleManage',
currentComponent: '',
btn: [
{
type: 'error',
id: '',
name: '批量删除'
}
],
iconMsg: [{ type: 'md-trash', id: '', name: '删除' }],
itemList: [],
indexList: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
entrustId: '', // 委托id
showModal: false,
recordHis: false,
searchOpen: true,
modalTitle: '管理样品',
selectIds: [],
selectData: {},
getPage: {},
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 },
{ title: '现场编号', key: 'siteNo', width: 100 },
{ title: '委托编号', key: 'entrustCode', width: 100 },
{ title: '收样位置', key: 'receiveLocation', width: 100 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '土质描述详情', key: 'describeDetail', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }
],
sampleId: '',
dateList: [],
formObj: {
receiveLocation: undefined,
entrustId: undefined
}
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
methods: {
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_ok() {
this.showModal = false
this.$refs.footerModal._hideLoading()
console.log(this.getPage)
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '批量删除':
this._deleteSelected()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName, index) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '删除':
this._deleteById(data.id)
break
}
})
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'allSelect':
this.allSelect(data)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
allSelect(data) {
this.indexList = []
for (let i = 0; i < data.length; i++) {
this.indexList.push(data[i].index)
}
console.log('索引', this.indexList)
},
_open(id, name) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.entrustId = id // 委托id
this.formObj.receiveLocation = name // 委托id
this.$refs.pageTable._hideLoading()
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageLocationSample(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._deleteOk(ids)
}
})
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_deleteOk: async function(ids) {
const result = await soilSample.removeSampleFromLocation({
ids: ids.join(',')
})
if (result) {
this.$Message.success('成功移除')
this._page()
}
// const result = await drugCatalogueItem.deleteById(id)
},
// 添加编辑模拟样品
_search() {
this._page()
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
}
}
}
</script>
......@@ -8,9 +8,6 @@
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item class="search-item" label="项目名称:">
<Input v-model="formObj.projectName" @on-enter="_formSearch" name="projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
......@@ -379,7 +376,7 @@ export default {
// 上传文件
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'sampleId')
this.$refs.refModal._open(id, 'aloneSampleId')
})
},
_getById: async function(id) {
......
......@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托单号" clearable/>
<Form-item class="search-item" label="项目名称:">
<Input v-model="formObj.projectName" @on-enter="_formSearch" name="projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -56,9 +53,10 @@
<script>
import { soilAptitude, soilEntrust } from '../../api'
import MeterEntrustRecord from '../../components/operation/Operation'
import ViewDetail from './ViewDetail'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord },
components: { MeterEntrustRecord, ViewDetail },
data() {
return {
currentComponent: '',
......@@ -75,7 +73,12 @@ export default {
{
type: 'ios-list',
id: '',
name: '试样列表'
name: '查看'
},
{
type: 'ios-cloud',
id: '',
name: '附件'
},
{
type: 'ios-clock',
......@@ -90,20 +93,11 @@ export default {
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '项目名称', key: 'projectName', width: 120 },
{ title: '项目负责人', key: 'projectLeader', width: 150, detail: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
},
......@@ -140,6 +134,9 @@ export default {
case '编辑':
this._editModal(true, data.id)
break
case '查看':
this._viewModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
......@@ -161,6 +158,28 @@ export default {
}
})
},
_viewModal(edit, id) {
this.currentComponent = 'ViewDetail'
if (edit) {
this.$refs.pageTable._showLoading()
// 编辑
this._getDetailById(id)
} else {
// 添加
this.$nextTick(() => {
this.$refs.refModal._open()
})
}
},
_getDetailById: async function(id) {
const result = await soilEntrust.aloneSampleGetById(id)
if (result) {
this.$refs.refModal._open(result)
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
_sampleManage(data) {
// 管理样品
this.currentComponent = 'SoilSampleManage'
......@@ -189,7 +208,9 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageRegHis(this.formObj)
const result = await soilEntrust.pageRegisterHis(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......@@ -226,7 +247,10 @@ export default {
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'sampleId')
})
},
_getById: async function(id) {
const result = await soilAptitude.getById(id)
......
......@@ -170,6 +170,7 @@ export default {
this.$refs.createModal._open()
},
_certificateSelectExcelBack(data) {
this.$refs.pageTable._showLoading()
if (data) {
console.log(this.selectIds)
console.log(data)
......@@ -179,7 +180,6 @@ export default {
}
},
_makeCodeExcel: async function(data) {
this.$refs.pageTable._hideLoading()
const result = await soilSample.generateReport({
entrustId: this.formObj.entrustId,
expReportIds: this.selectIds,
......@@ -192,8 +192,11 @@ export default {
this.$refs.pageTable._hideLoading()
return false
} else {
this.$refs.pageTable._hideLoading()
this._viewReport(result)
}
} else {
this.$refs.pageTable._hideLoading()
}
},
_viewReport(data) {
......
......@@ -142,8 +142,6 @@ export default {
pageColumns: [
{ title: '试验名称', key: 'name', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType' },
{ title: '检测依据', key: 'testBasis', width: 180 },
{ title: '试验方法', key: 'testMethod', width: 180 },
{ title: '状态', key: 'status', width: 180 }
......
......@@ -9,10 +9,7 @@
<Form :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="模板名称:">
<Input v-model="formObj.templateTitle" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
</Form-item>
<Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.cusNames" @on-enter="_formSearch" placeholder="请输入委托单位" clearable></Input>
<Input v-model="formObj.title" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -42,18 +39,6 @@
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
<!-- <template slot="col">-->
<!-- <vxe-table-column-->
<!-- :width="190"-->
<!-- title="操作"-->
<!-- align="center"-->
<!-- fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <VXEIconList :msg="(scope.row.hasInputItem===1) ? iconMsg : iconMsgDisable"-->
<!-- @on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>-->
<!-- </template>-->
<!-- </vxe-table-column>-->
<!-- </template>-->
</PTVXETable>
</Col>
</Row>
......@@ -84,7 +69,7 @@ export default {
currentComponent: '',
getPage: {},
showModal: false,
btn: [{ type: 'primary', id: '', name: '生成报告' }],
btn: [],
selectIds: [],
iconMsg: [
{
......@@ -102,54 +87,6 @@ export default {
id: '',
name: '查看试验项目'
}
// {
// type: 'erlenmeyer-flask',
// id: '',
// name: '查看样品',
// componentName: 'SampleView'
// },
// {
// type: 'document-text',
// id: '',
// name: '查看检测项目',
// componentName: 'ItemView'
// },
// { type: 'cloud', id: '', name: '附件', componentName: 'FileManage' },
// { type: 'trash-a', id: '', name: '删除' },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'ElnFormRecord'
// }
],
iconMsgDisable: [
{ type: 'md-create', id: '', name: '编辑', disabled: true },
{
type: '',
id: '',
name: '查看原始记录',
componentName: 'OriginalItemView'
},
{
type: 'ios-list',
id: '',
name: '查看试验项目'
}
// {
// type: 'document-text',
// id: '',
// name: '查看检测项目',
// componentName: 'ItemView'
// },
// { type: 'cloud', id: '', name: '附件', componentName: 'FileManage' },
// { type: 'trash-a', id: '', name: '删除', disabled: true },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'ElnFormRecord'
// }
],
pageColumns: [
{ title: '模板名称', key: 'title' },
......@@ -167,7 +104,8 @@ export default {
cusNames: '',
codes: '',
itemNames: '',
testAccordings: ''
testAccordings: '',
title: undefined
},
searchOpen: false
}
......@@ -184,42 +122,17 @@ export default {
methods: {
_componentResult(data) {
switch (this.currentComponent) {
case 'EditDateModal':
this._updateDate(data)
break
default:
this._page()
}
},
_updateDate(date) {
this.$store
.dispatch('PrintForm/updateTimeBatch', {
ids: this.selectIds.join(','),
fillInTime: date
})
.then(() => {
if (this.$store.state.PrintForm.success) {
this._page()
this.$Message.success('更新成功!')
}
})
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '纠正填写时间':
this._editWriteTime()
break
case '设置填写人乙':
this._setAnotherTester()
break
case '生成报告':
this._reportMake()
break
case '删除':
this._batchDelete()
break
case 'search':
this.searchOpen = !this.searchOpen
break
......@@ -253,7 +166,7 @@ export default {
})
if (result) {
this.$Message.success('报告成功生成')
this._page()
await this._page()
this.$emit('on-result-change')
}
this.$refs.pageTable._hideLoading()
......@@ -265,21 +178,6 @@ export default {
duration: 3000
})
},
// 设置填写人乙
_setAnotherTester() {
if (this.selectIds.length === 0) {
this.$msgTip('warning')
} else {
this.$refs.testerModal._open(this.selectIds)
}
},
_editWriteTime() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open('填写时间')
}
},
_dateChange(data) {
this.formObj.fillInTimeBegin = data[0]
this.formObj.fillInTimeEnd = data[1]
......@@ -289,15 +187,10 @@ export default {
this.$nextTick(() => {
switch (res) {
case '编辑':
// this.$refs.recordEditModal._openWithType(
// data.originalRecordId,
// 'ENVTESTMAKEEDIT'
// )
this._recordEdit(data)
break
case '查看原始记录':
this._recordLook(data)
// this._recordView(data.originalRecordId)
break
case '查看试验项目':
this._itemView(data.id)
......@@ -305,18 +198,6 @@ export default {
case '查看检测项目':
this.$refs.refModal._open(data)
break
case '查看样品':
this.$refs.refModal._open(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'originalId')
break
case '删除':
this._deleteByIds([data.id])
break
case '操作记录':
this.$refs.refModal._open(data.id)
break
}
})
},
......@@ -340,10 +221,6 @@ export default {
_reportMakeLook(data) {
console.log(data)
this._viewReport(data)
// const result = await soilReport.getExcelOriginalRecord(data.id)
// if (result) {
// this._viewReport(result)
// }
},
_viewReport(data) {
if (data) {
......@@ -392,9 +269,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.EnvItem.page
break
case 'selectIds':
this.selectIds = data
break
......@@ -418,29 +292,6 @@ export default {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
// 批量删除原始记录
_batchDelete() {
if (this.selectIds.length > 0) {
const content = '确定删除这' + this.selectIds.length + '条数据?'
this._deleteByIds(this.selectIds, content)
} else {
this.$msgTip('warning')
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this.$store.dispatch('EnvItem/deleteOriRecord', ids).then(() => {
if (this.$store.state.EnvItem.success) {
this._page()
this.$Message.success('删除成功!')
}
})
}
})
}
}
}
......
......@@ -6,7 +6,10 @@
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="样品台账" name="sample">
<ReportMakeBySample ref="sampleTabs" @on-result-change="_sampleTabResult"></ReportMakeBySample>
<ReportMakeBySample ref="sampleTabs"></ReportMakeBySample>
</el-tab-pane>
<el-tab-pane label="汇总报告台账" name="summary">
<SummaryInfo ref="summaryTabs"></SummaryInfo>
</el-tab-pane>
<el-tab-pane label="试验项目报告台账" name="report">
<ReportInfoMake ref="reportTabs"></ReportInfoMake>
......@@ -19,11 +22,13 @@
<script>
import ReportInfoMake from './tabs/ReportInfoMake'
import ReportMakeBySample from './tabs/ReportMakeBySample'
import SummaryInfo from './tabs/SummaryInfo'
export default {
components: {
ReportMakeBySample,
ReportInfoMake
ReportInfoMake,
SummaryInfo
},
data() {
return {
......@@ -93,6 +98,9 @@ export default {
console.log(this.entrustId)
this.$refs.sampleTabs._open(this.entrustId)
},
_summary() {
this.$refs.summaryTabs._open(this.entrustId)
},
_changeTabs(tab, event) {
switch (tab.name) {
case 'sample':
......@@ -101,14 +109,17 @@ export default {
case 'report':
this._report()
break
}
},
_sampleTabResult(msg) {
if (msg === 'changeTab') {
this.activeName = 'report'
this.$refs.reportTabs._open(this.contractId, this.personal)
case 'summary':
this._summary()
break
}
}
// _sampleTabResult(msg) {
// if (msg === 'changeTab') {
// this.activeName = 'report'
// this.$refs.reportTabs._open(this.contractId, this.personal)
// }
// }
}
}
</script>
<template>
<div>
<!--内容-->
<Modal v-model="showModal" :width="100" class="modal-footer-none modal-top-0">
<p slot="header">{{modalTitle}}</p>
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="样品台账" name="sample">
<ReportMakeBySample ref="sampleTabs"></ReportMakeBySample>
</el-tab-pane>
<el-tab-pane label="汇总报告台账" name="summary">
<SummaryInfo ref="summaryTabs"></SummaryInfo>
</el-tab-pane>
<el-tab-pane label="试验项目报告台账" name="report">
<ReportInfoMake ref="reportTabs"></ReportInfoMake>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import ReportInfoMake from './sample-report-manage/ReportInfoMake'
import ReportMakeBySample from './sample-report-manage/ReportMakeBySample'
import SummaryInfo from './sample-report-manage/SummaryInfo'
export default {
components: {
ReportMakeBySample,
ReportInfoMake,
SummaryInfo
},
data() {
return {
showModal: false,
modalTitle: '',
activeName: '',
contractId: '',
entrustId: '',
type: '',
personal: ''
}
},
computed: {
tableHeight: function() {
return document.documentElement.clientHeight - 135
}
},
methods: {
_open(entrustId) {
this.modalTitle = '管理样品和报告'
this.showModal = true
this.activeName = 'sample'
this.entrustId = entrustId
this.$refs.sampleTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.entrustId)
},
_sample() {
console.log(this.entrustId)
this.$refs.sampleTabs._open(this.entrustId)
},
_summary() {
this.$refs.summaryTabs._open(this.entrustId)
},
_changeTabs(tab, event) {
switch (tab.name) {
case 'sample':
this._sample()
break
case 'report':
this._report()
break
case 'summary':
this._summary()
break
}
}
// _sampleTabResult(msg) {
// if (msg === 'changeTab') {
// this.activeName = 'report'
// this.$refs.reportTabs._open(this.contractId, this.personal)
// }
// }
}
}
</script>
......@@ -8,10 +8,6 @@
<Col span="24">
<Form id="search-form-report-tab" :label-width="70" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="报告编号:">
<Input @on-enter="_formSearch" name="reportCode" placeholder="请输入报告编号"
clearable/>
</Form-item>
<Form-item class="search-item" label="委托单位:">
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
......@@ -85,8 +81,11 @@
<script>
import { soilReport } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
import SampleByMakeModal from '../../report-manage/SampleByMakeModal'
import OriginalRecordView from '../OriginalRecordView'
export default {
components: { Operation },
// eslint-disable-next-line vue/no-unused-components
components: { Operation, SampleByMakeModal, OriginalRecordView },
props: {
reportStatus: null
},
......@@ -121,6 +120,17 @@ export default {
// componentName: 'ErecordIndex'
// },
{
type: 'ios-flask-outline',
id: '',
name: '管理样品和报告'
},
{
type: 'ios-beaker',
id: '',
name: '查看原始记录'
},
{ type: 'ios-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作记录'
......@@ -184,23 +194,6 @@ export default {
break
}
},
_reportDateChange(data) {
$('input[name="reportDueDateBegin"]').val(data[0])
$('input[name="reportDueDateEnd"]').val(data[1])
},
// 制单日期
_ctimeChange(data) {
$('input[name="ctimeBegin"]').val(data[0])
$('input[name="ctimeEnd"]').val(data[1])
},
_dateChange(data) {
$('input[name=auditDateBegin]').val(data[0])
$('input[name=auditDateEnd]').val(data[1])
},
_issueDateChange(data) {
$('input[name=issueDateBegin]').val(data[0])
$('input[name=issueDateEnd]').val(data[1])
},
_btnClick(msg) {
switch (msg) {
case '导出发放记录':
......@@ -291,8 +284,14 @@ export default {
this.currentComponent = componentName
this.$nextTick(() => {
switch (res) {
case '资料管理':
this._resManage(data)
case '管理样品和报告':
this._sampleManage(data.id)
break
case '查看原始记录':
this._viewRecord(data.id)
break
case '附件':
this._upload(data.id)
break
case '操作记录':
this._record(data.id)
......@@ -300,6 +299,26 @@ export default {
}
})
},
_upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// 上传文件
// this.$refs.FileManage._open(id, 'entrustId')
},
_viewRecord(id) {
this.currentComponent = 'OriginalRecordView'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
},
_sampleManage(id) {
this.currentComponent = 'SampleByMakeModal'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
},
_record(id) {
this.$refs.recordModal._open(id)
},
......
......@@ -50,9 +50,8 @@
<div v-else-if="item.key==='type'">
{{scope.row[item.key]===0?'国家标准':scope.row[item.key]===1?'地方标准':scope.row[item.key]===2?'行业标准':scope.row[item.key]===3?'企业标准': ''}}
</div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</div>
<div v-else-if="item.key==='keepLimitTime'" :class="[ scope.row.keepReminder ===1 ? 'redColor' : '' ]">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-else-if="item.key==='fileUrl'">
<span v-if="scope.row['fileUrl']" class="green-color"></span>
<span v-else class="red-color"></span>
......@@ -121,6 +120,7 @@ export default {
{ title: '现场编号', key: 'siteNo', width: 100 },
{ title: '接收人', key: 'receiver', width: 120 },
{ title: '接收时间', key: 'receiveTime', width: 140, date: true },
{ title: '留存有效期', key: 'keepLimitTime', width: 140 },
{ title: '收样存储位置', key: 'receiveLocation', width: 140 },
{ title: '土质描述', key: 'sampleDescribe', width: 185 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }
......@@ -143,25 +143,7 @@ export default {
searchOpen: true,
getPage: {},
// 选中的内容
selectIds: [],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
classifyList: [
{ value: 0, name: '判定标准' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
]
selectIds: []
}
},
computed: {
......@@ -415,3 +397,8 @@ export default {
}
}
</script>
<style scoped>
.redColor {
color: red;
}
</style>
......@@ -5,7 +5,7 @@
<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>
<Input v-model="formObj.detail " name="detail "></Input>
</Form-item>
</Form>
</div>
......
......@@ -4,13 +4,18 @@
<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%">
<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-item label="留存有效期:" prop="keepLimitTime" style="width: 100%">
<Date-picker v-model="formObj.keepLimitTime" @on-change="_ctimeChange" type="date" split-panels
placeholder="请选择留存有效期" name="keepLimitTime"></Date-picker>
</Form-item>
</Form>
</div>
<div slot="footer">
......@@ -33,39 +38,16 @@ export default {
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '留存位置选择',
formObj: {
receiveLocation: '',
locationId: ''
receiveLocation: undefined,
keepLimitTime: undefined,
locationId: undefined
},
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' }
......@@ -96,6 +78,9 @@ export default {
this.$emit('on-result-change')
this._hideLoading()
},
_ctimeChange(data) {
this.formObj.keepLimitTime = data
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
......@@ -120,18 +105,13 @@ export default {
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.keepLimitTime = undefined
this.formObj.locationId = ''
this._getLocation()
this.ids = ids
......@@ -152,15 +132,6 @@ export default {
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
}
}
}
......
<template>
<div>
<Row>
<!--查询条件-->
<Col span="24">
<div>
<Form :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="钻孔名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item label="委托编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item label="项目名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
<Form-item label="现场编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.siteNo" placeholder="请输入现场编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
</Col>
<Col span="24">
<BtnList :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide">
</BtnList>
</Col>
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
: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>
<div v-else-if="item.key==='testProgress'" style="position: relative">
<Progress :percent="scope.row.testProgressPer" :stroke-width="30" status="active" hide-info>
</Progress>
<div style="position: absolute;top: 0;bottom: 0;text-align: center;width: 100%;line-height: 30px">
{{scope.row[item.key]}}
</div>
</div>
<div v-else-if="item.status">
{{scope.row[item.key]?scope.row[item.key].display:''}}
</div>
<div v-else-if="item.type">{{$sampleType(scope.row[item.key])}}</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { soilStatistics } from '../../../api'
export default {
components: {},
data() {
return {
tableName: 'food-test-progress-table',
// 用户自己选中的列
userColumns: [],
searchOpen: true,
formObj: {
boreholeName: undefined,
sampleCode: undefined,
entrustCode: undefined,
projectName: undefined,
siteNo: undefined
},
btn: [
{ type: 'primary', id: '', name: '导出' },
{ type: 'primary', id: '', name: '催单' }
],
getPage: {},
pageColumns: [
{ title: '委托编号', key: 'entrustCode', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '样品编号', key: 'sampleCode', width: 140 },
{ title: '现场编号', key: 'siteNo', width: 140 },
{ title: '项目名称', key: 'projectName', width: 140 },
{ title: '深度', key: 'sampleDepth', width: 140 },
{ title: '状态', key: 'status', width: 80, status: true },
{ title: '检测进度', key: 'testProgress', width: 160 }
],
selectIds: [],
selectData: [],
groupData: [],
salesmanData: [],
selectGroupIds: [],
selectSalesmans: [],
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 300)
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 获取业务员数据
_getSalesManList() {
this.$store.dispatch('LmsEquipInfo/userList').then(() => {
const list = this.$store.state.LmsEquipInfo.userList
const tempList = []
list.forEach(item => {
if (item.status.display !== '待激活' && item.realname !== undefined) {
tempList.push({ id: item.id, realname: item.realname })
}
})
this.salesmanData = JSON.parse(JSON.stringify(tempList))
})
},
_salesmanDataChange(data) {
this.formObj.salesmans = data.join(',')
},
// 所选检测科室的ids
_groupDataChange(data) {
this.formObj.groupIds = data.join(',')
},
// 获取当前的检测科室下拉
_getGroupList() {
this.$store.dispatch('LmsUserGroup/list').then(() => {
this.groupData = this.$store.state.LmsUserGroup.list
})
},
// 应出报告日期
_reportDueDateChange(data) {
this.formObj.reportDateBegin = data[0]
this.formObj.reportDateEnd = data[1]
},
_btnClick(msg) {
switch (msg) {
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilStatistics.listSampleProgress(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSample.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
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
}
}
}
</script>
......@@ -183,7 +183,7 @@ export default {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 11,
idType: 13,
id: data.id,
isReport: 4
})
......
......@@ -6,21 +6,21 @@
<Form id="task-assign-item-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.name" placeholder="请输入检测项目" clearable @on-enter="_formSearch"></Input>
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list class="contHide" style="margin-bottom: 6px;" @on-result-change="_btnClick"></btn-list>
<btn-list @on-result-change="_btnClick" class="contHide" style="margin-bottom: 6px;"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :is-radio="true" :page-columns="pageColumns" :table-name="tableName"
:table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" :hide-checkbox="true" select-data @on-result-change="_tableResultChange">
:get-page="getPage" :icon-msg="iconMsg" :hide-checkbox="true" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
......@@ -193,15 +193,10 @@ export default {
}
},
_makeCodeExcel: async function(data) {
console.log('左侧项目名称', this.itemName)
console.log('右侧样品Id', this.sampleIds)
console.log('报告信息', data)
console.log('this.entrustId', this.id)
this.$refs.pageTable._hideLoading()
const result = await soilSample.saveExcelExpReport({
entrustId: this.id,
expName: encodeURI(this.itemName),
ids: this.sampleIds,
ids: this.sampleIds.join(','),
templateId: data.id
})
if (result) {
......@@ -211,8 +206,11 @@ export default {
this.$refs.pageTable._hideLoading()
return false
} else {
this.$refs.pageTable._hideLoading()
this._viewReport(result)
}
} else {
this.$refs.pageTable._hideLoading()
}
},
_viewReport(data) {
......
......@@ -6,21 +6,21 @@
<Form id="task-assign-item-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
<Input v-model="formObj.name" placeholder="请输入检测项目" clearable @on-enter="_formSearch"></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list @on-result-change="_btnClick" class="contHide" style="margin-bottom: 6px;"></btn-list>
<btn-list class="contHide" style="margin-bottom: 6px;" @on-result-change="_btnClick"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :is-radio="true" select-data hide-checkbox>
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-name="tableName"
:table-height="tableHeight"
:get-page="getPage" :is-radio="true" select-data hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
......@@ -35,8 +35,8 @@
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol>
<VXESettingCol slot="setting" :page-columns="pageColumns" :user-columns="userColumns"
:table-name="tableName" @on-result-change="_resetColumn"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
......@@ -63,11 +63,7 @@ export default {
],
getPage: {},
id: '',
pageColumns: [
{ title: '检测项目', key: 'name', width: 120 },
{ title: '检测方法', key: 'testMethod', width: 140 },
{ title: '检测依据名称', key: 'testBasisName', width: 200 }
]
pageColumns: [{ title: '检测项目', key: 'name', width: 120 }]
}
},
computed: {
......
<template>
<div>
<Row style="border: 2px solid #EEEEEE">
<!--查询条件-->
<Col span="24">
<div>
<Form :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="钻孔名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item label="委托编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item label="项目名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
<Form-item label="现场编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.siteNo" placeholder="请输入现场编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
</Col>
<Col span="24">
<PTVXETableHeight ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="300"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
: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>
<div v-else-if="item.key==='testProgress'" style="position: relative">
<Progress :percent="scope.row.testProgressPer" :stroke-width="30" status="active" hide-info>
</Progress>
<div style="position: absolute;top: 0;bottom: 0;text-align: center;width: 100%;line-height: 30px">
{{scope.row[item.key]}}
</div>
</div>
<div v-else-if="item.status">
{{scope.row[item.key]?scope.row[item.key].display:''}}
</div>
<div v-else-if="item.type">{{$sampleType(scope.row[item.key])}}</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</template>
<script>
import { soilStatistics } from '../../api'
export default {
components: {},
data() {
return {
tableName: 'food-test-progress-table',
// 用户自己选中的列
userColumns: [],
searchOpen: true,
formObj: {
boreholeName: undefined,
sampleCode: undefined,
entrustCode: undefined,
projectName: undefined,
siteNo: undefined
},
btn: [
{ type: 'primary', id: '', name: '导出' },
{ type: 'primary', id: '', name: '催单' }
],
getPage: {},
pageColumns: [
{ title: '委托编号', key: 'entrustCode', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '样品编号', key: 'sampleCode', width: 140 },
{ title: '现场编号', key: 'siteNo', width: 140 },
{ title: '项目名称', key: 'projectName', width: 140 },
{ title: '深度', key: 'sampleDepth', width: 140 },
{ title: '状态', key: 'status', width: 80, status: true },
{ title: '检测进度', key: 'testProgress', width: 160 }
],
selectIds: [],
selectData: [],
groupData: [],
salesmanData: [],
selectGroupIds: [],
selectSalesmans: [],
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 300)
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 获取业务员数据
_getSalesManList() {
this.$store.dispatch('LmsEquipInfo/userList').then(() => {
const list = this.$store.state.LmsEquipInfo.userList
const tempList = []
list.forEach(item => {
if (item.status.display !== '待激活' && item.realname !== undefined) {
tempList.push({ id: item.id, realname: item.realname })
}
})
this.salesmanData = JSON.parse(JSON.stringify(tempList))
})
},
_salesmanDataChange(data) {
this.formObj.salesmans = data.join(',')
},
// 所选检测科室的ids
_groupDataChange(data) {
this.formObj.groupIds = data.join(',')
},
// 获取当前的检测科室下拉
_getGroupList() {
this.$store.dispatch('LmsUserGroup/list').then(() => {
this.groupData = this.$store.state.LmsUserGroup.list
})
},
// 应出报告日期
_reportDueDateChange(data) {
this.formObj.reportDateBegin = data[0]
this.formObj.reportDateEnd = data[1]
},
_btnClick(msg) {
switch (msg) {
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilStatistics.listSampleProgress(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSample.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
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
}
}
}
</script>
......@@ -15,7 +15,7 @@
</div>
<div style="width: 100%;">
<PTVXETableHeight ref="pageTable" :table-height="300" :loading="true"
:get-page="getPage" hide-checkbox="true">
:get-page="getPage" @on-result-change="_tableResultChange" hide-checkbox="true">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -45,6 +45,7 @@ export default {
return {
tableData: { records: [] },
getPage: {},
formObj: {},
pageColumns: [
{ title: '委托单位', key: 'client' },
{ title: '委托编号', key: 'entrustCode', width: 180 },
......@@ -64,35 +65,20 @@ export default {
this.$refs.unfinishedDetail._open()
},
_page: async function() {
const result = await soilStatistics.pageWaitEnd()
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilStatistics.pageWaitEnd(this.formObj)
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_request() {
this.$refs.pageTable._hideLoading()
this.$store
.dispatch('FoodContract/unfinishedContract', { page: 1, rows: 7 })
.then(() => {
const tableData = this.$store.state.FoodContract.page.records
const total = this.$store.state.FoodContract.page.total
if (total === 0) {
this.total = ''
} else {
this.total = '(共 ' + total + ' 条)'
}
let num = 0
if (tableData.length < 7) {
num = tableData.length
} else {
num = 7
}
for (let i = 0; i < num; i++) {
this.tableData.records.push(tableData[i])
}
})
_tableResultChange(msg, data) {
switch (msg) {
case 'changeSize':
this._page()
break
}
}
}
}
......
......@@ -12,7 +12,7 @@
</div>
<div style="width: 100%;">
<PTVXETableHeight ref="pageTable" :page-columns="pageColumns"
:get-page="getPage" :table-height="tableHeight">
:get-page="getPage" @on-result-change="_tableResultChange" :table-height="tableHeight">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -43,6 +43,7 @@ export default {
pageColumns: [
{ title: '委托编号', key: 'entrustCode', width: 150 },
{ title: '试验名称', key: 'name', width: 140 },
{ title: '状态', key: 'status', width: 140 },
{ title: '试样编号', key: 'sampleCode', width: 140 },
{ title: '试验项目英文简写', key: 'shortName', width: 180 },
{ title: '检测依据', key: 'testBasis', width: 100 }
......@@ -66,6 +67,13 @@ export default {
}
// const result = await
// this.$refs.pageTable._page('search-form', 'SysFileTemplate/page')
},
_tableResultChange(msg, data) {
switch (msg) {
case 'changeSize':
this._page()
break
}
}
}
}
......
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<Row style="margin-top: 10px;">
<Form id="search-form-sample-progress" :label-width="80" inline onsubmit="return false">
<Form-item label="试验名称:" class="search-item">
<Input @on-enter="_search" v-model="formObj.name" name="name" placeholder="请输入试验名称" style="width:100%" clearable></Input>
</Form-item>
<Form-item label="钻孔名称:" class="search-item">
<Input @on-enter="_search" v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入钻孔名称" style="width:100%" clearable></Input>
</Form-item>
<Form-item class="search-item">
<Button @click="_search" type="primary" class="width-80">搜索</Button>
</Form-item>
</Form>
<!--查询条件-->
<!--样品进度-->
<!--<Col span="24">-->
<!--<SampleSteps :info="sampleInfo" ref="stepsModal"></SampleSteps>-->
<!--</Col>-->
<Col style="height: 300px;" span="24">
<VScrollFull ref="myscrollfull" @load="_loadData" :pageSize="rows">
<div slot="empty" style="text-align:center" class="gray-color">暂无数据</div>
<SampleSteps ref="stepsModal" :info="sampleInfo"></SampleSteps>
</VScrollFull>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import VScrollFull from '../../../components/base/VScrollFull'
import { soilStatistics } from '../../../api'
import SampleSteps from './SampleSteps'
export default {
components: {
SampleSteps,
VScrollFull
},
data() {
return {
dateList: [],
sampleProgressList: ['已分配', '检测完成', '复核', '校核'],
// 样品信息
sampleInfo: [],
testTypeList: [],
// 合同id
contractId: '',
//
page: 0,
rows: 10,
formObj: {},
processObj: {
height: document.documentElement.clientHeight - 300 + 'px'
},
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }]
}
},
mounted() {
// this._initData()
},
methods: {
_reportDateChange(data) {
$('input[name="reportDateBegin"]').val(data[0])
$('input[name="reportDateEnd"]').val(data[1])
},
// 日期
_ctimeChange(data) {
$('input[name="beginDate"]').val(data[0])
$('input[name="endDate"]').val(data[1])
},
_search() {
// 超期未完成(默认的)
// 重置
this.$refs.myscrollfull.$_init()
},
_loadData: async function(pageIndex) {
console.log('pageIndex', pageIndex)
this.page = pageIndex
if (pageIndex === 1) {
this.sampleInfo = []
}
Object.assign(this.formObj, this._searchParams())
const result = await soilStatistics.listExperimentProgress(
this.$serializeForm(this.formObj)
)
if (result) {
const records = result.records
const pages = result.pages
for (let i = 0; i < records.length; i++) {
// 获取下标
if (records[i].auditTime) {
records[i].progressIndex = 3
} else if (records[i].checkTime) {
records[i].progressIndex = 2
} else if (records[i].testEndTime) {
records[i].progressIndex = 1
} else if (records[i].allotTime) {
records[i].progressIndex = 0
} else {
records[i].progressIndex = -1
}
}
// this.sampleInfo = records
this.sampleInfo = this.sampleInfo.concat(records)
this.$refs.myscrollfull.endByPage(this.sampleInfo.length, pages)
}
// this.$store
// .dispatch('StbSampleProgress/list', this._searchParams())
// .then(() => {
// const result = this.$store.state.StbSampleProgress.list
// const records = result.records
// const pages = result.pages
// for (let i = 0; i < records.length; i++) {
// // 获取下标
// records[i].statisStatusIndex = this.sampleProgressList.indexOf(
// records[i].statisStatus
// )
// }
// this.sampleInfo = this.sampleInfo.concat(records)
// this.$refs.myscrollfull.endByPage(this.sampleInfo.length, pages)
// })
},
// 获取模块数量
_statusChange(data, list) {
const temp = []
const blueList = list.blueList
const redList = list.redList
const greenList = list.greenList
const orgList = list.orgList
for (let i = 0; i < blueList.length; i++) {
temp.push(blueList[i])
}
for (let i = 0; i < redList.length; i++) {
temp.push(redList[i])
}
for (let i = 0; i < greenList.length; i++) {
temp.push(greenList[i])
}
for (let i = 0; i < orgList.length; i++) {
temp.push(orgList[i])
}
if (temp.length !== 0) {
$('input[name=queryTypeList]').val(temp.join(','))
} else {
$('input[name=queryTypeList]').val('')
}
this._search()
},
_searchParams() {
const data = this.$serialize('search-form-sample-progress')
data.page = this.page
data.rows = this.rows
return this.$extend(data)
}
}
}
</script>
<template>
<div>
<div v-for="itemInfo in info" :key="itemInfo" class="contract-box">
<Row>
<!--样品信息-->
<Col span="6">
<ul class="progress-ul">
<li>
<div class="title">样品编号</div>
<div class="cont">
<a
:class="{
'blue-color':itemInfo.queryType === 0,
'green-color':itemInfo.queryType === 1,
'red-color':itemInfo.queryType === 2,
'warning-color':itemInfo.queryType === 3
}"
style="font-weight: bold"
>{{itemInfo.sampleCode}}</a>
</div>
</li>
<li>
<div class="title">试验名称</div>
<div class="cont">
{{itemInfo.name}}
</div>
</li>
<li>
<div class="title">钻孔编号</div>
<div class="cont">
{{itemInfo.boreholeName}}
</div>
</li>
</ul>
</Col>
<!--样品进度信息-->
<Col span="18">
<ProgressList :progressList="[{name:'已分配',time:itemInfo.allotTime,user:itemInfo.alloter},
{name:'检测完成',time:itemInfo.testEndTime,user:itemInfo.testEnder},{name:'已复核',time:itemInfo.checkTime,user:itemInfo.checker},
{name:'已审核',time:itemInfo.auditTime,user:itemInfo.auditor}]"
:state="itemInfo.progressIndex"></ProgressList>
</Col>
</Row>
</div>
</div>
</template>
<script>
import ProgressList from '../../../components/statistic/ProgressList'
export default {
components: { ProgressList },
props: {
info: null
},
data() {
return {
progressList: [],
sampleInfo: []
}
},
watch: {
info: function(newVal, oldVal) {
console.log('newVal===========', newVal.oldValue)
}
},
mounted() {
this._console(this.info)
},
methods: {
_sampleClick(data) {
// 样品详情
this.$refs.detail._open(data)
},
_console(info) {
console.log('info', info)
}
}
}
</script>
<style>
.progress-ul li {
border: 1px solid #ddd;
overflow: hidden;
}
.progress-ul li .title {
padding: 13px;
}
.progress-ul li .title {
width: 35%;
background: #eee;
padding: 13px;
border-right: 1px solid #ddd;
float: left;
}
.progress-ul li .cont {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-top: 15px;
padding-left: 15px;
float: left;
width: 65%;
}
.contract-box {
margin: 10px 0;
}
.contract-box {
border: 1px solid #dcdcdc;
}
</style>
......@@ -26,6 +26,12 @@
<Col span="12">
<UnfinishedContract></UnfinishedContract>
</Col>
<Col span="24">
<SampleProgress style="margin-bottom: 20px;"></SampleProgress>
</Col>
<Col span="24" style="margin-bottom: 10px;">
<SampleProgressDetail></SampleProgressDetail>
</Col>
<Col span="12">
<UnfinishedItem></UnfinishedItem>
</Col>
......@@ -84,6 +90,8 @@ import YearTestItem from './YearTestItem'
import YearOverItem from './YearOverItem'
import GroupItem from './GroupItem'
import CustomerContract from './CustomerContract'
import SampleProgress from './sample-progress/SampleProgress'
import SampleProgressDetail from './SampleProgressDetail'
export default {
name: 'Workbench',
components: {
......@@ -116,7 +124,11 @@ export default {
// eslint-disable-next-line vue/no-unused-components
GroupItem,
// eslint-disable-next-line vue/no-unused-components
CustomerContract
CustomerContract,
// eslint-disable-next-line vue/no-unused-components
SampleProgress,
// eslint-disable-next-line vue/no-unused-components
SampleProgressDetail
},
data() {
return {
......
......@@ -10,6 +10,7 @@ import ReceiveSampleIndex from '../pages/soil-alone-sample/EntrustIndex'
import InstockIndex from '../pages/soil-alone-sample-instock/EntrustIndex'
import OutstockIndex from '../pages/soil-alone-sample-manage/soil-alone-sample-outstock/EntrustIndex'
import StorehousePlace from '../pages/soil-alone-sample-manage/storehouse-place-manage/AddressManage'
import StorehouseSample from '../pages/soil-alone-sample-manage/storehouse-sample-manage/AddressManage'
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'
......@@ -31,6 +32,7 @@ import yearDeclara from '../pages/soil-statistics/yearDeclara'
import MeterCustomerEntrust from '../pages/soil-statistics/customer-entrust/MeterCustomerEntrust'
import MeterPersonalTask from '../pages/soil-statistics/personal-task/MeterPersonalTask'
import MeterAnnualEntrust from '../pages/soil-statistics/annual-entrust/MeterAnnualEntrust'
import SampleProgressDetail from '../pages/soil-statistics/sample-progress/SampleProgressDetail'
import ReportAuditIndex from '../pages/soil-report-manage/report-audit/ReportAuditIndex'
import ReportIssueIndex from '../pages/soil-report-manage/report-issue/ReportIssueIndex'
import SampleDisposeIndex from '../pages/soil-sample-manage/sample-dispose/SampleDisposeIndex'
......@@ -72,6 +74,11 @@ export default [
path: 'storehouse_place',
component: StorehousePlace,
meta: { title: '库房位置管理' }
},
{
path: 'storehouse_sample',
component: StorehouseSample,
meta: { title: '库房样品管理' }
}
]
},
......@@ -261,6 +268,11 @@ export default [
meta: { title: '不合格项目查询' }
},
{
path: 'sample_progress',
component: SampleProgressDetail,
meta: { title: '样品进度查询' }
},
{
path: 'year_declara_count',
component: yearDeclara,
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