Commit c38bd9e8 by yangmengmeng

Merge branch 'dev'

parents 63b3f026 b613dd1b
/**
* 流程附件
*/
import http from '../http'
export default {
// 查询所有
list: id => http.post('/flow/v1/attachment/list-' + id).then(res => res),
// 删除
delFile: data =>
http.delete('/flow/v1/attachment/?ids=' + data).then(res => res)
}
/**
* 按钮绑定的流程表
*/
import http from '../http'
export default {
// 通过按钮code查询流程
list: data =>
http.post('/flow/v1/buttonFlow/listByButtonCode', data).then(res => res)
}
/**
* 发起流程 -- 新的流程部署
*/
import http from '../http'
import { https } from '../https'
export default {
// 获取流程的启动表单
renderedStartForm: data =>
http
.get(
'/flow/v1/processInstance/renderedStartForm?processDefinitionId=' + data
)
.then(res => res),
// 启动流程实例
start: data =>
https
.post('/flow/v1/processInstance/start', JSON.stringify(data))
.then(res => res),
// 查看-流程表单
formData: id =>
http
.get('/flow/v1/processInstance/formData?processInstanceId=' + id)
.then(res => res)
}
/**
* HTTP 请求 axios dto封装
*/
import axios from 'axios'
import global from './config'
import loading from './loading'
// Axios 全局配置
const httpJson = axios.create()
httpJson.defaults.baseURL = global.baseURL
httpJson.defaults.withCredentials = true
// 添加请求拦截器
httpJson.interceptors.request.use(
config => {
if (!global.getLn()) {
window.location.href = global.ssoURL
}
const header = global.headersJson
// 无法获取情况下,设置登录 COOKIE
if (process.__TOKEN__) {
header.Cookie = 'uid=' + process.__TOKEN__
}
config.headers = header
config.transformRequest = global.transformRequestJSON
return config
},
error => {
return Promise.reject(error)
}
)
// 返回数据处理
// 返回格式 {code:业务码 , data: 内容 , msg: 描述}
httpJson.interceptors.response.use(
response => {
console.log('----response---响应结果---', response)
switch (response.data.code) {
case '-2':
global.logout()
window.location.href = global.ssoURL
break
case '1':
return response.data.data
default:
loading.toast.show(response.data.code, response.data.msg)
}
},
error => {
console.log('--error---', error)
if (error.response.status === 401) {
console.log('unauthorized, logging out ...')
}
return Promise.reject(error)
}
)
export default httpJson
......@@ -32,3 +32,6 @@ export { default as soilSample } from './soil/soil-sample'
export { default as soilTest } from './soil/soil-test'
export { default as soilStatistics } from './soil/soil-statistics'
export { default as soilReport } from './soil/soil-report'
export { default as processInstance } from '../api/flow/process-instance'
export { default as flowAttachment } from '../api/flow/attachment'
export { default as buttonFlow } from '../api/flow/button-flow'
......@@ -43,6 +43,7 @@ export default {
http.post('soil/v1/standard/list', data).then(res => res),
getGroupList: data =>
http.post('/res/v1/user_group/list', data).then(res => res),
getDictInfo: data => http.post('/res/v1/dict/page', data).then(res => res),
getBasisList: data =>
http.post('soil/v1/standard/list', data).then(res => res),
originalTemplatePage: data =>
......@@ -108,5 +109,41 @@ export default {
pageSummaryTemplate: data =>
http
.post('soil/v1/exp_report_template/page_summary_template', data)
.then(res => res)
.then(res => res),
originalTemplateBalance: data =>
http.post('soil/v1/original_template_balance/page', data).then(res => res),
originalTemplateBalanceSave: data =>
http.post('soil/v1/original_template_balance/', data).then(res => res),
originalTemplateBalanceGet: data =>
http.get('soil/v1/original_template_balance/' + data).then(res => res),
originalTemplateBalanceEdit: data =>
http
.put('soil/v1/original_template_balance/' + data.id, data.obj)
.then(res => res),
originalTemplateBalanceDelete: data =>
http
.delete('soil/v1/original_template_balance/?ids=' + data)
.then(res => res),
soilEnvMonitorWarning: data =>
http.post('soil/v1/env_monitor/page', data).then(res => res),
envMonitorWarningPage: data =>
http.post('soil/v1/env_monitor_warning/page', data).then(res => res),
envMonitorWarningDelete: data =>
http.delete('soil/v1/env_monitor/?ids=' + data).then(res => res),
deleteEnvMonitorWarning: data =>
http.delete('soil/v1/env_monitor_warning/?ids=' + data).then(res => res),
envMonitorWarningInfo: data =>
http.get('soil/v1/env_monitor/' + data.id).then(res => res),
infoEnvMonitorWarning: data =>
http.get('soil/v1/env_monitor_warning/' + data.id).then(res => res),
envMonitorEdit: data =>
http.put('soil/v1/env_monitor/' + data.id, data.obj).then(res => res),
editEnvMonitor: data =>
http
.put('soil/v1/env_monitor_warning/' + data.id, data.obj)
.then(res => res),
envMonitorAdd: data =>
http.post('soil/v1/env_monitor/', data).then(res => res),
addEnvMonitor: data =>
http.post('soil/v1/env_monitor_warning/', data).then(res => res)
}
......@@ -17,6 +17,8 @@ export default {
http.post('soil/v1/open_soil_record/page', data).then(res => res),
getRecordById: data =>
http.get('soil/v1/open_soil_record/' + data).then(res => res),
deleteRecordSoil: data =>
http.delete('soil/v1/open_soil_record/?ids=' + data).then(res => res),
listEntrustItemNum: data =>
http
.post('soil/v1/statistics/list_entrust_item_num', data)
......@@ -195,5 +197,7 @@ export default {
getInExport: data =>
http.get('soil/v1/alone_sample/get_in_export_' + data).then(res => res),
getOutExport: data =>
http.get('soil/v1/alone_sample/get_out_export_' + data).then(res => res)
http.get('soil/v1/alone_sample/get_out_export_' + data).then(res => res),
experimentDelete: data =>
http.delete('soil/v1/experiment/?ids=' + data).then(res => res)
}
......@@ -30,5 +30,9 @@ export default {
pageReportEndBySummaryReport: data =>
http
.post('soil/v1/entrust/page_report_end_by_summary_report', data)
.then(res => res)
.then(res => res),
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)
}
......@@ -308,5 +308,13 @@ export default {
.post('soil/v1/alone_sample/storage_sample_submit', data)
.then(res => res),
addSample: data =>
http.post('soil/v1/sample/sample_split_save', data).then(res => res)
http.post('soil/v1/sample/sample_split_save', data).then(res => res),
getStayDate: data =>
http
.post('soil/v1/alone_in_out_stock/get_stay_date', data)
.then(res => res),
outStorageBack: data =>
http.post('soil/v1/alone_sample/out_storage_back', data).then(res => res),
editSample: data =>
http.put('soil/v1/sample/' + data.id, data.obj).then(res => res)
}
......@@ -102,6 +102,14 @@ export default {
http
.post('soil/v1/entrust/page_report_issue_by_summary_report', data)
.then(res => res),
pageStatistics: data =>
http.post('soil/v1/experiment/page_statistics', data).then(res => res),
pageAreaStatistics: data =>
http.post('soil/v1/statistics/page_area_statistics', data).then(res => res),
pageProjectStatistics: data =>
http
.post('soil/v1/statistics/page_project_statistics', data)
.then(res => res),
summaryReportIssueSubmit: data =>
http
.post('soil/v1/report/summary_report_issue_submit?ids=' + data)
......
......@@ -22,6 +22,8 @@ export default {
// 试验任务按样品分配-试验项目分配操作
allotExp: data =>
http.post('soil/v1/experiment/allot_exp', data).then(res => res),
allotExpAuto: data =>
http.post('soil/v1/experiment/auto_allot_exp', data).then(res => res),
changeExpAllot: data =>
http.post('soil/v1/experiment/change_exp_allot', data).then(res => res),
// 试验任务分配样品对应检测项目分页列表
......@@ -238,5 +240,9 @@ export default {
dataGdsDetail: data =>
http.post('soil/v1/data_gds_detail/page', data).then(res => res),
pageSummaryEnd: data =>
http.post('soil/v1/report/page_summary_report_end', data).then(res => res)
http.post('soil/v1/report/page_summary_report_end', data).then(res => res),
sampleEdit: data =>
http.put('soil/v1/sample/' + data.id, data).then(res => res),
editSeniorType: data =>
http.post('soil/v1/sample/edit_senior_type', data).then(res => res)
}
<template>
<div>
<div v-if="disabled === undefined || reEdit" class="fl">
<el-upload
:multiple="true"
:action="action"
:show-file-list="false"
:data="dataObj"
:accept="obj.accept"
:on-success="_handleSuccess"
with-credentials
class="upload-file"
list-type="picture-card">
<i slot="default" class="el-icon-plus"></i>
</el-upload>
</div>
<div class="fl">
<ul class="upload-file-ul">
<li v-for="(item,index) in list" :key="index">
<span @click="_edit(item)">{{item.fileName}}</span>
<div @click="_download(item)" class="upload-list-cover">{{item.fileName}}</div>
<div v-if="disabled === undefined || reEdit" class="upload-list-cover-close">
<i @click="_del(item)" class="el-icon-close" style="margin-left: 10px"/>
</div>
</li>
</ul>
</div>
<div class="clear"></div>
</div>
</template>
<script>
/**
* 流程附件:上传、下载、删除、预览
* 按住ctrl选择多个文件上传
*/
import { flowAttachment } from '../../api'
import global from '../../api/config'
export default {
name: 'UploadFileList',
props: {
// 组件的所有信息
obj: null,
// 是否禁用(表示只读,不许上传)
disabled: null,
// 附件可操作
reEdit: null,
// 流程id(根据流程id查看附件)自定义的
processId: null
},
data() {
return {
dataObj: {
file: ''
},
list: [],
previewList: [],
// 上传附件
action: '',
// 生成form表单的id
createFormKey: '',
flowProcessId: '', // 自己定义的id,用于查询附件
downloadUrl: ''
}
},
watch: {
// 监听processId数据,更新表单
processId: {
handler(val) {
console.log('processId==', val)
if (val) {
this._list()
} else {
this.list = []
}
},
deep: true
},
// 监听obj数据,更新表单
obj: {
handler(val) {
console.log('obj-value==', val)
this._list()
},
deep: true
}
},
mounted() {
this._list()
},
methods: {
// 自己定义的流程id
_replaceId() {
if (this.processId) {
let flowProcessId = ''
const processIdList = this.processId.split(':')
if (processIdList.length === 1) {
flowProcessId = processIdList[0]
} else if (processIdList.length === 3) {
flowProcessId = processIdList[2]
}
this.flowProcessId = flowProcessId
this.action =
global.baseURL + '/flow/v1/attachment/upload-' + flowProcessId
this.downloadUrl = global.baseURL + '/flow/v1/attachment/download?ids='
}
},
_handleSuccess(response, file, fileList) {
// 上传成功
if (response.success) {
this._list()
} else {
this.$message.error(response.msg)
}
},
// list接口
_list: async function() {
this._replaceId()
if (this.flowProcessId) {
const result = await flowAttachment.list(this.flowProcessId)
// 处理数据,可进行预览图片
// 拼接图片预览地址
this.previewList = []
// 支持page与list
const records = result.records ? result.records : result
for (let i = 0; i < records.length; i++) {
// 判断是否是图片格式
if (this.$fileFormat(records[i].type, 'img')) {
const url = this.downloadUrl + records[i].id
this.$set(records[i], 'url', url)
this.previewList.push(url)
}
}
this.list = records
}
},
// 下载
_download(item) {
const url = this.downloadUrl + item.id
window.open(url, '_blank')
},
// 删除
_del(item) {
this.$confirm('确定要删除附件吗?', '提示', {
type: 'warning'
}).then(() => {
this._delOk(item.id)
})
},
_delOk: async function(id) {
const result = await flowAttachment.delFile(id)
if (result) {
this._list()
}
},
// 编辑或预览
_edit(item) {
if (this.disabled === undefined || this.reEdit) {
// 进行编辑
this.$viewDocument(item, 'edit')
} else {
// 进行预览
this.$viewDocument(item, 'readonly')
}
}
}
}
</script>
<style>
/*多个附件上传*/
.upload-file .el-upload--picture-card {
width: 100px;
height: 100px;
line-height: 100px;
}
.upload-file-ul {
overflow: hidden;
}
.upload-file-ul li {
float: left;
text-align: center;
width: 100px;
height: 100px;
line-height: 100px;
border: 1px solid #ddd;
margin-left: 5px;
border-radius: 7px;
position: relative;
}
.upload-list-cover {
display: none;
position: absolute;
left: 0;
right: 0;
top: 70px;
line-height: 30px;
height: 30px;
background: rgba(0, 0, 0, 0.4);
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px;
}
.upload-file-ul li:hover .upload-list-cover {
display: block;
color: #fff;
cursor: pointer;
}
.upload-list-cover-close {
position: absolute;
z-index: 2000;
left: 70px;
bottom: 70px;
line-height: 30px;
cursor: pointer;
}
.upload-list-cover-close:hover {
color: #eb6877;
}
.upload-file-ul li:hover span {
cursor: pointer;
color: #409eff;
}
/*多个附件上传*/
</style>
<template>
<div style="margin-top: 5px">
<quill-editor
ref="myTextEditor"
v-model="html"
:options="editorOption"
@change="onEditorChange($event)"></quill-editor>
</div>
</template>
<script>
export default {
props: ['html'],
data() {
return {
content: '',
editorOption: {
// 操作按钮
modules: {
toolbar: [
['bold', 'italic', 'underline'],
[{ header: 1 }, { header: 2 }],
[{ color: [] }],
['image']
]
},
placeholder: '请完善新闻详情'
}
}
},
methods: {
onEditorChange({ editor, html, text }) {
// 富文本编辑器 文本改变时 设置字段值
this.html = html
const data = {
html: this.html,
content: text
}
this.$emit('on-result-change', data)
}
}
}
</script>
<style>
.ql-container {
height: 300px !important;
}
.ql-snow {
border: 1px solid #dddee1 !important;
}
.ql-editor.ql-blank::before {
color: #bbbec4 /* rgba(0,0,0,0.6)*/;
font-style: normal;
}
.ql-toolbar.ql-snow {
border-radius: 5px 5px 0 0 !important;
}
.ql-container.ql-snow {
border-radius: 0 0 5px 5px !important;
border-top: none !important;
}
</style>
......@@ -7,6 +7,7 @@
:type="item.type?item.type:'default'"
:loading="loading === true && currentIndex === index"
@click="_footerClick(item.name,index)"
style="margin-left: 20px;"
>{{item.name}}
</Button>
</div>
......
......@@ -23,7 +23,7 @@
</Upload>
</label>
<Button @click="_batchUpload">批量上传</Button>
<Button @click="_exportList()">列表导出</Button>
<!-- <Button @click="_exportList()">列表导出</Button>-->
<!--一系列操作-->
<!--非表格-->
<!-- <Button v-if="viewStyle === 2 || viewStyle === 3" v-for="item in menusListA" :key="item.name" @click="_radioChange(item.value)"-->
......@@ -61,7 +61,7 @@
fixed="right">
<template slot-scope="scope">
<VXEIconList
:msg="scope.row.type === 'jpg'||scope.row.type === 'pdf'||scope.row.type === 'png' ?iconMsgJpg:iconMsg"
:msg="scope.row.type === 'jpg'||scope.row.type === 'jpeg'||scope.row.type === 'pdf'||scope.row.type === 'png'||scope.row.type === 'xlsx'||scope.row.type === 'docx'||scope.row.type === 'bmp' ?iconMsgJpg:iconMsg"
@on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>
</template>
</vxe-table-column>
......@@ -301,9 +301,9 @@ export default {
break
}
},
_exportList() {
console.log('列表导出')
},
// _exportList() {
// console.log('列表导出')
// },
_iconClick(res, data) {
switch (res) {
case '下载':
......@@ -329,6 +329,12 @@ export default {
this.imgViewList = imgViewList
this.imgViewIndex = 0
break
case 'jpeg':
const jpegViewList = []
jpegViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = jpegViewList
this.imgViewIndex = 0
break
case 'pdf':
this.$pdfView(data.objectKey)
break
......@@ -338,6 +344,28 @@ export default {
this.imgViewList = pngViewList
this.imgViewIndex = 0
break
case 'bmp':
const bmpViewList = []
bmpViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = bmpViewList
this.imgViewIndex = 0
break
case 'xlsx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
case 'docx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
}
// console.log(data)
// if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
......
......@@ -26,8 +26,14 @@ export default {
}
},
methods: {
_open(id, key) {
_open(id, key, title) {
this.showModal = true
if (title) {
this.modalTitle = title
} else {
this.modalTitle = '附件管理'
}
this.$refs.fileCont._open(id, key)
}
}
......
......@@ -60,7 +60,7 @@
fixed="right">
<template slot-scope="scope">
<VXEIconList
:msg="scope.row.type === 'jpg'||scope.row.type === 'pdf'||scope.row.type === 'png' ?iconMsgJpg:iconMsg"
:msg="scope.row.type === 'jpg'||scope.row.type === 'jpeg'||scope.row.type === 'pdf'||scope.row.type === 'png'||scope.row.type === 'xlsx'||scope.row.type === 'docx'||scope.row.type === 'bmp' ?iconMsgJpg:iconMsg"
@on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>
</template>
</vxe-table-column>
......@@ -127,8 +127,8 @@
</div>
<!--图片预览-->
<div>
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex"
@close="imgViewIndex = null"></vue-gallery-slideshow>
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex" @close="imgViewIndex = null"
style="height: 100vh"></vue-gallery-slideshow>
</div>
</div>
......@@ -326,6 +326,12 @@ export default {
this.imgViewList = imgViewList
this.imgViewIndex = 0
break
case 'jpeg':
const jpegViewList = []
jpegViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = jpegViewList
this.imgViewIndex = 0
break
case 'pdf':
this.$pdfView(data.objectKey)
break
......@@ -335,6 +341,34 @@ export default {
this.imgViewList = pngViewList
this.imgViewIndex = 0
break
case 'bmp':
const bmpViewList = []
bmpViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = bmpViewList
this.imgViewIndex = 0
break
case 'xlsx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
case 'docx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
case 'doc':
this.$Message.warning('预览功能不支持doc格式')
break
case 'xls':
this.$Message.warning('预览功能不支持xls格式')
break
}
// console.log(data)
// if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
......
<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>
<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>
<template>
<div>
<Modal v-model="showModal" :width="900" v-drag class="modal-footer-none zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<div>
<FileManageCont ref="fileCont" :flag="flag"></FileManageCont>
</div>
</Modal>
</div>
</template>
<script>
import FileManageCont from './FileManageCont'
export default {
components: {
FileManageCont
},
props: {
// 只能删除自己的标识
flag: null
},
data() {
return {
showModal: false,
modalTitle: '附件管理'
}
},
methods: {
_open(id, key, title) {
this.showModal = true
if (title) {
this.modalTitle = title
} else {
this.modalTitle = '附件管理'
}
this.$refs.fileCont._open(id, key)
}
}
}
</script>
<template>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24" style="margin-bottom: -10px">
<Form :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="文件名称:">
<Input v-model="fileName" @on-enter="_search" placeholder="请输入文件名称"
style="width:200px" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--列表-->
<Col span="24">
<FilesList ref="fileModal" :fileName="fileName" @on-result-change="_fileData"></FilesList>
</Col>
</Row>
<!--删除提示框-->
<ModalConfirm ref="confirmModal" :content="modalContent" :btnModalList="btnModalList"
@on-result-change="_modalResult"></ModalConfirm>
</div>
</template>
<script>
import ModalConfirm from '../../base/ModalConfirm'
import { meterEntrust } from '../../../api'
import FilesList from './FilesList'
export default {
components: {
FilesList,
ModalConfirm
},
props: {
// 只能删除自己的标识
flag: null
},
data() {
return {
fileName: '',
selectIds: [],
getPage: {},
// ids
contractId: '',
sampleId: '',
subcontractorId: '',
originalRecordId: '',
curveId: '',
// 用于区分是哪种附件(合同、委托、样品)
idKey: '',
// 弹框的内容
modalContent: '',
btnModalList: [
{ type: '', name: '取消' },
{ type: 'primary', name: '确定' }
],
//
deleteId: [],
urlData: {}
}
},
methods: {
/**
* msg:表示是哪种附件(委托,样品,分包商)
* pageUrl:page 请求地址
* deleteUrl:删除请求地址
* uploadFileUrl:上传地址
* downloadFileUrl:下载地址
* uri:预览请求地址
* viewUri:预览图片地址
* downloadBatch:批量打包下载
*/
_open(id, key) {
this.fileName = ''
this.showModal = true
this.contractId = ''
this.sampleId = ''
this.subcontractorId = ''
this.originalRecordId = ''
this.curveId = ''
this.entrustId = ''
this.idKey = key
switch (key) {
// 委托
case 'contractId':
this.contractId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: '/meter/v1/entrust_attachment/page',
deleteUrl: '/meter/v1/entrust_attachment/?ids=',
uploadFileUrl: '/meter/v1/entrust_attachment/upload/',
downloadFileUrl: '/meter/v1/entrust_attachment/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: '/meter/v1/entrust_attachment/preview/'
}
break
case 'entrustId':
this.entrustId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: 'soil/v1/entrust_annex/page',
deleteUrl: '/soil/v1/entrust_annex/?ids=',
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/'
}
break
case 'aloneSampleId':
// 样品
this.entrustId = id
this.urlData = {
msg: 'FoodSampleAttachment',
pageUrl: 'soil/v1/alone_sample_annex/page',
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'
}
break
case 'subcontractorId':
// 分包商
this.subcontractorId = id
this.urlData = {
msg: 'FoodSubContractAttachment',
pageUrl: '/meter/v1/contract_attachment/page',
deleteUrl: '/meter/v1/contract_attachment/?ids=',
uploadFileUrl: '/meter/v1/contract_attachment/upload/',
downloadFileUrl: '/meter/v1/contract_attachment/download/',
downloadBatch: '/food/v1/subcontractor_attachment/download_batch',
uri: 'FoodSubContractAttachment/getBySubcontractorId',
viewUri: '/food/v1/subcontractor_attachment/view'
}
break
case 'originalRecordId':
// 原始记录
this.originalRecordId = id
this.urlData = {
msg: 'FoodOriginalRecordAttachment',
pageUrl: 'FoodOriginalRecordAttachment/page',
deleteUrl: 'FoodOriginalRecordAttachment/deleteByIds',
uploadFileUrl: '/food/v1/original_attachment/',
downloadFileUrl: '/food/v1/original_attachment/download/',
downloadBatch: '/food/v1/original_attachment/download_batch',
uri: 'FoodOriginalRecordAttachment/getByOriginalRecordId',
viewUri: '/food/v1/original_attachment/preview'
}
break
case 'curveId':
// 采样记录
this.curveId = id
this.urlData = {
msg: 'ElnCurveAttachment',
pageUrl: 'ElnCurveAttachment/page',
deleteUrl: 'ElnCurveAttachment/deleteByIds',
uploadFileUrl: '/print/v1/curve_attachment/',
downloadFileUrl: '/print/v1/curve_attachment/download/',
downloadBatch: '/print/v1/curve_attachment/download_batch',
uri: 'ElnCurveAttachment/getById',
viewUri: '/print/v1/curve_attachment/view'
}
break
}
const idsObj = {
contractId: this.contractId,
sampleId: this.sampleId,
subcontractorId: this.subcontractorId,
originalRecordId: this.originalRecordId,
curveId: this.curveId,
entrustId: this.entrustId
}
this.$refs.fileModal._setUploadData(
Object.assign({ id: id }, this.urlData),
idsObj,
this.idKey
)
},
_deleteById(ids) {
this.deleteId = ids
this.modalContent = '确定要删除这 ' + ids.length + ' 个附件?'
this.$refs.confirmModal._openModal()
},
_delPage: async function(data) {
console.log(data)
const result = await meterEntrust.attachmentDelete(
this.urlData.deleteUrl,
data.id
)
if (result) {
this.$Message.success('删除成功!')
this.$refs.fileModal._page()
}
this.$refs.confirmModal._closeModal()
this.deleteId = []
},
// 删除提示框返回
_modalResult(msg) {
if (msg === '确定') {
// 删除一条记录
if (this.flag === undefined) {
// 只能删除自己上传的
this._delPage({ id: this.deleteId, flag: 1 })
} else {
// 可以删除全部
this._delPage({ id: this.deleteId })
}
}
},
_fileData(msg, data) {
switch (msg) {
case 'delete':
this._deleteById(data)
break
}
},
// 搜索
_search() {
this.$refs.fileModal._page(this.fileName)
}
}
}
</script>
<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>
<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>
<template>
<div>
<Modal v-model="showModal" :width="900" v-drag class="modal-footer-none zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<div>
<FileManageCont ref="fileCont" :flag="flag"></FileManageCont>
</div>
</Modal>
</div>
</template>
<script>
import FileManageCont from './FileManageCont'
export default {
components: {
FileManageCont
},
props: {
// 只能删除自己的标识
flag: null
},
data() {
return {
showModal: false,
modalTitle: '附件管理'
}
},
methods: {
_open(id, key, title) {
this.showModal = true
if (title) {
this.modalTitle = title
} else {
this.modalTitle = '附件管理'
}
this.$refs.fileCont._open(id, key)
}
}
}
</script>
<template>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24" style="margin-bottom: -10px">
<Form :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="文件名称:">
<Input v-model="fileName" @on-enter="_search" placeholder="请输入文件名称"
style="width:200px" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--列表-->
<Col span="24">
<FilesList ref="fileModal" :fileName="fileName" @on-result-change="_fileData"></FilesList>
</Col>
</Row>
<!--删除提示框-->
<ModalConfirm ref="confirmModal" :content="modalContent" :btnModalList="btnModalList"
@on-result-change="_modalResult"></ModalConfirm>
</div>
</template>
<script>
import ModalConfirm from '../../base/ModalConfirm'
import { meterEntrust } from '../../../api'
import FilesList from './FilesList'
export default {
components: {
FilesList,
ModalConfirm
},
props: {
// 只能删除自己的标识
flag: null
},
data() {
return {
fileName: '',
selectIds: [],
getPage: {},
// ids
contractId: '',
sampleId: '',
subcontractorId: '',
originalRecordId: '',
curveId: '',
// 用于区分是哪种附件(合同、委托、样品)
idKey: '',
// 弹框的内容
modalContent: '',
btnModalList: [
{ type: '', name: '取消' },
{ type: 'primary', name: '确定' }
],
//
deleteId: [],
urlData: {}
}
},
methods: {
/**
* msg:表示是哪种附件(委托,样品,分包商)
* pageUrl:page 请求地址
* deleteUrl:删除请求地址
* uploadFileUrl:上传地址
* downloadFileUrl:下载地址
* uri:预览请求地址
* viewUri:预览图片地址
* downloadBatch:批量打包下载
*/
_open(id, key) {
this.fileName = ''
this.showModal = true
this.contractId = ''
this.sampleId = ''
this.subcontractorId = ''
this.originalRecordId = ''
this.curveId = ''
this.entrustId = ''
this.idKey = key
switch (key) {
// 委托
case 'contractId':
this.contractId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: '/meter/v1/entrust_attachment/page',
deleteUrl: '/meter/v1/entrust_attachment/?ids=',
uploadFileUrl: '/meter/v1/entrust_attachment/upload/',
downloadFileUrl: '/meter/v1/entrust_attachment/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: '/meter/v1/entrust_attachment/preview/'
}
break
case 'entrustId':
this.entrustId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: 'soil/v1/entrust_annex/page',
deleteUrl: '/soil/v1/entrust_annex/?ids=',
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/'
}
break
case 'aloneSampleId':
// 样品
this.entrustId = id
this.urlData = {
msg: 'FoodSampleAttachment',
pageUrl: 'soil/v1/alone_sample_annex/page',
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'
}
break
case 'subcontractorId':
// 分包商
this.subcontractorId = id
this.urlData = {
msg: 'FoodSubContractAttachment',
pageUrl: '/meter/v1/contract_attachment/page',
deleteUrl: '/meter/v1/contract_attachment/?ids=',
uploadFileUrl: '/meter/v1/contract_attachment/upload/',
downloadFileUrl: '/meter/v1/contract_attachment/download/',
downloadBatch: '/food/v1/subcontractor_attachment/download_batch',
uri: 'FoodSubContractAttachment/getBySubcontractorId',
viewUri: '/food/v1/subcontractor_attachment/view'
}
break
case 'originalRecordId':
// 原始记录
this.originalRecordId = id
this.urlData = {
msg: 'FoodOriginalRecordAttachment',
pageUrl: 'FoodOriginalRecordAttachment/page',
deleteUrl: 'FoodOriginalRecordAttachment/deleteByIds',
uploadFileUrl: '/food/v1/original_attachment/',
downloadFileUrl: '/food/v1/original_attachment/download/',
downloadBatch: '/food/v1/original_attachment/download_batch',
uri: 'FoodOriginalRecordAttachment/getByOriginalRecordId',
viewUri: '/food/v1/original_attachment/preview'
}
break
case 'curveId':
// 采样记录
this.curveId = id
this.urlData = {
msg: 'ElnCurveAttachment',
pageUrl: 'ElnCurveAttachment/page',
deleteUrl: 'ElnCurveAttachment/deleteByIds',
uploadFileUrl: '/print/v1/curve_attachment/',
downloadFileUrl: '/print/v1/curve_attachment/download/',
downloadBatch: '/print/v1/curve_attachment/download_batch',
uri: 'ElnCurveAttachment/getById',
viewUri: '/print/v1/curve_attachment/view'
}
break
}
const idsObj = {
contractId: this.contractId,
sampleId: this.sampleId,
subcontractorId: this.subcontractorId,
originalRecordId: this.originalRecordId,
curveId: this.curveId,
entrustId: this.entrustId
}
this.$refs.fileModal._setUploadData(
Object.assign({ id: id }, this.urlData),
idsObj,
this.idKey
)
},
_deleteById(ids) {
this.deleteId = ids
this.modalContent = '确定要删除这 ' + ids.length + ' 个附件?'
this.$refs.confirmModal._openModal()
},
_delPage: async function(data) {
console.log(data)
const result = await meterEntrust.attachmentDelete(
this.urlData.deleteUrl,
data.id
)
if (result) {
this.$Message.success('删除成功!')
this.$refs.fileModal._page()
}
this.$refs.confirmModal._closeModal()
this.deleteId = []
},
// 删除提示框返回
_modalResult(msg) {
if (msg === '确定') {
// 删除一条记录
if (this.flag === undefined) {
// 只能删除自己上传的
this._delPage({ id: this.deleteId, flag: 1 })
} else {
// 可以删除全部
this._delPage({ id: this.deleteId })
}
}
},
_fileData(msg, data) {
switch (msg) {
case 'delete':
this._deleteById(data)
break
}
},
// 搜索
_search() {
this.$refs.fileModal._page(this.fileName)
}
}
}
</script>
<template>
<div>
<Modal v-model="showUserModal" v-drag :mask-closable="false" width="800" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Row :gutter="16">
<!--组织列表-->
<Col span="10">
<Card class="user_card_tree">
<p slot="title">{{titleChange}}</p>
<!-- <p v-if="isChange === undefined" slot="extra" @click="_changeLimit">-->
<!-- <Tooltip content="切换" placement="top-end">-->
<!-- <Badge dot>-->
<!-- <Icon type="ios-switch" size="23"></Icon>-->
<!-- </Badge>-->
<!-- </Tooltip>-->
<!-- </p>-->
<div>
<orginZtree ref="orginZtree" @on-result-change="_orgData"></orginZtree>
</div>
</Card>
</Col>
<!--待选列表-->
<Col span="14">
<Card class="user_card_tree">
<p slot="title">待选人员列表</p>
<div>
<userCheck ref="userCheck" :is-sampling-person="isSamplingPerson" @on-result-change="_userCheckData"></userCheck>
</div>
</Card>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
/**
* 选择人员信息
*/
import orginZtree from '../user-info/orginZtreeCheck.vue'
import { sysOrg } from '../../api'
import userCheck from './userCheck'
export default {
components: {
orginZtree,
userCheck
},
props: {
// 是否显示切’换操‘作
isChange: null,
isSamplingPerson: null // 是否显示人员变红(采样人员)
},
data() {
return {
id: '',
modalTitle: '选择人员',
showUserModal: false,
titleChange: '组织列表',
changeBool: true,
currentRowData: {},
// 用于区分tree
treeName: '',
footerList: [
{ name: '取消', type: '' },
{ name: '确定', type: 'primary' }
]
}
},
methods: {
// modal-footer
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open(treeName, modalTitle) {
if (treeName === undefined) {
this.treeName = 'userMan'
} else {
this.treeName = treeName
}
// 标题
if (modalTitle === undefined) {
this.modalTitle = '选择人员'
} else {
this.modalTitle = modalTitle
}
this.showUserModal = true
this.changeBool = true
this.titleChange = '组织列表'
this._getCurrentOrg()
this.$refs.userCheck._refresh()
this._hideLoading()
},
_openGoupByUserId(modalTitle, uid, treeName) {
this.modalTitle = modalTitle
this.changeBool = false
this.showUserModal = true
this.titleChange = '用户编组'
if (treeName === undefined) {
this.treeName = 'userMan'
} else {
this.treeName = treeName
}
this.$refs.userCheck._refresh()
this.$refs.marshalling._uidOpen(uid)
},
_openGoup(modalTitle, treeName) {
this.modalTitle = modalTitle
this.changeBool = false
this.showUserModal = true
this.titleChange = '用户编组'
if (treeName === undefined) {
this.treeName = 'userMan'
} else {
this.treeName = treeName
}
this.$refs.userCheck._refresh()
this.$refs.marshalling._open()
},
_openOrg(modalTitle, treeName) {
this.modalTitle = modalTitle
this.changeBool = false
this.showUserModal = true
this.titleChange = '用户编组'
this._changeLimit()
if (treeName === undefined) {
this.treeName = 'userMan'
} else {
this.treeName = treeName
}
this.$refs.userCheck._refresh()
},
// 当前登录用户所处的组织
_getCurrentOrg: async function() {
const result = await sysOrg.getOrg()
if (result !== undefined) {
this.$refs.orginZtree._getZtree(this.treeName, result.id)
this._orgData(result)
} else {
this.$refs.orginZtree._getZtree(this.treeName)
}
},
_orgData(data) {
console.log(data)
this.$refs.userCheck._open(data.id, this.treeName)
this.currentRowData = {}
},
_marshallingData(data) {
this.$refs.userCheck._marshallingOpen(data.id, this.treeName + 'Ma')
},
_userCheckData(data, msg) {
this.currentRowData = data
if (msg === 'dbClick') {
// 双击
this._ok()
}
},
_changeLimit() {
this.changeBool = !this.changeBool
this.currentRowData = {}
if (this.changeBool) {
// 组织
this.titleChange = '组织列表'
this._getCurrentOrg()
this.$refs.userCheck._refresh()
} else {
// 用户编组
this.titleChange = '用户编组'
this.$refs.marshalling._open()
this.$refs.userCheck._refresh()
}
},
_cancel() {
this.showUserModal = false
},
_ok() {
if (JSON.stringify(this.currentRowData) === '{}') {
this.$Message.warning('请选择人员!')
this._hideLoading()
} else {
// 根据组织选择人员时
if (this.currentRowData.userId === undefined) {
this.currentRowData.userId = this.currentRowData.id
}
this.$emit('on-result-change', this.currentRowData, this.treeName)
this.showUserModal = false
}
}
}
}
</script>
......@@ -68,8 +68,7 @@ export default {
pageParams: { page: 1, rows: 20 },
pageColumns: [
{ title: '姓名', key: 'realname' },
{ title: '待办试验项目量', key: 'total' },
{ title: '性别', key: 'sex', sex: true, width: 100 }
{ title: '待办试验项目量', key: 'total' }
],
getPage: {},
selectIds: [],
......
<template>
<div style="text-align: center;overflow-y: auto;height: 410px;">
<ul :id="treeName" class="ztree" />
</div>
</template>
<script>
/**
* 组织Ztree
*/
import { sysOrg } from '../../api'
let treeObj
export default {
data() {
return {
treeName: '' // 区别tree id
}
},
methods: {
_getZtree: async function(name, currentId) {
this.treeName = name + 'OrginTree'
const setting = {
data: {
simpleData: {
enable: true,
idKey: 'id',
pIdKey: 'pid'
}
},
callback: {
onClick: this.zTreeOnClick
}
}
const result = await sysOrg.orgTreeList()
console.log('tree结果')
console.log(result)
if (result) {
$.fn.zTree.init($('#' + this.treeName), setting, result)
treeObj = $.fn.zTree.getZTreeObj(this.treeName)
if (currentId !== undefined) {
const nodeId = treeObj.getNodeByParam('id', currentId, null)
treeObj.checkNode(nodeId, true, true)
treeObj.expandNode(nodeId, true, true, true)
treeObj.selectNode(nodeId)
} else {
treeObj.expandAll(true)
}
}
},
zTreeOnClick(event, treeId, treeNode) {
this.$emit('on-result-change', treeNode)
console.log('zTree')
console.log(treeNode)
}
}
}
</script>
// 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
NC_URL=http://123.133.38.68:8088
pipeline {
agent any
stages {
stage('git pull') {
steps {
echo '=== Build web-soil Begin'
checkout([$class: 'GitSCM', branches: [[name: 'dev']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'patzn-zmq', url: 'http://git.patzn.com/wangweidong/pt-cloud-service-soil-web.git']]])
echo '=== Build web-soil End'
}
}
stage('Npm run build') {
steps {
nodejs('node14'){
sh '''
node --version
npm --version
yarn --version
yarn config set registry https://registry.npm.taobao.org
yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
yarn
NODE_ENV=zhyf STATIC_URL=http://static.lims.com nuxt build
'''
}
}
}
stage('Docker build and push') {
steps {
echo '=== Build docker image Begin'
sh """
docker build -t patzn-web-soil:2.0 .
docker login -u patzn -p Qw123qwe https://192.168.0.140
docker tag patzn-web-soil:2.0 192.168.0.140/zhyf/web-soil:1.0
docker push 192.168.0.140/zhyf/web-soil:1.0
"""
echo '=== Build docker image End'
}
}
}
}
......@@ -100,7 +100,6 @@ module.exports = {
{ src: '~/plugins/common.js', ssr: true },
{ src: '~/plugins/drag.js', ssr: true },
{ src: '~/plugins/global.js', ssr: true },
{ src: '~/plugins/editor.js', ssr: false },
{ src: '@/plugins/gallery.js', ssr: false },
{ src: '@/plugins/ieCharts.js', ssr: false },
{ src: '@/plugins/fullcalendar.js', ssr: false }
......
......@@ -9,6 +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",
"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",
......@@ -20,7 +21,7 @@
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/dotenv": "^1.3.0",
"@nuxtjs/pwa": "^2.6.0",
"@nuxtjs/router": "^1.1.0",
"@nuxtjs/router": "1.3.2",
"cookie-universal-nuxt": "^2.0.14",
"cross-env": "^5.2.0",
"dateformat": "^3.0.3",
......@@ -43,7 +44,6 @@
"vue-echarts-v3": "^2.0.1",
"vue-full-calendar": "^2.8.1-0",
"vue-gallery-slideshow": "^1.3.1",
"vue-quill-editor": "^3.0.6",
"vue-runtime-helpers": "^1.1.2",
"vxe-table": "^2.9.11",
"vxe-utils": "^1.9.3",
......
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form id="search-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="width-23" label="位置:">
<input name="type" type="hidden" value=0>
<Input v-model="formObj.location" @on-enter="_formSearch" placeholder="请输入位置" clearable></Input>
</Form-item>
<Form-item label="日期:" style="margin-left: -20px;" class="width-23">
<Date-picker @on-change="_dateChange" :editable="false" type="daterange" split-panels
style="width:100%;" placeholder="请选择监测日期"></Date-picker>
</Form-item>
<Form-item style="margin-left: -50px">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col>
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg" :optColWidth="120">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key"
sortable>
<template slot-scope="scope">
<div v-if="item.date">
{{scope.row.monitorFormat?(scope.row[item.key]?$dateformat(scope.row[item.key],scope.row.monitorFormat):'')
:(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>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!-- 添加、编辑 -->
<LmsEnvNormalMonitorEdit ref="editModal" @on-result-change="_search"></LmsEnvNormalMonitorEdit>
<!-- 查看详情 -->
<!--导入-->
<!--操作记录-->
<earlyWarningSet ref="setModal"></earlyWarningSet>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
import LmsEnvNormalMonitorEdit from './LmsEnvNormalMonitorEdit.vue'
import earlyWarningSet from './earlyWarningSet'
export default {
components: {
LmsEnvNormalMonitorEdit,
earlyWarningSet
},
data() {
return {
btn: [
{ type: 'success', id: 'early-warning-add', name: '添加' },
{ type: 'error', id: 'early-warning-deletes', name: '删除' },
{ type: '', id: 'early-warning-set', name: '预警设置' }
],
iconMsg: [
{ type: 'md-create', id: 'early-warning-edit', name: '编辑' },
{ type: 'md-trash', id: 'early-warning-delete', name: '删除' }
],
selectIds: [],
pageColumns: [
{ title: '位置', key: 'location', detail: true, width: 140 },
{ title: '相对湿度(%)', key: 'humidity', width: 120 },
{ title: '温度(℃)', key: 'temperature', width: 100 },
{ title: '设备编号', key: 'equipNum' },
{ title: '监测日期', key: 'monitorDate', date: true, width: 140 },
{ title: '记录人', key: 'recorderName', width: 120 }
],
dataObj: {
file: ''
},
getPage: {},
formObj: {
location: '',
startDate: '',
endDate: ''
}
}
},
mounted() {
this._page()
},
methods: {
_dateChange(data) {
this.formObj.startDate = data[0]
this.formObj.endDate = data[1]
},
_import() {
this.$refs.importModal._open()
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '删除':
this._deleteById(data.id)
break
case '操作日志':
this._normalRecord(data.id)
break
}
},
_normalRecord(id) {
this.$refs.recordModal._open(id)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.soilEnvMonitorWarning(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids.join(','))
}
})
},
_delete: async function(ids) {
const result = await soilAptitude.envMonitorWarningDelete(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(id) {
// 查看
this.$store.dispatch('LmsEnvNormalMonitor/getById', id).then(() => {
this.$refs.detailModal._open(
this.$store.state.LmsEnvNormalMonitor.model
)
})
},
_editModal(edit, id) {
if (edit) {
// 编辑
this._getInfoById(id)
} else {
// 添加
this.$refs.editModal._open()
}
},
_getInfoById: async function(id) {
const result = await soilAptitude.envMonitorWarningInfo({ id: id })
console.log(result)
if (result) {
this.$refs.editModal._open(result)
}
},
_search() {
this._page()
},
_export() {
const ids = this.selectIds
if (ids.length === 0) {
this._exportAll()
} else {
this._exportByIds(ids, '确定导出 ' + ids.length + ' 条记录?')
}
},
_exportAll() {
this.$Modal.confirm({
title: '提示',
content: '确定要导出全部数据?',
onOk: () => {
window.open(
global.baseURL + '/res/v1/env_monitor/exportNormalAll',
'_blank'
)
}
})
},
_exportByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content,
onOk: () => {
window.open(
global.baseURL + '/res/v1/env_monitor/exportNormal?ids=' + ids,
'_blank'
)
}
})
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
this.$Message.success('上传成功!')
} else {
this.$Message.warning(response.msg)
}
this._search()
},
_btnClick(msg) {
switch (msg) {
case '添加':
this._editModal(false)
break
case '删除':
this._deleteSelected()
break
case '导入':
this._import()
break
case '导出':
this._export()
break
case '预警设置':
this._earlyWarning()
break
}
},
_earlyWarning() {
this.$refs.setModal._open()
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.LmsEnvNormalMonitor.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" v-drag>
<p slot="header">{{modalTitle}}</p>
<div>
<Form ref="formObj" :id="formId" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form-item label="位置" prop="location">
<Input v-model="formObj.location" name="location" placeholder="请输入位置"></Input>
</Form-item>
<Form-item label="相对湿度(%)" prop="humidity">
<Input v-model="formObj.humidity" name="humidity" placeholder="请输入相对湿度"></Input>
</Form-item>
<Form-item label="温度(℃)" prop="temperature">
<Input v-model="formObj.temperature" name="temperature" placeholder="请输入温度"></Input>
</Form-item>
<Form-item label="设备编号" prop="equipNum">
<Input v-model="formObj.equipNum" name="equipNum" placeholder="请输入设备编号"></Input>
</Form-item>
<Form-item label="监测日期" prop="monitorDate">
<Date-picker :format="format" v-model="formObj.monitorDate" name="monitorDate" type="datetime"
placeholder="监测日期" style="width: 100%;"></Date-picker>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
/**
* 添加编辑常规环境检测
*/
export default {
components: {},
data() {
return {
id: '',
modalTitle: '',
formObj: {
location: '',
humidity: '',
temperature: '',
monitorDate: '',
recorder: '',
companyId: '',
equipNum: ''
},
locList: [],
ruleValidate: {
type: [
{
required: true,
message: '类型不能为空',
trigger: 'blur',
type: 'number'
}
],
location: [
{ required: true, message: '位置不能为空', trigger: 'blur' }
],
humidity: [
{ required: true, message: '相对湿度不能为空', trigger: 'blur' }
],
temperature: [
{ required: true, message: '温度不能为空', trigger: 'blur' }
]
},
showEditModal: false,
dateList: [],
format: '',
monitorFormat: '',
formId: '',
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
if (this.$store.state.LmsEnvNormalMonitor.success) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
} else {
this._hideLoading()
}
},
// 字典
_dicSearch() {
this.$store
.dispatch('LmsBaseDict/getItem', '环境监测管理日期格式')
.then(() => {
const result = this.$store.state.LmsBaseDict.item
if (result) {
switch (result[0].name) {
case '年月日':
this.format = 'yyyy-MM-dd'
this.monitorFormat = 'yyyy-mm-dd'
break
case '年月日时':
this.format = 'yyyy-MM-dd HH'
this.monitorFormat = 'yyyy-mm-dd HH'
break
case '年月日时分':
this.format = 'yyyy-MM-dd HH:mm'
this.monitorFormat = 'yyyy-mm-dd HH:MM'
break
case '年月日时分秒':
this.format = 'yyyy-MM-dd HH:mm:ss'
this.monitorFormat = 'yyyy-mm-dd HH:MM:ss'
break
default:
this.format = 'yyyy-MM-dd'
this.monitorFormat = 'yyyy-mm-dd'
}
}
})
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize(this.formId)
if (this.$string(this.id).isEmpty()) {
// 添加
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 soilAptitude.envMonitorAdd(data)
if (result) {
this.$Message.success('添加成功')
this.showEditModal = false
this.$emit('on-result-change')
}
},
_edit: async function(data) {
const result = await soilAptitude.envMonitorEdit(data)
if (result) {
this.$Message.success('编辑成功')
this.showEditModal = false
this.$emit('on-result-change')
}
},
_cancel() {
this.showEditModal = false
},
_open(formObj) {
this.formId = 'edit-form-normal-' + this.$randomCode()
this.showEditModal = true
this.$refs.formObj.resetFields()
this._hideLoading()
if (this.$string(formObj).isEmpty()) {
this.id = ''
this.modalTitle = '添加常规环境检测'
} else {
this.id = formObj.id
this.formObj = formObj
this.modalTitle = '编辑常规环境检测'
if (formObj.monitorDate === undefined) {
this.formObj.monitorDate = ''
} else {
this.formObj.monitorDate = new Date(formObj.monitorDate)
$('input[name="monitorDate"]').val(
this.$dateformat(formObj.monitorDate, 'yyyy-mm-dd')
)
}
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" v-drag>
<p slot="header">{{modalTitle}}</p>
<div>
<Form ref="formObj" :id="formId" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form-item label="科室:" prop="groupName" class="width-48">
<el-select @change="_selGroup" v-model="formObj.groupName" placeholder="请选择" name="groupName" style="width: 100%">
<el-option
v-for="(item,index) in groupoptions"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</Form-item>
<Form-item label="预警项目" prop="warningType">
<Input v-model="formObj.warningType" name="warningType" placeholder="请输入预警项目"></Input>
</Form-item>
<Form-item label="预警上限" prop="upperLimit">
<Input v-model="formObj.upperLimit" name="upperLimit" placeholder="请输入预警上限"></Input>
</Form-item>
<Form-item label="预警下限" prop="lowerLimit">
<Input v-model="formObj.lowerLimit" name="lowerLimit" placeholder="请输入预警下限"></Input>
</Form-item>
<Form-item label="手机号" prop="tel">
<Input v-model="formObj.tel" name="tel" placeholder="请输入手机号"></Input>
</Form-item>
<Form-item label="邮箱" prop="email">
<Input v-model="formObj.email" name="email" placeholder="请输入邮箱"></Input>
</Form-item>
<Form-item label="备注" prop="remark">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注"></Input>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
/**
* 添加编辑常规环境检测
*/
export default {
components: {},
data() {
return {
id: '',
modalTitle: '',
formObj: {
groupName: '',
groupId: ''
},
locList: [],
groupoptions: [],
ruleValidate: {
type: [
{
required: true,
message: '类型不能为空',
trigger: 'blur',
type: 'number'
}
],
location: [
{ required: true, message: '位置不能为空', trigger: 'blur' }
],
humidity: [
{ required: true, message: '相对湿度不能为空', trigger: 'blur' }
],
temperature: [
{ required: true, message: '温度不能为空', trigger: 'blur' }
]
},
showEditModal: false,
dateList: [],
format: '',
monitorFormat: '',
formId: '',
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
_getGroupList: async function() {
const result = await soilAptitude.getGroupList()
if (result) {
this.groupoptions = result
}
},
_selGroup(data) {
this.formObj.groupId = data
},
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
// 字典
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize(this.formId)
if (this.$string(this.id).isEmpty()) {
// 添加
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 soilAptitude.addEnvMonitor(data)
if (result) {
this.$Message.success('添加成功')
this.showEditModal = false
this.$emit('on-result-change')
}
},
_edit: async function(data) {
const result = await soilAptitude.editEnvMonitor(data)
if (result) {
this.$Message.success('编辑成功')
this.showEditModal = false
this.$emit('on-result-change')
}
},
_cancel() {
this.showEditModal = false
},
_open(formObj) {
this.formId = 'edit-form-normal-' + this.$randomCode()
this.showEditModal = true
this.$refs.formObj.resetFields()
this._hideLoading()
this._getGroupList()
if (this.$string(formObj).isEmpty()) {
this.id = ''
this.modalTitle = '添加'
} else {
this.id = formObj.id
this.formObj = formObj
this.modalTitle = '编辑'
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<Modal v-model="showModal" title="预警设置" width="1000" class="modal-footer-none">
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form-edit" :label-width="50" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="名称:">
<Input @on-enter="_formSearch" v-model="formObj.name" placeholder="请输入名称" style="width:200px"
clearable></Input>
</Form-item>
<Form-item style="margin-left: -50px">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="400"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg" :optColWidth="100">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key"
sortable>
<template slot-scope="scope">
<div>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
<earlySetEdit ref="setModal" @on-result-change="_page"></earlySetEdit>
<!-- 未关联耗材 -->
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
import earlySetEdit from './earlySetEdit'
export default {
components: { earlySetEdit },
data() {
return {
btn: [
{ type: 'success', id: 'early-warning-set-add', name: '添加' },
{ type: 'error', id: 'early-warning-set-deletes', name: '移除' }
],
supplierId: '',
selectIds: [],
relChemicalPage: {},
pageColumns: [
{ title: '科室', key: 'groupName', ellipsis: true },
{ title: '预警项目', key: 'warningType', ellipsis: true },
{ title: '预警上限', key: 'upperLimit', ellipsis: true },
{ title: '预警下限', key: 'lowerLimit', ellipsis: true },
{ title: '手机号', key: 'tel', ellipsis: true },
{ title: '邮箱', key: 'email', ellipsis: true },
{ title: '备注', key: 'remark', ellipsis: true }
],
iconMsg: [
{ type: 'md-create', id: 'early-warning-set-edit', name: '编辑' },
{
type: 'md-remove-circle',
id: 'early-warning-set-delete',
name: '删除'
}
],
showModal: false,
relSupplierData: {
// 保存要提交的信息
chemicalId: '',
supplierId: '',
price: ''
},
getPage: {},
formObj: {
name: '',
supplierId: ''
}
}
},
methods: {
_iconClick(res, data) {
switch (res) {
case '编辑':
this._openSet(true, data.id)
break
case '删除':
this._deleteById(data.id)
break
}
},
_open(id) {
this.showModal = true
this.formObj = this.$resetFields(this.formObj)
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.envMonitorWarningPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids.join(','))
}
})
},
_delete: async function(ids) {
const result = await soilAptitude.deleteEnvMonitorWarning(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定移除 ' + ids.length + ' 条记录?')
}
},
_search() {
this._page()
},
_btnClick(msg) {
switch (msg) {
case '添加':
this._openSet(false)
break
case '移除':
this._deleteSelected()
break
}
},
_openSet(data, id) {
if (data) {
this._getInfoById(id)
} else {
this.$refs.setModal._open()
}
},
_getInfoById: async function(id) {
const result = await soilAptitude.infoEnvMonitorWarning({ id: id })
console.log(result)
if (result) {
this.$refs.setModal._open(result)
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.LmsProductManage.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
}
}
}
</script>
......@@ -91,15 +91,15 @@ export default {
{ title: '试验方法', key: 'testMethod' }
],
btn: [
{ type: 'success', id: '', name: '添加' },
{ type: 'error', id: '', name: '删除' },
{ type: '', id: '', name: '导入' }
{ type: 'success', id: 'experiment-add', name: '添加' },
{ type: 'error', id: 'experiment-deletes', name: '删除' },
{ type: '', id: 'experiment-import', name: '导入' }
],
iconMsg: [
{ type: 'md-apps', id: '', name: '指标管理' },
{ type: 'md-create', id: '', name: '编辑' },
{ type: 'md-apps', id: 'experiment-index', name: '指标管理' },
{ type: 'md-create', id: 'experiment-edit', name: '编辑' },
// { type: 'md-add', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' }
{ type: 'md-trash', id: 'experiment-delete', name: '删除' }
// { type: 'md-add', id: '', name: '操作日志' }
],
formObj: {
......
......@@ -45,8 +45,8 @@ export default {
modalTitle: '',
showModal: false,
btn: [
{ type: 'success', id: '', name: '添加指标' },
{ type: 'error', id: '', name: '删除' }
{ type: 'success', id: 'experiment-index-add', name: '添加指标' },
{ type: 'error', id: 'experiment-index-delete', name: '删除' }
],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
......@@ -58,7 +58,9 @@ export default {
{ title: '单位', key: 'unit', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
iconMsg: [
{ type: 'md-create', id: 'experiment-index-edit', name: '编辑' }
],
selectIds: [],
formObj: {
name: ''
......
......@@ -53,6 +53,18 @@
<Input v-model="formObj.testMethod"
name="testMethod" placeholder="请输入试验方法"/>
</Form-item>
<Form-item @click.native="_selectPerson" label="主检人" prop="mainTester" class="width-48">
<Input v-model="formObj.mainTester"
name="mainTester" placeholder="请输入主检人"/>
<Input v-model="formObj.mainTesterId"
name="mainTesterId" style="display: none"/>
</Form-item>
<Form-item @click.native="_selectCheckPerson" label="审核人" prop="checker" class="width-48">
<Input v-model="formObj.checker"
name="checker" placeholder="请输入审核人"/>
<Input v-model="formObj.checkerId"
name="checkerId" style="display: none"/>
</Form-item>
</div>
</Form>
</div>
......@@ -60,6 +72,8 @@
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
<assignPerson ref="userModal" @on-result-change="_userResult"></assignPerson>
<assignPersonCheck ref="userCheckModal" @on-result-change="_userCheckResult"></assignPersonCheck>
</div>
</template>
<script>
......@@ -68,9 +82,10 @@
*/
import { soilAptitude } from '../../../api'
import assignPerson from '../../../components/user-info-single/assignPerson'
import assignPersonCheck from '../../../components/user-info-single/assignPersonCheck'
export default {
components: {},
components: { assignPerson, assignPersonCheck },
data() {
return {
activeName: '',
......@@ -128,6 +143,22 @@ export default {
console.log(data)
// this.formObj.groupId = da
},
_selectPerson() {
this.$refs.userModal._openOrg('选择主检人', 'itemTree')
},
_selectCheckPerson() {
this.$refs.userCheckModal._openOrg('选择审核人', 'itemTreeCheck')
},
_userResult(data, msg) {
this.$forceUpdate()
this.formObj.mainTester = data.realname
this.formObj.mainTesterId = data.id
},
_userCheckResult(data, msg) {
this.$forceUpdate()
this.formObj.checker = data.realname
this.formObj.checkerId = data.id
},
_selGroup(data) {
console.log(data)
this.formObj.groupId = data
......
......@@ -98,11 +98,11 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'test-basis-add',
name: '添加',
componentName: 'StandardsManageEdit'
},
{ type: 'error', id: '', name: '删除' }
{ type: 'error', id: 'test-basis-deletes', name: '删除' }
// { id: '', name: '导入', componentName: 'DownloadTemplateImport' },
// { id: '', name: '导出' }
],
......@@ -122,27 +122,27 @@ export default {
iconMsg: [
{
type: 'ios-photos',
id: '',
id: 'test-basis-find',
name: '查看替代关系',
componentName: 'SubstitutionalRelation'
},
{
type: 'md-create',
id: '',
id: 'test-basis-edit',
name: '编辑',
componentName: 'StandardsManageEdit'
},
{
type: 'md-add',
id: '',
id: 'test-basis-upload',
name: '上传'
},
{
type: 'ios-cloud',
id: '',
id: 'test-basis-upload-view',
name: '查看附件'
},
{ type: 'md-remove-circle', id: '', name: '删除' }
{ type: 'md-remove-circle', id: 'test-basis-delete', name: '删除' }
],
searchOpen: false,
getPage: {},
......
......@@ -89,22 +89,22 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'entrust-register-add',
name: '手动添加'
},
{
type: 'success',
id: '',
id: 'entrust-register-import',
name: '自动导入'
},
{
type: 'success',
id: '',
id: 'entrust-register-review',
name: '提交至评审'
},
{
type: 'success',
id: '',
id: 'entrust-register-export',
name: '导出检测委托书模板'
}
// ,
......@@ -117,32 +117,32 @@ export default {
iconMsg: [
{
type: 'md-create',
id: '',
id: 'entrust-register-edit-operation',
name: '编辑'
},
{
type: 'ios-list',
id: '',
id: 'entrust-register-sample',
name: '试样列表'
},
{
type: 'ios-apps',
id: '',
id: 'entrust-register-item',
name: '试验项目列表'
},
{
type: 'md-cloud',
id: '',
id: 'entrust-register-upload-operation',
name: '附件'
},
{
type: 'md-remove-circle',
id: '',
id: 'entrust-register-delete-operation',
name: '删除'
},
{
type: 'ios-clock',
id: '',
id: 'entrust-register-record',
name: '操作日志'
}
],
......
......@@ -9,7 +9,7 @@
@on-result-change="_cusNameChange" name="client" placeholder="请输入或选择委托单位"
></AutoComplete>
</Form-item>
<Form-item label="委托日期" prop="entrustDate" class="width-48">
<Form-item label="委托日期" prop="entrustDate" class="width-48">
<Date-picker v-model="formObj.entrustDate" @on-change="_ctimeChange" type="date" split-panels style="width:100%;"
placeholder="请选择委托日期" name="entrustDate"></Date-picker>
</Form-item>
......@@ -36,7 +36,7 @@
<Input v-model="formObj.latitude" name="latitude" placeholder="请输入纬度"/>
</Form-item>
<Form-item label="水深(米)" prop="waterDepth" class="width-48">
<Input v-model="formObj.waterDepth" @keydown.native="channelInputLimit" type="number" name="waterDepth" placeholder="请输入深度"/>
<Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入深度"/>
</Form-item>
<Form-item label="平均容重" prop="projectNo" class="width-48">
<Input v-model="formObj.projectNo" name="projectNo" placeholder="请输入平均容重"/>
......@@ -44,11 +44,11 @@
<Form-item @click.native="_selectPerson" label="制表人" prop="tabulater" class="width-48">
<Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/>
</Form-item>
<Form-item label="制单日期" prop="tabulateDate" class="width-48">
<Form-item label="制单日期" prop="tabulateDate" class="width-48">
<Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;"
placeholder="请选择委托日期"></Date-picker>
</Form-item>
<Form-item label="检验类别" prop="testType" class="width-48">
<Form-item label="检验类别" prop="testType" class="width-48">
<el-select v-model="formObj.testType" @change="typeChange" name="testType" placeholder="请选择"
size="small"
style="width:100%"
......@@ -705,7 +705,7 @@ export default {
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
if (key === 'e') {
e.returnValue = false
return false
}
......@@ -809,6 +809,7 @@ export default {
this.showBtn = true
this.showModal = true
this._hideLoading()
this.selectIds = []
if (this.$string(formObj).isEmpty()) {
this.$refs.formObj.resetFields()
this.getPage.records = []
......@@ -833,6 +834,7 @@ export default {
this.$refs.formObj.resetFields()
this._getUser()
this.getPage.records = []
this.selectIds = []
this._hideLoading()
this.id = ''
this.modalTitle = '委托单编辑'
......
......@@ -75,17 +75,17 @@ export default {
iconMsg: [
{
type: 'ios-list',
id: '',
id: 'entrust-register-his-sample',
name: '试样列表'
},
{
type: 'ios-clock',
id: '',
id: 'entrust-register-his-record',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
id: 'entrust-register-his-delete',
name: '删除'
}
],
......
<template>
<div>
<Modal
v-drag
v-model="showModal"
title="流程启动表单"
width="1000px"
>
<div>
<DesignFormView ref="form" :processId="processId"/>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import { processInstance } from '../../../api'
import DesignFormView from './DesignFormView'
/**
* 流程中配置的启动表单
*/
export default {
name: 'Index',
components: { DesignFormView },
data() {
return {
showModal: false,
processDefinitionId: '',
processId: '', // 临时
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '发起', type: 'primary' }
]
}
},
methods: {
_open(data, id) {
this.showModal = true
this.processDefinitionId = id
this.processId = id + new Date().getTime()
this._hideLoading()
if (data.renderedStartForm) {
this._initForm(JSON.parse(data.renderedStartForm))
}
},
_initForm(data) {
this.$nextTick(() => {
this.$refs.form._open(data)
})
},
// modal
_footerResult(name) {
switch (name) {
case '取消':
this.showModal = false
break
case '发起':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok: async function() {
const obj = {
processDefinitionId: this.processDefinitionId,
values: {}
}
// 填写的表单数据
const formObj = this.$refs.form.formObj
formObj.processDefinitionId = this.processId
obj.values = formObj
// 验证必填项
const formList = this.$refs.form.formList
for (let i = 0; i < formList.length; i++) {
const item = formList[i]
if (item.required && !formObj[item.vModel]) {
this.$message.error(item.label + '不能为空~')
this._hideLoading()
return false
}
}
const result = await processInstance.start(obj)
if (result) {
this.$message.success('发起成功,请到系统管理进行审批')
this.showModal = false
this.$emit('on-result-change')
}
this._hideLoading()
}
}
}
</script>
......@@ -52,6 +52,7 @@
<Operation ref="operation"></Operation>
<EntrustDetail ref="sampleEdit"></EntrustDetail>
<SampleManage ref="sampleManageModal"></SampleManage>
<SelectFlowRelBtn ref="flow"/>
</div>
</template>
<script>
......@@ -61,8 +62,15 @@ import Reason from '../../../components/base/Reason'
import SampleManage from '../SoilSampleManage'
import global from '../../../api/config'
import EntrustDetail from './EntrustDetail'
import SelectFlowRelBtn from './SelectFlowRelBtn'
export default {
components: { Operation, Reason, EntrustDetail, SampleManage },
components: {
Operation,
Reason,
EntrustDetail,
SampleManage,
SelectFlowRelBtn
},
data() {
return {
currentComponent: 'FoodSampleGovern',
......@@ -72,45 +80,50 @@ export default {
{
// meter-review-entrust-pass-btn
type: 'success',
id: '',
id: 'review-pass',
name: '通过'
},
// meter-review-entrust-back-btn
{
type: 'success',
id: '',
id: 'review-back',
name: '驳回'
},
{
type: 'success',
id: '',
id: 'review-export',
name: '导出标书合同(协议)评审表模板'
},
{
type: 'success',
id: '',
id: 'review-export-plus',
name: '导出标书合同(协议)补充单模板'
},
{
type: 'success',
id: 'submit-flow',
name: '提交审批'
}
],
iconMsg: [
{
type: 'md-paper',
id: '',
id: 'review-detail',
name: '详情'
},
{
type: 'ios-beaker',
id: '',
id: 'review-sample-manage',
name: '样品管理'
},
{
type: 'md-cloud',
id: '',
id: 'review-upload',
name: '附件'
},
{
type: 'ios-clock',
id: '',
id: 'review-record',
name: '操作日志'
}
],
......@@ -159,6 +172,9 @@ export default {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '提交审批':
this._submit('submit-flow')
break
case '驳回':
this._goBack()
break
......@@ -180,6 +196,9 @@ export default {
}
})
},
_submit(key) {
this.$refs.flow._open(key)
},
_exportTemplate() {
const data = {
downloadUrl:
......
<template>
<div>
<Modal
v-drag
v-model="showModal"
:title="modalTitle"
width="500px"
>
<div style="max-height:350px;overflow:auto">
<el-radio-group v-model="selectData" style="display: inline">
<el-radio
:label="item.flowId"
v-for="item in flowList"
:key="item.flowName"
border
style="width:47%;margin-left: 0;margin-right: 10px"
>{{item.flowName}}
</el-radio>
</el-radio-group>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"/>
</div>
</Modal>
<!--点击确定后,发起流程-->
<RenderedStartForm ref="startForm" @on-result-change="_close"/>
</div>
</template>
<script>
import ModalFooter from '../../../components/base/modalFooter'
import { processInstance, buttonFlow } from '../../../api'
import RenderedStartForm from './RenderedStartForm'
/**
* 根据按钮code选择流程
*/
export default {
name: 'SelectFlowByBtn',
components: { ModalFooter, RenderedStartForm },
data() {
return {
showModal: false,
modalTitle: '请选择流程',
getPage: {},
// 选中的数据
selectData: '',
flowList: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
// 按钮的code
btnCode: ''
}
},
methods: {
_open(btnCode) {
this.$nextTick(() => {
this.btnCode = btnCode
this.selectData = ''
this._hideLoading()
this._getFlowByBtn()
})
},
// 根据按钮code查询流程列表
_getFlowByBtn: async function() {
const result = await buttonFlow.list({ buttonCode: this.btnCode })
this.flowList = result
if (result && result.length > 1) {
// 超过一个需要进行选择
this.showModal = true
} else if (result && result.length === 1) {
// 一个则直接调用接口
this.selectData = result[0].flowId
this._startForm()
} else {
this.$message.warning('按钮暂无绑定流程,无法发起流程!')
}
},
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this.showModal = false
break
case '确定':
if (this.selectData !== '') {
this._startForm()
} else {
this.$message.warning('请选择一个流程!')
this._hideLoading()
}
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
// 发起流程 ----->1.有表单需要填写表单数据局;2.无表单直接发起
// 启动流程表单
_startForm: async function() {
const result = await processInstance.renderedStartForm(this.selectData)
if (result && result.renderedStartForm !== '') {
// 表单信息不为空,才弹出表单界面
this.$refs.startForm._open(result, this.selectData)
} else {
this._startOk()
}
},
_startOk: async function() {
const obj = {
processDefinitionId: this.selectData
}
const result = await processInstance.start(obj)
if (result) {
this.$message.success('发起成功,请到系统管理进行审批')
}
this._hideLoading()
},
_close() {
this.showModal = false
}
}
}
</script>
......@@ -57,6 +57,8 @@
import { soilEntrust, soilSample } from '../../api'
import Operation from '../../components/operation/Operation'
import importModal from '../../components/import/DownloadTemplateImport'
import photoManage from '../../components/file/instock-file-manage/FileManage'
import sampleFileManage from '../../components/file/sample-file-manage/FileManage'
import EntrustRegisterEdit from './EntrustRegisterEdit'
import RegisterDetail from './RegisterDetail'
import ViewDetail from './ViewDetail'
......@@ -74,7 +76,11 @@ export default {
// eslint-disable-next-line vue/no-unused-components
ViewDetail,
// eslint-disable-next-line vue/no-unused-components
Instock
Instock,
// eslint-disable-next-line vue/no-unused-components
sampleFileManage,
// eslint-disable-next-line vue/no-unused-components
photoManage
},
data() {
return {
......@@ -84,34 +90,34 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'instock-instock',
name: '入库'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
id: 'instock-edit',
name: '编辑'
},
{
type: 'ios-list',
id: '',
id: 'instock-view',
name: '查看'
},
{
type: 'ios-camera',
id: '',
id: 'instock-pic',
name: '照片'
},
{
type: 'md-cloud',
id: '',
id: 'instock-upload',
name: '附件'
},
{
type: 'md-remove-circle',
id: '',
id: 'instock-delete',
name: '删除'
}
],
......@@ -127,7 +133,7 @@ export default {
{ title: '项目负责人', key: 'projectLeader', width: 150, detail: true },
{ title: '入库单号', key: 'instockCode', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '数量', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
......@@ -251,9 +257,9 @@ export default {
},
_uploadPhoto(data) {
// 上传照片文件
this.currentComponent = 'FileManage'
this.currentComponent = 'photoManage'
this.$nextTick(() => {
this.$refs.refModal._open(data.id, 'aloneSampleId')
this.$refs.refModal._open(data.id, 'aloneSampleId', '照片管理')
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
......@@ -404,7 +410,7 @@ export default {
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.currentComponent = 'sampleFileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
......
......@@ -28,8 +28,8 @@
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
</Form-item>
<Form-item label="箱数" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入箱数"/>
<Form-item label="数量" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入数量"/>
</Form-item>
<Form-item @click.native="_selectRegisterPerson" label="登记人" prop="registrant" class="width-48">
<Input v-model="formObj.registrant" name="registrant" placeholder="请输入登记人"/>
......
......@@ -53,11 +53,23 @@
<script>
import { soilAptitude, soilEntrust, soilSample } from '../../api'
import MeterEntrustRecord from '../../components/operation/Operation'
import SampleFileManage from '../../components/file/sample-file-manage/FileManage'
import SamplePhotoManage from '../../components/file/instock-file-manage/FileManage'
import ViewDetail from './ViewDetail'
import CreateReport from './CreateReport'
export default {
components: {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord, ViewDetail, CreateReport },
MeterEntrustRecord,
// eslint-disable-next-line vue/no-unused-components
ViewDetail,
// eslint-disable-next-line vue/no-unused-components
CreateReport,
// eslint-disable-next-line vue/no-unused-components
SampleFileManage,
// eslint-disable-next-line vue/no-unused-components
SamplePhotoManage
},
data() {
return {
currentComponent: '',
......@@ -73,27 +85,32 @@ export default {
iconMsg: [
{
type: 'ios-list',
id: '',
id: 'instock-his-view',
name: '查看'
},
{
type: 'ios-cloud-download',
id: '',
id: 'instock-his-export',
name: '导出入库资料'
},
{
type: 'ios-cloud',
type: 'ios-camera',
id: '',
name: '照片'
},
{
type: 'ios-cloud',
id: 'instock-his-upload',
name: '附件'
},
{
type: 'ios-clock',
id: '',
id: 'instock-his-record',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
id: 'instock-his-delete',
name: '删除'
}
],
......@@ -108,7 +125,7 @@ export default {
{ title: '项目名称', key: 'projectName', width: 120 },
{ title: '项目负责人', key: 'projectLeader', width: 150, detail: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '数量', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
......@@ -152,6 +169,9 @@ export default {
case '资质项目':
this._itemModal(data.id)
break
case '照片':
this._uploadPhoto(data.id)
break
case '附件':
this._upload(data.id)
break
......@@ -341,10 +361,17 @@ export default {
_itemModal(data) {
this.$refs.refModal._open(data)
},
_uploadPhoto(data) {
// 上传照片文件
this.currentComponent = 'SamplePhotoManage'
this.$nextTick(() => {
this.$refs.refModal._open(data, 'aloneSampleId', '照片管理')
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.currentComponent = 'SampleFileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
......
......@@ -7,8 +7,8 @@
<Form-item @click.native="_storageModel()" label="库房号" prop="storehouse" style="width: 100%">
<Input v-model="formObj.storehouse" name="storehouse" placeholder="请输入库房号"/>
</Form-item>
<Form-item @click.native="_storageModel()" label="架位号" prop="shelfCode" style="width: 100%">
<Input v-model="formObj.shelfCode" name="shelfCode" placeholder="请输入架位号"/>
<Form-item @click.native="_storageModel()" label="货架号" prop="shelfCode" style="width: 100%">
<Input v-model="formObj.shelfCode" name="shelfCode" placeholder="请输入货架号"/>
</Form-item>
<Form-item label="入库人" prop="inStocker" style="width: 100%">
<Input v-model="formObj.inStocker" @click.native="_selectStaff" name="inStocker" readonly/>
......@@ -22,11 +22,11 @@
</Form-item>
<Form-item label="留存有效期:" prop="keepLimitTime" style="width: 100%;">
<!-- <Date-picker v-model="formObj.keepLimitTime" @on-change="_keepLimitTimeChange" type="date" split-panels style="width:100%;"-->
<!-- placeholder="请选择入库时间" name="keepLimitTime"></Date-picker>-->
<Select v-model="formObj.keepLimit" clearable name="keepLimit" style="width:150px" placeholder="请选择期限">
<Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option>
</Select>
<Date-picker v-model="formObj.keepLimitTime" @on-change="_keepLimitTimeChange" type="date" split-panels style="width:100%;"
placeholder="请选择入库时间" name="keepLimitTime"></Date-picker>
<!-- <Select v-model="formObj.keepLimit" clearable name="keepLimit" style="width:150px" placeholder="请选择期限">-->
<!-- <Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option>-->
<!-- </Select>-->
</Form-item>
</Form>
</div>
......
......@@ -22,7 +22,7 @@
<tr>
<th>钻孔名称</th>
<td>{{obj.boreholeName}}</td>
<th>箱数</th>
<th>数量</th>
<td>{{obj.casesNum}}</td>
</tr>
<tr>
......
......@@ -60,6 +60,8 @@
import { soilEntrust, soilSample } from '../../../api'
import Operation from '../../../components/operation/Operation'
import importModal from '../../../components/import/DownloadTemplateImport'
import SampleFileManage from '../../../components/file/sample-file-manage/FileManage'
import SamplePhotoManage from '../../../components/file/instock-file-manage/FileManage'
import EntrustRegisterEdit from './EntrustRegisterEdit'
import RegisterDetail from './RegisterDetail'
import ViewDetail from './ViewDetail'
......@@ -77,7 +79,11 @@ export default {
// eslint-disable-next-line vue/no-unused-components
ViewDetail,
// eslint-disable-next-line vue/no-unused-components
Outstock
Outstock,
// eslint-disable-next-line vue/no-unused-components
SampleFileManage,
// eslint-disable-next-line vue/no-unused-components
SamplePhotoManage
},
data() {
return {
......@@ -87,29 +93,34 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'outstock-outstock',
name: '出库'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
id: 'outstock-edit',
name: '编辑'
},
{
type: 'ios-list',
id: '',
id: 'outstock-view',
name: '查看'
},
{
type: 'md-cloud',
id: '',
id: 'outstock-upload',
name: '附件'
},
{
type: 'md-remove-circle',
type: 'ios-camera',
id: '',
name: '照片'
},
{
type: 'md-remove-circle',
id: 'outstock-delete',
name: '删除'
}
],
......@@ -125,7 +136,7 @@ export default {
{ title: '项目负责人', key: 'projectLeader', width: 150, detail: true },
{ title: '出库单号', key: 'outstockCode', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '数量', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
......@@ -235,6 +246,9 @@ export default {
case '附件':
this._upload(data.id)
break
case '照片':
this._uploadPhoto(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
......@@ -390,9 +404,17 @@ export default {
this.$refs.pageTable._hideLoading()
}
},
_uploadPhoto(data) {
// 上传照片文件
this.currentComponent = 'SamplePhotoManage'
this.$nextTick(() => {
this.$refs.refModal._open(data, 'aloneSampleId', '照片管理')
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.currentComponent = 'SampleFileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
......
......@@ -28,8 +28,8 @@
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
</Form-item>
<Form-item label="箱数" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入箱数"/>
<Form-item label="数量" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入数量"/>
</Form-item>
<Form-item @click.native="_selectRegisterPerson" label="登记人" prop="registrant" class="width-48">
<Input v-model="formObj.registrant" name="registrant" placeholder="请输入登记人"/>
......
......@@ -53,11 +53,23 @@
<script>
import { soilAptitude, soilEntrust, soilSample } from '../../../api'
import MeterEntrustRecord from '../../../components/operation/Operation'
import SampleFileManage from '../../../components/file/sample-file-manage/FileManage'
import SamplePhotoManage from '../../../components/file/instock-file-manage/FileManage'
import ViewDetail from './ViewDetail'
import CreateReport from './CreateReport'
export default {
components: {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord, ViewDetail, CreateReport },
MeterEntrustRecord,
// eslint-disable-next-line vue/no-unused-components
ViewDetail,
// eslint-disable-next-line vue/no-unused-components
CreateReport,
// eslint-disable-next-line vue/no-unused-components
SampleFileManage,
// eslint-disable-next-line vue/no-unused-components
SamplePhotoManage
},
data() {
return {
currentComponent: '',
......@@ -73,32 +85,37 @@ export default {
iconMsg: [
{
type: 'ios-redo',
id: '',
id: 'outstock-his-back',
name: '出库撤销'
},
{
type: 'ios-list',
id: '',
id: 'outstock-his-view',
name: '查看'
},
{
type: 'ios-cloud',
id: '',
id: 'outstock-his-upload',
name: '附件'
},
{
type: 'ios-cloud-download',
type: 'ios-camera',
id: '',
name: '照片'
},
{
type: 'ios-cloud-download',
id: 'outstock-his-export',
name: '导出出库资料'
},
{
type: 'ios-clock',
id: '',
id: 'outstock-his-record',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
id: 'outstock-his-delete',
name: '删除'
}
],
......@@ -112,7 +129,7 @@ export default {
{ title: '项目名称', key: 'projectName', width: 120 },
{ title: '项目负责人', key: 'projectLeader', width: 150, detail: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '数量', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
......@@ -162,6 +179,9 @@ export default {
case '附件':
this._upload(data.id)
break
case '照片':
this._uploadPhoto(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
......@@ -353,10 +373,17 @@ export default {
_itemModal(data) {
this.$refs.refModal._open(data)
},
_uploadPhoto(data) {
// 上传照片文件
this.currentComponent = 'SamplePhotoManage'
this.$nextTick(() => {
this.$refs.refModal._open(data, 'aloneSampleId', '照片管理')
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.currentComponent = 'SampleFileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
......
......@@ -22,7 +22,7 @@
<tr>
<th>钻孔名称</th>
<td>{{obj.boreholeName}}</td>
<th>箱数</th>
<th>数量</th>
<td>{{obj.casesNum}}</td>
</tr>
<tr>
......@@ -58,7 +58,10 @@
<th>出库接收人</th>
<td>{{obj.outStockReceiver}}</td>
</tr>
<tr>
<th>出库去向</th>
<td>{{obj.outGo}}</td>
</tr>
</tbody>
</table>
</div>
......@@ -97,7 +100,7 @@ export default {
} else {
this.showMoney = false
}
this.height = '350px'
this.height = '400px'
}
}
}
......
......@@ -82,11 +82,11 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'storehouse-place-add',
name: '添加',
componentName: 'StandardsManageEdit'
},
{ type: 'error', id: '', name: '删除' }
{ type: 'error', id: 'storehouse-place-deletes', name: '删除' }
],
// 表格
pageColumns: [
......@@ -100,16 +100,20 @@ export default {
iconMsg: [
{
type: 'md-create',
id: '',
id: 'storehouse-place-edit',
name: '编辑',
componentName: 'StandardsManageEdit'
},
{
type: 'md-apps',
id: '',
id: 'storehouse-place-view',
name: '查看试样'
},
{ type: 'md-remove-circle', id: '', name: '删除' }
{
type: 'md-remove-circle',
id: 'storehouse-place-delete',
name: '删除'
}
],
searchOpen: false,
getPage: {},
......
......@@ -97,7 +97,7 @@ export default {
warehouse: [
{ required: true, message: '库房号不能为空', trigger: 'blur' }
],
name: [{ required: true, message: '架位号不能为空', trigger: 'blur' }]
name: [{ required: true, message: '货架号不能为空', trigger: 'blur' }]
},
showEditModal: false,
classifyList: [
......
......@@ -108,7 +108,7 @@ export default {
pageColumns: [
{ title: '项目名称', key: 'projectName', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '数量', key: 'casesNum', width: 120 },
{ title: '收样时间', key: 'receiveTime', width: 120, date: true },
{ title: '收样人', key: 'receiver', width: 120 },
{ title: '登记时间', key: 'registTime', width: 120, date: true },
......
......@@ -12,7 +12,10 @@
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item class="search-item" label="库房号:">
<Input @on-enter="_formSearch" v-model="formObj.warehouse" name="warehouse" placeholder="请输入库房号" clearable/>
<Input @on-enter="_formSearch" v-model="formObj.storehouse" name="storehouse" placeholder="请输入库房号" clearable/>
</Form-item>
<Form-item class="search-item" label="货架号:">
<Input @on-enter="_formSearch" v-model="formObj.shelfCode" name="shelfCode" placeholder="请输入货架号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -68,6 +71,8 @@
<FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<BatchModal ref="batchModal" @on-result-change="_page"></BatchModal>
<stockSampleEdit ref="editModal" @on-result-change="_page"></stockSampleEdit>
<SampleFileManage ref="SampleFileManage" @on-result-change="_page"></SampleFileManage>
<SamplePhotoManage ref="SamplePhotoManage" @on-result-change="_page"></SamplePhotoManage>
</div>
</template>
......@@ -75,6 +80,8 @@
import { soilEntrust, soilSample } from '../../../api'
import ViewDetail from '../../soil-alone-sample/ViewDetail'
import Outstock from '../soil-alone-sample-outstock/Outstock'
import SampleFileManage from '../../../components/file/sample-file-manage/FileManage'
import SamplePhotoManage from '../../../components/file/instock-file-manage/FileManage'
import ViewSample from './ViewLocationEntrust'
import stockSampleEdit from './stockSampleEdit'
import BatchModal from './BatchModal'
......@@ -84,7 +91,9 @@ export default {
ViewSample,
ViewDetail,
BatchModal,
Outstock
Outstock,
SampleFileManage,
SamplePhotoManage
},
data() {
return {
......@@ -96,10 +105,14 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'storehouse-sample-submit',
name: '提交'
},
{ type: 'success', id: '', name: '批量填写' }
{
type: 'success',
id: 'storehouse-sample-batch-input',
name: '批量填写'
}
],
// 表格
pageColumns: [
......@@ -108,7 +121,7 @@ export default {
{ title: '入库日期', key: 'instockTime', date: true },
{ title: '留存有效期', key: 'keepLimitTime', date: true },
{ title: '库房号', key: 'storehouse' },
{ title: '架位号', key: 'shelfCode' }
{ title: '货架号', key: 'shelfCode' }
],
// 当前时间
currentTime: new Date().getTime(),
......@@ -116,21 +129,30 @@ export default {
iconMsg: [
{
type: 'md-create',
id: '',
id: 'storehouse-sample-edit',
name: '编辑',
componentName: 'StandardsManageEdit'
},
{
type: 'ios-list',
id: '',
id: 'storehouse-sample-view',
name: '查看'
},
{
type: 'md-cloud',
type: 'ios-camera',
id: '',
name: '照片'
},
{
type: 'md-cloud',
id: 'storehouse-sample-upload',
name: '附件'
},
{ type: 'md-remove-circle', id: '', name: '删除' }
{
type: 'md-remove-circle',
id: 'storehouse-sample-delete',
name: '删除'
}
],
searchOpen: false,
getPage: {},
......@@ -225,6 +247,9 @@ export default {
case '查看':
this._viewModal(true, data.id)
break
case '照片':
this._uploadPhoto(data.id)
break
case '附件':
this._upload(data.id)
break
......@@ -234,9 +259,14 @@ export default {
}
})
},
_uploadPhoto(data) {
// 上传照片文件
this.$refs.SamplePhotoManage._open(data, 'aloneSampleId', '照片管理')
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'aloneSampleId')
this.$refs.SampleFileManage._open(id, 'aloneSampleId')
},
_viewModal(edit, id) {
if (edit) {
......
......@@ -17,8 +17,8 @@
<Form-item class="search-item" label="库房号:">
<Input @on-enter="_formSearch" v-model="formObj.warehouse" name="warehouse" placeholder="请输入库房号" clearable/>
</Form-item>
<Form-item class="search-item" label="架位号:">
<Input @on-enter="_formSearch" v-model="formObj.receiveLocation" name="receiveLocation" placeholder="请输入架位号" clearable/>
<Form-item class="search-item" label="货架号:">
<Input @on-enter="_formSearch" v-model="formObj.receiveLocation" name="receiveLocation" placeholder="请输入货架号" clearable/>
</Form-item>
<Form-item class="search-item" label="项目名称:">
<Input @on-enter="_formSearch" v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称" clearable/>
......@@ -82,6 +82,8 @@
<FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<BatchModal ref="batchModal" @on-result-change="_page"></BatchModal>
<stockSampleEdit ref="editModal" @on-result-change="_page"></stockSampleEdit>
<SampleFileManage ref="SampleFileManage" @on-result-change="_page"></SampleFileManage>
<SamplePhotoManage ref="SamplePhotoManage" @on-result-change="_page"></SamplePhotoManage>
</div>
</template>
......@@ -89,6 +91,8 @@
import { soilEntrust, soilSample } from '../../../api'
import ViewDetail from '../../soil-alone-sample/ViewDetail'
import Outstock from '../soil-alone-sample-outstock/Outstock'
import SampleFileManage from '../../../components/file/sample-file-manage/FileManage'
import SamplePhotoManage from '../../../components/file/instock-file-manage/FileManage'
import ViewSample from './ViewLocationEntrust'
import stockSampleEdit from './stockSampleEdit'
import BatchModal from './BatchModal'
......@@ -98,7 +102,9 @@ export default {
ViewSample,
ViewDetail,
BatchModal,
Outstock
Outstock,
SampleFileManage,
SamplePhotoManage
},
data() {
return {
......@@ -110,7 +116,7 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'storehouse-sample-export',
name: '导出'
}
],
......@@ -124,7 +130,7 @@ export default {
{ title: '现场编号', key: 'siteNo' },
{ title: '项目名称', key: 'projectName' },
{ title: '库房号', key: 'warehouse' },
{ title: '架位号', key: 'receiveLocation' },
{ title: '货架号', key: 'receiveLocation' },
{ title: '进度', key: 'progress', status: true }
],
// 操作
......@@ -141,6 +147,11 @@ export default {
name: '查看'
},
{
type: 'ios-camera',
id: '',
name: '照片'
},
{
type: 'md-cloud',
id: '',
name: '附件'
......@@ -259,6 +270,9 @@ export default {
case '查看试样':
this._viewSample(data.name)
break
case '照片':
this._uploadPhoto(data.id)
break
case '查看':
this._viewModal(true, data.id)
break
......@@ -271,9 +285,14 @@ export default {
}
})
},
_uploadPhoto(data) {
// 上传照片文件
this.$refs.SamplePhotoManage._open(data, 'aloneSampleId', '照片管理')
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'aloneSampleId')
this.$refs.SampleFileManage._open(id, 'aloneSampleId')
},
_viewModal(edit, id) {
if (edit) {
......
......@@ -8,8 +8,8 @@
<Input v-model="formObj.storehouse" name="storehouse" placeholder="请输入库房号" style="width: 95%;"/>
<span @click="_storageModel()" style="font-size: 20px;color: #00b5ec">+</span>
</Form-item>
<Form-item label="架位号" prop="shelfCode " style="width: 100%">
<Input v-model="formObj.shelfCode " name="shelfCode" placeholder="请输入架位号"></Input>
<Form-item label="货架号" prop="shelfCode " style="width: 100%">
<Input v-model="formObj.shelfCode " name="shelfCode" placeholder="请输入货架号"></Input>
</Form-item>
</Form>
</div>
......
......@@ -23,8 +23,8 @@
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
</Form-item>
<Form-item label="箱数" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入箱数"/>
<Form-item label="数量" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入数量"/>
</Form-item>
<Form-item @click.native="_selectRegisterPerson" label="登记人" prop="registrant" class="width-48">
<Input v-model="formObj.registrant" name="registrant" placeholder="请输入登记人"/>
......
......@@ -57,6 +57,8 @@
import { soilEntrust, soilSample } from '../../api'
import Operation from '../../components/operation/Operation'
import importModal from '../../components/import/DownloadTemplateImport'
import sampleFileManage from '../../components/file/sample-file-manage/FileManage'
import SamplePhotoManage from '../../components/file/instock-file-manage/FileManage'
import EntrustRegisterEdit from './EntrustRegisterEdit'
import RegisterDetail from './RegisterDetail'
import ViewDetail from './ViewDetail'
......@@ -71,7 +73,11 @@ export default {
// eslint-disable-next-line vue/no-unused-components
RegisterDetail,
// eslint-disable-next-line vue/no-unused-components
ViewDetail
ViewDetail,
// eslint-disable-next-line vue/no-unused-components
sampleFileManage,
// eslint-disable-next-line vue/no-unused-components
SamplePhotoManage
},
data() {
return {
......@@ -81,34 +87,39 @@ export default {
btn: [
{
type: 'success',
id: '',
id: 'entrust-register-sample-register',
name: '来样登记'
},
{
type: 'success',
id: '',
id: 'entrust-register-submit',
name: '提交'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
id: 'entrust-register-edit',
name: '编辑'
},
{
type: 'ios-list',
id: '',
id: 'entrust-register-view',
name: '查看'
},
{
type: 'md-cloud',
type: 'ios-camera',
id: '',
name: '照片管理'
},
{
type: 'md-cloud',
id: 'entrust-register-upload',
name: '附件'
},
{
type: 'md-remove-circle',
id: '',
id: 'entrust-register-delete',
name: '删除'
}
],
......@@ -127,7 +138,7 @@ export default {
{ title: '工程类型', key: 'projectType', width: 120 },
{ title: '项目类型', key: 'itemType', width: 120 },
{ title: '接收状态', key: 'receiveStatus', width: 120 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '数量', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
......@@ -218,6 +229,9 @@ export default {
case '试验项目列表':
this._itemManage(data.id)
break
case '照片管理':
this._uploadPhoto(data.id)
break
case '附件':
this._upload(data.id)
break
......@@ -230,7 +244,14 @@ export default {
}
})
},
_uploadPhoto(data) {
// 上传照片文件
this.currentComponent = 'SamplePhotoManage'
this.$nextTick(() => {
this.$refs.refModal._open(data, 'aloneSampleId', '照片管理')
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_sampleManage(data) {
// 管理样品
this.currentComponent = 'SoilSampleManage'
......@@ -378,7 +399,7 @@ export default {
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.currentComponent = 'sampleFileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
......
......@@ -25,8 +25,8 @@
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
</Form-item>
<Form-item label="箱数" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入箱数"/>
<Form-item label="数量" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入数量"/>
</Form-item>
<Form-item label="工程类型:" class="width-48">
<Select v-model="formObj.projectType" clearable name="projectType" placeholder="请选择工程类型">
......@@ -70,7 +70,13 @@
/**
* 添加编辑分包商
*/
import { meterEntrust, meterSample, soilEntrust, soilSample } from '../../api'
import {
meterEntrust,
meterSample,
soilAptitude,
soilEntrust,
soilSample
} from '../../api'
import importModal from '../../components/import/DownloadTemplateImport'
import AutoComplete from '../../components/base/AutoCompletes'
import SampleItemSelect from '../meter-aptitude/standard-manage/SampleItemSelect'
......@@ -104,20 +110,7 @@ export default {
searchOpen: true,
testedCityData: [],
judgeType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
projectArray: [
{
name: '开发项目'
},
{
name: '井场项目'
},
{
name: '风电项目'
},
{
name: '其他'
}
],
projectArray: [],
itemArray: [
{
name: '深孔'
......@@ -686,6 +679,7 @@ export default {
this.edit = false
this._getProjectList()
this._getLeaderList()
this._getProjectArray()
this.showBtn = true
this.showModal = true
this._hideLoading()
......@@ -760,6 +754,16 @@ export default {
this.projectData = projectlist
}
},
_getProjectArray: async function() {
const result = await soilAptitude.getDictInfo({
type: '工程类型',
page: 1,
rows: 50
})
if (result) {
this.projectArray = result.records
}
},
_getLeaderList: async function() {
const result = await soilSample.getUserList()
if (result) {
......
......@@ -53,10 +53,20 @@
<script>
import { soilAptitude, soilEntrust } from '../../api'
import MeterEntrustRecord from '../../components/operation/Operation'
import SampleFileManage from '../../components/file/sample-file-manage/FileManage'
import SamplePhotoManage from '../../components/file/instock-file-manage/FileManage'
import ViewDetail from './ViewDetail'
export default {
components: {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord, ViewDetail },
MeterEntrustRecord,
// eslint-disable-next-line vue/no-unused-components
ViewDetail,
// eslint-disable-next-line vue/no-unused-components
SampleFileManage,
// eslint-disable-next-line vue/no-unused-components
SamplePhotoManage
},
data() {
return {
currentComponent: '',
......@@ -72,22 +82,27 @@ export default {
iconMsg: [
{
type: 'ios-list',
id: '',
id: 'receive-sample-view',
name: '查看'
},
{
type: 'ios-cloud',
type: 'ios-camera',
id: '',
name: '照片'
},
{
type: 'ios-cloud',
id: 'receive-sample-upload',
name: '附件'
},
{
type: 'ios-clock',
id: '',
id: 'receive-sample-record',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
id: 'receive-sample-delete',
name: '删除'
}
],
......@@ -105,7 +120,7 @@ export default {
{ title: '工程类型', key: 'projectType', width: 120 },
{ title: '项目类型', key: 'itemType', width: 120 },
{ title: '接收状态', key: 'receiveStatus', width: 120 },
{ title: '箱数', key: 'casesNum', width: 120 },
{ title: '数量', key: 'casesNum', width: 120 },
{ title: '登记日期', key: 'registTime', width: 120, date: true }
]
}
......@@ -149,6 +164,9 @@ export default {
case '资质项目':
this._itemModal(data.id)
break
case '照片':
this._uploadPhoto(data.id)
break
case '附件':
this._upload(data.id)
break
......@@ -167,6 +185,14 @@ export default {
}
})
},
_uploadPhoto(data) {
// 上传照片文件
this.currentComponent = 'SamplePhotoManage'
this.$nextTick(() => {
this.$refs.refModal._open(data, 'aloneSampleId', '照片管理')
})
// this.$refs.PhotoManage._open(id, 'entrustId')
},
_viewModal(edit, id) {
this.currentComponent = 'ViewDetail'
if (edit) {
......@@ -256,7 +282,7 @@ export default {
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.currentComponent = 'SampleFileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
......
......@@ -22,7 +22,7 @@
<tr>
<th>钻孔名称</th>
<td>{{obj.boreholeName}}</td>
<th>箱数</th>
<th>数量</th>
<td>{{obj.casesNum}}</td>
</tr>
<tr>
......@@ -48,6 +48,18 @@
<tr>
<th>留存有效期</th>
<td>{{$dateformat(obj.keepLimitTime,'yyyy-mm-dd')}}</td>
<th>深度</th>
<td>{{obj.receiveDepth}}</td>
</tr>
<tr>
<th>工程类型</th>
<td>{{obj.projectType}}</td>
<th>项目类型</th>
<td>{{obj.itemType}}</td>
</tr>
<tr>
<th>接收状态</th>
<td>{{obj.receiveStatus}}</td>
</tr>
</tbody>
</table>
......
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