Commit c362682e by wangweidong

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

parents 1f44bcdb eaf17188
......@@ -45,6 +45,8 @@ export default {
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data =>
http.delete('soil/v1/entrust/?ids=' + data).then(res => res),
standardAnnexDelete: data =>
http.delete('soil/v1/standard_annex/?ids=' + data).then(res => res),
experimentDeleteById: data =>
http.delete('soil/v1/experiment/?ids=' + data).then(res => res),
// 保存
......@@ -131,6 +133,8 @@ export default {
http.post('soil/v1/sample/page_take', data).then(res => res),
testType: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res),
projectQueryList: data =>
http.post('res/v1/dict/dict_query', data).then(res => res),
pageSurplusHandleCheckHis: data =>
http
.post('soil/v1/prepare/page_surplus_handle_check_his', data)
......
<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/entrust_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>
......@@ -22,7 +22,7 @@ export default {
data() {
return {
showModal: false,
modalTitle: '附件'
modalTitle: '附件管理'
}
},
methods: {
......
......@@ -104,8 +104,8 @@ export default {
msg: 'FoodContractAttachment',
pageUrl: 'soil/v1/entrust_annex/page',
deleteUrl: '/soil/v1/entrust_annex/?ids=',
uploadFileUrl: '/soil/v1/standard_annex/upload/',
downloadFileUrl: '/soil/v1/standard_annex/download/',
uploadFileUrl: '/soil/v1/entrust_annex/upload/',
downloadFileUrl: '/soil/v1/entrust_annex/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: '/soil/v1/standard_annex/preview/'
......
......@@ -22,6 +22,7 @@
<Button>上传</Button>
</Upload>
</label>
<Button @click="_batchUpload">批量上传</Button>
<!--一系列操作-->
<!--非表格-->
<!-- <Button v-if="viewStyle === 2 || viewStyle === 3" v-for="item in menusListA" :key="item.name" @click="_radioChange(item.value)"-->
......@@ -115,6 +116,7 @@
<!--/-->
</Col>
</Row>
<BatchUpload ref="batchUpload" @on-result-change="_page"></BatchUpload>
<!--上传loading-->
<div v-show="isLoad">
<Spin fix>
......@@ -134,11 +136,12 @@
// import VueGallerySlideshow from 'vue-gallery-slideshow'
import global from '../../../api/config'
import { meterEntrust } from '../../../api'
import BatchUpload from './BatchUpload'
/**
* 公共组件modal 弹框(支持上传,下载,预览,删除附件等操作)
*/
export default {
// components: { VueGallerySlideshow },
components: { BatchUpload },
props: {
fileName: null
},
......@@ -202,6 +205,9 @@ export default {
}
},
methods: {
_batchUpload() {
this.$refs.batchUpload._open(this.id)
},
_setUploadData(data, idsObj, idKey) {
this.selectIds = []
this.imgViewIndex = null
......@@ -411,6 +417,7 @@ export default {
} else {
this.isLoad = true
this.$Message.error(response.msg)
this.isLoad = false
}
}
}
......
......@@ -423,6 +423,7 @@ export default {
} else {
this.isLoad = true
this.$Message.error(response.msg)
this.isLoad = false
}
}
}
......
......@@ -310,7 +310,7 @@ export default {
},
_deleteOk: async function(ids) {
const result = await soilEntrust.deleteById(ids)
const result = await soilEntrust.standardAnnexDelete(ids)
if (result) {
this._resultChange('删除成功! ')
}
......
......@@ -14,7 +14,10 @@
placeholder="请选择委托日期" name="entrustDate"></Date-picker>
</Form-item>
<Form-item label="项目名称" prop="projectName" class="width-48">
<Input v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称"/>
<!-- <Input v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称"/>-->
<AutoComplete ref="autoInput" v-model="formObj.projectName" :down-data="projectData"
@on-result-change="_projectChange" name="projectName" placeholder="请输入或选择项目名称"
></AutoComplete>
</Form-item>
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
......@@ -149,6 +152,7 @@ export default {
},
showBtn: true,
customerData: [],
projectData: [],
edit: false,
cityData: [],
selectData: [],
......@@ -340,15 +344,41 @@ export default {
} else if (this.customerData.indexOf(data) !== -1) {
this._getQueryList(data)
} else {
this._cusNameQuery(data)
}
},
_customerMatch(data) {
this._getQueryList(data)
},
_cusNameQuery(query) {
console.log('query', query)
this.formObj.client = query
this._getQueryList(query)
},
_projectChange(msg, data) {
if (this.$string(this.id).isEmpty()) {
// 添加的时候选择单位
switch (msg) {
case 'select':
this._projectMatch(data)
break
case 'query':
this._projectQuery(data)
break
}
} else if (this.projectData.indexOf(data) !== -1) {
this._getProjectQueryList(data)
} else {
this._projectQuery(data)
}
},
_projectMatch(data) {
this._getQueryList(data)
},
_projectQuery(query) {
this.formObj.projectName = query
this._getProjectQueryList(query)
},
_btnClick(msg) {
this.$nextTick(function() {
switch (msg) {
......@@ -690,6 +720,7 @@ export default {
this._getList()
this._getTestType()
this._getPackList()
this._getProjectList()
this._getSoil()
this._getUser()
this.showBtn = true
......@@ -780,12 +811,41 @@ export default {
this.customerData = list
}
},
_getProjectList: async function() {
const result = await soilEntrust.testType('项目名称')
const projectlist = []
if (result) {
for (let i = 0; i < result.length; i++) {
projectlist.push(result[i].name)
}
this.projectData = projectlist
}
},
_getQueryList: async function(data) {
const result = await meterEntrust.pageQueryList(data)
const queryList = []
if (result) {
for (let i = 0; i < result.length; i++) {
queryList.push(result[i].cname)
}
this.customerData = queryList
console.log('委托商', result)
}
},
_getProjectQueryList: async function(data) {
const queryData = {}
queryData.type = '项目名称'
queryData.name = data
const result = await soilEntrust.projectQueryList(queryData)
const queryList = []
if (result) {
for (let i = 0; i < result.length; i++) {
queryList.push(result[i].name)
}
this.projectData = queryList
console.log('项目名称', result)
}
},
_save: async function(data) {
const result = await soilEntrust.save(data)
if (result) {
......
......@@ -82,7 +82,8 @@
<script>
import global from '../../../../api/config'
import http from '../../../../api/http'
import { soilReport } from '../../../../api'
import { soilReport, soilTest } from '../../../../api'
import Global from '../../../../api/config'
/**
* 报告编制的-待办-报告台账
......@@ -212,7 +213,8 @@ export default {
this.$refs.refModal._open(data)
break
case '预览/编辑报告':
this._viewReport(data)
this._reportView(data)
// this._viewReport(data)
break
case '操作记录':
this._record(data.id)
......@@ -238,16 +240,57 @@ export default {
_upload(id) {
this.$refs.refModal._open(id)
},
_reportView(data) {
if (data.objectKey) {
this._reportMakeLook(data)
} else {
this._recordView(data.originalRecordId)
}
},
_reportMakeLook: async function(data) {
console.log(data)
const result = await soilReport.expReportGetById(data.id)
// this._viewReport(data)
// const result = await soilReport.getExcelOriginalRecord(data.id)
if (result) {
console.log('result')
this._viewReport(result)
}
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
idType: 11,
id: data.id,
isReport: 4
})
}
},
_recordView(originalRecordId) {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
recordUrl + '/print/v1/form/' + originalRecordId + '?type=ENVTESTMAKE',
{
event: {
onload: {
after: function(layxWindow, winform) {
// eslint-disable-next-line no-undef
layx.max(winform.id)
}
}
}
}
)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
......@@ -283,7 +326,7 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilReport.reportPage(
const result = await soilTest.expReportPage(
this.$serializeForm(this.formObj)
)
if (result) {
......
......@@ -34,7 +34,7 @@
</template>
<script>
import { soilAptitude, soilTest } from '../../../api'
import { soilTest } from '../../../api'
import IndexManageEdit from './IndexManageEdit'
export default {
......@@ -151,9 +151,9 @@ export default {
}
},
_delOk: async function(ids) {
const result = await soilAptitude.expItemDeleteByIds(ids)
const result = await soilTest.itemDelete(ids)
if (result) {
this.$message.success('删除成功')
this.$Message.success('删除成功')
this._page()
}
}
......
......@@ -159,7 +159,7 @@ export default {
this.$refs.footerModal._hideLoading()
},
_open(id, formObj) {
this.formId = 'edit-form'
this.formId = 'edit-form-prepare'
this._hideLoading()
this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) {
......@@ -318,7 +318,8 @@ export default {
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('edit-form')
const data = this.$serialize('edit-form-prepare')
console.log('data', data)
if (this.$string(this.id).isEmpty()) {
data.experimentId = this.expId
// 添加
......@@ -334,7 +335,7 @@ export default {
})
},
_save: async function(data) {
console.log(data)
console.log('data', data)
const result = await soilTest.itemSave(data)
console.log(result)
if (result) {
......
......@@ -331,6 +331,7 @@ export default {
this.$refs.pageTable._loadColumn(colList)
},
_equipResult: async function(res) {
this.$refs.pageTable._showLoading()
const tempData = {}
tempData.equipList = []
res.map((item, index) => {
......@@ -351,6 +352,9 @@ export default {
const result = await soilTest.addExpEquip(tempData)
if (result) {
this.$Message.success('添加成功')
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
// 从字典查预警期
......
......@@ -271,6 +271,7 @@ export default {
}
},
_equipResult: async function(res) {
this.$refs.pageTable._showLoading()
console.log(res)
const tempData = {}
tempData.equipList = []
......@@ -292,6 +293,9 @@ export default {
const result = await soilTest.addExpEquip(tempData)
if (result) {
this.$Message.success('添加成功')
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
// 调整分组
......
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