Commit 6e998ebd by wangweidong

土工试验Lims初始化

parent bedfa32b
......@@ -59,6 +59,7 @@ export default {
webURL: process.env.WEB_URL,
staticURL: process.env.STATIC_URL,
ncURL: process.env.NC_URL,
recordURL: process.env.RECORD_URL,
transformRequest: [
// 后面数组中的函数必须返回一个字符串,或 ArrayBuffer,或 Stream
function(data) {
......
......@@ -9,9 +9,11 @@ export { default as sysForm } from './sys/sys-form'
export { default as sysTableColumn } from './sys/sys-table-column'
export { default as sysMessage } from './sys/sys-message'
export { default as sysOrg } from './sys/sys-org'
export { default as sysAddress } from './sys/sys-address'
export { default as lmsMarshalManage } from './lims/lms-marshal-manage'
export { default as lmsUserGroup } from './lims/lms-user-group'
export { default as lmsSupplier } from './lims/lms-supplier'
export { default as equip } from './lims/lms-equip-info'
/**
*工作流
......@@ -19,3 +21,21 @@ export { default as lmsSupplier } from './lims/lms-supplier'
export { default as flowProcess } from './workflow/flow-process'
export { default as workbench } from './meter/workbench/workbench'
/**
* 计量检定
*/
export { default as meterSubcontractor } from './meter/meter-subcontractor'
export { default as meterAptitude } from './meter/meter-aptitude'
export { default as meterManage } from './meter/meter-manage'
export { default as meterEntrust } from './meter/meter-entrust'
export { default as meterSample } from './meter/meter-sample'
export { default as meterManageItem } from './meter/meter-manage-item'
export { default as meterItem } from './meter/meter-item'
export { default as meterDevice } from './meter/meter-device'
export { default as meterContract } from './meter/meter-contract'
export { default as meterSampleQuote } from './meter/meter-sample-quote'
export { default as meterRecord } from './meter/meter-record'
export { default as meterSubContract } from './meter/meter-sub-contract'
export { default as meterPrint } from './meter/meter-print'
export { default as meterTemplate } from './meter/meter-template'
export { default as lmsBaseDict } from './lims/lms-base-dict'
/**
* 相关
* 用户编组
*/
import http from '../http'
export default {
getItem: data =>
http.get('/res/v1/dict/dict_class_item?classType=' + data).then(res => res),
getUserByGroupId: data =>
http.post('/res/v1/user_group/page_rel_user', data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
export default {
// page
page: data => http.post('meter/v1/standard/page', data).then(res => res),
getById: data => http.get('meter/v1/standard/' + data).then(res => res),
// 删除
deleteById: data =>
http.delete('meter/v1/standard/?ids=' + data).then(res => res),
// 保存
save: data => http.post('meter/v1/standard/', data).then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/standard/' + data.id, data.obj).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/contract/page', data).then(res => res),
pageHis: data =>
http
.post('meter/v1/contract/page_quote_register_his', data)
.then(res => res),
pageQuoteFirstReview: data =>
http
.post('meter/v1/contract/page_quote_first_review', data)
.then(res => res),
pageQuoteFirstReviewHis: data =>
http
.post('meter/v1/contract/page_quote_first_review_his', data)
.then(res => res),
pageQuoteSecondReview: data =>
http
.post('meter/v1/contract/page_quote_second_review', data)
.then(res => res),
pageQuoteSecondReviewHis: data =>
http
.post('meter/v1/contract/page_quote_second_review_his', data)
.then(res => res),
pageQuoteThirdReview: data =>
http
.post('meter/v1/contract/page_quote_third_review', data)
.then(res => res),
pageQuoteThirdReviewHis: data =>
http
.post('meter/v1/contract/page_quote_third_review_his', data)
.then(res => res),
pageAccepted: data =>
http.post('meter/v1/contract/page_accepted', data).then(res => res),
pageAcceptedHis: data =>
http.post('meter/v1/contract/page_accepted_his', data).then(res => res),
pageContractRegister: data =>
http
.post('meter/v1/contract/page_contract_register', data)
.then(res => res),
pageContractRegisterHis: data =>
http
.post('meter/v1/contract/page_contract_register_his', data)
.then(res => res),
pageContractReview: data =>
http.post('meter/v1/contract/page_contract_review', data).then(res => res),
pageContractReviewHis: data =>
http
.post('meter/v1/contract/page_contract_review_his', data)
.then(res => res),
pageContractForEntrust: data =>
http
.post('meter/v1/contract/page_contract_for_entrust', data)
.then(res => res),
pageContractFile: data =>
http.post('meter/v1/contract/page_contract_file', data).then(res => res),
submitQuoteFirstReview: data =>
http
.post('meter/v1/contract/submit_to_review_first?ids=' + data)
.then(res => res),
submitToContractRegister: data =>
http
.post('meter/v1/contract/submit_to_contract_register?ids=' + data)
.then(res => res),
submitToReviewThird: data =>
http
.post('meter/v1/contract/submit_to_review_third?ids=' + data)
.then(res => res),
submitToAccepted: data =>
http
.post('meter/v1/contract/submit_to_accepted?ids=' + data)
.then(res => res),
submitToContractReview: data =>
http
.post('meter/v1/contract/submit_to_contract_review?ids=' + data)
.then(res => res),
submitToReviewSecond: data =>
http
.post('meter/v1/contract/submit_to_review_second?ids=' + data)
.then(res => res),
getById: data => http.get('meter/v1/contract/' + data).then(res => res),
getVOById: data => http.get('meter/v1/contract/vo/' + data).then(res => res),
// 删除
deleteById: data =>
http.delete('meter/v1/contract/?ids=' + data).then(res => res),
// 初审退回
check: data =>
http
.post(
'meter/v1/contract/back_to_review_first?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
// 复审退回
checkSecond: data =>
http
.post(
'meter/v1/contract/back_review_second?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
// 报价单批准退回
approve: data =>
http
.post(
'meter/v1/contract/back_review_third?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
editDTO: data =>
https
.post('meter/v1/contract/edit_quote', JSON.stringify(data))
.then(res => res),
// 业务受理退回
reception: data =>
http
.post(
'meter/v1/contract/back_accepted?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
// 保存
save: data =>
https
.post('meter/v1/contract/add_aptitude', JSON.stringify(data))
.then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/contract/' + data.id, data.obj).then(res => res),
addQuote: data =>
https
.post('meter/v1/contract/add_quote', JSON.stringify(data))
.then(res => res),
addContractRegister: data =>
https
.post('meter/v1/contract/add_contract_register', JSON.stringify(data))
.then(res => res),
passContractReview: data =>
http.post('meter/v1/contract/pass_contract_review', data).then(res => res),
contractReviewBack: data =>
http.post('meter/v1/contract/contract_review_back', data).then(res => res),
getReviewById: data =>
http.get('meter/v1/contract/review/' + data).then(res => res),
getReviewDTOById: data =>
http.get('meter/v1/contract/review_record/' + data).then(res => res),
getReviewRecordById: data =>
http.get('meter/v1/contract/review_record/' + data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/test_device/page', data).then(res => res),
getById: data => http.get('meter/v1/test_device/' + data).then(res => res),
deleteById: data =>
http.delete('meter/v1/test_device/?ids=' + data).then(res => res),
// 保存
save: data => http.post('meter/v1/test_device/', data).then(res => res),
addEquipUse: data =>
https
.post('meter/v1/test_device/equip_user', JSON.stringify(data))
.then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/test_device/' + data.id, data.obj).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/entrust/page', data).then(res => res),
pagePrintEntrust: data =>
http.post('meter/v1/entrust/page_print_entrust', data).then(res => res),
pagePrintedEntrust: data =>
http.post('meter/v1/entrust/page_printed_entrust', data).then(res => res),
// list
pageList: data => http.get('res/v1/customer/list').then(res => res),
// querylist
pageQueryList: data =>
http.get('/res/v1/customer/list?cname=' + data).then(res => res),
pageSendEntrust: data =>
http
.post('meter/v1/entrust/page_send_draft_entrust', data)
.then(res => res),
pageSendEntrustHis: data =>
http
.post('meter/v1/entrust/page_send_draft_entrust_his', data)
.then(res => res),
pageDistributeEntrust: data =>
http
.post('meter/v1/entrust/page_distribute_entrust', data)
.then(res => res),
pageDistributeEntrustHis: data =>
http
.post('meter/v1/entrust/page_distribute_entrust_his', data)
.then(res => res),
pageGoOutEntrust: data =>
http.post('meter/v1/entrust/page_out_draft_entrust', data).then(res => res),
pageClientOnlineEntrust: data =>
http
.post('meter/v1/entrust/page_client_online_entrust', data)
.then(res => res),
pageGoOutEntrustHis: data =>
http
.post('meter/v1/entrust/page_out_draft_entrust_his', data)
.then(res => res),
pageOutTaskDistribute: data =>
http
.post('meter/v1/entrust/page_out_task_distribute', data)
.then(res => res),
pageOutTaskDistributeHis: data =>
http
.post('meter/v1/entrust/page_out_task_distribute_his', data)
.then(res => res),
pageEntrustReview: data =>
http.post('meter/v1/entrust/page_review_entrust', data).then(res => res),
pageEntrustProgress: data =>
http.post('meter/v1/entrust/page_entrust_progress', data).then(res => res),
pageEntrustReceive: data =>
http
.post('meter/v1/entrust/page_sample_receive_entrust', data)
.then(res => res),
pageEntrustReceiveHis: data =>
http
.post('meter/v1/entrust/page_sample_receive_entrust_his', data)
.then(res => res),
pageSubpackageEntrust: data =>
http
.post('meter/v1/entrust/page_subpackage_entrust', data)
.then(res => res),
pageSubpackageEntrustHis: data =>
http
.post('meter/v1/entrust/page_subpackage_entrust_his', data)
.then(res => res),
// 委托评审驳回
back: data =>
http
.post(
'meter/v1/entrust/review_back?ids=' +
data.ids +
'&reason=' +
data.remark
)
.then(res => res),
pageSubpackageInputEntrust: data =>
http
.post('meter/v1/entrust/page_subpackage_input_entrust', data)
.then(res => res),
// 操作日志
pageOutTaskOperation: data =>
http.post('meter/v1/entrust_record/page', data).then(res => res),
// 任务分配操作日志
pageTask: data =>
http.post('meter/v1/sample_record/page', data).then(res => res),
getById: data => http.get('meter/v1/entrust/' + data).then(res => res),
getVOById: data => http.get('meter/v1/entrust/vo/' + data).then(res => res),
deleteById: data =>
http.delete('meter/v1/entrust/?ids=' + data).then(res => res),
// 保存
save: data =>
https
.post('meter/v1/entrust/add_send_entrust', JSON.stringify(data))
.then(res => res),
saveOutEntrust: data =>
https
.post('meter/v1/entrust/add_out_entrust', JSON.stringify(data))
.then(res => res),
editDTO: data =>
https
.post('meter/v1/entrust/edit_entrust', JSON.stringify(data))
.then(res => res),
editOnlineDTO: data =>
https
.post('meter/v1/entrust/edit_online_entrust', JSON.stringify(data))
.then(res => res),
// 提交
submit: data =>
https
.post('meter/v1/entrust/submit_to_review?ids=' + data)
.then(res => res),
submitSkipReview: data =>
https
.post('meter/v1/entrust/submit_to_skip_review?ids=' + data)
.then(res => res),
submitToEntrustRegister: data =>
https
.post('meter/v1/entrust/submit_to_entrust_register?ids=' + data)
.then(res => res),
passReview: data =>
http.post('meter/v1/entrust/pass_review?ids=' + data).then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/entrust/' + data.id, data.obj).then(res => res),
// 省份
getProvince: data => http.post('/base/v1/province/list_all').then(res => res),
// 城市
getCity: data => http.post('/base/v1/city/list_' + data).then(res => res),
// 地区
getArea: data => http.post('/base/v1/area/list_' + data).then(res => res),
// 附件列表
attachmentPage: (url, data) => http.post(url, data).then(res => res),
// 附件删除
attachmentDelete: (url, data) => http.delete(url + data).then(res => res),
// 预览附件
attachmentPreview: data =>
http.post('/meter/v1/contract_attachment/preview/' + data).then(res => res),
// 委托附件预览
entrustPreview: data =>
http.post('/meter/v1/entrust_attachment/preview/' + data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/item/page', data).then(res => res),
pageTest: data => http.post('meter/v1/item/page_test', data).then(res => res),
// 个人任务
getById: data => http.get('meter/v1/item/' + data).then(res => res),
deleteById: data =>
http.delete('meter/v1/item/?ids=' + data).then(res => res),
// 保存
save: data =>
https
.post('meter/v1/item/add_send_entrust', JSON.stringify(data))
.then(res => res),
saveItems: data =>
http
.post(
'meter/v1/item/add_sample_item?sampleIds=' +
data.sampleIds +
'&itemIds=' +
data.itemIds
)
.then(res => res),
testValue: data =>
http
.post(
'meter/v1/item/bath_write_value/' +
data.itemIds +
'?testValue=' +
data.testValue
)
.then(res => res),
_handJudge: data =>
http.post('meter/v1/item/hand_judge/' + data.ids, data).then(res => res),
testEnd: data =>
http
.post(
'meter/v1/item/bath_test_end?itemIds=' +
data.ids +
'&sampleId=' +
data.sampleId
)
.then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/aptitude_item/page', data).then(res => res),
getById: data => http.get('meter/v1/aptitude/' + data).then(res => res),
// 删除
deleteById: data =>
http.delete('meter/v1/aptitude/?ids=' + data).then(res => res),
deleteItemById: data =>
http.delete('meter/v1/aptitude_item/?ids=' + data).then(res => res),
// 保存
save: data =>
https
.post('meter/v1/aptitude/add_aptitude', JSON.stringify(data))
.then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/aptitude/' + data.id, data.obj).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/aptitude/page', data).then(res => res),
pageForQuote: data =>
http.post('meter/v1/aptitude/page_for_quote', data).then(res => res),
pageBeyond: data =>
http.post('meter/v1/aptitude/page_beyond', data).then(res => res),
getById: data => http.get('meter/v1/aptitude/' + data).then(res => res),
// 删除
deleteById: data =>
http.delete('meter/v1/aptitude/?ids=' + data).then(res => res),
// 保存
save: data =>
https
.post('meter/v1/aptitude/add_aptitude', JSON.stringify(data))
.then(res => res),
// 保存
saveBeyond: data =>
https
.post('meter/v1/aptitude/add_beyond_aptitude', JSON.stringify(data))
.then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/aptitude/' + data.id, data.obj).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
export default {
// 证书模板
pageSampleInputRecordTemp: data =>
http.post('/print/v1/template_category/list_type', data).then(res => res),
// 实验室原始记录模板名称
pageSampleTemplate: data =>
http.post('/print/v1/template/page', data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
export default {
// page
pageContractRecord: data =>
http.post('meter/v1/contract_record/page', data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
export default {
// page
page: data => http.post('meter/v1/sample_quote/page', data).then(res => res),
pageInAptitude: data =>
http.post('meter/v1/sample_quote/page_in_aptitude', data).then(res => res),
pageSubSample: data =>
http.post('meter/v1/sample_quote/page_out_sample', data).then(res => res),
getById: data => http.get('meter/v1/sample_quote/' + data).then(res => res),
deleteById: data =>
http.delete('meter/v1/sample_quote/?ids=' + data).then(res => res),
// 保存
save: data => http.post('meter/v1/sample_quote/', data).then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/sample_quote/' + data.id, data.obj).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data =>
http.post('meter/v1/sub_contract/page_vo', data).then(res => res),
pageSubmit: data =>
http.post('meter/v1/sub_contract/page_have_submit', data).then(res => res),
getById: data => http.get('meter/v1/sub_contract/' + data).then(res => res),
getDTOById: data =>
http.get('meter/v1/sub_contract/dto/' + data).then(res => res),
// 删除
deleteById: data =>
http.delete('meter/v1/sub_contract/?ids=' + data).then(res => res),
// 保存
save: data => http.post('meter/v1/sub_contract/', data).then(res => res),
submit: data =>
http.post('meter/v1/sub_contract/submit?ids=' + data).then(res => res),
addSubContract: data =>
https
.post('meter/v1/sub_contract/add_sub_contract', JSON.stringify(data))
.then(res => res),
editSubContract: data =>
https
.post('meter/v1/sub_contract/edit_sub_contract', JSON.stringify(data))
.then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/sub_contract/' + data.id, data.obj).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
export default {
// page
page: data => http.post('meter/v1/subcontractor/page', data).then(res => res),
getById: data => http.get('meter/v1/subcontractor/' + data).then(res => res),
deleteById: data =>
http.delete('meter/v1/subcontractor/?ids=' + data).then(res => res),
// 保存
save: data => http.post('meter/v1/subcontractor/', data).then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/subcontractor/' + data.id, data.obj).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
export default {
// 证书模板
pageTemplate: data =>
http.post('meter/v1/file_template/page', data).then(res => res),
getById: data => http.get('meter/v1/file_template/' + data).then(res => res),
edit: data =>
http
.put('meter/v1/file_template/' + data.id, data.formObj)
.then(res => res),
deleteById: data =>
http.delete('meter/v1/file_template/?ids=' + data).then(res => res)
}
/**
* 组织表相关
*/
import http from '../http'
export default {
page: data => http.post('/base/v1/org/page', data).then(res => res),
add: data => http.post('/base/v1/org/', data).then(res => res)
}
<template>
<div>
<el-dialog title="上传文件" :visible.sync="dialogFileUploadVisible" width="120">
<el-upload
drag
:action="action"
multiple>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'HBody',
components: {},
props: {
isCollapse: null
},
data() {
return {
menuList: [],
dialogFileUploadVisible: false,
action: '',
icon: 'el-icon-message',
clientHeight: 'height 500px'
}
},
mounted() {
this._getHeight()
},
methods: {
handleSelect(key, keyPath) {
console.log('KEYpATH===========', keyPath)
this.$router.push(keyPath[1])
},
_open(url) {
this.dialogFileUploadVisible = true
this.action = url
},
_getHeight() {
this.clientHeight =
'height: ' + (document.documentElement.clientHeight - 100) + 'px;'
}
}
}
</script>
<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 120px;
min-height: 200px;
}
</style>
......@@ -17,22 +17,24 @@
<!--</Dropdown>-->
<el-dropdown
@command="_dropDown"
trigger="click"
size="small"
placement="bottom-start"
style="width:100%;"
@command="_dropDown"
class="dropdownBox"
>
<Input
v-model="value"
v-model="dataValue"
:name="name"
:placeholder="placeholder"
icon="ios-search"
style="width:100%"
:class="{'iview-input-error':showError === ''}"
@on-change="_query"
@on-blur="_inputBlur"
@on-focus="_inputFocus"
:maxlength="maxlength?maxlength:10000"
icon="ios-search"
style="width:100%"
/>
<el-dropdown-menu slot="dropdown" style="max-height: 200px;overflow: auto;">
<el-dropdown-item v-for="(item,index) in downData" :key="index" :command="item">
......@@ -45,33 +47,54 @@
<script>
export default {
// props: [
// 'name',
// 'showKey',
// 'placeholder',
// 'downData',
// 'value',
// 'showError',
// 'blur',
// 'focus',
// 'handleObj'
// ],
props: {
name: null,
showKey: null,
placeholder: null,
downData: null,
value: null,
// 当此值为空时,显示红框
showError: null,
blur: null,
focus: null,
handleObj: null
handleObj: null,
maxlength: null
},
data() {
return {
selectObj: {},
value: null
// value: null
dataValue: this.value,
dataHandObj: this.handleObj
// isFocus: false
}
},
watch: {
value: function(newVal, oldVal) {
console.log(newVal)
this.dataValue = newVal
}
},
mounted() {},
methods: {
// 选择
_dropDown(data) {
this.$emit('on-result-change', 'select', data, this.handleObj)
this.$emit('on-result-change', 'select', data, this.dataHandObj)
if (this.showKey) {
this.value = data[this.showKey]
this.dataValue = data[this.showKey]
} else {
this.value = data
this.dataValue = data
}
this.selectObj = data
// this.isFocus = false;
......@@ -80,33 +103,47 @@ export default {
_query() {
if (this.showKey) {
const obj = {}
obj[this.showKey] = this.value
this.$emit('on-result-change', 'query', obj, this.handleObj)
obj[this.showKey] = this.dataValue
this.$emit('on-result-change', 'query', obj, this.dataHandObj)
} else {
this.$emit('on-result-change', 'query', this.value, this.handleObj)
this.$emit(
'on-result-change',
'query',
this.dataValue,
this.dataHandObj
)
// console.log(this.dataValue)
}
},
_inputBlur() {
if (this.value && this.blur !== undefined) {
if (this.dataValue && this.blur !== undefined) {
// 失去焦点有值时触发
this.$emit('on-result-change', 'blur', '', this.handleObj)
this.$emit('on-result-change', 'blur', '', this.dataHandObj)
}
},
// 聚焦
_inputFocus() {
console.log('下拉选项', this.downData, this.showKey)
// this.isFocus = true;
if (this.focus !== undefined) {
this.$emit('on-result-change', 'focus', '', this.handleObj)
this.$emit('on-result-change', 'focus', '', this.dataHandObj)
}
}
}
}
</script>
<style>
.ivu-modal-mask {
z-index: 1000 !important;
}
.ivu-modal-wrap {
z-index: 1000 !important;
}
.iview-input-error .ivu-input {
border: 1px solid #eb6877 !important;
}
.el-dropdown-menu__item {
z-index: 3000 !important;
max-width: 400px !important;
}
</style>
<template>
<div>
<!--<Cascader-->
<!--:data="casData"-->
<!--:load-data="loadData"-->
<!--@on-change="_casChange"-->
<!--placeholder="请选择省、市、区"-->
<!--clearable-->
<!--v-model="value"-->
<!--:name="name"-->
<!--transfer></Cascader>-->
<Cascader
:data="casData"
:load-data="loadData"
@on-change="_casChange"
transfer
change-on-select>
<Input
v-model="value"
@on-change="_clear"
placeholder="请选择省、市、区"
readonly
clearable
/>
</Cascader>
</div>
</template>
<script>
import { meterEntrust } from '../../api'
/**
* 省、市、县 级联选择
*/
export default {
props: {
value: null,
name: null
},
data() {
return {
casData: []
}
},
mounted() {
this._getProvince()
},
methods: {
_getProvince: async function(data) {
// 获取省份
const result = await meterEntrust.getProvince()
// this.$store.dispatch('SysProvince/getProvince').then(() => {
// const result = this.$store.state.SysProvince.list
const casData = []
for (let i = 0; i < result.length; i++) {
casData.push({
label: result[i].label,
value: result[i].label,
valueName: result[i].value,
children: [],
loading: false
})
}
this.casData = casData
// })
},
loadData: async function(item, callback) {
const val = item.__value
item.loading = true
if (val.length <= 1) {
// 不存在逗号
const result = await meterEntrust.getCity(item.valueName)
if (result === undefined) {
}
const cityData = []
for (let i = 0; i < result.length; i++) {
cityData.push({
label: result[i].label,
value: result[i].label,
valueName: result[i].value,
children: [],
loading: false
})
}
item.children = cityData
item.loading = false
callback()
} else {
const result = await meterEntrust.getArea(item.valueName)
const areaData = []
for (let i = 0; i < result.length; i++) {
areaData.push({
label: result[i].label,
value: result[i].label,
valueName: result[i].value
})
}
item.children = areaData
item.loading = false
callback()
}
},
// 省、市、区都可选
_casChange(value, selectedData) {
const tempData = {
value: value,
selectedData: selectedData
}
switch (selectedData.length) {
case 1:
selectedData[1] = { label: '', value: '' }
selectedData[2] = { label: '', value: '' }
value[1] = ''
value[2] = ''
break
case 2:
selectedData[2] = { label: '', value: '' }
value[2] = ''
break
}
this.$emit('on-result-change', this.name, tempData)
},
// 数据改变(删除数据的时候用)
_clear() {
const tempData = {
value: ['', '', '']
}
this.$emit('on-result-change', this.name, tempData, 'clear')
}
}
}
</script>
<style>
.ivu-cascader-transfer {
z-index: 1160;
}
</style>
<template>
<div>
<Modal
:title="modalTitle"
v-model="showModalConfirm"
:closable="false"
:mask-closable="false"
:width="420"
class="modal-confirm zIndex-1200">
<div class="modal-confirm-flex">
<div><i class="ivu-icon ivu-icon-help-circled"></i></div>
<div><p class='content-p'>{{content}}</p></div>
</div>
<div slot="footer">
<Button :type="item.type === '' ? 'text' : 'primary' " v-for="(item,index) in btnModalList" :key="index"
@click="_btnModal(item.name,index)" :loading="isLoading !== undefined &&loading === true && currentIndex === index"
style="margin:0 3px;" size="large">
{{item.name}}
</Button>
</div>
</Modal>
</div>
</template>
<script>
/**
* modal 确认弹框提示(底部多个按钮)
*
**/
export default {
name: 'ModalConfirm',
props: {
btnModalList: null,
content: null,
isLoading: null // 是否显示loading
},
data() {
return {
showModalConfirm: false,
modalTitle: '提示',
// 用于区别modal
modalName: '',
// 临时数据存储
tempObj: {},
loading: false,
currentIndex: -1
}
},
methods: {
_openModal(name, tempObj) {
this.showModalConfirm = true
this.currentIndex = -1
this._isLoading(false)
this.loading = false
if (name === undefined) {
this.modalName = 'confirmModal'
} else {
this.modalName = name
}
this.tempObj = tempObj || {}
},
_closeModal() {
this.showModalConfirm = false
this._isLoading(false)
},
// loading 显示与否
_isLoading(msg) {
if (this.isLoading !== undefined) {
this.loading = msg
}
},
_btnModal(name, index) {
this.currentIndex = index
if (name === '取消') {
this._closeModal()
}
this.$emit('on-result-change', name, this.modalName, this.tempObj)
},
// 取消loading
_cancelLoading() {
this.isLoading = false
}
}
}
</script>
<style scoped>
.modal-confirm .ivu-modal-header {
border-bottom: none !important;
}
.modal-confirm .ivu-modal-body {
padding: 20px !important;
}
.modal-confirm .ivu-modal-footer {
border-top: none !important;
}
.modal-confirm i {
color: #f90 !important;
}
.modal-confirm i {
font-size: 36px !important;
}
.modal-confirm .modal-confirm-flex {
display: flex;
justify-content: flex-start;
text-align: center;
}
.modal-confirm-flex div {
margin-right: 10px;
}
.content-p {
margin-top: 5px;
margin-bottom: 0;
}
</style>
<template>
<div>
<vxe-grid
ref="xTable"
:show-overflow="hideOverflow === undefined || hideOverflow === true?true:false"
:auto-resize="true"
:height="500"
:loading="loading"
:pager-config="
hidePage === undefined?{total:getPage.total,currentPage:getPage.current,pageSize:getPage.size,pageSizes:pageSizeOpts,background:true}:null"
:scroll-y="setOptimization === undefined?defOptimization:setOptimization"
:checkbox-config="selectConfig"
@checkbox-all="_selectAll"
@checkbox-change="_selectRowChange"
@page-change="_pageSizeChange"
:cell-class-name="_tableCellClassName"
:row-class-name="_tableRowClassName"
:edit-config="editConfig"
:row-key="true"
:tooltip-config="{enterable:true}"
size="mini"
border
resizable
stripe
show-header-overflow
>
<vxe-table-column
v-if="hideCheckbox===undefined || hideCheckbox === false"
type="checkbox"
fixed="left"
width="50"
align="center"/>
<vxe-table-column
type="seq"
fixed="left"
title="序号"
width="50"
align="center"/>
<slot></slot>
<vxe-table-column
:width="$optColWidth(iconMsg)"
v-if="$optColWidth(iconMsg)>0?true:false"
title="操作"
align="center" fixed="right">
<template slot-scope="scope">
<VXEIconList :msg="iconMsg" @on-result-change="_iconClick" :rowData="scope.row"
:rowIndex="scope.rowIndex"></VXEIconList>
</template>
</vxe-table-column>
<slot name="col"></slot>
</vxe-grid>
<!--自定义表格列-->
<div style="position: absolute;right:0;top:0;z-index:2000">
<slot name="setting"></slot>
</div>
</div>
</template>
<script>
/**
* VXE-TABLE 数据录入用(分包数据录入,检测数据录入 专用)
*/
import VXEIconList from '../base/VXEIconList'
export default {
components: { VXEIconList },
props: {
hideOverflow: null,
hidePage: null,
pageColumns: null,
// tableHeight: 500,
hideCheckbox: null,
optColWidth: null,
getPage: null,
iconMsg: null,
warnKey: null,
selectData: null,
hideElevator: null,
hideTotal: null,
hideSizer: null,
clickValue: null, // 单击返回值
noWarning: null, // 不显示警告提示
isDataTest: null, // 判断是否是数据检测
tableName: null, // 该值存在,则支持自定义表格
setOptimization: null, // 加载滚动配置项
rows: null
},
data() {
return {
formId: '',
extendsData: {},
loading: false,
pageParams: {
page: 1,
rows: this.rows !== undefined ? this.rows : this.$defRow
},
rowData: {},
checkData: [],
sampleHandleValue: '',
// 一系列配置
pageSizeOpts: [50, 100, 500, 1000],
// 默认的配置
defOptimization: this.$setOptimization(),
selectConfig: { checkField: 'checked', trigger: 'row' },
editConfig: {
trigger: 'click',
mode: 'cell',
showIcon: true,
autoClear: false,
showStatus: true
}
}
},
watch: {
// // 监听数据
'getPage.records': function(newVal, oldVal) {
this._loadData(newVal)
}
},
methods: {
_loadData(data) {
// 阻断 vue 对大数组的双向绑定,大数据性能翻倍提升
if (this.$refs.xTable) {
this.$refs.xTable.loadData(data)
}
},
// 刷新column 和刷新数据
_refreshColumn() {
this.$refs.xTable.refreshColumn()
this.$refs.xTable.syncData()
},
_pageSizeChange(row) {
switch (row.type) {
case 'size':
this.pageParams.page = 1
this.pageParams.rows = row.pageSize
this._pageParamsChange()
break
case 'current':
this._pageChange(row.currentPage)
break
}
},
_pageChange(page) {
this.pageParams.page = page
this._pageParamsChange()
},
_pageParamsChange() {
this.$emit('on-result-change', 'changeSize')
},
_searchParams() {
const data = {}
const serData = this.$serialize(this.formId)
Object.assign(data, serData, this.extendsData)
if (this.hidePage === undefined) {
return this.$extend(data, this.pageParams)
} else {
return this.$extend(data)
}
},
_page(formId, uri, extendsData) {
this.loading = true
if (this.tableName !== undefined) {
// tableName存在-----支持自定义表格
this._settingCol(formId, uri, extendsData)
} else {
this._pageTemp(formId, uri, extendsData)
}
},
_settingCol(formId, uri, extendsData) {
if (uri) {
// 为了避免uri为undefined
this.$store
.dispatch('SysTableColumn/getByTableName', this.tableName)
.then(() => {
// 查询用户下的表格数据
const userTableCode = this.$store.state.SysTableColumn.model
this.$emit(
'on-result-change',
'table-col',
this.$tableColumns(this.pageColumns, userTableCode)
)
this._pageTemp(formId, uri, extendsData)
})
}
},
// 临时
_pageTemp(formId, uri, extendsData) {
this.formId = formId
if (extendsData) {
this.extendsData = extendsData
}
this.$store.dispatch(uri, this._searchParams()).then(() => {
this.loading = false
this.$emit('on-result-change', 'page', '')
this._refreshColumn()
})
},
// 多选
_selectAll: function(data) {
this._selectRowChange(data)
},
_selectRowChange(data) {
// 可编辑单元格
if (this.hideCheckbox === undefined || this.hideCheckbox === false) {
const selData = data.selection
this.checkData = selData
// 默认返回的是id数组
if (this.selectData === undefined) {
const idList = []
for (let i = 0; i < selData.length; i++) {
idList.push(selData[i].id)
}
this.$emit('on-result-change', 'selectIds', idList)
this.$emit('on-result-change', 'selectData', selData)
} else {
// 有selectData参数时执行
this.$emit('on-result-change', 'selectData', selData)
}
}
},
// 单元格变色
_tableCellClassName({ row, column, rowIndex, columnIndex }) {
// if (column.property === 'name' && row['progress'] && row.progress.display.indexOf('退回') !== -1) {//含有退回就变红
// return 'cell-red';
// }
if (
column.property === 'serviceType' &&
row.serviceType &&
row.serviceType.indexOf('加急') !== -1
) {
// 含有加急就变红
return 'cell-red'
}
// if (column.property === 'name' && row['name'] && row.name.indexOf('复测') !== -1) {//含有加急就变红
// return 'cell-red';
// }
},
// 整行变色
_tableRowClassName({ row, rowIndex }) {
// console.log('row==', row, rowIndex)
if (this.checkData.length !== 0) {
/* 选中的进行高亮显示 */
const index = this.checkData.indexOf(row)
if (index !== -1) {
return 'high-light-row'
}
} else {
/* 没选中的根据页面逻辑变色 */
}
},
// 操作列回调
_iconClick(name, rowData, componentName, rowIndex, obj) {
this.$emit('on-result-change', 'iconClick', {
name: name,
rowData: rowData,
componentName: componentName,
rowIndex: rowIndex,
obj: obj
})
},
// 关闭loading
_hideLoading() {
this.loading = false
},
// 打开loading
_showLoading() {
this.loading = true
},
// 清空选中checkbox状态
_clearSelection() {
this.$nextTick(function() {
this.$refs.xTable.clearCheckboxRow()
})
this.checkData = []
if (this.hideCheckbox === undefined || this.hideCheckbox === false) {
if (this.selectData === undefined) {
this.$emit('on-result-change', 'selectIds', [])
} else {
this.$emit('on-result-change', 'selectData', [])
}
}
},
// 激活单元格编辑 row:当前行数据,field:单元格的英文名称
_activeCell(obj) {
this.$refs.xTable.setActiveCell(obj.row, obj.field)
if (obj.msg === 'left') {
// 向左返回的时候 清除滚动状态
this.$refs.xTable.clearScroll()
}
},
// 只刷新选中行的数据
_refreshRows(rowList) {
const records = this.getPage.records
for (let i = 0; i < rowList.length; i++) {
const index = records.findIndex(item => item.id === rowList[i].id)
if (index !== -1) {
this.$set(this.getPage.records, index, rowList[i])
}
}
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div>
<Row :gutter=gutter>
<Col :span="leftSpan">
<Card>
<p slot="title" style="width: 60%;">{{leftName}}</p>
<p slot="title" style="width: 40%;text-align: right">
<a @click="_refresh" class="blue-color">
<Icon type="refresh" size="20"></Icon>
</a>
</p>
<div>
<slot name="left"></slot>
</div>
</Card>
</Col>
<Col :span="rightSpan">
<Card>
<p slot="title">{{rightName}}</p>
<div>
<slot name="right"></slot>
</div>
</Card>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
gutter: null,
leftName: null,
rightName: null,
leftSpan: null
},
data() {
return {
rowGutter: this.gutter ? this.gutter : 0
}
},
computed: {
rightSpan: function() {
return 24 - this.leftSpan
}
},
methods: {
// 刷新
_refresh() {
this.$emit('on-result-change')
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Tooltip v-for="item in msg" :content="item.name" :key="item.name" transfer>
<span v-if="item.disabled">
<Icon :type="item.type"
:id="item.id"
v-if="$showBtn(item.id)"
:style="objStyle" style="margin-left: 5px" class="marRight-10 icons"
size=20></Icon>
</span>
<span v-else>
<!--预览或预览编辑报告 需要选中前面的checkbox-->
<Icon :type="item.type"
:id="item.id"
v-if="$showBtn(item.id) && (item.name.indexOf('预览') !== -1)"
@click.native="_iconClick(item.name,item.componentName,rowIndex,item.id)" style="margin-left: 5px" class="marRight-10 icons"
size=20></Icon>
<Icon :type="item.type"
:id="item.id"
v-else-if="$showBtn(item.id)"
@click.native.stop="_iconClick(item.name,item.componentName,rowIndex,item.id)" style="margin-left: 5px" class="marRight-10 icons"
size=20></Icon>
</span>
</Tooltip>
</div>
</template>
<script>
/**
* VXE-TABLE ICON-LIST
*/
export default {
props: {
msg: null, // 任何类型
id: null,
rowData: null,
rowIndex: null // 当前行的索引值
},
data() {
return {
objStyle: {
color: '#999',
cursor: 'not-allowed'
}
}
},
methods: {
_iconClick(name, componentName, rowIndex, btnId) {
// 按钮点击事件
this.$emit(
'on-result-change',
name,
this.rowData,
componentName,
rowIndex,
{ btnId: btnId }
)
}
}
}
</script>
<template>
<div>
<!--阿里巴巴图标-->
<div>
<div class="col-setting">
<span @click="_checkClick" style="cursor: pointer">
<i class="pt-ivu-icon pt-setting" style="color: #00a0e9;font-size: 20px"></i>
</span>
</div>
</div>
<!--阿里巴巴图标-->
<!--select-table-start-modal-->
<div>
<Modal v-model="showSelectModal" width="700" class="zIndex-1300">
<p slot="header">{{modalTitle}}</p>
<div>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="_checkAll">{{title}}</el-checkbox>
<el-checkbox-group v-model="checkList" @change="_selectChange" style="margin-top:10px">
<el-checkbox :label="item.key" v-for="item in tableColumns" :key="item.key"
style="width:25%;margin-left: 0">{{item.title}}
</el-checkbox>
</el-checkbox-group>
</div>
<div slot="footer" class="btn-width">
<Button @click="_cancel" style="margin-left: 8px">取消</Button>
<Button @click="_ok" :loading="isLoading" type="primary">保存</Button>
</div>
</Modal>
</div>
<!--select-table-end-modal-->
</div>
</template>
<script>
/* VXE-TABLE 自定义表格列 */
export default {
props: {
pageColumns: null, // table 列(自己选中需要展示的)
tableName: null, // 表格的名字(英文)
userColumns: null // 用户自己选中的列 code
},
data() {
return {
// 自定义列
checkList: [],
modalTitle: '自定义列',
showSelectModal: false,
checkAll: false,
isIndeterminate: true, // 设置 indeterminate 状态,只负责样式控制
title: '',
tableColumns: [], // 从企业中获得的表格数据
isLoading: false
}
},
methods: {
_checkClick() {
this.showSelectModal = true
this.isLoading = false
// 查询该企业下表格列(根据表格名称)
this._getByNameCompany()
},
_getByNameCompany() {
this.$store
.dispatch('SysTableColumn/getByNameCompany', this.tableName)
.then(() => {
const result = this.$store.state.SysTableColumn.model
/** *********企业的表格信息与本地pageColumns比较(如果企业没有选择表格,则显示全部表格列信息)***********/
const tableColumns = []
for (let i = 0; i < this.pageColumns.length; i++) {
result.map(item => {
if (item === this.pageColumns[i].key) {
tableColumns.push(this.pageColumns[i])
}
})
}
this.tableColumns = tableColumns
/** ********************************************用户选中的数据*************************************/
// 用户没选中则勾选的是企业的表格数据
const userData =
this.userColumns.length === 0 ? this.tableColumns : this.userColumns
const checkList = []
for (let k = 0; k < userData.length; k++) {
checkList.push(userData[k].key)
}
this.checkList = checkList
/** **********************************************是否全部选中*************************************/
if (checkList.length === this.tableColumns.length) {
// 全部选中
this.checkAll = true
this.isIndeterminate = false
this.title = '全不选'
} else {
this.checkAll = false
this.isIndeterminate = true
this.title = '全选'
}
})
},
// 选中的checkbox
_selectChange(data) {
this.checkList = data
const checkedCount = data.length
this.checkAll = checkedCount === this.tableColumns.length
this.isIndeterminate =
checkedCount > 0 && checkedCount < this.tableColumns.length
if (this.checkAll) {
this.title = '全不选'
} else {
this.title = '全选'
}
},
// 全选
_checkAll(val) {
this.isIndeterminate = false
if (val) {
// 全选
const checkList = []
for (let k = 0; k < this.tableColumns.length; k++) {
checkList.push(this.tableColumns[k].key)
}
this.checkList = checkList
this.title = '全不选'
} else {
// 全不选
this.checkList = []
this.title = '全选'
}
},
// 保存
_ok() {
if (this.checkList.length === 0) {
this.$Message.warning('请至少选择一项数据!')
} else {
this.isLoading = true
const data = {
tableName: this.tableName,
codes: this.checkList
}
this.$store.dispatch('SysTableColumn/userSave', data).then(() => {
if (this.$store.state.SysTableColumn.success) {
this.$Message.success('保存成功')
this.$emit('on-result-change')
this._cancel()
this.isLoading = false
} else {
this.isLoading = false
}
})
}
},
// 取消
_cancel() {
this.showSelectModal = false
}
}
}
</script>
<style>
.col-setting {
padding: 0px 5px;
border-top: 1px solid #ebeef5;
border-right: 1px solid #ebeef5;
background: #f8f8f9;
height: 30px;
line-height: 42px;
}
</style>
<template>
<div>
<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="_pageChange(1)" placeholder="请输入文件名称" style="width:200px" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<FilesListView ref="fileModal" @on-result-change="_fileData"></FilesListView>
</Col>
</Row>
</div>
</div>
</template>
<script>
import global from '../../../api/config'
import FilesListView from './FilesListView'
export default {
components: {
FilesListView
},
data() {
return {
selectIds: [],
getPage: {},
pageParams: {
page: 1,
rows: 20
},
downloadFileUrl: '',
fileName: '',
// id
salesId: '',
contractId: '',
sampleId: '',
subcontractorId: '',
// 用于区分是哪种附件(合同、委托、样品)
idKey: ''
}
},
methods: {
_open(data, key) {
this.fileName = ''
switch (key) {
case 'contractId':
this.salesId = ''
this.contractId = data.id
this.sampleId = ''
this.subcontractorId = ''
this.idKey = 'contractId'
break
}
this.$emit('on-result-change')
this.downloadFileUrl = data.downloadFileUrl
this.$refs.fileModal._fileViewData(data, this.idKey)
},
_openFile(pageData) {
this.getPage = pageData
this.$refs.fileModal._open(pageData, '300')
},
_page(uri) {
this.$store.dispatch(uri, this._searchParams()).then(() => {
this.$emit('on-result-change', 'file-page', '')
})
},
_pageChange(page) {
this.pageParams.page = page
this.$emit('on-result-change')
},
_pageSizeChange(rows) {
this.pageParams.rows = rows
this.$emit('on-result-change')
},
_search() {
this.$emit('on-result-change')
},
_searchParams() {
const data = {
page: this.pageParams.page,
rows: this.pageParams.rows
}
if (this.fileName) {
Object.assign(data, { fileName: this.fileName })
}
// 委托id
if (this.contractId) {
Object.assign(data, { contractId: this.contractId })
}
return data
},
// 下载
_download(id) {
window.open(global.baseURL + this.downloadFileUrl + id, '_blank')
},
_fileData(msg, data) {
switch (msg) {
case 'down':
this._download(data)
break
case 'page':
this._pageChange(data)
break
case 'rows':
this._pageSizeChange(data)
break
}
}
}
}
</script>
<template>
<div>
<Row>
<!--操作-->
<Col span="24" style="margin-bottom: 10px">
<div class="btns-menu">
<!--表格-->
<Button v-for="item in menusList" :key="item.name" @click="_tableChange(item.value)"
v-if="viewStyle === 1" type="ghost" style="margin-right: 5px">&nbsp;{{item.name}}
</Button>
</div>
</Col>
<Col span="24">
<!-- 默认是详细模式 -->
<div v-if="viewStyle === 1">
<el-table
ref="moveTable"
:data="getPage.records"
:height="tableHeight"
v-loading="loading"
@select-all="_selectAll"
@selection-change="_selectRowChange"
@cell-click="_cellClick"
:row-class-name="_tableRowClassName"
stripe
border
size="small"
style="width: 100%"
>
<el-table-column
type="selection"
width="55"
fixed="left"
align="center">
</el-table-column>
<el-table-column
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
v-for="item in pageColumns"
:key="item.key" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
<el-table-column
title="操作"
align="center"
width="100"
fixed="right">
<template slot-scope="scope">
<IconList :msg="(scope.row['type'] === 'jpg' || scope.row['type'] === 'png')?iconMsg:iconMsgDis"
@on-result-change="_iconClick" :rowData="scope.row"></IconList>
</template>
</el-table-column>
</el-table>
<Page :total="getPage.total" :page-size="getPage.size" :current="getPage.current" @on-change="_pageChange"
@on-page-size-change='_pageSizeChange'
placement="top" show-elevator show-total show-sizer style="margin-top: 10px;"></Page>
</div>
<!--/-->
<!--缩略图 模式-->
<div v-else-if="viewStyle === 2">
<ul :style="{ 'height': tableHeight + 'px' }" class="thumbnailStyle">
<CheckboxGroup @on-change="_chkVal" v-model="selectIds">
<li v-for="item in getPage.records" :key="item.id">
<div class="thumbnailStyleImg">
<Tooltip placement="top">
<img :src=" bigUrl+item.type+'.png' "/>
<div slot="content" style="white-space: normal">
<p>名称:{{item.fileName}}</p>
</div>
</Tooltip>
</div>
<div class="thumbnailStyleCheck clearCheck">
<Checkbox :label="item.id"><span class="inline-span" style="display: inline">{{item.fileName}}</span>
</Checkbox>
</div>
</li>
</CheckboxGroup>
</ul>
<div style="margin-top: 10px">共 {{getPage.total}} 条</div>
</div>
<!--/-->
<!--列表 模式-->
<div v-else="viewStyle === 3">
<ul :style="{ 'height': tableHeight + 'px' }" class="listStyle">
<CheckboxGroup @on-change="_chkVal" v-model="selectIds">
<li v-for="item in getPage.records" :key="item.id">
<div class="listStyleCheck clearCheck">
<Tooltip placement="top">
<span class="spanImg">
<img :src=" smallUrl+item.type+'.png' "/>
</span>
<span>
<Checkbox :label="item.id"><span>{{item.fileName}}</span></Checkbox>
</span>
<div slot="content" style="white-space: normal">
<p>名称:{{item.fileName}}</p>
</div>
</Tooltip>
</div>
</li>
</CheckboxGroup>
</ul>
<div style="margin-top: 10px">共 {{getPage.total}} 条</div>
</div>
<!--/-->
</Col>
</Row>
<!--图片预览-->
<div>
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex"
@close="imgViewIndex = null"></vue-gallery-slideshow>
</div>
</div>
</template>
<script>
import VueGallerySlideshow from 'vue-gallery-slideshow'
import ElementTable from '../../table/ElementTable'
import IconList from '../../base/IconList'
import global from '../../../api/config'
import { http } from '../../../api/http'
/* 样品附件--只读-附属 */
export default {
components: { ElementTable, IconList, VueGallerySlideshow },
data() {
return {
loading: false,
iconMsg: [
{ type: 'ios-download', id: '', name: '下载' },
{ type: 'images', id: '', name: '预览' }
],
iconMsgDis: [
{ type: 'ios-download', id: '', name: '下载' },
{ type: 'images', id: '', name: '预览', disabled: true }
],
selectIds: [],
getPage: {},
pageParams: {
rows: 20
},
pageColumns: [
{ title: '文件名', key: 'fileName' },
{ title: '类型', key: 'type', width: 120 },
{ title: '上传时间', key: 'ctime', width: 140, dateTime: true }
// {title: '上传人', key: 'cname', width: 120},
],
viewVal: 1,
viewStyle: 1,
menusList: [{ name: '下载', value: 'down' }],
checkList: [
{ name: '详细模式', value: 1 },
{ name: '缩略图模式', value: 2 },
{ name: '列表模式', value: 3 }
],
Ids: [],
smallUrl: global.staticURL + '/img/smallfile/',
bigUrl: global.staticURL + '/img/bigfile/',
imgViewList: [],
imgViewIndex: null,
id: '',
objectKey: [],
idKey: '', // 判断是哪种附件(合同、委托、样品)
checkData: []
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
// 点击单元格触发
_cellClick(row, event, column) {
if (event.label !== '操作') {
this.checkData = [row]
this.$refs.moveTable.toggleRowSelection(row)
}
},
_iconClick(res, data) {
switch (res) {
case '下载':
this._download(data.id)
break
case '预览':
this._viewImg(data)
break
}
},
// 预览图片(该合同下所有的)
_viewImg(data) {
const uri = 'FoodSampleAttachment/getPicByContractId'
const viewUri = 'sample_attachment/view'
this.$store.dispatch(uri, this.id).then(() => {
const result = this.$store.state.FoodSampleAttachment.list
const imgViewList = []
for (let i = 0; i < result.length; i++) {
imgViewList.push(
global.baseURL +
'/food/v1/' +
viewUri +
'?id=' +
result[i].id +
'&objectKey=' +
result[i].objectKey
)
}
this.imgViewList = imgViewList
// 打开的是当前第几张图片
const salesUri =
global.baseURL +
'/food/v1/' +
viewUri +
'?id=' +
data.id +
'&objectKey=' +
data.objectKey
const index = this.imgViewList.findIndex(item => item === salesUri)
if (index === -1) {
this.imgViewIndex = 0
} else {
this.imgViewIndex = index
}
})
},
_fileViewData(data, idKey) {
this.idKey = idKey
this.id = data.id
},
_open(data, height) {
this.getPage = data
this.tableHeight = height
this.selectIds = []
this.imgViewIndex = null
},
_pageChange(page) {
this.$emit('on-result-change', 'page', page)
},
_selectRowChange(data) {
this.checkData = data
const idList = []
const objectKey = []
for (let i = 0; i < data.length; i++) {
idList.push(data[i].id)
objectKey.push(data[i].objectKey)
}
this.Ids = idList
this.objectKey = objectKey
},
_selectAll: function(data) {
this._selectRowChange(data)
},
_pageSizeChange(rows) {
this.$emit('on-result-change', 'rows', rows)
},
// 下载
_download(id) {
this.$emit('on-result-change', 'down', id)
},
// 查看方式改变
_view(val) {
this.viewStyle = val
this.selectIds = []
},
_chkVal(val) {
this.selectIds = val
},
// 一系列操作返回的值
_tableChange(val) {
if (val == 'down') {
if (this.objectKey.length === 0) {
this.$Message.warning('请选择一条数据!')
} else {
this._downloadAll(this.objectKey)
}
}
},
// 批量打包下载
_downloadAll(ids) {
const uri = '/food/v1/sample_attachment/download_batch'
window.open(global.baseURL + uri + '?objectKeys=' + ids)
}
}
}
</script>
<template>
<div>
<Modal v-model="showUploadModal" :width="800" class="modal-footer-none zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<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="_pageChange(1)" placeholder="请输入文件名称" style="width:200px" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<FilesListView ref="fileModal" @on-result-change="_fileData"></FilesListView>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
import global from '../../../api/config'
import FilesListView from './FilesListView'
export default {
components: {
FilesListView
},
data() {
return {
showUploadModal: false,
modalTitle: '查看附件',
selectIds: [],
getPage: {},
pageParams: {
page: 1,
rows: 20
},
downloadFileUrl: '',
fileName: '',
// id
salesId: '',
contractId: '',
sampleId: '',
subcontractorId: '',
// 用于区分是哪种附件(合同、委托、样品)
idKey: ''
}
},
methods: {
_open(data, key) {
this.showUploadModal = true
this.fileName = ''
switch (key) {
case 'contractId':
this.salesId = ''
this.contractId = data.id
this.sampleId = ''
this.subcontractorId = ''
this.idKey = 'contractId'
break
case 'sampleId':
this.salesId = ''
this.contractId = ''
this.sampleId = data.id
this.subcontractorId = ''
this.idKey = 'sampleId'
break
}
this.$emit('on-result-change')
this.downloadFileUrl = data.downloadFileUrl
this.$refs.fileModal._fileViewData(data, this.idKey)
},
_openFile(pageData) {
this.getPage = pageData
this.$refs.fileModal._open(pageData, '300')
},
_page(uri) {
this.$store.dispatch(uri, this._searchParams()).then(() => {
this.$emit('on-result-change', 'file-page', '')
})
},
_pageChange(page) {
this.pageParams.page = page
this.$emit('on-result-change')
},
_pageSizeChange(rows) {
this.pageParams.rows = rows
this.$emit('on-result-change')
},
_search() {
this.$emit('on-result-change')
},
_searchParams() {
const data = {
page: this.pageParams.page,
rows: this.pageParams.rows
}
if (this.fileName) {
Object.assign(data, { fileName: this.fileName })
}
// 委托id
if (this.contractId) {
Object.assign(data, { contractId: this.contractId })
}
// 样品id
if (this.sampleId) {
Object.assign(data, { sampleId: this.sampleId })
}
return data
},
// 下载
_download(id) {
window.open(global.baseURL + this.downloadFileUrl + id, '_blank')
},
_fileData(msg, data) {
switch (msg) {
case 'down':
this._download(data)
break
case 'page':
this._pageChange(data)
break
case 'rows':
this._pageSizeChange(data)
break
}
}
}
}
</script>
<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) {
this.showModal = true
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.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 'sampleId':
// 样品
this.sampleId = id
this.urlData = {
msg: 'FoodSampleAttachment',
pageUrl: 'FoodSampleAttachment/page',
deleteUrl: 'FoodSampleAttachment/deleteByIds',
uploadFileUrl: '/food/v1/sample_attachment/upload/',
downloadFileUrl: '/food/v1/sample_attachment/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
}
this.$refs.fileModal._setUploadData(
Object.assign({ id: id }, this.urlData),
idsObj
)
},
_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()
}
}
}
</script>
<template>
<div>
<Modal v-model="showUploadModal" :width="800" class="modal-footer-none zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24" style="margin-bottom: -10px">
<Form id="search-form-upload" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="文件名称:" class="search-item">
<Input v-model="fileName" @on-enter="_pageChange(1)" name="fileName" placeholder="请输入文件名称" clearable/>
<input name="contractId" type="hidden">
<input name="originalId" type="hidden">
<input name="salesId" type="hidden">
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--列表-->
<Col span="24">
<FilesList ref="fileModal" @on-result-change="_fileData"></FilesList>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
import global from '../../../api/config'
import FilesList from './FilesList'
import UploadFile from './UploadFile'
export default {
components: {
FilesList,
UploadFile
},
data() {
return {
showUploadModal: false,
modalTitle: '附件',
fileName: '',
selectIds: [],
uri: '',
getPage: {},
pageParams: {
rows: 20
},
downloadFileUrl: ''
}
},
methods: {
_open(data, key, title) {
console.log('data', data)
this.fileName = ''
this.showUploadModal = true
this.downloadFileUrl = data.downloadFileUrl
this.modalTitle = title
this.url = data.pageUrl
$('input[name=' + key + ']').val(data.id)
this._page()
this.$emit('on-result-change')
this.$refs.fileModal._setUploadData(data)
},
_openFile(pageData) {
this.getPage = pageData
this.$refs.fileModal._open(pageData, '300')
},
_delPage(url, data) {
this.$store.dispatch(url, data).then(() => {
this.$emit('on-result-change', 'success', '')
})
},
_page() {
this.$store
.dispatch('FoodOriginalDataFile/page', this._searchParams())
.then(() => {
this.$emit('on-result-change', 'file-page', '')
})
},
_pageChange(page) {
this.pageParams.page = page
this.$emit('on-result-change')
},
_pageSizeChange(rows) {
this.pageParams.rows = rows
this.$emit('on-result-change')
},
_search() {
this.$emit('on-result-change')
},
_searchParams() {
const data = this.$serialize('search-form-upload')
return this.$extend(data, this.pageParams)
},
_deleteById(id) {
// 删除一条记录
this.$emit('on-result-change', 'delete-page', id)
},
// 下载
_download(id) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载?',
onOk: () => {
window.open(global.baseURL + this.downloadFileUrl + id, '_blank')
}
})
},
_fileData(msg, data) {
switch (msg) {
case 'delete':
this._deleteById(data)
break
case 'down':
this._download(data)
break
case 'page':
this._pageChange(data)
break
case 'rows':
this._pageSizeChange(data)
break
case 'refresh':
this._search()
break
}
}
}
}
</script>
<template>
<div>
<div>
<Upload
:action="action"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
>
<Button type="success">导入文件</Button>
</Upload>
</div>
<div v-show="isLoad">
<Spin fix>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在上传,请稍后...</div>
</Spin>
</div>
</div>
</template>
<script>
/**
* 添加编辑文件夹表
*/
import global from '../../../api/config'
export default {
data() {
return {
action: '',
dataObj: {
file: '',
contractId: ''
},
isLoad: false, // 是否显示loading...
contractId: '' // 合同id
}
},
methods: {
_open(data) {
this.isLoad = false
this.contractId = data.id
this.action = global.baseURL + data.uploadFileUrl + this.contractId
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
this.isLoad = false
this.$Message.success('上传成功!')
this.$emit('on-result-change')
} else {
this.isLoad = false
this.$Message.error(response.msg)
}
}
}
}
</script>
......@@ -2,9 +2,9 @@
<div>
<!--头部 header-->
<div
style="height:60px;width:100%;position: fixed"
:class="{'background-black':skin==='black_b','background-green':skin==='green_g',
'background-blue':skin==='blue_b','theme-star':skin ==='theme-star'}">
'background-blue':skin==='blue_b','theme-star':skin ==='theme-star'}"
style="height:60px;width:100%;position: fixed">
<header-top
:menu-list="menuList"
:menu-theme="menuTheme"
......@@ -16,7 +16,7 @@
</div>
<div>
<!--左侧菜单 menu-->
<div class="menu-list-cont background-black-menu" :class="{'shrink-menu-list-cont':isShrink}">
<div :class="{'shrink-menu-list-cont':isShrink}" class="menu-list-cont background-black-menu">
<div style="color: #fff;">
<!--展开时的菜单-->
<side-bar-menu
......@@ -27,7 +27,7 @@
</div>
</div>
<!--右侧面包屑 bread-->
<div class="bread-list-cont" :class="{'shrink-bread-list-cont':isShrink,'skin-star-bread':skin ==='theme-star'}">
<div :class="{'shrink-bread-list-cont':isShrink,'skin-star-bread':skin ==='theme-star'}" class="bread-list-cont">
<bread-crumbs v-if="!navTags" :crumbs="crumbs"/>
<Tags v-else class="tags-con"/>
</div>
......@@ -36,7 +36,8 @@
</template>
<script>
import Store from 'store2'
import SideBarMenu from '../menus/side-bar-menu'
// import SideBarMenu from '../menus/side-bar-menu'
import SideBarMenu from '../menus/sideBarMenu'
// import ShrinkSideBarMenu from '../menus/shrink-side-bar-menu'
import breadCrumbs from '../base/breadCrumbs'
import { sysResource, sysUser } from '../../api'
......@@ -111,7 +112,6 @@ export default {
this._recursion(notZero, [zero[0]])
this.menuListTemp = zero[0].leftMenus
this.menuList = zero
// console.log(this.menuList)
},
// 递归查询菜单
_recursion(more, rest) {
......
<!--下载模板导入-->
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" class="zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<Alert v-if="hideDownloadBtn===undefined" type="warning" show-icon>请下载导入模板并按照正确格式填写!</Alert>
<Alert v-if="msg === '资质项目管理导入'" type="warning" show-icon>此按钮可实现新增、更新资质项目的功能,不可新增或更新限量信息</Alert>
<Alert v-if="msg === '导入更新'" type="warning" show-icon>此功能可更新现有的资质项目、判定依据、限量信息</Alert>
<Alert v-if="showError" type="error" show-icon style="margin-top: 10px">{{errorMessage}}</Alert>
<Alert v-if="showSuccess" type="success" show-icon style="margin-top: 10px">{{successMessage}}</Alert>
<div v-show="isLoad">
<Spin>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在导入,请稍后...</div>
</Spin>
</div>
<div>
<Button v-if="hideDownloadBtn===undefined" size="large" @click="_download">下载模板</Button>
</div>
<div slot="footer" class="btn-width">
<Button @click="_cancel">取消</Button>
<label style="margin-bottom: 0;margin-left:15px; float: right">
<Upload
:action="importUrl"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:on-format-error="_formatError"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
:format="format"
>
<Button :disabled="isDisabled" type="primary">导入</Button>
</Upload>
</label>
</div>
</Modal>
</div>
</template>
<script>
/**
* 导入并下载模板
*/
// import global from '../../api/config'
import global from '../../api/config'
export default {
components: {},
props: {
hideDownloadBtn: null
},
data() {
return {
msg: '',
modalTitle: '导入检测项目信息',
showModal: false,
isLoad: false,
isDisabled: false,
showError: false,
showSuccess: false,
dataObj: {
file: ''
},
errorMessage: '',
successMessage: '',
format: ['xlsx', 'xls'],
importUrl: '',
downloadUrl: '',
// 500的提示语
errStr: '很抱歉!无法处理您的操作,请检查您的操作步骤或者联系系统管理员!'
}
},
methods: {
_open(data, msg) {
this.isLoad = false
this.showModal = true
this.isDisabled = false
this.showError = false
this.showSuccess = false
this.modalTitle = data.title
this.importUrl = global.baseURL + data.importUrl
this.downloadUrl = data.downloadUrl
this.msg = msg
},
_download() {
// this.$Modal.confirm({
// title: '提示',
// content: '确定要下载模板?',
// onOk: () => {
//
// }
// });
window.open(global.baseURL + this.downloadUrl, '_blank')
},
_cancel() {
this.showModal = false
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
this.isDisabled = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
console.log('---response', response)
this.isLoad = false
this.$Message.success('导入成功!')
this.$emit('on-result-change', response.data)
this.showModal = false
this.isDisabled = false
this.showError = false
this.showSuccess = true
this.successMessage = response.msg
} else {
this.isLoad = false
this.showSuccess = false
this.isDisabled = false
this.errorMessage = response.code === '500' ? this.errStr : response.msg
this.showError = true
// this.$Message.error(response.msg);
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' + file.name + ' 格式不正确,请上传格式为 .xlsx、xls 的文件!'
})
this.isLoad = false
}
}
}
</script>
<!--下载模板导入-->
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" class="zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<Alert v-if="showError" type="error" show-icon style="margin-top: 10px">{{errorMessage}}</Alert>
<Alert v-if="showSuccess" type="success" show-icon style="margin-top: 10px">{{successMessage}}</Alert>
<Alert v-if="msg === '上传图片'" type="warning" show-icon>请选择png,jpg格式的图片上传</Alert>
<div v-show="isLoad">
<Spin>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在导入,请稍后...</div>
</Spin>
</div>
<!-- <div>-->
<!-- <Button v-if="hideDownloadBtn===undefined" size="large" @click="_download">下载模板</Button>-->
<!-- </div>-->
<div slot="footer" class="btn-width">
<Button @click="_cancel">取消</Button>
<label style="margin-bottom: 0;margin-left:15px; float: right">
<Upload
:action="importUrl"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:on-format-error="_formatError"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
:format="format"
>
<Button :disabled="isDisabled" type="primary">导入</Button>
</Upload>
</label>
</div>
</Modal>
</div>
</template>
<script>
/**
* 导入并下载模板
*/
// import global from '../../api/config'
import global from '../../api/config'
export default {
components: {},
props: {
hideDownloadBtn: null
},
data() {
return {
msg: '',
modalTitle: '上传图片信息',
showModal: false,
isLoad: false,
isDisabled: false,
showError: false,
showSuccess: false,
dataObj: {
file: ''
},
errorMessage: '',
successMessage: '',
format: ['png', 'jpg'],
importUrl: '',
downloadUrl: '',
// 500的提示语
errStr: '很抱歉!无法处理您的操作,请检查您的操作步骤或者联系系统管理员!'
}
},
methods: {
_open(data, msg) {
this.isLoad = false
this.showModal = true
this.isDisabled = false
this.showError = false
this.showSuccess = false
this.modalTitle = data.title
this.importUrl = global.baseURL + data.importUrl
this.downloadUrl = data.downloadUrl
this.msg = msg
},
_cancel() {
this.showModal = false
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
this.isDisabled = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
console.log('---response', response)
this.isLoad = false
this.$Message.success('导入成功!')
this.$emit('on-result-change', response.data)
this.showModal = false
this.isDisabled = false
this.showError = false
this.showSuccess = true
this.successMessage = response.msg
} else {
this.isLoad = false
this.showSuccess = false
this.isDisabled = false
this.errorMessage = response.code === '500' ? this.errStr : response.msg
this.showError = true
// this.$Message.error(response.msg);
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' + file.name + ' 格式不正确,请上传格式为 .xlsx、xls 的文件!'
})
this.isLoad = false
}
}
}
</script>
<template>
<div>
<el-menu
:default-active="defaultActive"
:unique-opened="true"
background-color="#495060"
text-color="#eee"
active-text-color="#ffd04b">
<template v-for="(item,index) in menuList">
<!--不存在二级,只有一级菜单-->
<!--有二级菜单-->
<el-submenu :index="item.name" :key="index" v-if="item.leftMenus">
<template slot="title">
<i class="el-icon-menu"></i>
<span slot="title"> {{item.name}}</span>
</template>
<template v-for="(child,childIndex) in item.leftMenus">
<el-menu-item
:index="child.name"
:key="childIndex"
@click.native="_goto(child.uri)">
<i class="el-icon-menu"></i>
<span slot="title"> {{child.name}}</span>
</el-menu-item>
</template>
</el-submenu>
<el-menu-item
:index="item.name"
:key="index"
@click.native="_goto(item.uri)"
v-else>
<i class="el-icon-menu"></i>
<span slot="title"> {{item.name}}</span>
</el-menu-item>
</template>
</el-menu>
</div>
</template>
<script>
/**
* * 展开时的菜单
*/
export default {
// props: {
// menuList: Array,
// menuTheme: {
// type: String,
// default: 'dark'
// }
// },
props: ['menuList', 'menuTheme', 'activeTextColor'],
data() {
return {
openNames: [],
activeName: '',
defaultActive: '',
menuListCon: this.menuList
}
},
watch: {
$route(newRoute) {
this._setDefaultMenu(newRoute)
}
},
mounted() {
this._setDefaultMenu(this.$route)
},
methods: {
_goto(next) {
this.$router.push(next)
},
_setDefaultMenu(route) {
this.defaultActive = route.meta.title
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" width="900" class="modal-footer-none zIndex-1100">
<p slot="header">操作日志</p>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="search-contract-record" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="操作阶段:">
<Input v-model="formObj.origin" @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">
<PTVXETable ref="pageTable" :table-height="tableHeight"
:get-page="getPage" @on-result-change="_tableResultChange" hide-checkbox>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200" :fixed="item.fixed?item.fixed:undefined">
<template slot-scope="scope">
<span v-if="item.key==='type'">
{{scope.row[item.key] === 0 ? '流转' : scope.row[item.key] === 1 ? '退回': scope.row[item.key] === 2 ?'更新' :
scope.row[item.key] === 3 ? '转发':'文件'}}
</span>
<span v-else-if="item.key==='ctime'">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
/**
* 操作日志-委托
*/
import { meterEntrust } from '../../api'
export default {
data() {
return {
showModal: false,
getPage: {},
pageColumns: [
{ title: '操作类型', key: 'type', width: 80 },
{ title: '操作阶段', key: 'origin', width: 120 },
{ title: '目标阶段', key: 'target', width: 120 },
{ title: '操作人', key: 'operator', width: 80 },
{ title: '操作时间', key: 'ctime', width: 150 },
{ title: '操作原因', key: 'remark' },
{ title: '责任人', key: 'liable', width: 80 }
],
formObj: {
entrustId: '',
origin: undefined,
sampleId: ''
}
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_open(entrustId) {
this.showModal = true
this.formObj.entrustId = entrustId
this.formObj.sampleId = undefined
this._page()
},
_openTask(sampleId) {
this.showModal = true
this.formObj.sampleId = sampleId
this.formObj.entrustId = undefined
this._pageTask()
},
_page: async function() {
console.log('要传的参数')
console.log(this.formObj)
const result = await meterEntrust.pageOutTaskOperation(this.formObj)
console.log(result)
if (result) {
this.getPage = result
}
// this.$refs.pageTable._page(
// 'search-contract-record',
// 'FoodContractRecord/page',
// this.$serializeFormSearch(this.formObj)
// )
},
_pageTask: async function() {
console.log('要传的参数')
console.log(this.formObj)
const result = await meterEntrust.pageTask(this.formObj)
console.log(result)
if (result) {
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContractRecord.page
break
case 'changeSize':
this._page()
break
}
},
_search() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
<template>
<div>
<div>
<Form onsubmit="return false">
<Form-item>
<Input v-model="key" @on-enter="_search" placeholder="请输入关键字,回车查询" style="width:100%"
icon="ios-search-strong"/>
</Form-item>
</Form>
</div>
<!--加载中-->
<div v-show="loading" class="demo-spin-container spin-bg">
<Spin fix size="large"></Spin>
</div>
<ul :id="treeId" v-show="isTree" class="ztree ztreePro tree_height"
style="overflow-x: auto;height:360px"></ul>
</div>
</template>
<script>
import { equip } from '../../api'
/**
* 添加编辑Ztree
*/
let setting
export default {
data() {
return {
key: '',
loading: true,
isTree: false,
treeId: ''
}
},
mounted() {},
methods: {
_treeHeight() {
$('.tree_height').height(document.documentElement.clientHeight - 290)
},
_open: async function() {
this.treeId = 'equip' + this.$randomCode()
this._treeHeight()
this.key = ''
this.loading = true
this.isTree = false
setting = {
data: {
simpleData: {
enable: true,
idKey: 'id',
pIdKey: 'pid'
}
},
callback: {
onClick: this._zTreeOnClick
}
}
// this.$store.dispatch('LmsEquipClass/list').then(() => {
// $.fn.zTree.init(
// $('#' + this.treeId),
// setting,
// this.$store.state.LmsEquipClass.list
// )
const result = await equip.pageEquipList()
console.log('列表数据', result)
if (result) {
$.fn.zTree.init($('#' + this.treeId), setting, result)
setTimeout(() => {
this.loading = false
this.isTree = true
}, 300)
}
// })
},
_zTreeOnClick(event, treeId, treeNode) {
this.$emit('on-result-change', treeNode.id)
},
_search() {
if (this.key !== '') {
this.loading = true
this.isTree = false
this.$store
.dispatch('LmsEquipClass/list', { name: this.key })
.then(() => {
$.fn.zTree.init(
$('#' + this.treeId),
setting,
this.$store.state.LmsEquipClass.list
)
setTimeout(() => {
this.loading = false
this.isTree = true
}, 300)
})
} else {
this._open()
}
}
}
}
</script>
<template>
<div>
<ElTableNoPage ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage">
<el-table-column
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
</ElTableNoPage>
</div>
</template>
<script>
/**
* 已选中
*/
import ElTableNoPage from '../table/ElTableNoPage'
export default {
components: {
ElTableNoPage
},
data() {
return {
// tableHeight: document.documentElement.clientHeight - 225,
tableHeight: 500,
getPage: {
records: []
},
pageColumns: [
{ title: '仪器名称', key: 'name', width: 160 },
{ title: '仪器编号', key: 'labNum', width: 100 },
{ title: '品牌', key: 'brand', width: 100 },
{ title: '规格型号', key: 'spec', width: 100 },
{ title: '描述', key: 'remark' }
],
selectIds: []
}
},
mounted() {
this.$refs.pageTable._hideLoading()
this._empty()
},
methods: {
// 添加
_open(data) {
for (let i = 0; i < data.length; i++) {
this.getPage.records.push(data[i])
}
this.getPage.records = this.$uniqueArray(this.getPage.records, 'id')
this.$emit('on-result-change', this.getPage.records, [])
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectIds':
this.selectIds = data
break
}
this.$emit('on-result-change', this.getPage.records, this.selectIds)
},
// 删除
_delData() {
for (let j = 0; j < this.selectIds.length; j++) {
for (let i = 0; i < this.getPage.records.length; i++) {
if (this.getPage.records[i].id === this.selectIds[j]) {
this.getPage.records.splice(i, 1)
}
}
}
this.$emit('on-result-change', this.getPage.records, [])
},
_empty() {
this.getPage.records = []
this.$emit('on-result-change', [], [])
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" width="100" class="full-screen zIndex-1200">
<div slot="header">设备管理</div>
<div>
<Collapse @on-result-change="_optionResult" left-title="仪器类别" right-title="已选仪器" left-width="15">
<template slot="left">
<Row :gutter="16">
<Col span="10">
<EquipClassTree ref="equipClassTree" :z-tree-id="treeName"
@on-result-change="_searchEquip"></EquipClassTree>
</Col>
<Col span="14">
<div>
<div>
<Form :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="仪器名称:" style="width: 40%">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入仪器名称"/>
</Form-item>
<Form-item label="仪器编号:" style="width: 40%">
<Input v-model="formObj.labNum" @on-enter="_formSearch" placeholder="请输入仪器编号"/>
</Form-item>
<Form-item style="margin-left: -60px">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
<ElementTable ref="pageTable" :tableHeight="tableHeight" @on-result-change="_tableResultChange" :getPage="getPage"
hide-elevator hide-sizer hide-total select-data >
<el-table-column
:prop="item.key"
:label="item.title"
:width="item.width"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
</ElementTable>
</div>
</Col>
</Row>
</template>
<template slot="right">
<Equiped ref="equipedModal" @on-result-change="_rightResult"></Equiped>
</template>
</Collapse>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
import Collapse from '../base/Collapse'
import ElementTable from '../table/elementTable'
import ModalFooter from '../base/modalFooter'
import { equip } from '../../api'
import EquipClassTree from './EquipClassTree'
import Equiped from './Equiped'
export default {
components: {
Collapse,
Equiped,
EquipClassTree,
ElementTable,
ModalFooter
},
data() {
return {
// tableHeight: document.documentElement.clientHeight - 320,
tableHeight: 500,
getPage: {},
pageColumns: [
{ title: '仪器名称', key: 'name', width: 160 },
{ title: '仪器编号', key: 'labNum', width: 100 },
{ title: '品牌', key: 'brand', width: 100 },
{ title: '规格型号', key: 'spec', width: 100 },
{ title: '描述', key: 'remark', width: 260 }
],
selectData: [],
showModal: false,
// 选中要删除的id
delIds: [],
// 要提交的数据
tempData: [],
footerList: [
{ name: '取消', type: '' },
{ name: '确定', type: 'primary' }
],
// 用于区别仪器ztree
treeName: '',
tempObj: '', // 临时数据
formObj: {
name: '',
labNum: '',
classId: ''
}
}
},
methods: {
_open(treeName, tempObj) {
this.showModal = true
this.formObj = this.$resetFields(this.formObj)
this._hideLoading()
if (treeName === undefined || treeName === '') {
this.treeName = 'equipClassTree' + this.$randomCode()
} else {
this.treeName = treeName + this.$randomCode()
}
this.$refs.equipClassTree._open()
this._page()
this.$refs.equipedModal._empty()
this.tempData = []
this.selectData = []
this.delIds = []
this.tempObj = tempObj
},
// modal-footer
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_page: async function() {
// this.$refs.pageTable._page(
// '',
// 'LmsEquipInfo/page',
// this.$serializeFormSearch(this.formObj)
// )
const result = await equip.page()
console.log('仪器结果', result)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.LmsEquipInfo.page
break
case 'selectData':
this.selectData = data
break
case 'dbSelect':
this.selectData = [data]
this._add()
break
default:
this._page()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 添加
_add() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.equipedModal._open(this.selectData)
this._page()
}
},
// 删除
_del() {
if (this.delIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.equipedModal._delData()
}
},
_searchEquip(id) {
this.formObj.classId = id
this._formSearch()
},
_rightResult(data, ids) {
this.delIds = ids
this.tempData = data
},
_optionResult(name) {
switch (name) {
case '添加':
this._add()
break
case '删除':
this._del()
break
}
},
_ok() {
if (this.tempData.length === 0) {
this.$Message.warning('请至少选择一条数据!')
this._hideLoading()
} else {
this.$emit('on-result-change', this.tempData, { obj: this.tempObj })
this._cancel()
}
},
_cancel() {
this.showModal = false
}
}
}
</script>
<template>
<div>
<el-table
:show-summary="showSummary !== undefined?true:false"
:data="getPage.records"
ref="moveTable"
:header-cell-style="{background:'#F8F8F9'}"
:height="tableHeight"
v-loading="loading"
@select-all="_selectAll"
@selection-change="_selectRowChange"
@cell-click="_cellClick"
@current-change="_currentChange"
@row-dblclick="_dbClickRow"
:row-class-name="_tableRowClassName"
stripe
border
size="small"
style="width: 100%;"
element-loading-text="拼命加载中..."
>
<el-table-column
v-if="hideCheckbox===undefined"
type="selection"
width="55"
fixed="left"
align="center">
</el-table-column>
<slot></slot>
<el-table-column
:width="$optColWidth(iconMsg)"
v-if="$optColWidth(iconMsg)>0?true:false"
label="操作"
align="center" fixed="right">
<template slot-scope="scope">
<IconList :msg="iconMsg" @on-result-change="_iconClick" :rowData="scope.row"
:rowIndex="scope.$index"></IconList>
</template>
</el-table-column>
<slot name="col"></slot>
</el-table>
</div>
</template>
<script>
export default {
name: 'PageTable',
props: {
pageColumns: null,
tableHeight: null,
hideCheckbox: null,
optColWidth: null,
getPage: null,
iconMsg: null,
warnKey: null,
selectData: null,
clickValue: null,
dbClickRow: null,
editable: null,
showSummary: null // 是否显示总计
},
data() {
return {
loading: true,
rowData: {},
extendsData: {}, // 扩展数据,数据传不过来使用
checkData: []
}
},
methods: {
// 点击单元格触发
_cellClick(row, event, column) {
if (event.label === '操作') {
} else {
this._rowClickChange(row)
}
},
// 获取当前行数据与上一行数据
_currentChange(currentRow, oldCurrentRow) {
if (this.editable !== undefined) {
if (currentRow) {
this.$set(currentRow, 'editable', true)
}
if (oldCurrentRow) {
this.$set(oldCurrentRow, 'editable', false)
}
}
},
_rowClickChange(row) {
this.checkData = [row]
if (this.clickValue === undefined) {
// 默认选中该行数据
this.$refs.moveTable.toggleRowSelection(row)
} else {
// 有clickValue参数时执行
this.$emit('on-result-change', 'select', row)
}
},
// 整行变色
_tableRowClassName({ row, rowIndex }) {
if (this.checkData.length !== 0) {
/* 选中的进行高亮显示 */
const index = this.checkData.indexOf(row)
if (index !== -1) {
return 'high-light-row'
} else {
/* 没选中的根据页面逻辑变色 */
return this._rowClassName(row, rowIndex)
}
} else {
/* 没选中的根据页面逻辑变色 */
return this._rowClassName(row, rowIndex)
}
},
_rowClassName(row, rowIndex) {
return ''
},
_checkAll() {
this.$refs.moveTable.toggleAllCheckboxRow()
},
_page(formId, uri, extendsData) {
this.loading = true
this.formId = formId
const data = this.$serialize(this.formId)
if (extendsData) {
this.extendsData = extendsData
Object.assign(data, this.extendsData)
}
this.$store.dispatch(uri, data).then(() => {
this.loading = false
this.$emit('on-result-change', 'page', '')
})
},
// 多选
_selectRowChange(data) {
if (this.hideCheckbox === undefined) {
this.checkData = data
if (this.selectData !== undefined) {
this.$emit('on-result-change', 'selectData', data)
} else {
const idList = []
for (let i = 0; i < data.length; i++) {
idList.push(data[i].id)
}
// 有checkbox 则返回选中的id数组
this.$emit('on-result-change', 'selectIds', idList)
}
}
},
_selectAll: function(data) {
this._selectRowChange(data)
},
// 操作列回调
_iconClick(name, rowData, componentName, rowIndex) {
this.$emit('on-result-change', 'iconClick', {
name: name,
rowData: rowData,
componentName: componentName,
rowIndex: rowIndex
})
},
// 关闭loading
_hideLoading() {
this.loading = false
},
// 打开loading
_showLoading() {
this.loading = true
},
// 双击行操作
_dbClickRow(row, event) {
if (this.dbClickRow === undefined) {
// 默认是有双击操作的,若此参数有值,则不返回
this.$emit('on-result-change', 'dbSelect', row)
}
}
}
}
</script>
<template>
<div>
<el-select
v-model="groupIds"
@change="_selMultiUser"
multiple
size="small"
style="width:100%"
placeholder="请选择检测科室,可多选">
<el-option v-for="item in groupData" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</template>
<script>
/* 选择科室(或叫用户编组),默认展示20条数据(多选) */
export default {
props: {
isGroupName: null // 是否显示名称
},
data() {
return {
groupData: [],
groupIds: []
}
},
mounted() {
// this._page()
},
methods: {
_open(groupIds) {
if (groupIds) {
this.groupIds = groupIds
} else {
this.groupIds = []
}
},
// 科室下的人员
_page() {
this.$store.dispatch('LmsUserGroup/list').then(() => {
this.groupData = this.$store.state.LmsUserGroup.list
})
},
_selMultiUser() {
if (this.isGroupName !== undefined) {
// isGroupName 有值,需要显示name
const ids = this.groupIds
const groupNames = []
for (let i = 0; i < ids.length; i++) {
groupNames.push(
this.groupData.find(item => {
return item.id === ids[i]
})
)
}
this.$emit('on-result-change', groupNames)
} else {
this.$emit('on-result-change', this.groupIds)
}
}
}
}
</script>
<template>
<div>
<el-select
v-model="testerIds"
@change="_selMultiUser"
:filter-method="_queryChangeMethod"
multiple
size="small"
filterable
placeholder="请选择人员,可多选"
style="width: 100%;">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.realname"
:value="item.userId"
>
</el-option>
</el-select>
</div>
</template>
<script>
/* (1)查询科室下的所有人,默认展示20条数据
(2)根据科室(多个科室)选择科室下面的人(有参数 isGroupIds)
用这个组件人员需要跟科室有关
* */
export default {
props: {
isGroupIds: null // 是否显示某几个科室下的人员
},
data() {
return {
userList: [],
testerIds: [],
keyword: '',
groupIds: []
}
},
methods: {
// 所有科室下的人员
_open(data) {
this.keyword = '' // 清空搜索字
if (data) {
this.testerIds = data
} else {
this.testerIds = []
}
this._page()
},
// 查询某几个科室下的人员(多个科室)
_openUserByGroup(ids, testerIds) {
this.groupIds = ids
this.testerIds = testerIds || []
this.keyword = '' // 清空搜索字
this._pageByGroup()
},
_pageByGroup() {
this.$store
.dispatch('LmsUserGroup/getUserByGroupIds', this._searchParams())
.then(() => {
this.userList = this.$store.state.LmsUserGroup.userPage.records
})
},
// 科室下的人员
_page() {
this.$store
.dispatch('LmsMarshalManage/userPage', this._searchParams())
.then(() => {
this.userList = this.$store.state.LmsMarshalManage.userPage.records
})
},
_searchParams() {
const data = {
page: 1,
rows: 20
}
if (this.keyword) {
data.realname = this.keyword
}
if (this.isGroupIds !== undefined) {
data.groupIds = this.groupIds ? this.groupIds.join(',') : ''
}
// 这个查询条件是为了将某个人设置为第一个
if (this.testerIds && this.testerIds.length > 0) {
data.userId = this.testerIds[0]
}
return data
},
_queryChangeMethod(query) {
this.keyword = query
if (this.isGroupIds !== undefined) {
this._pageByGroup()
} else {
this._page()
}
},
_selMultiUser() {
if (this.testerIds.length === 0) {
this.keyword = ''
if (this.isGroupIds !== undefined) {
this._pageByGroup()
} else {
this._page()
}
}
this.$emit('on-result-change', this.testerIds)
}
}
}
</script>
......@@ -31,6 +31,8 @@ export default {
}
}
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)
......@@ -46,6 +48,8 @@ export default {
},
zTreeOnClick(event, treeId, treeNode) {
this.$emit('on-result-change', treeNode)
console.log('zTree')
console.log(treeNode)
}
}
}
......
......@@ -6,7 +6,7 @@
module.exports = {
apps: [
{
name: 'pt-llgt',
name: 'pt-soil',
script: './node_modules/nuxt-start/bin/nuxt-start.js',
instances: 2,
max_memory_restart: '512M',
......
// 请求地址
WEB_URL=http://sys.patzn.com
WEB_URL=http://meter.patzn.com
BASE_URL=http://api.patzn.com
SSO_URL=http://sso.patzn.com
STATIC_URL=http://static.patzn.com
NC_URL=http://192.168.81.76:8088
NC_URL=http://123.133.38.68:8088
<template>
<div>
<div >
<header-menu :crumbs="crumbsList" @on-result-change="_headerMenuResult"/>
<div class="iview-layout-nuxt" :class="{'shrink-iview-layout-nuxt':isShrink}">
<nuxt />
<div :class="{'shrink-iview-layout-nuxt':isShrink}" class="iview-layout-nuxt">
<nuxt v-if="isRouterAlive" />
</div>
</div>
</template>
......@@ -18,7 +18,9 @@ export default {
data() {
return {
isShrink: false,
crumbsList: []
crumbsList: [],
show: false,
isRouterAlive: false
}
},
watch: {
......@@ -27,15 +29,27 @@ export default {
}
},
mounted() {
// this.show = true
this._setBreadCrumb(this.$route)
this.$nextTick(() => {
this._initLoad()
})
},
methods: {
// 刷新
_reload() {
this.isRouterAlive = false
this.$nextTick(() => {
this.isRouterAlive = true
})
},
// 初始化加载
_initLoad() {
if (!Global.getLn()) {
// 暂时没有登录-跳到首页
window.location.href = Global.ssoURL
} else {
this._reload()
}
},
// 设置面包屑
......
......@@ -9,7 +9,7 @@ if (process.env.NODE_ENV) {
module.exports = {
mode: 'universal',
server: {
port: 8028,
port: 8131,
host: '0.0.0.0'
},
/*
......
......@@ -41,7 +41,11 @@
"vue-echarts-v3": "^2.0.1",
"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",
"webstomp-client": "^1.2.0",
"xe-utils": "^2.4.5",
"xlsx": "^0.14.1"
},
"devDependencies": {
......
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="data-input-contract-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item-select">
<SelectInput ref="selInput1" :optionList="optionList" @on-result-change="_selInputResult1"
keyword="code" placeholder="请输入委托编号"></SelectInput>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--//操作-->
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide">
<!--切换待认领任务-->
<template slot="processTask" v-if="$showBtn('food-data-input-contract-task')">
<div class="fr process-task" style="margin-right: 10px">
<el-checkbox v-model="personal" @change="_page" :true-label="1"
:false-label="0" size="medium">个人任务
</el-checkbox>
</div>
</template>
</btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns"
:table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange"
:getPage="getPage"
:rows="100" is-task :isRadio="true" hide-checkbox>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<a v-if="item.detail" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<span
v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_page" :table-name="tableName"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { meterManage } from '../../api'
import SelectInput from './SelectInput'
export default {
components: {
SelectInput
},
data() {
return {
currentComponent: '',
tableName: 'food-data-input-contract-left',
// 用户自己选中的列
userColumns: [],
personal: 1,
btn: [],
optionList: [
{ key: 'code', name: '委托编号', placeholder: '请输入委托编号' },
{ key: 'cname', name: '委托单位', placeholder: '请输入委托单位' },
{ key: 'name', name: '委托名称', placeholder: '请输入委托名称' },
{
key: 'reportDueDate',
name: '应出报告日期',
placeholder: '请选择应出报告日期',
date: true
}
],
getPage: {},
pageColumns: [
{ title: '委托名称', key: 'name', width: 160 },
{ title: '委托编号', key: 'code', width: 180 },
{ title: '委托单位', key: 'cname', width: 200 },
{ title: '服务类型', key: 'serviceType', width: 120 },
{ title: '应出报告日期', key: 'reportDueDate', width: 140, date: true }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
methods: {
_btnClick() {},
_selInputResult1(msg, data) {
switch (msg) {
case 'search':
this._formSearch()
break
}
},
_open() {
this._page()
},
_searchParams() {
const obj = {}
const obj1 = this.$refs.selInput1._getFormObj()
Object.assign(obj, obj1)
if (this.personal) {
obj.personal = this.personal
}
return obj
},
_page: async function() {
const result = await meterManage.page(this.formObj)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectIds':
this.$emit('on-result-change', data, this.personal)
break
case 'singleSelect':
this.$emit('on-result-change', data.id, this.personal)
break
case 'changeSize':
this._page()
this._clear()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
},
_clear() {
this.selectIds = []
this.$emit('on-result-change', [])
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
this._clear()
}
}
}
</script>
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="data-input-contract-right" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item-select">
<SelectInput ref="selInput1" :option-list="optionList" :judge-list="judgeList"
compare-keyword="testBasis" keyword="name"
placeholder="请输入检测项目"
@on-result-change="_selInputResult1"></SelectInput>
</Form-item>
<Form-item class="search-item-select">
<SelectInput ref="selInput2" :option-list="optionList" :judge-list="judgeList"
compare-keyword="name" keyword="testBasis"
placeholder="请输入检测依据"
@on-result-change="_selInputResult2"></SelectInput>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_page">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :show-btn-num="7" class="contHide" @on-result-change="_btnClick"></btn-list>
</Col>
<Col span="24">
<PTVXETableData
ref="pageTable"
:table-height="tableHeight"
:get-page="getPage"
:table-name="tableName"
:page-columns="pageColumns"
:rows="100"
@on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
:edit-render="item.editCell?{autofocus: 'input'}:null"
sortable
>
<template v-slot="{ row }">
<div v-if="item.date">{{row[item.key]?$dateformat(row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-else-if="item.key==='progress'">{{row[item.key].display}}</div>
<div v-else>{{row[item.key]}}</div>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :page-columns="pageColumns" :user-columns="userColumns"
:table-name="tableName" @on-result-change="_page"></VXESettingCol>
</PTVXETableData>
</Col>
</Row>
</div>
</template>
<script>
import { meterManageItem } from '../../api'
import VXESettingCol from '../../components/base/VXESettingCol'
import SelectInput from './SelectInput'
export default {
components: {
VXESettingCol,
SelectInput
},
data() {
return {
formObj: {
aptitudeId: '',
name: '',
code: '',
standardName: ''
},
tableName: 'food-data-input-contract-right',
// 用户自己选中的列
userColumns: [],
currentComponent: '',
edit: false,
btnModalList: [
{ type: 'primary', name: '更新' },
{ type: 'primary', name: '新增' },
{ type: '', name: '取消' }
],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' },
{ key: 'num', name: '样品编号', placeholder: '请输入样品编号' },
{ key: 'code', name: '委托编号', placeholder: '请输入委托编号' },
{ key: 'sampleName', name: '样品名称', placeholder: '请输入样品名称' },
{ key: 'firstClass', name: '大类', placeholder: '请输入大类' },
{ key: 'detectType', name: '细类', placeholder: '请输入细类' },
{
key: 'sampleRemark',
name: '样品备注',
placeholder: '请输入样品备注'
},
{
key: 'planDate',
name: '计划完成时间',
placeholder: '请选择计划完成时间',
date: true
},
{
key: 'reportDueDate',
name: '应出报告日期',
placeholder: '请选择应出报告日期',
date: true
},
{
key: 'receiveDate',
name: '接收日期',
placeholder: '请选择接收日期',
date: true,
dateToMin: true
},
{ key: 'limitDefault', name: '限量', placeholder: '请输入限量' }
],
judgeList: [
{ name: '待判定', value: '0' },
{ name: '不判定', value: '5' },
{ name: '合格', value: '7' },
{ name: '不合格', value: '9' }
],
btn: [],
currentRow: {},
currentIndex: -1,
getPage: {
records: []
},
pageColumns: [
{ title: '检测项目', key: 'name', width: 120, fixed: 'left' },
{ title: '比较符', key: 'compare', width: 180, fixed: 'left' },
{ title: '限量值', key: 'limitValue', width: 140 },
{ title: '单位', key: 'unit', width: 160 },
{ title: '是否判定', key: 'judged', width: 120, editCell: true },
{ title: '备注', key: 'remark', width: 120, editCell: true }
],
iconMsg: [],
iconMsgDisable: [],
leftSelectIds: [],
selectIds: [],
selectData: [],
selectSampleIds: [],
personal: '',
// 检测步骤
stepId: '',
// 点击编辑时的当前的key
currentEditKey: ''
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
mounted() {
// this._dicSearch()
},
methods: {
_resultChange(msg) {
this.$Message.success(msg)
this._page()
this.selectIds = []
this.selectData = []
this.selectSampleIds = []
},
_selInputResult1(msg, data) {
switch (msg) {
case 'keyword':
this.$refs.selInput2._setCompareKeyword(data)
break
case 'search':
this._formSearch()
break
}
},
_selInputResult2(msg, data) {
switch (msg) {
case 'keyword':
this.$refs.selInput1._setCompareKeyword(data)
break
case 'search':
this._formSearch()
break
}
},
_open(ids, personal) {
this.leftSelectIds = ids
this.formObj.aptitudeId = ids
this.personal = personal
if (ids.length === 0) {
this.$set(this.getPage, 'records', [])
this.$set(this.getPage, 'total', 0)
this.$set(this.getPage, 'current', 1)
this.selectIds = []
this.selectData = []
this.selectSampleIds = []
} else {
this._page()
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectIds':
this.selectIds = data
this.$emit('on-result-change', this.selectIds)
break
case 'selectData':
this.selectData = data
this.selectSampleIds = data.map(({ sampleId: i }) => i)
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
case 'changeSize':
if (this.leftSelectIds.length) {
this._page()
}
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterManageItem.page(this.formObj)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
console.log(result)
}
},
// 操作的序号
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.index
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '仪器':
// this._selectEquipment()
break
case '检测项目重置':
// this._itemResetInfo()
break
}
})
},
_copyHisData() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_confirmResult(name) {
switch (name) {
case '更新':
this._saveToLabOk(0)
break
case '新增':
this._saveToLabOk(1)
break
}
},
// 导入
_import() {
this.$refs.refModal._open()
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '样品附件':
this._upload(data.sampleId)
break
case '操作日志':
this._record(data.id)
break
}
})
}
}
}
</script>
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