Commit 33986546 by wangweidong

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

parents 73470c4a 3b3bc05d
......@@ -34,5 +34,7 @@ export default {
reportDelete: data =>
http.delete('soil/v1/report/?ids=' + data).then(res => res),
generateAppendix: data =>
http.post('soil/v1/exp_report/generate_appendix', data).then(res => res)
http.post('soil/v1/exp_report/generate_appendix', data).then(res => res),
itemReportMerge: data =>
http.post('soil/v1/exp_report/item_report_merge', data).then(res => res)
}
// docker测试环境 请求地址
WEB_URL=http://soil.docker.com
BASE_URL=http://api.docker.com
SSO_URL=http://sso.docker.com
STATIC_URL=http://static.docker.com
RECORD_URL=http://record.patzn.com
WEB_URL=http://soil.docker.com:9000
BASE_URL=http://api.docker.com:9000
SSO_URL=http://sso.docker.com:9000
STATIC_URL=http://static.docker.com:9000
RECORD_URL=http://record.patzn.com:9000
NC_URL=http://123.133.38.68:8088
......@@ -9,7 +9,7 @@
"build": "nuxt build",
"start": "cross-env NODE_ENV=production node server/index.js",
"zhyf": "cross-env NODE_ENV=zhyf STATIC_URL=http://static.lims.com nuxt build",
"dockertest": "cross-env NODE_ENV=dockertest STATIC_URL=http://static.docker.com nuxt build",
"dockertest": "cross-env NODE_ENV=dockertest STATIC_URL=http://static.docker.com:9000 nuxt build",
"test": "cross-env NODE_ENV=testing node server/index.js",
"pertest": "cross-env NODE_ENV=pertesting node server/index.js",
"devtest": "cross-env NODE_ENV=devtest node server/index.js",
......
......@@ -2,8 +2,8 @@
<div>
<Row>
<Form
v-show="searchOpen"
id="lab-sample-form"
v-show="searchOpen"
:label-width="70"
inline
onsubmit="return false"
......@@ -11,19 +11,19 @@
>
<label class="label-sign" />
<Form-item class="search-item" label="委托方:">
<Input name="client" placeholder="请输入委托方" clearable @on-enter="_formSearch" />
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托方" clearable />
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch" />
<Input @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable />
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">
<Button @click="_formSearch" type="primary">
搜索
</Button>
</Form-item>
</Form>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick" />
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" />
</Col>
<Col span="24">
<PTVXETable
......@@ -32,9 +32,9 @@
:table-height="tableHeight"
:get-page="getPage"
:icon-msg="iconMsg"
@on-result-change="_tableResultChange"
show-check-box
select-data
@on-result-change="_tableResultChange"
>
<vxe-table-column
v-for="item in pageColumns"
......@@ -65,6 +65,7 @@
<Reason ref="reasonModal" @on-result-change="_reasonResult" />
<SoilGroupExpReportMake ref="soilGroupExpReportMakeModal" @on-result-change="_page" />
<OperationModal ref="operationModal" />
<OriginalRecordView ref="OriginalRecordView" @on-result-change="_page" />
</div>
</template>
......@@ -75,9 +76,15 @@ import global from '../../../../api/config'
import Reason from '../../../../components/base/Reason'
import OperationModal from '../../../../components/operation/Operation'
import SoilGroupExpReportMake from '../../report-make/SoilGroupExpReportMake'
import OriginalRecordView from '../../../soil-report-manage/report-make/OriginalRecordView'
export default {
name: 'PreparationManage',
components: { Reason, OperationModal, SoilGroupExpReportMake },
components: {
Reason,
OperationModal,
SoilGroupExpReportMake,
OriginalRecordView
},
data() {
return {
name: '',
......@@ -109,6 +116,7 @@ export default {
selectData: [],
iconMsg: [
// { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-beaker', name: '查看原始记录' },
{ id: 'make-report', type: 'md-image', name: '项目报告' },
{ id: 'make-upload', type: 'ios-cloud', name: '附件' },
{ id: 'make-record', type: 'ios-clock', name: '操作日志' }
......@@ -311,8 +319,14 @@ export default {
case '项目报告':
this._expReport(data)
break
case '查看原始记录':
this._viewRecord(data.id)
break
}
},
_viewRecord(id) {
this.$refs.OriginalRecordView._open(id)
},
_viewReport(data) {
this._getObjectKey(data)
},
......
......@@ -129,6 +129,12 @@ export default {
},
{
value: '物性'
},
{
value: '高级'
},
{
value: '土工'
}
],
id: '',
......
......@@ -81,6 +81,12 @@ export default {
},
{
value: '物性'
},
{
value: '高级'
},
{
value: '土工'
}
],
showEditModal: false,
......
<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/experiment/upload_dynamics_collect/' +
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>
......@@ -66,6 +66,11 @@ export default {
type: 'error',
id: 'do-test-sample-viewitem-delete-batch',
name: '批量删除'
},
{
type: 'primary',
id: '',
name: '合并'
}
],
selectIds: [],
......@@ -133,12 +138,32 @@ export default {
case '批量删除':
this._batchDelete()
break
case '合并':
this._merge()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_merge() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this._mergeFile()
}
},
_mergeFile: async function() {
this.$refs.pageTable._showLoading()
const result = await soilReport.itemReportMerge({
ids: this.selectIds.join(',')
})
if (result) {
this.$Message.success('合并成功')
this._page()
}
},
_batchDelete() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
......
......@@ -60,6 +60,7 @@
<Operation ref="Operation"></Operation>
<importModal ref="importModal"></importModal>
<ItemBatchUpload ref="batchUpload"></ItemBatchUpload>
<BatchUploadPhysical ref="batchUploadPhysical"></BatchUploadPhysical>
<OtherItemBatchUpload ref="otherItemBatchUpload"></OtherItemBatchUpload>
</div>
</template>
......@@ -77,6 +78,7 @@ import CollectFileManage from '../CollectFileManage'
import Reason from '../../../../components/base/Reason'
import Operation from '../../../../components/operation/ItemOperation'
import importModal from '../../../../components/import/GDSImport'
import BatchUploadPhysical from '../BatchUploadPhysical'
import CreateReport from './CreateReport'
import ItemBatchUpload from './ItemBatchUpload'
import OtherItemBatchUpload from './OtherItemBatchUpload'
......@@ -95,7 +97,8 @@ export default {
Operation,
importModal,
ItemBatchUpload,
OtherItemBatchUpload
OtherItemBatchUpload,
BatchUploadPhysical
},
data() {
return {
......@@ -150,15 +153,19 @@ export default {
},
{
type: 'success',
id: 'do-test-sample-item-right-submit',
name: '完成提交'
id: 'do-test-sample-item-right-file',
name: '力学文件上传采集'
},
{
type: 'success',
id: 'do-test-sample-item-right-equip',
name: '设备'
id: 'do-test-sample-item-right-file-physical',
name: '物性上传图片'
},
{
type: 'success',
id: 'do-test-sample-item-right-file-moisture',
name: '界限含水率上传采集'
},
{ type: 'success', id: 'do-test-sample-item-right-back', name: '退回' },
{
type: 'success',
id: 'do-test-sample-item-right-GDS',
......@@ -166,14 +173,15 @@ export default {
},
{
type: 'success',
id: 'do-test-sample-item-right-file',
name: '力学文件上传采集'
id: 'do-test-sample-item-right-equip',
name: '设备'
},
{
type: 'success',
id: '',
name: '界限含水率上传采集'
}
id: 'do-test-sample-item-right-submit',
name: '完成提交'
},
{ type: 'success', id: 'do-test-sample-item-right-back', name: '退回' }
],
iconMsg: [
{
......@@ -229,7 +237,7 @@ export default {
{ title: '土质描述', key: 'describeDetail', width: 110 },
{ title: '含水率', key: 'haveWater', width: 110 },
{ title: '密度', key: 'density', width: 110 },
{ title: '重', key: 'bulkDensity', width: 110 },
{ title: '土粒比重', key: 'bulkDensity', width: 110 },
{ title: '检测方法', key: 'testMethod', width: 140 },
{ title: '检测依据', key: 'testBasis', width: 140 },
{ title: '试样包装类型', key: 'samplePack', width: 160 },
......@@ -515,6 +523,9 @@ export default {
case '力学文件上传采集':
this._batchUpload()
break
case '物性上传图片':
this._batchUploadPhysical()
break
case '界限含水率上传采集':
this._otherBatchUpload()
break
......@@ -523,6 +534,9 @@ export default {
_batchUpload() {
this.$refs.batchUpload._open(this.entrustId)
},
_batchUploadPhysical() {
this.$refs.batchUploadPhysical._open(this.entrustId)
},
_otherBatchUpload() {
this.$refs.otherItemBatchUpload._open(this.entrustId)
},
......
......@@ -155,7 +155,7 @@ export default {
{ title: '土质描述', key: 'describeDetail', width: 110 },
{ title: '含水率', key: 'haveWater', width: 110 },
{ title: '密度', key: 'density', width: 110 },
{ title: '重', key: 'bulkDensity', width: 110 },
{ title: '土粒比重', key: 'bulkDensity', width: 110 },
{ title: '试样包装类型', key: 'samplePack', width: 180 },
{ title: '状态', key: 'progress', width: 180 },
{ title: '大类', key: 'mainType', width: 140 },
......
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