Commit a390d3be by zhangmengqi

Merge branch 'dev'

# Conflicts:
#	api/index.js
#	api/meter/meter-entrust.js
#	components/base/AutoCompletes.vue
#	components/file/file-manage/FileManageCont.vue
#	components/file/file-manage/FilesList.vue
#	components/import/DownloadTemplateImport.vue
#	components/operation/Operation.vue
#	components/select-equip/SelEquip.vue
#	components/table/PTVXETable.vue
#	ecosystem.config.js
#	env/.env.production
#	nuxt.config.js
#	pages/meter-aptitude/manage/MeterAptitudeManage.vue
#	pages/meter-aptitude/standard/MeterAptitudeStandard.vue
#	plugins/global.js
#	plugins/iframe.js
#	router/meter-routes.js
parents 6e998ebd c29671bf
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
}, },
// code // code
getCode: function() { getCode: function() {
return 'meter' return 'soil'
}, },
getCookie: function(cookieName) { getCookie: function(cookieName) {
if (document.cookie.length > 0) { if (document.cookie.length > 0) {
......
function test() {
console.log(123)
}
function waveImg(dataPersonal) {
const xData = []
const yData = []
const sevenList = dataPersonal
for (let i = 0; i < sevenList.length; i++) {
const obj = sevenList[i]
xData.push(obj.dayIns)
yData.push(obj.insNum)
}
const echarts = require('echarts')
const myChart = echarts.init(document.getElementById('waveImg'))
myChart.setOption({
title: {
text: ''
},
tooltip: {},
xAxis: {
data: xData,
boundaryGap: false,
show: false,
splitLine: {
show: false
}
},
yAxis: {
show: false,
splitLine: {
show: false
}
},
series: [
{
name: '',
type: 'line',
smooth: true,
areaStyle: {},
itemStyle: {
normal: {
color: 'lightblue', // 圈圈的颜色
lineStyle: {
color: 'lightblue' // 线的颜色
}
}
},
data: yData
}
],
grid: {
top: 30,
// left: 0,
height: 60
}
})
// setTimeout(() => {
// myChart.resize()
// }, 1000)
}
function histogram(listSevenReceive) {
const xData = []
const yData = []
const sevenList = listSevenReceive
for (let i = 0; i < sevenList.length; i++) {
const obj = sevenList[i]
xData.push(obj.dayIns)
yData.push(obj.insNum)
}
console.log(xData)
console.log(yData)
const echarts = require('echarts')
const myChart = echarts.init(document.getElementById('histogram'))
myChart.setOption({
title: {
text: ''
},
tooltip: {},
xAxis: {
data: xData,
type: 'category',
boundaryGap: true,
show: false,
splitLine: {
show: false
}
},
yAxis: {
show: false,
splitLine: {
show: false
}
},
series: [
{
name: '',
type: 'bar',
smooth: true,
areaStyle: {},
itemStyle: {
normal: {
color: 'lightblue', // 圈圈的颜色
lineStyle: {
color: 'lightblue' // 线的颜色
}
}
},
data: yData
}
],
grid: {
top: 30,
// left: 0,
height: 60
}
})
}
function saleImg(itemNotOk) {
const xData = []
const yData = []
const sevenList = itemNotOk
for (let i = 0; i < sevenList.length; i++) {
const obj = sevenList[i]
xData.push(obj.name)
yData.push(obj.number)
}
const echarts = require('echarts')
const myChart = echarts.init(document.getElementById('saleImg'))
myChart.setOption({
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: xData,
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '不合格数量',
type: 'bar',
barWidth: '60%',
data: yData
}
]
})
}
function salesTrendImg(sampleList) {
const xData = []
const yData = []
const sevenList = sampleList
for (let i = 0; i < sevenList.length; i++) {
const obj = sevenList[i]
xData.push(obj.name)
yData.push(obj.number)
}
const echarts = require('echarts')
const myChart = echarts.init(document.getElementById('salesTrendImg'))
myChart.setOption({
color: ['lightblue'],
tooltip: {
trigger: 'axis',
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
top: 10,
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: xData,
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '',
type: 'bar',
barWidth: '60%',
data: yData
}
]
})
}
function visitImg(data) {
const xData = []
const yData = []
const zData = []
const sevenList = data.sampleRank
const sevenListItem = data.itemRank
for (let i = 0; i < sevenList.length; i++) {
const obj = sevenList[i]
xData.push(obj.name)
yData.push(obj.number)
}
for (let i = 0; i < sevenListItem.length; i++) {
const obj = sevenListItem[i]
zData.push(obj.number)
}
const echarts = require('echarts')
const myChart = echarts.init(document.getElementById('visitImg'))
myChart.setOption({
title: {
// text: '折线图堆叠'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['报检量', '项目量']
},
grid: {
top: 20,
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
// height: 320
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xData
},
yAxis: {
type: 'value'
},
series: [
{
name: '报检量',
type: 'line',
data: yData
},
{
name: '项目量',
type: 'line',
data: zData
}
]
})
console.log('js加载完成')
}
export { test, waveImg, histogram, saleImg, salesTrendImg, visitImg }
...@@ -22,20 +22,13 @@ export { default as flowProcess } from './workflow/flow-process' ...@@ -22,20 +22,13 @@ export { default as flowProcess } from './workflow/flow-process'
export { default as workbench } from './meter/workbench/workbench' 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 meterEntrust } from './meter/meter-entrust'
export { default as meterSample } from './meter/meter-sample' export { default as meterSample } from './meter/meter-sample'
export { default as meterManageItem } from './meter/meter-manage-item' export { default as soilAptitude } from './soil/soil-aptitude'
export { default as meterItem } from './meter/meter-item' export { default as soilEntrust } from './soil/soil-entrust'
export { default as meterDevice } from './meter/meter-device' export { default as soilSample } from './soil/soil-sample'
export { default as meterContract } from './meter/meter-contract' export { default as soilTest } from './soil/soil-test'
export { default as meterSampleQuote } from './meter/meter-sample-quote' export { default as soilStatistics } from './soil/soil-statistics'
export { default as meterRecord } from './meter/meter-record' export { default as soilReport } from './soil/soil-report'
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'
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
.then(res => res), .then(res => res),
// 操作日志 // 操作日志
pageOutTaskOperation: data => pageOutTaskOperation: data =>
http.post('meter/v1/entrust_record/page', data).then(res => res), http.post('soil/v1/entrust_record/page', data).then(res => res),
// 任务分配操作日志 // 任务分配操作日志
pageTask: data => pageTask: data =>
http.post('meter/v1/sample_record/page', data).then(res => res), http.post('meter/v1/sample_record/page', data).then(res => res),
...@@ -154,5 +154,11 @@ export default { ...@@ -154,5 +154,11 @@ export default {
http.post('/meter/v1/contract_attachment/preview/' + data).then(res => res), http.post('/meter/v1/contract_attachment/preview/' + data).then(res => res),
// 委托附件预览 // 委托附件预览
entrustPreview: data => entrustPreview: data =>
http.post('/meter/v1/entrust_attachment/preview/' + data).then(res => res) http.post('/meter/v1/entrust_attachment/preview/' + data).then(res => res),
// 余样操作日志分页列表
prepareRecordPage: data =>
http.post('soil/v1/prepare_record/page', data).then(res => res),
// 备样操作日志分页列表
backupRecordPage: data =>
http.post('soil/v1/sample_backup_record/page', data).then(res => res)
} }
/**
* 工作台
*/
import http from '../http'
// import { https } from '../https'
export default {
// 检测依据管理
standardPage: data =>
http.post('soil/v1/standard/page', data).then(res => res),
standardGetById: data =>
http.get('soil/v1/standard/' + data).then(res => res),
standardSave: data => http.post('soil/v1/standard/', data).then(res => res),
standardEdit: data =>
http.put('soil/v1/standard/' + data.id, data.obj).then(res => res),
standardDeleteById: data =>
http.delete('soil/v1/standard/?ids=' + data).then(res => res),
// 试验项目
// page
page: data => http.post('soil/v1/aptitude_exp/page', data).then(res => res),
getById: data => http.get('soil/v1/aptitude_exp/' + data).then(res => res),
deleteById: data =>
http.delete('soil/v1/aptitude_exp/?ids=' + data).then(res => res),
// 保存
save: data => http.post('soil/v1/aptitude_exp/', data).then(res => res),
edit: data =>
http.put('soil/v1/aptitude_exp/' + data.id, data.obj).then(res => res),
// 指标页面
expItemPage: data =>
http.post('soil/v1/exp_item/page', data).then(res => res),
expItemDeleteByIds: data =>
http.delete('soil/v1/exp_item/?ids=' + data).then(res => res),
expItemSave: data => http.post('soil/v1/exp_item/', data).then(res => res),
expItemEdit: data =>
http.put('soil/v1/exp_item/' + data.id, data.obj).then(res => res),
expItemGetById: data => http.get('soil/v1/exp_item/' + data).then(res => res),
getStandardList: data =>
http.post('soil/v1/standard/list', data).then(res => res),
getGroupList: data =>
http.post('/res/v1/user_group/list', data).then(res => res),
getBasisList: data =>
http.post('soil/v1/standard/list', data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('soil/v1/entrust/page', data).then(res => res),
pageRegHis: data =>
http.post('soil/v1/entrust/page_reg_his', data).then(res => res),
pageItem: data => http.post('soil/v1/experiment/page', data).then(res => res),
pageItemByEntrustId: data =>
http.post('soil/v1/experiment/page_by_entrust', data).then(res => res),
pageReview: data =>
http.post('soil/v1/entrust/page_review', data).then(res => res),
pageSampleReceive: data =>
http.post('soil/v1/entrust/page_sample_receive', data).then(res => res),
pageSampleTake: data =>
http.post('soil/v1/entrust/page_sample_take', data).then(res => res),
pageSampleReceiveHis: data =>
http.post('soil/v1/entrust/page_sample_receive_his', data).then(res => res),
pageSamplePrepare: data =>
http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res),
pageSamplePrepareHis: data =>
http.post('soil/v1/entrust/page_sample_prepare_his', data).then(res => res),
getById: data => http.get('soil/v1/entrust/' + data).then(res => res),
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data =>
http.delete('soil/v1/entrust/?ids=' + data).then(res => res),
// 保存
save: data =>
https
.post('soil/v1/entrust/add_entrust', JSON.stringify(data))
.then(res => res),
edit: data => http.put('soil/v1/entrust/' + data.id, data.obj),
editDTO: data =>
https
.post('soil/v1/entrust/edit_entrust', JSON.stringify(data))
.then(res => res),
editItem: data => http.put('soil/v1/experiment/' + data.id, data.obj),
submit: data =>
https.post('soil/v1/entrust/submit_to_review?ids=' + data).then(res => res),
submitSkipReview: data =>
https
.post('soil/v1/entrust/submit_to_skip_review?ids=' + data)
.then(res => res),
back: data =>
http
.post(
'soil/v1/entrust/review_back?ids=' + data.ids + '&reason=' + data.remark
)
.then(res => res),
reviewPass: data =>
http.post('soil/v1/entrust/review_pass?ids=' + data).then(res => res),
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageReceive: data =>
http.post('soil/v1/sample/page_receive', data).then(res => res),
pageReceiveHis: data =>
http.post('soil/v1/sample/page_receive_his', data).then(res => res),
pageSend: data =>
http.post('soil/v1/sample/page_send', data).then(res => res),
pageSendHis: data =>
http.post('soil/v1/sample/page_send_his', data).then(res => res),
receiveSample: data =>
http.post('soil/v1/sample/receive_sample', data).then(res => res),
sendSample: data =>
http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data =>
http.post('soil/v1/sample/page_prepare', data).then(res => res),
pagePrepareHis: data =>
http.post('soil/v1/sample/page_prepare_his', data).then(res => res),
pagePrepareDetailHis: data =>
http.post('soil/v1/prepare/page_prepare_his', data).then(res => res),
sampleEdit: data =>
http.put(
'soil/v1/sample/' + data.id + '?describeDetail=' + data.describeDetail
),
weiteSoilDetail: data =>
http.post('soil/v1/sample/write_soil_detail', data).then(res => res),
pageBackup: data =>
http.post('soil/v1/sample_backup/page_backup', data).then(res => res),
// 试验项目列表
experimentPage: data =>
http.post('soil/v1/experiment/page', data).then(res => res),
// 开土制备试验照片预览
photoView: data =>
http
.get('soil/v1/sample_photo/view?objectKey=' + data.objectKey)
.then(res => res),
// 试样制备表
preparePage: data =>
http
.post('soil/v1/sample/obtain_prepare_data?ids=' + data)
.then(res => res),
// 试样制备完成
savePrepare: data =>
https
.post('soil/v1/sample/prepare_ok', JSON.stringify(data))
.then(res => res),
// 试验室按样品分页列表
pageTake: data =>
http.post('soil/v1/sample/page_take', data).then(res => res),
testType: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
// import { https } from '../https'
export default {
// 报告编制 历史报告分页列表
pageReportMakeHis: data =>
http.post('soil/v1/entrust/page_report_make_his', data).then(res => res),
// 报告审核 历史任务分页列表
pageReportCheckHis: data =>
http.post('soil/v1/entrust/page_report_check_his', data).then(res => res),
// 报告签发 历史任务分页列表
pageReportIssueHis: data =>
http.post('soil/v1/entrust/page_report_issue_his', data).then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
locationPage: data =>
http.post('soil/v1/receive_location/page', data).then(res => res),
locationList: data =>
http.post('soil/v1/receive_location/list', data).then(res => res),
locationGetById: data =>
http.get('soil/v1/receive_location/' + data).then(res => res),
locationSave: data =>
http.post('soil/v1/receive_location/', data).then(res => res),
locationDeleteById: data =>
http.delete('soil/v1/receive_location/?ids=' + data).then(res => res),
locationEdit: data =>
http.put('soil/v1/receive_location/' + data.id, data.obj).then(res => res),
// 试验室领样操作
takeSample: data =>
http.post('soil/v1/sample/take_sample?ids=' + data).then(res => res),
// 备样历史分页列表
pageBackupHis: data =>
http.post('soil/v1/sample_backup/page_backup_his', data).then(res => res),
// 备样管理提交申请
appleHandle: data =>
http.post('soil/v1/sample_backup/apply_handle', data).then(res => res),
// 样品处理分页列表
pageBackupHandleCheck: data =>
http
.post('soil/v1/sample_backup/page_backup_handle_check', data)
.then(res => res),
pageBackupHandleCheckHis: data =>
http
.post('soil/v1/sample_backup/page_backup_handle_check_his', data)
.then(res => res),
// 样品处理审批通过
disposalOk: data =>
http.post('soil/v1/sample_backup/disposal_ok?ids=' + data).then(res => res),
// 样品处理审批驳回
disposalFail: data =>
http
.post(
'soil/v1/sample_backup/disposal_fail?ids=' +
data.ids +
'&reason=' +
data.remark
)
.then(res => res),
// 备样管理处理备样申请
handleOk: data =>
http.post('soil/v1/sample_backup/handle_ok?ids=' + data).then(res => res),
pageSurplus: data =>
http.post('soil/v1/prepare/page_surplus', data).then(res => res),
// 余样处理审批分页列表
pageSurplusHandleCheck: data =>
http
.post('soil/v1/prepare/page_surplus_handle_check', data)
.then(res => res),
// 余样管理处理备样申请
surplusApplyHandle: data =>
http.post('soil/v1/prepare/apply_handle', data).then(res => res),
// 余样管理处理备样申请
surplusHandleOk: data =>
http.post('soil/v1/prepare/handle_ok?ids=' + data).then(res => res),
// 余品处理审批通过
surplusDisposalOk: data =>
http.post('soil/v1/prepare/disposal_ok?ids=' + data).then(res => res),
// 余样处理审批驳回
surplueDisposalFail: data =>
http
.post(
'soil/v1/prepare/disposal_fail?ids=' +
data.ids +
'&reason=' +
data.remark
)
.then(res => res),
// 余样样品历史分页列表
pageSurplusHis: data =>
http.post('soil/v1/prepare/page_surplus_his', data).then(res => res),
// 报告模板
reportTemplate: data =>
http.post('soil/v1/report/page', data).then(res => res),
reportMake: data =>
https
.post('soil/v1/report/make_report', JSON.stringify(data))
.then(res => res),
getReport: data =>
http.get('soil/v1/report/get_report_' + data).then(res => res),
getToken: data =>
http.get('/print/url/get_access_token', data).then(res => res),
// 报告编制提交至报告审核
reportMakeSubmit: data =>
http
.post('soil/v1/entrust/report_make_submit?ids=' + data)
.then(res => res),
// 报告审核提交至报告签发
reportCheckSubmit: data =>
http
.post('soil/v1/entrust/report_check_submit?ids=' + data)
.then(res => res),
// 报告审核退回至报告编制
reportCheckBack: data =>
http
.post(
'soil/v1/entrust/report_check_back?ids=' +
data.ids +
'&reason=' +
data.remark
)
.then(res => res),
// 报告签发提交
reportIssueSubmit: data =>
http
.post('soil/v1/entrust/report_issue_submit?ids=' + data)
.then(res => res),
// 报告签发退回
reportIssueBack: data =>
http
.post(
'soil/v1/entrust/report_issue_back?ids=' +
data.ids +
'&reason=' +
data.remark
)
.then(res => res),
getDictList: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res),
editBackup: data =>
http.put('soil/v1/sample_backup/' + data.id, data.obj).then(res => res),
editItem: data =>
http.post('soil/v1/experiment/bath_update_info', data).then(res => res),
// 余样编辑
editPrepare: data =>
http.put('soil/v1/prepare/' + data.id, data.obj).then(res => res),
getUserList: data => http.post('/base/v1/user/page').then(res => res)
}
/**
* 工作台
*/
import http from '../http'
// import { https } from '../https'
export default {
// 检测依据管理
pageReportMake: data =>
http.post('soil/v1/entrust/page_report_make', data).then(res => res),
pageReportCheck: data =>
http.post('soil/v1/entrust/page_report_check', data).then(res => res),
pageReportIssue: data =>
http.post('soil/v1/entrust/page_report_issue', data).then(res => res),
pageAnnual: data =>
http
.post('soil/v1/statistics/page_annual_entrust_statistics', data)
.then(res => res),
pageCustomer: data =>
http
.post('soil/v1/statistics/page_customer_entrust_statistics', data)
.then(res => res),
listCoordinateStatistics: data =>
http
.post('soil/v1/statistics/list_coordinate_statistics', data)
.then(res => res),
pageCustomerEntrustStatistics: data =>
http
.post('soil/v1/statistics/page_customer_entrust_statistics', data)
.then(res => res),
pageCoordinateStatistics: data =>
http
.post('soil/v1/statistics/page_coordinate_statistics', data)
.then(res => res),
filePage: data =>
http.post('soil/v1/standard_annex/page', data).then(res => res),
// 待完成委托量
pageWaitEnd: data =>
http
.post('soil/v1/statistics/page_wait_end_entrust_statistics', data)
.then(res => res)
}
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
// import { https } from '../https'
export default {
// page
pageExpAllot: data =>
http.post('soil/v1/entrust/page_exp_allot', data).then(res => res),
// 试验任务分配按样品分配分页列表
pageExpAllotSample: data =>
http.post('soil/v1/sample/page_exp_allot_sample', data).then(res => res),
// 试验任务按样品分配-试验项目分配操作
allotExp: data =>
http.post('soil/v1/experiment/allot_exp', data).then(res => res),
// 试验任务分配样品对应检测项目分页列表
pageAllot: data =>
http.post('soil/v1/experiment/page_allot', data).then(res => res),
pageExpTest: data =>
http.post('soil/v1/entrust/page_exp_test', data).then(res => res),
pageExpTestHis: data =>
http.post('soil/v1/entrust/page_exp_test_his', data).then(res => res),
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageExpTestSample: data =>
http.post('soil/v1/sample/page_exp_test_sample', data).then(res => res),
pageExpAuditSample: data =>
http.post('soil/v1/sample/page_exp_audit_sample', data).then(res => res),
pageExpCheckSample: data =>
http.post('soil/v1/sample/page_exp_check_sample', data).then(res => res),
pageItem: data => http.post('soil/v1/experiment/page', data).then(res => res),
pageAllotByExp: data =>
http.post('soil/v1/experiment/page_allot_by_exp', data).then(res => res),
pageExperimentAllot: data =>
http.post('soil/v1/experiment/page_exp_allot', data).then(res => res),
pageTestByExp: data =>
http.post('soil/v1/experiment/page_test_by_exp', data).then(res => res),
pageExperimentTest: data =>
http.post('soil/v1/experiment/page_exp_test', data).then(res => res),
zTree: data =>
http.post('/print/v1/template_category/ztree', data).then(res => res),
templatePage: data =>
http.post('/print/v1/template/page', data).then(res => res),
checkLimit: data =>
http.post('/env/v1/env_item/check_limit', data).then(res => res),
searchItem: data =>
http
.post('/env/v1/env_item/search_all_common_sample_count', data)
.then(res => res),
saveItem: data =>
http
.post('soil/v1/original_record/save_original_record', data)
.then(res => res),
recordPage: data =>
http.post('soil/v1/original_record/page', data).then(res => res),
pageTest: data =>
http.post('soil/v1/experiment/page_test', data).then(res => res),
pageCheck: data =>
http.post('soil/v1/experiment/page_check', data).then(res => res),
pageAudit: data =>
http.post('soil/v1/experiment/page_audit', data).then(res => res),
updateItem: data =>
http
.post('soil/v1/original_record/update_original_record', data)
.then(res => res),
pageOriginalExp: data =>
http.post('soil/v1/experiment/page_original_exp', data).then(res => res),
// 查看指标分页列表
itemPage: data => http.post('soil/v1/item/page', data).then(res => res),
itemSave: data => http.post('soil/v1/item/', data).then(res => res),
itemEdit: data =>
http.put('soil/v1/item/' + data.id, data.obj).then(res => res),
itemGetById: data => http.get('soil/v1/item/' + data).then(res => res),
endExp: data =>
http.post('soil/v1/experiment/end_exp?ids=' + data).then(res => res),
pageExpCheck: data =>
http.post('soil/v1/entrust/page_exp_check', data).then(res => res),
endExpCheck: data =>
http.post('soil/v1/experiment/end_exp_check?ids=' + data).then(res => res),
endExpAudit: data =>
http.post('soil/v1/experiment/end_exp_audit?ids=' + data).then(res => res),
pageCheckByExp: data =>
http.post('soil/v1/experiment/page_check_by_exp', data).then(res => res),
pageExpByCheck: data =>
http.post('soil/v1/experiment/page_exp_check', data).then(res => res),
pageExpAudit: data =>
http.post('soil/v1/entrust/page_exp_audit', data).then(res => res),
pageAuditByExp: data =>
http.post('soil/v1/experiment/page_audit_by_exp', data).then(res => res),
pageExpByAudit: data =>
http.post('soil/v1/experiment/page_exp_audit', data).then(res => res),
auditBack: data =>
http
.post(
'soil/v1/experiment/exp_audit_back?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
checkBack: data =>
http
.post(
'soil/v1/experiment/exp_check_back?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
// 添加设备信息
addExpEquip: data =>
https
.post('soil/v1/experiment_rel_equip/add_exp_equip', JSON.stringify(data))
.then(res => res),
equipPage: data =>
http.post('soil/v1/experiment_rel_equip/page', data).then(res => res),
deleteEquip: data =>
http.delete('soil/v1/experiment_rel_equip/?ids=' + data).then(res => res),
pageExpCheckHis: data =>
http.post('soil/v1/entrust/page_exp_check_his', data).then(res => res),
pageExpTestSampleHis: data =>
http.post('soil/v1/sample/page_exp_test_sample_his', data).then(res => res),
// 数据复核历史任务 试样分页列表
pageExpCheckSampleHis: data =>
http
.post('soil/v1/sample/page_exp_check_sample_his', data)
.then(res => res),
// 数据审核 按照样品审核 右侧分页列表
pageExpAuditSampleHis: data =>
http
.post('soil/v1/sample/page_exp_audit_sample_his', data)
.then(res => res),
collectDataPage: data =>
http.post('soil/v1/experiment_collect_data/page', data).then(res => res),
collectFilePage: data =>
http.post('soil/v1/experiment_collect_file/page', data).then(res => res)
}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* 组织表相关 * 组织表相关
*/ */
// import Global from '../config'
import http from '../http' import http from '../http'
export default { export default {
...@@ -18,5 +19,7 @@ export default { ...@@ -18,5 +19,7 @@ export default {
// 分配机构ztree // 分配机构ztree
orginTreeList: () => http.post('/base/v1/org/org_tree').then(res => res), orginTreeList: () => http.post('/base/v1/org/org_tree').then(res => res),
// 当前用户所在部门 // 当前用户所在部门
getOrg: () => http.get('/base/v1/org/current').then(res => res) getOrg: () => http.get('/base/v1/org/current').then(res => res),
// 首页模块
getModulesList: () => http.post('/base/v1/module/list_user_module_soil')
} }
...@@ -82,7 +82,6 @@ export default { ...@@ -82,7 +82,6 @@ export default {
}, },
watch: { watch: {
value: function(newVal, oldVal) { value: function(newVal, oldVal) {
console.log(newVal)
this.dataValue = newVal this.dataValue = newVal
} }
}, },
...@@ -123,7 +122,7 @@ export default { ...@@ -123,7 +122,7 @@ export default {
}, },
// 聚焦 // 聚焦
_inputFocus() { _inputFocus() {
console.log('下拉选项', this.downData, this.showKey) // console.log('下拉选项', this.downData, this.showKey)
// this.isFocus = true; // this.isFocus = true;
if (this.focus !== undefined) { if (this.focus !== undefined) {
this.$emit('on-result-change', 'focus', '', this.dataHandObj) this.$emit('on-result-change', 'focus', '', this.dataHandObj)
...@@ -133,17 +132,26 @@ export default { ...@@ -133,17 +132,26 @@ export default {
} }
</script> </script>
<style> <style>
.ivu-modal-mask { /*.ivu-modal-mask {*/
z-index: 1000 !important; /* z-index: 1000 !important;*/
} /*}*/
.ivu-modal-wrap { /*.ivu-modal-wrap {*/
z-index: 1000 !important; /* z-index: 1000 !important;*/
} /*}*/
.iview-input-error .ivu-input { .iview-input-error .ivu-input {
border: 1px solid #eb6877 !important; border: 1px solid #eb6877 !important;
} }
/*.el-dropdown-menu__item {*/
/* z-index: 3000 !important;*/
/* max-width: 400px !important;*/
/*}*/
.el-dropdown-menu {
z-index: 2147483647 !important;
}
.el-select-dropdown {
z-index: 2147483647 !important;
}
.el-dropdown-menu__item { .el-dropdown-menu__item {
z-index: 3000 !important;
max-width: 400px !important; max-width: 400px !important;
} }
</style> </style>
...@@ -81,6 +81,7 @@ export default { ...@@ -81,6 +81,7 @@ export default {
this.subcontractorId = '' this.subcontractorId = ''
this.originalRecordId = '' this.originalRecordId = ''
this.curveId = '' this.curveId = ''
this.entrustId = ''
this.idKey = key this.idKey = key
switch (key) { switch (key) {
// 委托 // 委托
...@@ -97,6 +98,19 @@ export default { ...@@ -97,6 +98,19 @@ export default {
viewUri: '/meter/v1/entrust_attachment/preview/' viewUri: '/meter/v1/entrust_attachment/preview/'
} }
break break
case 'entrustId':
this.entrustId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: 'soil/v1/entrust_annex/page',
deleteUrl: '/soil/v1/entrust_annex/?ids=',
uploadFileUrl: '/soil/v1/standard_annex/upload/',
downloadFileUrl: '/soil/v1/standard_annex/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: '/soil/v1/standard_annex/preview/'
}
break
case 'sampleId': case 'sampleId':
// 样品 // 样品
this.sampleId = id this.sampleId = id
...@@ -159,11 +173,13 @@ export default { ...@@ -159,11 +173,13 @@ export default {
sampleId: this.sampleId, sampleId: this.sampleId,
subcontractorId: this.subcontractorId, subcontractorId: this.subcontractorId,
originalRecordId: this.originalRecordId, originalRecordId: this.originalRecordId,
curveId: this.curveId curveId: this.curveId,
entrustId: this.entrustId
} }
this.$refs.fileModal._setUploadData( this.$refs.fileModal._setUploadData(
Object.assign({ id: id }, this.urlData), Object.assign({ id: id }, this.urlData),
idsObj idsObj,
this.idKey
) )
}, },
_deleteById(ids) { _deleteById(ids) {
...@@ -206,7 +222,7 @@ export default { ...@@ -206,7 +222,7 @@ export default {
}, },
// 搜索 // 搜索
_search() { _search() {
this.$refs.fileModal._page() this.$refs.fileModal._page(this.fileName)
} }
} }
} }
......
...@@ -165,8 +165,8 @@ export default { ...@@ -165,8 +165,8 @@ export default {
// {title: '上传人', key: 'cname', width: 120}, // {title: '上传人', key: 'cname', width: 120},
], ],
formObj: { formObj: {
contractId: '', contractId: undefined,
entrustId: '' entrustId: undefined
}, },
viewVal: 1, viewVal: 1,
viewStyle: 1, viewStyle: 1,
...@@ -202,13 +202,17 @@ export default { ...@@ -202,13 +202,17 @@ export default {
} }
}, },
methods: { methods: {
_setUploadData(data, idsObj) { _setUploadData(data, idsObj, idKey) {
this.selectIds = [] this.selectIds = []
this.imgViewIndex = null this.imgViewIndex = null
this.isLoad = false this.isLoad = false
this.id = data.id this.id = data.id
this.formObj.contractId = data.id const pageKey = idKey
this.formObj.entrustId = data.id console.log(pageKey)
this.$set(this.formObj, pageKey, data.id)
console.log(this.formObj)
// this.formObj.contractId = data.id
// this.formObj.entrustId = data.id
// 各个ids // 各个ids
this.idsObj = idsObj this.idsObj = idsObj
this.urlData = data this.urlData = data
...@@ -217,7 +221,12 @@ export default { ...@@ -217,7 +221,12 @@ export default {
this._page() this._page()
}) })
}, },
_page: async function() { _page: async function(fileName) {
if (fileName) {
this.formObj.fileName = fileName
} else {
this.formObj.fileName = undefined
}
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.attachmentPage( const result = await meterEntrust.attachmentPage(
this.urlData.pageUrl, this.urlData.pageUrl,
......
<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 './PhotoManageCont'
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 './PhotoList'
export default {
components: {
FilesList,
ModalConfirm
},
props: {
// 只能删除自己的标识
flag: null
},
data() {
return {
fileName: '',
selectIds: [],
getPage: {},
// ids
contractId: '',
sampleId: '',
subcontractorId: '',
originalRecordId: '',
curveId: '',
// 用于区分是哪种附件(合同、委托、样品)
idKey: '',
// 弹框的内容
modalContent: '',
btnModalList: [
{ type: '', name: '取消' },
{ type: 'primary', name: '确定' }
],
//
deleteId: [],
urlData: {}
}
},
methods: {
/**
* msg:表示是哪种附件(委托,样品,分包商)
* pageUrl:page 请求地址
* deleteUrl:删除请求地址
* uploadFileUrl:上传地址
* downloadFileUrl:下载地址
* uri:预览请求地址
* viewUri:预览图片地址
* downloadBatch:批量打包下载
*/
_open(id, key) {
this.fileName = ''
this.showModal = true
this.contractId = ''
this.sampleId = ''
this.subcontractorId = ''
this.originalRecordId = ''
this.curveId = ''
this.entrustId = ''
this.idKey = key
switch (key) {
// 委托
case 'contractId':
this.contractId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: '/meter/v1/entrust_attachment/page',
deleteUrl: '/meter/v1/entrust_attachment/?ids=',
uploadFileUrl: '/meter/v1/entrust_attachment/upload/',
downloadFileUrl: '/meter/v1/entrust_attachment/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: '/meter/v1/entrust_attachment/preview/'
}
break
case 'entrustId':
this.entrustId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: '/soil/v1/sample_photo/page',
deleteUrl: '/soil/v1/sample_photo/?ids=',
uploadFileUrl: '/soil/v1/sample_photo/upload/',
downloadFileUrl: '/soil/v1/sample_photo/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: 'soil/v1/sample_photo/view'
}
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,
entrustId: this.entrustId
}
this.$refs.fileModal._setUploadData(
Object.assign({ id: id }, this.urlData),
idsObj,
this.idKey
)
},
_deleteById(ids) {
this.deleteId = ids
this.modalContent = '确定要删除这 ' + ids.length + ' 个附件?'
this.$refs.confirmModal._openModal()
},
_delPage: async function(data) {
console.log(data)
const result = await meterEntrust.attachmentDelete(
this.urlData.deleteUrl,
data.id
)
if (result) {
this.$Message.success('删除成功!')
this.$refs.fileModal._page()
}
this.$refs.confirmModal._closeModal()
this.deleteId = []
},
// 删除提示框返回
_modalResult(msg) {
if (msg === '确定') {
// 删除一条记录
if (this.flag === undefined) {
// 只能删除自己上传的
this._delPage({ id: this.deleteId, flag: 1 })
} else {
// 可以删除全部
this._delPage({ id: this.deleteId })
}
}
},
_fileData(msg, data) {
switch (msg) {
case 'delete':
this._deleteById(data)
break
}
},
// 搜索
_search() {
this.$refs.fileModal._page()
}
}
}
</script>
...@@ -272,7 +272,8 @@ export default { ...@@ -272,7 +272,8 @@ export default {
this._changeTags() this._changeTags()
} else { } else {
// 其他 // 其他
window.open(global.webURL + '/#/sysmanage?query=' + data, '_blank') // window.open(global.webURL + '/#/sysmanage?query=' + data, '_blank')
window.open(global.webURL + '/sys/personal_data/my_home', '_blank')
} }
}, },
// 多标签 // 多标签
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</Spin> </Spin>
</div> </div>
<div> <div>
<Button v-if="hideDownloadBtn===undefined" size="large" @click="_download">下载模板</Button> <Button v-if="hideDownloadBtn===undefined" @click="_download" size="large">下载模板</Button>
</div> </div>
<div slot="footer" class="btn-width"> <div slot="footer" class="btn-width">
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}, },
errorMessage: '', errorMessage: '',
successMessage: '', successMessage: '',
format: ['xlsx', 'xls'], format: ['xlsx', 'xls', 'doc', 'docx'],
importUrl: '', importUrl: '',
downloadUrl: '', downloadUrl: '',
// 500的提示语 // 500的提示语
...@@ -130,7 +130,9 @@ export default { ...@@ -130,7 +130,9 @@ export default {
title: '文件格式不正确', title: '文件格式不正确',
duration: 10, duration: 10,
desc: desc:
'文件 ' + file.name + ' 格式不正确,请上传格式为 .xlsx、xls 的文件!' '文件 ' +
file.name +
' 格式不正确,请上传格式为 .xlsx、xls、doc、docx 的文件!'
}) })
this.isLoad = false this.isLoad = false
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<Form id="search-contract-record" :label-width="70" inline onsubmit="return false"> <Form id="search-contract-record" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="操作阶段:"> <Form-item label="操作阶段:">
<Input v-model="formObj.origin" @on-enter="_search" placeholder="请输入操作阶段" <Input v-model="formObj.origin" @on-enter="_search" name="origin" placeholder="请输入操作阶段"
style="width: 200px" clearable/> style="width: 200px" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
:key="item.key" :key="item.key"
:field="item.key" :field="item.key"
:title="item.title" :title="item.title"
:min-width="item.width?item.width:200" :fixed="item.fixed?item.fixed:undefined"> :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.key==='type'"> <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] === 0 ? '流转' : scope.row[item.key] === 1 ? '退回': scope.row[item.key] === 2 ?'更新' :
...@@ -64,9 +65,9 @@ export default { ...@@ -64,9 +65,9 @@ export default {
{ title: '责任人', key: 'liable', width: 80 } { title: '责任人', key: 'liable', width: 80 }
], ],
formObj: { formObj: {
entrustId: '', entrustId: undefined,
origin: undefined, origin: undefined,
sampleId: '' sampleId: undefined
} }
} }
}, },
...@@ -88,6 +89,16 @@ export default { ...@@ -88,6 +89,16 @@ export default {
this.formObj.entrustId = undefined this.formObj.entrustId = undefined
this._pageTask() this._pageTask()
}, },
_openSurplus(samplePrepareId) {
this.showModal = true
this.formObj.samplePrepareId = samplePrepareId
this._pageSurplus()
},
_openBcakup(sampleBackupId) {
this.showModal = true
this.formObj.sampleBackupId = sampleBackupId
this._pageBackup()
},
_page: async function() { _page: async function() {
console.log('要传的参数') console.log('要传的参数')
console.log(this.formObj) console.log(this.formObj)
...@@ -102,6 +113,22 @@ export default { ...@@ -102,6 +113,22 @@ export default {
// this.$serializeFormSearch(this.formObj) // this.$serializeFormSearch(this.formObj)
// ) // )
}, },
_pageSurplus: async function() {
const result = await meterEntrust.prepareRecordPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
}
},
_pageBackup: async function() {
const result = await meterEntrust.backupRecordPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
}
},
_pageTask: async function() { _pageTask: async function() {
console.log('要传的参数') console.log('要传的参数')
console.log(this.formObj) console.log(this.formObj)
...@@ -122,7 +149,15 @@ export default { ...@@ -122,7 +149,15 @@ export default {
} }
}, },
_search() { _search() {
this.$refs.pageTable._pageChange(1) if (this.formObj.entrustId !== undefined) {
this._page()
} else if (this.formObj.sampleBackupId !== undefined) {
this._pageBackup()
} else if (this.formObj.samplePrepareId !== undefined) {
this._pageSurplus()
} else {
this._pageTask()
}
} }
} }
} }
......
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
// 'LmsEquipInfo/page', // 'LmsEquipInfo/page',
// this.$serializeFormSearch(this.formObj) // this.$serializeFormSearch(this.formObj)
// ) // )
const result = await equip.page() const result = await equip.page(this.$serializeFormSearch(this.formObj))
console.log('仪器结果', result) console.log('仪器结果', result)
if (result) { if (result) {
this.getPage = result this.getPage = result
...@@ -204,13 +204,8 @@ export default { ...@@ -204,13 +204,8 @@ export default {
} }
}, },
_ok() { _ok() {
if (this.tempData.length === 0) {
this.$Message.warning('请至少选择一条数据!')
this._hideLoading()
} else {
this.$emit('on-result-change', this.tempData, { obj: this.tempObj }) this.$emit('on-result-change', this.tempData, { obj: this.tempObj })
this._cancel() this._cancel()
}
}, },
_cancel() { _cancel() {
this.showModal = false this.showModal = false
......
...@@ -267,7 +267,7 @@ export default { ...@@ -267,7 +267,7 @@ export default {
for (let i = 0; i < selData.length; i++) { for (let i = 0; i < selData.length; i++) {
idList.push(selData[i].id) idList.push(selData[i].id)
} }
this.$emit('on-result-change', 'selectIds', idList) this.$emit('on-result-change', 'selectIds', idList, selData)
} else { } else {
// 有selectData参数时执行 // 有selectData参数时执行
this.$emit('on-result-change', 'selectData', selData) this.$emit('on-result-change', 'selectData', selData)
...@@ -276,6 +276,7 @@ export default { ...@@ -276,6 +276,7 @@ export default {
}, },
// 整行变色 // 整行变色
_tableRowClassName({ row, rowIndex }) { _tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
if (this.checkData.length !== 0) { if (this.checkData.length !== 0) {
/* 选中的进行高亮显示 */ /* 选中的进行高亮显示 */
const index = this.checkData.indexOf(row) const index = this.checkData.indexOf(row)
...@@ -418,6 +419,9 @@ export default { ...@@ -418,6 +419,9 @@ export default {
obj: obj obj: obj
}) })
}, },
checkedData() {
this.$emit('on-result-change', 'allSelect', this.$refs.xTable.selection)
},
// 双击行操作 // 双击行操作
_dbChange(data, event) { _dbChange(data, event) {
this.$emit('on-result-change', 'dbSelect', data.row) this.$emit('on-result-change', 'dbSelect', data.row)
......
...@@ -124,6 +124,33 @@ export default { ...@@ -124,6 +124,33 @@ export default {
this.$refs.userCheck._refresh() this.$refs.userCheck._refresh()
this.$refs.marshalling._uidOpen(uid) this.$refs.marshalling._uidOpen(uid)
}, },
_openGoup(modalTitle, treeName) {
this.modalTitle = modalTitle
this.changeBool = false
this.showUserModal = true
this.titleChange = '用户编组'
if (treeName === undefined) {
this.treeName = 'userMan'
} else {
this.treeName = treeName
}
this.$refs.userCheck._refresh()
this.$refs.marshalling._open()
},
_openOrg(modalTitle, treeName) {
this.modalTitle = modalTitle
this.changeBool = false
this.showUserModal = true
this.titleChange = '用户编组'
this._changeLimit()
if (treeName === undefined) {
this.treeName = 'userMan'
} else {
this.treeName = treeName
}
this.$refs.userCheck._refresh()
this.$refs.marshalling._open()
},
// 当前登录用户所处的组织 // 当前登录用户所处的组织
_getCurrentOrg: async function() { _getCurrentOrg: async function() {
const result = await sysOrg.getOrg() const result = await sysOrg.getOrg()
...@@ -135,6 +162,7 @@ export default { ...@@ -135,6 +162,7 @@ export default {
} }
}, },
_orgData(data) { _orgData(data) {
console.log(data)
this.$refs.userCheck._open(data.id, this.treeName) this.$refs.userCheck._open(data.id, this.treeName)
this.currentRowData = {} this.currentRowData = {}
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
module.exports = { module.exports = {
apps: [ apps: [
{ {
name: 'pt-soil', name: 'pt-metr',
script: './node_modules/nuxt-start/bin/nuxt-start.js', script: './node_modules/nuxt-start/bin/nuxt-start.js',
instances: 2, instances: 2,
max_memory_restart: '512M', max_memory_restart: '512M',
......
// 请求地址 // 请求地址
WEB_URL=http://web.dev.patzn.com:8028 WEB_URL=http://web.dev.patzn.com:8096
BASE_URL=http://api.dev.patzn.com:7000 BASE_URL=http://api.dev.patzn.com:7000
SSO_URL=http://api.dev.patzn.com:7000 SSO_URL=http://api.dev.patzn.com:7000
STATIC_URL=http://static.patzn.com STATIC_URL=http://static.patzn.com
RECORD_URL=http://record.patzn.com:7000
NC_URL=http://123.133.38.68:8088 NC_URL=http://123.133.38.68:8088
// 请求地址 // 请求地址
WEB_URL=http://sys.pertest.patzn.com WEB_URL=http://soil.pertest.patzn.com
BASE_URL=http://api.pertest.patzn.com BASE_URL=http://api.pertest.patzn.com
SSO_URL=http://sso.pertest.patzn.com SSO_URL=http://sso.pertest.patzn.com
STATIC_URL=http://static.patzn.com STATIC_URL=http://static.patzn.com
......
// 请求地址 // 请求地址
WEB_URL=http://meter.patzn.com WEB_URL=http://soil.patzn.com
BASE_URL=http://api.patzn.com BASE_URL=http://api.patzn.com
SSO_URL=http://sso.patzn.com SSO_URL=http://sso.patzn.com
STATIC_URL=http://static.patzn.com STATIC_URL=http://static.patzn.com
......
// 请求地址 // 请求地址
WEB_URL=http://sys.test.patzn.com WEB_URL=http://soil.test.patzn.com
BASE_URL=http://api.test.patzn.com BASE_URL=http://api.test.patzn.com
SSO_URL=http://sso.test.patzn.com SSO_URL=http://sso.test.patzn.com
STATIC_URL=http://static.patzn.com STATIC_URL=http://static.patzn.com
......
...@@ -9,14 +9,14 @@ if (process.env.NODE_ENV) { ...@@ -9,14 +9,14 @@ if (process.env.NODE_ENV) {
module.exports = { module.exports = {
mode: 'universal', mode: 'universal',
server: { server: {
port: 8131, port: 8133,
host: '0.0.0.0' host: '0.0.0.0'
}, },
/* /*
** Headers of the page ** Headers of the page
*/ */
head: { head: {
title: '计量检定LIMS', title: '土工试验LIMS',
meta: [ meta: [
{ charset: 'utf-8' }, { charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' },
...@@ -27,6 +27,13 @@ module.exports = { ...@@ -27,6 +27,13 @@ module.exports = {
{ {
src: src:
'http://static.patzn.com/thirdparty/ztree/zTree_v3-3.5.29/js/jquery.ztree.all.min.js' 'http://static.patzn.com/thirdparty/ztree/zTree_v3-3.5.29/js/jquery.ztree.all.min.js'
},
{
src: 'http://static.patzn.com/thirdparty/layx/layx-2.5.3.min.js'
},
{
src:
'http://api.map.baidu.com/api?v=2.0&ak=o7zOtlrjZq7LTzVTyEiI6VhmRYYPrlKb'
} }
], ],
link: [ link: [
...@@ -52,7 +59,11 @@ module.exports = { ...@@ -52,7 +59,11 @@ module.exports = {
rel: 'stylesheet', rel: 'stylesheet',
href: 'http://static.patzn.com/theme/my-theme/main.css' href: 'http://static.patzn.com/theme/my-theme/main.css'
}, },
{ rel: 'stylesheet', href: '', name: 'theme' } { rel: 'stylesheet', href: '', name: 'theme' },
{
rel: 'stylesheet',
href: 'http://static.patzn.com/thirdparty/layx/layx-2.5.3.min.css'
}
] ]
}, },
...@@ -83,7 +94,8 @@ module.exports = { ...@@ -83,7 +94,8 @@ module.exports = {
{ src: '~/plugins/global.js', ssr: true }, { src: '~/plugins/global.js', ssr: true },
{ src: '~/plugins/editor.js', ssr: false }, { src: '~/plugins/editor.js', ssr: false },
{ src: '@/plugins/gallery.js', ssr: false }, { src: '@/plugins/gallery.js', ssr: false },
{ src: '@/plugins/ieCharts.js', ssr: false } { src: '@/plugins/ieCharts.js', ssr: false },
{ src: '@/plugins/fullcalendar.js', ssr: false }
], ],
/* /*
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
"string": "^3.3.3", "string": "^3.3.3",
"validator": "^9.4.1", "validator": "^9.4.1",
"vue-echarts-v3": "^2.0.1", "vue-echarts-v3": "^2.0.1",
"vue-full-calendar": "^2.8.1-0",
"vue-gallery-slideshow": "^1.3.1", "vue-gallery-slideshow": "^1.3.1",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-runtime-helpers": "^1.1.2", "vue-runtime-helpers": "^1.1.2",
...@@ -69,6 +70,7 @@ ...@@ -69,6 +70,7 @@
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"nodemon": "^1.18.9", "nodemon": "^1.18.9",
"prettier": "1.14.3", "prettier": "1.14.3",
"uglifyjs-webpack-plugin": "^1.3.0" "uglifyjs-webpack-plugin": "^1.3.0",
"vue-style-loader": "3.1.2"
} }
} }
...@@ -8,25 +8,18 @@ ...@@ -8,25 +8,18 @@
<Col span="24" style="margin-top:10px"> <Col span="24" style="margin-top:10px">
<Form v-show="searchOpen" :d="formId" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" :d="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="试验名称:" style="margin-left: 1px">
<Form-item class="search-item" label="授权资质器具名称:" style="margin-left: 1px"> <Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入试验名称" clearable/>
<Input v-model="formObj.name" name="name" placeholder="请输入授权资质器具名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="检定依据:" style="margin-left: -20px">
<Input v-model="formObj.code" name="judgeBasis" placeholder="请输入检定依据" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="检定依据名称:">
<Input v-model="formObj.basis" name="judgeBasisName" placeholder="请输入检定依据名称" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
@on-result-change="_btnClick"></btn-list> class="contHide"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
...@@ -63,38 +56,39 @@ ...@@ -63,38 +56,39 @@
<!-- 导入--> <!-- 导入-->
<!-- 添加、编辑 --> <!-- 添加、编辑 -->
<importModal ref="importModal" @on-result-change="_page"></importModal> <importModal ref="importModal" @on-result-change="_page"></importModal>
<MeterAptitudeManageEdit ref="editModal" @on-result-change="_page"></MeterAptitudeManageEdit>
<sampleItemList ref="testItemModal" @on-result-change="_formSearch" />
<imageTemplateImport ref="imageTemplateImport" @on-result-change="_page"></imageTemplateImport> <imageTemplateImport ref="imageTemplateImport" @on-result-change="_page"></imageTemplateImport>
<ItemManageEdit ref="editModal" @on-result-change="_page"></ItemManageEdit>
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<FileManage ref="FileManage"></FileManage>
</div> </div>
</template> </template>
<script> <script>
import { meterManage } from '../../../api' // eslint-disable-next-line no-unused-vars
import { soilAptitude } from '../../../api'
import importModal from '../../../components/import/DownloadTemplateImport' import importModal from '../../../components/import/DownloadTemplateImport'
import imageTemplateImport from '../../../components/import/ImageTemplateImport' import imageTemplateImport from '../../../components/import/ImageTemplateImport'
import MeterAptitudeManageEdit from './MeterAptitudeManageEdit.vue' import ItemManageEdit from './ItemManageEdit'
import sampleItemList from './SampleItemList' import IndexManage from './IndexManage'
export default { export default {
name: 'MeterAptitudeManage', name: 'MeterAptitudeManage',
components: { components: {
MeterAptitudeManageEdit,
sampleItemList,
imageTemplateImport, imageTemplateImport,
importModal importModal,
ItemManageEdit,
IndexManage
}, },
data() { data() {
return { return {
formId: 'meterAptitudeManageFormId', formId: 'meterAptitudeManageFormId',
pageColumns: [ pageColumns: [
{ title: '授权仪器名称', key: 'name' }, { title: '试验名称', key: 'name' },
{ title: '检定依据', key: 'code', width: 160 }, { title: '英文名称', key: 'elName', width: 160 },
{ title: '检定依据名称', key: 'basis' }, { title: '检测科室', key: 'groupName', width: 160 },
{ title: '检定周期', key: 'cycle' }, { title: '试验项目英文简写', key: 'shortName' },
// {title: '限制范围或说明', key: 'limitDescription'}, { title: '大类', key: 'mainType' },
{ title: '价格', key: 'price' }, { title: '小类', key: 'smallType' },
{ title: '图片是否上传', key: 'picUri', image: true } { title: '试验方法', key: 'testMethod' }
], ],
btn: [ btn: [
{ type: 'success', id: '', name: '添加' }, { type: 'success', id: '', name: '添加' },
...@@ -102,11 +96,11 @@ export default { ...@@ -102,11 +96,11 @@ export default {
{ type: '', id: '', name: '导入' } { type: '', id: '', name: '导入' }
], ],
iconMsg: [ iconMsg: [
{ type: 'md-apps', id: '', name: '指标管理' },
{ type: 'md-create', id: '', name: '编辑' }, { type: 'md-create', id: '', name: '编辑' },
{ type: 'md-add', id: '', name: '上传仪器图片' }, // { type: 'md-add', id: '', name: '附件' },
{ type: 'md-image', id: '', name: '图片预览' }, { type: 'md-trash', id: '', name: '删除' }
{ type: 'md-trash', id: '', name: '删除' }, // { type: 'md-add', id: '', name: '操作日志' }
{ type: 'md-apps', id: '', name: '管理检测项目' }
], ],
formObj: { formObj: {
basis: undefined, basis: undefined,
...@@ -159,20 +153,21 @@ export default { ...@@ -159,20 +153,21 @@ export default {
case '删除': case '删除':
this._deleteById(data.id) this._deleteById(data.id)
break break
case '管理检测项目': case '指标管理':
this.$refs.testItemModal._open(data.id) this.$refs.indexModal._open(data)
break break
case '上传仪器图片': case '附件':
this._uploadPic(data.id) this._upload(data.id)
break
case '图片预览':
this._lookPic(data)
break break
case '操作日志': case '操作日志':
this._record(data.id) this._record(data.id)
break break
} }
}, },
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'subcontractorId')
},
_lookPic(data) { _lookPic(data) {
if (data.picUri) { if (data.picUri) {
window.open(data.picUri) window.open(data.picUri)
...@@ -191,17 +186,12 @@ export default { ...@@ -191,17 +186,12 @@ export default {
}, },
_page: async function() { _page: async function() {
console.log(9522123)
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page') // this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) const result = await soilAptitude.page(this.formObj)
const result = await meterManage.page(this.formObj)
if (result) { if (result) {
console.log(55555)
console.log(result) console.log(result)
this.getPage = result this.getPage = result
console.log(123456789)
console.log(this.getPage)
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
} }
}, },
...@@ -211,7 +201,7 @@ export default { ...@@ -211,7 +201,7 @@ export default {
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page': case 'page':
this.getPage = this.$store.state.FoodJudgeBasis.page this._page()
break break
case 'selectIds': case 'selectIds':
this.selectIds = data this.selectIds = data
...@@ -230,12 +220,13 @@ export default { ...@@ -230,12 +220,13 @@ export default {
title: '提示', title: '提示',
content: content || '确定删除该记录?', content: content || '确定删除该记录?',
onOk: () => { onOk: () => {
console.log(ids)
this._delete(ids) this._delete(ids)
} }
}) })
}, },
_delete: async function(ids) { _delete: async function(ids) {
const result = await meterManage.deleteById(ids) const result = await soilAptitude.deleteById(ids)
if (result) { if (result) {
this._formSearch() this._formSearch()
this.$Message.success('删除成功!') this.$Message.success('删除成功!')
...@@ -269,9 +260,7 @@ export default { ...@@ -269,9 +260,7 @@ export default {
}, },
_getById: async function(id) { _getById: async function(id) {
const result = await meterManage.getById(id) const result = await soilAptitude.getById(id)
console.log('编辑结果')
console.log(result)
if (result) { if (result) {
this.$refs.editModal._open(result) this.$refs.editModal._open(result)
} }
...@@ -279,8 +268,8 @@ export default { ...@@ -279,8 +268,8 @@ export default {
// 导入 // 导入
_import() { _import() {
const data = { const data = {
importUrl: '/meter/v1/aptitude/import_aptitude', importUrl: '/soil/v1/aptitude_exp/import_aptitude/',
downloadUrl: '/meter/v1/excel/template/MeterAptitudeImport', downloadUrl: '/soil/v1/excel/template/SoilAptExpImport',
title: '授权资质导入' title: '授权资质导入'
} }
this.$refs.importModal._open(data, '授权资质导入') this.$refs.importModal._open(data, '授权资质导入')
......
<template>
<div>
<Modal v-model="showModal" width="100" class="modal-footer-none full-screen">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="指标名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入类别" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<IndexManageEdit ref="indexEdit" @on-result-change="_page"></IndexManageEdit>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
import IndexManageEdit from './IndexManageEdit'
export default {
components: { IndexManageEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [
{ type: 'success', id: '', name: '添加指标' },
{ type: 'error', id: '', name: '删除' }
],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '试验指标名称', key: 'name' },
{ title: '试验指标大类', key: 'mainType', width: 120 },
{ title: '试验指标小类', key: 'smallType', width: 120 },
{ title: '状态', key: 'status', width: 120 },
{ title: '检测值', key: 'testValue', width: 120 },
{ title: '单位', key: 'unit', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
selectIds: [],
formObj: {
name: ''
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.id = data.id
this.modalTitle = data.name + ' 指标管理'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.expId = this.id
const result = await soilAptitude.expItemPage(this.formObj)
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
}
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilAptitude.expItemGetById(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加指标':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds() {
if (this.selectIds.length === 0) {
// this.$msgTip('warning')
this.$message.warning('请至少选择一条记录')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定删除 ' + this.selectIds.length + ' 条记录?',
onOk: () => {
this._delOk(this.selectIds)
}
})
}
},
_delOk: async function(ids) {
const result = await soilAptitude.expItemDeleteByIds(ids)
if (result) {
this.$message.success('删除成功')
this._page()
}
}
}
}
</script>
<!--检测项目编辑列表(添加、导入检测项目)-->
<template>
<div>
<Modal
v-model="showModal"
:mask-closable="false"
:width="690"
title="检测项目管理"
>
<Row>
<Col span="24">
<Form v-model="formObj" :label-width="90" inline onsubmit="return false">
<Form-item class="search-item" label="试验名称:" style="margin-left: -25px">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable />
</Form-item>
<!-- <Form-item class="search-item" label="检测依据:">-->
<!-- <Input v-model="formObj.code" placeholder="请输入检测依据名称" clearable @on-enter="_formSearch" />-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--正常界面-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" />
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span v-if="item.key==='judged'">
{{ scope.row[item.key]===1?'是':'否' }}
</span>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.compareSymbol"
placeholder="请输入比较符"
/>
</div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.limitValue"
placeholder="请输入限值"
/>
</div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.unit"
placeholder="请输入单位"
/>
</div>
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.code"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i @click.stop="_selectjudgeBasis(scope.$index)" style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search"></i>
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
export default {
components: {},
data() {
return {
formObj: {
catalogueId: '',
name: '',
code: '',
standardCode: '',
standardName: ''
},
showModal: false,
searchOpen: false,
btn: [],
index: '',
iconMsg: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
pageColumns: [
{ title: '试验名称', key: 'name', width: 140 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
{ title: '方法', key: 'testMethod', width: 180 }
// { title: '设备', key: 'device', width: 180 },
// { title: '检测依据', key: 'code', width: 180 },
// { title: '检测科室', key: 'groupName', width: 110 },
// { title: '比较符', key: 'compareSymbol', width: 120 },
// { title: '限值', key: 'limitValue' },
// { title: '单位', key: 'unit' },
// { title: '是否系统判定', key: 'judged', width: 120, judged: true },
// { title: '备注', key: 'remark' }
],
catalogueId: '',
getPage: {},
selectData: []
}
},
methods: {
_open(catalogueId, label) {
this.formObj = this.$resetFields(this.formObj)
this.showModal = true
this.catalogueId = catalogueId
this.formObj.catalogueId = catalogueId
this.getPage.records = []
this.$refs.pageTable._hideLoading()
this._page()
// if (catalogueId) {
// this._page()
// }
},
_handleRow(scope) {
console.log(scope)
},
_selectjudgeBasis(index) {
console.log(index)
this.index = index
this.$refs.EditModal._open()
},
_backData(data) {
console.log(typeof this.index)
this.getPage.records[this.index].code = data.code
this.$set(
this.getPage.records,
this.index,
this.getPage.records[this.index]
)
console.log(this.getPage.records)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.page(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_btnClick(msg) {
switch (msg) {
case '导入检测项目':
this.$refs.relItemModal._open(this.catalogueId)
break
}
},
// 操作列操作
_iconClick(res, data) {
switch (res) {
case '删除':
this._deleteById(data.relPackageId)
break
}
},
// 删除
_deleteById(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除该数据?',
onOk: () => {
this._deleteOk(id)
}
})
},
// _deleteOk: async function(id) {
// // const result = await drugCatalogueItem.deleteById(id)
// if (result) {
// this.$Message.success('删除成功')
// this._page()
// }
// },
// table结果 返回整行
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_ok() {
const data = this.selectData
if (data.length === 0) {
this._hideLoading()
this.$Message.warning('请选择至少一条数据!')
}
const ids = []
data.forEach(item => {
ids.push(item.id)
})
this._saveCatalogueItem(data)
},
_saveCatalogueItem(data) {
this.showModal = false
this._hideLoading()
this.$emit('on-result-change', data)
console.log('data------', data)
this._hideLoading()
},
_cancel() {
this.selectData = []
this.showModal = false
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="检测依据" prop="code" style="width: 100%">
<Input v-model="formObj.code" name="code" placeholder="请输入检测依据"/>
</Form-item>
<Form-item label="检测依据名称" prop="name" style="width: 100%">
<Input v-model="formObj.name" name="name" placeholder="请输入检测依据名称"/>
</Form-item>
<!-- <Form-item label="英文名称" prop="enName" class="width-48">-->
<!-- <Input v-model="formObj.enName" name="enName" placeholder="请输入英文名"/>-->
<!-- </Form-item>-->
<!-- <Form-item label="标准状态" prop="status" class="width-48">-->
<!-- <Select v-model="formObj.status" name='status'>-->
<!-- <Option v-for="item in statusList" :value="item.value" :key="item.value">{{ item.name }}</Option>-->
<!-- </Select>-->
<!-- </Form-item>-->
<!-- <Form-item label="标准类型" prop="type" class="width-48">-->
<!-- <Select v-model="formObj.type" name="type">-->
<!-- <Option v-for="item in typeList" :value="item.value" :key="item.value">{{ item.name }}</Option>-->
<!-- </Select>-->
<!-- </Form-item>-->
<!-- <Form-item label="发布日期" prop="publishDate" class="width-48">-->
<!-- <Date-picker v-model="formObj.publishDate" type="date" name="publishDate" placeholder="发布日期"-->
<!-- format="yyyy-MM-dd" style="width: 100%;"></Date-picker>-->
<!-- </Form-item>-->
<!-- <Form-item label="实施日期" prop="effectDate" class="width-48">-->
<!-- <Date-picker v-model="formObj.effectDate" type="date" name="effectDate" placeholder="实施日期"-->
<!-- format="yyyy-MM-dd" style="width: 100%;"></Date-picker>-->
<!-- </Form-item>-->
<!-- <Form-item label="归口单位" prop="belongUnit" class="width-48">-->
<!-- <Input v-model="formObj.belongUnit" name="belongUnit" placeholder="请输入归口单位"/>-->
<!-- </Form-item>-->
<!-- <Form-item label="发布单位" prop="publishUnit" class="width-48">-->
<!-- <Input v-model="formObj.publishUnit" name="publishUnit" placeholder="请输入发布单位"/>-->
<!-- </Form-item>-->
<!-- <Form-item label="标准介绍" prop="remark" style="width:98%">-->
<!-- <Input :rows="3" :maxlength="255" v-model="formObj.remark" placeholder="请输入标准介绍,不能超过256个字..."-->
<!-- type="textarea" name="remark"/>-->
<!-- </Form-item>-->
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilAptitude } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
formObj: {
code: '',
name: ''
},
ruleValidate: {
code: [
{ required: true, message: '检测依据不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '检测依据名称不能为空', trigger: 'blur' }
]
},
showEditModal: false,
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
if (this.formObj.publishDate && this.formObj.effectDate) {
if (this.formObj.publishDate > this.formObj.effectDate) {
this.$Message.error('发布日期应早于实施日期')
this._hideLoading()
return
}
}
const data = this.$serialize('edit-form')
if (this.$string(this.formObj.id).isEmpty()) {
// 添加
this._save(data)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
}
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(formObj) {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) {
this.modalTitle = '添加'
this.formObj.id = ''
} else {
this.formObj = formObj
this.formObj.id = formObj.id
this.formObj.effectDate = this.formObj.effectDate
? new Date(formObj.effectDate)
: ''
this.formObj.publishDate = this.formObj.publishDate
? new Date(formObj.publishDate)
: ''
this.modalTitle = '编辑'
}
this.showEditModal = true
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
<template>
<Modal v-model="showModal" :width="800" class="modal-footer-none">
<p slot="header">{{modalTitle}}</p>
<div>
<!-- 表格 -->
<form id="sub-rel-form">
<input v-model="standardId" type="hidden" name="standardId"/>
</form>
<Row>
<Col span="24">
<element-table ref="pageTable" @on-result-change="_tableResultChange"
:getPage="getPage" table-height="300" hide-checkbox>
<el-table-column
:prop="item.key"
:label="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.id"
sortable show-overflow-tooltip>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
</element-table>
</Col>
</Row>
</div>
</Modal>
</template>
<script>
export default {
components: {},
data() {
return {
showModal: false,
modalTitle: '替代关系',
pageColumns: [
{ title: '标准号', key: 'standardNum' },
{ title: '替代标准号(旧)', key: 'standardInsteadNum' },
{ title: '被替代标准号(新)', key: 'standardInsteadedNum' }
],
getPage: {},
// 选中的内容
selectIds: [],
// 多选
standardId: ''
}
},
methods: {
_open(id) {
this.showModal = true
this.standardId = id
$('input[name=standardId]').val(id)
this._page()
},
// 获取数据
_page() {
console.log('page')
// this.$refs.pageTable._page('sub-rel-form', 'StandardInstead/page')
},
// 表格内容
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
// this.getPage = this.$store.state.StandardInstead.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
default:
this._page()
}
}
}
}
</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>
<div v-show="isLoad">
<Spin >
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在导入,请稍后...</div>
</Spin>
</div>
<div>
<label>
<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>
<div slot="footer" class="btn-width">
<Button @click="_cancel" :loading="isLoad">取消</Button>
</div>
</Modal>
</div>
</template>
<script>
/**
* 导入并下载模板
*/
import global from '../../../api/config'
export default {
components: {},
data() {
return {
modalTitle: '上传文件',
showModal: false,
isLoad: false,
isDisabled: false,
showError: false,
showSuccess: false,
dataObj: {
file: ''
},
errorMessage: '',
successMessage: '',
format: ['doc', 'docx', 'xlsx', 'xls'],
importUrl: ''
}
},
methods: {
_open(data) {
this.isLoad = false
this.showModal = true
this.isDisabled = false
this.showError = false
this.showSuccess = false
this.importUrl = global.baseURL + data.importUrl
},
_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) {
this.isLoad = false
this.$Message.success('导入成功!')
this.$emit('on-result-change')
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.msg
this.showError = true
this.$Message.error(response.msg)
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 doc、docx、xlsx 格式的文件!'
})
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>
<div v-show="isLoad">
<Spin >
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在导入,请稍后...</div>
</Spin>
</div>
<div>
<label>
<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>
<div slot="footer" class="btn-width">
<Button @click="_cancel" :loading="isLoad">取消</Button>
</div>
</Modal>
</div>
</template>
<script>
/**
* 导入并下载模板
*/
import global from '../../../api/config'
export default {
components: {},
data() {
return {
modalTitle: '上传文件',
showModal: false,
isLoad: false,
isDisabled: false,
showError: false,
showSuccess: false,
dataObj: {
file: ''
},
errorMessage: '',
successMessage: '',
format: ['pdf', 'PDF'],
importUrl: ''
}
},
methods: {
_open(data) {
this.isLoad = false
this.showModal = true
this.isDisabled = false
this.showError = false
this.showSuccess = false
this.importUrl = global.baseURL + data.importUrl
},
_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) {
this.isLoad = false
this.$Message.success('导入成功!')
this.$emit('on-result-change')
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.msg
this.showError = true
this.$Message.error(response.msg)
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc: '文件 ' + file.name + ' 格式不正确,请上传格式为 pdf 格式的文件!'
})
this.isLoad = false
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top:10px">
<Form :d="formId" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检定依据:" style="margin-left: -20px">
<Input @on-enter="_formSearch" v-model="formObj.code" name="judgeBasis" placeholder="请输入判定依据" clearable/>
</Form-item>
<Form-item class="search-item" label="检定依据名称:">
<Input @on-enter="_formSearch" v-model="formObj.name" name="judgeBasisName" placeholder="请输入判定依据名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable
ref="pageTable"
:form-id="formId"
:tableHeight="tableHeight"
:getPage="getPage"
:iconMsg="iconMsg"
@on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<span v-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>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!-- 添加、编辑 -->
<MeterAptitudeStandardEdit ref="editModal" @on-result-change="_page"></MeterAptitudeStandardEdit>
<!--导入资质项目-->
<!-- <DownloadTemplateImport ref="sampleModal" @on-result-change="_page"></DownloadTemplateImport>-->
</div>
</template>
<script>
import { meterAptitude } from '../../../api'
import MeterAptitudeStandardEdit from './MeterAptitudeStandardEdit'
export default {
name: 'MeterAptitudeStandard',
components: { MeterAptitudeStandardEdit },
data() {
return {
formId: 'meterAptitudeFormId',
pageColumns: [
{ title: '检定依据', key: 'code', width: 160 },
{ title: '检定依据名称', key: 'name' },
{ title: '登记时间', key: 'ctime', date: true, width: 140 },
{ title: '备注', key: 'remark' }
],
btn: [
{ type: 'success', id: '', name: '添加' },
{ type: 'error', id: '', name: '删除' }
],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' },
{ type: 'md-trash', id: '', name: '删除' }
],
formObj: {
name: undefined,
code: undefined
},
searchOpen: true,
selectIds: [],
getPage: {},
typeData: []
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_btnClick(msg) {
switch (msg) {
case '添加':
this._editModal(false)
break
case '删除':
this._deleteSelected()
break
case '导入':
this._import()
break
case '导出':
this._export()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '删除':
this._deleteById(data.id)
break
case '操作日志':
this._record(data.id)
break
}
},
_page: async function() {
console.log(9522123)
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterAptitude.page(this.formObj)
if (result) {
console.log(55555)
console.log(result)
this.getPage = result
console.log(123456789)
console.log(this.getPage)
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodJudgeBasis.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await meterAptitude.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除这 ' + ids.length + ' 条记录?')
}
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
this._getById(id)
// 编辑
// this.$store.dispatch('FoodJudgeBasis/getById', id).then(() => {
// this.$refs.editModal._open(this.$store.state.FoodJudgeBasis.model)
// })
} else {
// 添加
this.$refs.editModal._open()
}
},
_getById: async function(id) {
const result = await meterAptitude.getById(id)
if (result) {
this.$refs.editModal._open(result)
}
},
// 导入
_import() {
const data = {
importUrl:
'/food/v1/food_aptitude_judge_basis/food_aptitude_judge_import',
downloadUrl: '/food/v1/excel/template/FoodAptitudeJudgeBasis',
title: '导入检验方法管理'
}
this.$refs.sampleModal._open(data)
},
// 导出
_export() {
console.log('.this.selectIds', this.selectIds)
if (this.selectIds.length === 0) {
this.$Message.warning('请选择需要导出的数据')
} else {
const content = '确定导出 ' + this.selectIds.length + ' 条记录?'
this.$Modal.confirm({
title: '提示',
content: content,
onOk: () => {
// eslint-disable-next-line no-undef
http.open(
'/food/v1/food_aptitude_judge_basis/food_aptitude_judge_export?ids=' +
this.selectIds
)
}
})
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait"></el-tab-pane>
<el-tab-pane label="历史记录" name="his"></el-tab-pane>
</el-tabs>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent"></component>
</keep-alive>
</div>
</div>
</div>
</template>
<script>
import MeterSendEntrust from './EntrustRegister'
import MeterSendEntrustHis from './EntrustRegisterHis'
export default {
name: 'MeterSendEntrustIndex',
components: {
// eslint-disable-next-line vue/no-unused-components
MeterSendEntrust,
// eslint-disable-next-line vue/no-unused-components
MeterSendEntrustHis
},
data() {
return {
activeName: 'wait',
currentComponent: ''
}
},
mounted() {
this.activeName = 'wait'
this.currentComponent = 'MeterSendEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this.currentComponent = 'MeterSendEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
} else {
this.currentComponent = 'MeterSendEntrustHis'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.hisTabs._page()
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托单号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange">
<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" sortable>
<template slot-scope="scope">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
<!-- <MeterEntrustRecord ref="entrustRecordModal" @on-result-change="_page"></MeterEntrustRecord>-->
<!-- <SoilSampleManage ref="sampleManageModal" @on-result-change="_page"></SoilSampleManage>-->
</div>
</template>
<script>
import { soilAptitude, soilEntrust } from '../../../api'
import MeterEntrustRecord from '../../../components/operation/Operation'
import SoilSampleManage from '../SoilSampleManageHis'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord, SoilSampleManage },
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: true,
btn: [
// {
// type: 'success',
// id: '',
// name: '添加'
// }
],
iconMsg: [
{
type: 'ios-list',
id: '',
name: '试样列表'
},
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
client: undefined,
entrustCode: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
case '查看样品':
this._sampleManage(data.id)
break
case '试样列表':
this._sampleManage(data.id)
break
}
})
},
_sampleManage(data) {
// 管理样品
this.currentComponent = 'SoilSampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
// this.$refs.sampleManageModal._open(data)
},
_record(id) {
this.currentComponent = 'MeterEntrustRecord'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.entrustRecordModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageRegHis(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await soilAptitude.getById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
}
},
_delete: async function(ids) {
const result = await soilAptitude.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showDetailModal" :width="700" title="委托详情" class="modal-footer-none">
<div :style="{height}" style="overflow-y: auto">
<table class="tableClass">
<tbody>
<tr>
<th colspan="6" class="tableClass_back">委托单信息</th>
</tr>
<tr>
<th>委托商</th>
<td>{{obj.client}}</td>
<th>制表人</th>
<td>{{obj.tabulater}}</td>
</tr>
<tr>
<th>钻孔名称</th>
<td>{{obj.boreholeName}}</td>
<th>钻孔位置</th>
<td>{{obj.boreholeLocation}}</td>
</tr>
<tr>
<th>水深(米)</th>
<td>{{obj.waterDepth}}</td>
<th>检验类别</th>
<td>{{obj.testType}}</td>
</tr>
</tbody>
</table>
</div>
</Modal>
</div>
</template>
<script>
/**
* 政府委托信息表详情
*/
export default {
data() {
return {
obj: {
// detail: {},
// customer: {},
// finance: {},
// tested: {}
firsted: 0,
client: '',
boreholeLocation: '',
boreholeName: '',
waterDepth: '',
tabulater: '',
testType: ''
},
showDetailModal: false,
// sampleType:['退样','留样','作废'],
dispose: '',
height: '',
showMoney: false
}
},
methods: {
_open(obj, flag) {
this.showDetailModal = true
this.obj = obj
console.log('传过来的数据')
console.log(this.obj)
// if(obj.dispose !== undefined || ''){
// this.dispose = this.sampleType[obj.dispose];
// }else{
// this.dispose = '';
// }
if (flag === 'showMoney') {
this.showMoney = true
} else {
this.showMoney = false
}
this.height = '350px'
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="报告审核" name="lab">
<reportMake ref="labTabs" />
</el-tab-pane>
<el-tab-pane label="历史任务" name="his">
<historyTask ref="hisTabs" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import reportMake from './tabs/reportAudit'
import historyTask from './tabs/historyTask'
export default {
components: { reportMake, historyTask },
data() {
return {
activeName: 'lab'
}
},
mounted() {
this.activeName = 'lab'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'lab') {
this._page()
} else {
this.$refs.hisTabs._clearPage()
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.labTabs._clearPage()
this.$refs.labTabs._page()
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="报告签发" name="lab">
<reportMake ref="labTabs" />
</el-tab-pane>
<el-tab-pane label="历史任务" name="his">
<historyTask ref="hisTabs" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import reportMake from './tabs/reportIssue'
import historyTask from './tabs/historyTask'
export default {
components: { reportMake, historyTask },
data() {
return {
activeName: 'lab'
}
},
mounted() {
this.activeName = 'lab'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'lab') {
this._page()
} else {
this.$refs.hisTabs._clearPage()
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.labTabs._clearPage()
this.$refs.labTabs._page()
}
}
}
</script>
<template>
<div>
<!--<Modal v-model="showModal" title="原始记录" :mask-closable="false" width="1300" class="modal-footer-none">-->
<!--<div style="text-align:center;align-content:center;width: 100%;height: 790px" v-html="htmlContent">-->
<!--</div>-->
<!--</Modal>-->
</div>
</template>
<script>
import Global from '../../../api/config'
import { soilTest } from '../../../api'
/**
* 编辑原始记录详情
*/
export default {
data() {
return {
// showModal: false,
again: false,
formId: '',
htmlContent: '',
formIdTemp: ''
}
},
created() {
// 监听原始记录消息
// eslint-disable-next-line nuxt/no-globals-in-created
window.addEventListener('message', this._saveOriginal)
},
// 销毁监听事件
beforeDestroy() {
this.again = false
window.removeEventListener('message', this._saveOriginal)
},
methods: {
_open(formId) {
this.formId = formId
this.formIdTemp = formId + this.$randomCode()
this.again = true
// this.showModal = true;
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
Global.recordURL +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri)
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
_openWithType(formId, fromType) {
this.formId = formId
this.formIdTemp = formId + this.$randomCode()
this.again = true
// this.showModal = true;
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
Global.recordURL +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri) +
'&type=' +
fromType
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
_saveOriginal(data) {
console.log('修改的数据', data)
if (this.again) {
if (data.data.msg === true) {
this._editSaveRecord(data)
} else {
this._cancel()
}
this.again = false
}
},
_cancel() {
// this.showModal = false;
// 关闭所有layx弹框
// eslint-disable-next-line no-undef
layx.destroyAll(this.formIdTemp)
},
_updateRecord: async function(param) {
const result = await soilTest.updateItem(param)
console.log(result)
if (result) {
this.$Message.success('保存成功')
this._cancel()
this.$emit('on-result-change')
}
},
// 保存后解析项目的检测值
_editSaveRecord(data) {
const param = {
formId: this.formId
}
console.log('data', data)
const copyMapTemp = {}
if (data.data.copySheet && data.data.copyedSheet) {
param.copyMap = {}
const copyedKey = String(data.data.copyedSheet)
copyMapTemp[copyedKey] = ''
copyMapTemp[copyedKey] = String(data.data.copySheet)
// 存在复制sheet的情况
param.copyMap = JSON.stringify(copyMapTemp)
} else if (typeof data.data.testValueArry !== 'undefined') {
const testValue = data.data.testValueArry
param.copyMap = {}
testValue.forEach(item => {
const copyedKey = String(item.copyedSheet)
copyMapTemp[copyedKey] = ''
copyMapTemp[copyedKey] = String(item.copySheet)
param.copyMap = JSON.stringify(copyMapTemp)
})
}
this._updateRecord(param)
// this.$store.dispatch('EnvItem/updateFormForItem', param).then(() => {
// if (this.$store.state.EnvItem.success) {
// this.$Message.success('保存成功')
// // this.showModal = false;
// this.$emit('on-result-change')
// this._cancel()
// }
// })
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="按委托编制" name="check">
<ReportMakeByEntrust ref="checkTabs"></ReportMakeByEntrust>
</el-tab-pane>
<el-tab-pane label="历史报告" name="checkHis">
<ReportMakeHis ref="checkHisTabs"></ReportMakeHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import ReportMakeByEntrust from './tabs/ReportMakeByEntrust'
import ReportMakeHis from './ReportMakeHis'
export default {
components: {
ReportMakeByEntrust,
ReportMakeHis
},
data() {
return {
activeName: 'check'
}
},
mounted() {
this.activeName = 'check'
this.$refs.checkTabs._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'check') {
this.$refs.checkTabs._open()
} else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page()
} else {
this.$refs.checkHisTabs._page()
}
}
}
}
</script>
<template>
<div>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" is-radio>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</template>
<script>
import { soilSample } from '../../../api'
export default {
components: {},
data() {
return {
tableHeight: '400',
pageColumns: [{ title: '报告模板名称', key: 'name' }],
formObj: {},
getPage: {},
modalTitle: '报告模板',
tempId: ''
}
},
methods: {
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.SysFileTemplate.page
if (this.tempId) {
this.$refs.pageTable.templateRadio = this.tempId
this.$emit('on-result-change', { id: this.tempId })
}
break
case 'radioSelect':
this.$emit('on-result-change', data)
break
default:
this._page()
}
},
_open(tempId) {
this.tempId = tempId || ''
this._page()
},
_page: async function() {
const result = await soilSample.reportTemplate(this.formObj)
if (result) {
console.log(result)
this.getPage.records = result
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="900" class="zIndex-1200">
<p slot="header">选择报告模板</p>
<div>
<ReportTemplate ref="reportTemplate" @on-result-change="_templateResultChange"></ReportTemplate>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import ReportTemplate from './ReportTemplate'
/**
* 重新生成的报告选择模板
*/
export default {
components: {
ReportTemplate
},
data() {
return {
showModal: false,
selectData: {},
footerList: [
{ type: '', id: '', name: '取消' },
{ type: 'primary', id: '', name: '确定' }
],
data: {}
}
},
methods: {
_open(data) {
this.showModal = true
this.$refs.footerModal._hideLoading()
this.data = data
this.$refs.reportTemplate._open(data.tempId)
},
_templateResultChange(selectData) {
this.selectData = selectData
},
_footerResult(name) {
switch (name) {
case '确定':
this.$emit('on-result-change', {
id: this.data.id,
tempId: this.selectData.id,
reportBatch: this.data.reportBatch
})
this.showModal = false
break
case '取消':
this.showModal = false
break
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<Modal v-model="showModal" :width="100" class="modal-footer-none modal-top-0">
<p slot="header">{{modalTitle}}</p>
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="样品台账" name="sample">
<ReportMakeBySample ref="sampleTabs" @on-result-change="_sampleTabResult"></ReportMakeBySample>
</el-tab-pane>
<el-tab-pane label="报告台账" name="report">
<ReportInfoMake ref="reportTabs"></ReportInfoMake>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import ReportInfoMake from './tabs/ReportInfoMake'
import ReportMakeBySample from './tabs/ReportMakeBySample'
export default {
components: {
ReportMakeBySample,
ReportInfoMake
},
data() {
return {
showModal: false,
modalTitle: '',
activeName: '',
contractId: '',
entrustId: '',
type: '',
personal: ''
}
},
computed: {
tableHeight: function() {
return document.documentElement.clientHeight - 135
}
},
methods: {
_open(entrustId) {
this.modalTitle = '管理样品和报告'
this.showModal = true
this.activeName = 'sample'
this.entrustId = entrustId
this.$refs.sampleTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.contractId, this.personal)
},
_sample() {
console.log(this.entrustId)
this.$refs.sampleTabs._open(this.entrustId)
},
_changeTabs(tab, event) {
switch (tab.name) {
case 'sample':
this._sample()
break
case 'report':
this._report()
break
}
},
_sampleTabResult(msg) {
if (msg === 'changeTab') {
this.activeName = 'report'
this.$refs.reportTabs._open(this.contractId, this.personal)
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showSubmitModal">
<p slot="header">{{modalTitle}}</p>
<div v-show="isLoad">
<Spin fix>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在上传,请稍后...</div>
</Spin>
</div>
<Alert type="warning" show-icon>请填写修改信息,例:xxx由xxx修改为xxx,多条填写时以‘;’分隔!</Alert>
<Input v-model="remark" :autosize="{minRows: 3,maxRows: 5}" @on-keyup="_blurChange"
type="textarea" placeholder="请输入内容"></Input>
<div style="margin-top:10px">
<Form :label-width="80" onsubmit="return false">
<Form-item label="报告名称:">
<Input v-model="reportName" @on-blur="_action" placeholder="请输入报告名称"/>
</Form-item>
</Form>
</div>
<div slot="footer" class="btn-width">
<Button @click="_cancel" style="margin-left: 310px;float: left;">取消</Button>
<label style="margin-bottom: 0">
<Upload
:action="action"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
>
<Button :disabled="isDisable" type="primary">上传</Button>
</Upload>
</label>
</div>
</Modal>
</div>
</template>
<script>
/**
* 上传报告-----报告台账上传报告
*/
import global from '../../../api/config'
export default {
components: {},
data() {
return {
ids: [], // 合同ids
modalTitle: '上传报告',
showSubmitModal: false,
isLoad: false,
action: '',
dataObj: {
file: ''
},
remark: '',
reportId: 0,
isDisable: true,
isReport: false, // 是否有过报告,
reportName: ''
}
},
methods: {
_open(reportId) {
this.showSubmitModal = true
this.isLoad = false
this.reportId = reportId
this.reportName = ''
this.remark = ''
},
_blurChange() {
if (this.remark !== '') {
this._action()
this.isDisable = false
} else {
this.isDisable = true
}
},
_action() {
this.action =
global.baseURL +
'/soil/v1/report/upload/' +
this.reportId +
'?reason=' +
this.remark +
'&reportName=' +
this.reportName
},
_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')
this.showSubmitModal = false
} else {
this.isLoad = false
this.$Message.error(response.msg)
}
},
_cancel() {
this.showSubmitModal = false
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="报告档案" name="contract"/>
<el-tab-pane label="报告台账" name="report"/>
</el-tabs>
<!--组件加载,缓存-->
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component :is="currentComponent"></component>
</keep-alive>
</div>
</div>
</div>
</template>
<script>
import ReportByContract from './tab/ReportByContract'
import ReportByReport from './tab/ReportByReport'
/**
* 报告档案
*/
export default {
components: {
// eslint-disable-next-line vue/no-unused-components
ReportByContract,
// eslint-disable-next-line vue/no-unused-components
ReportByReport
},
data() {
return {
activeName: '',
// 结束
reportStatus: 'FLOW_END',
currentComponent: ''
}
},
mounted() {
this.activeName = 'contract'
this.currentComponent = 'ReportByContract'
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'contract') {
this.currentComponent = 'ReportByContract'
} else if (tab.name === 'report') {
this.currentComponent = 'ReportByReport'
}
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="备样管理" name="wait">
<SampleBackupsManage ref="waitTabs"></SampleBackupsManage>
</el-tab-pane>
<el-tab-pane label="备样查询" name="query">
<SampleBackupsQuery ref="queryTabs"></SampleBackupsQuery>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import SampleBackupsManage from './tab/SampleBackupsManage'
import SampleBackupsQuery from './tab/SampleBackupsQuery'
export default {
components: {
SampleBackupsManage,
SampleBackupsQuery
},
data() {
return {
activeName: 'wait'
}
},
mounted() {
this.activeName = 'wait'
this.$refs.waitTabs._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this.$refs.waitTabs._page()
} else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page()
} else {
this.$refs.queryTabs._page()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false">
<p slot="header">填写存放信息</p>
<div>
<Form id="storage-location-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form-item label="存储条件:">
<el-select :value="formObj.conditions" @change="selCondi" style="width:100%" size="small">
<el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</Form-item>
<Form-item label="备样位置:" prop="backupLocation">
<Input v-model="formObj.backupLocation" clearable placeholder="请输入备样位置"></Input>
</Form-item>
<Form-item label="备样数量">
<Input v-model="formObj.quantity" clearable placeholder="请输入备样数量"></Input>
</Form-item>
<Form-item label="备样人:">
<el-select :value="formObj.backupUser" @change="selUser" style="width:100%" size="small">
<el-option v-for="item in backupUserList" :value="item.id" :label="item.realname" :key="item.realname">{{ item.realname }}
</el-option>
</el-select>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import { soilSample } from '../../../api'
export default {
components: {},
data() {
return {
ids: [], // 委托ids
showModal: false,
formObj: {},
ruleValidate: {
backupLocation: [
{ required: true, message: '备样位置不能为空', trigger: 'blur' }
]
},
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
conditionList: [],
locList: [],
backupUserList: [],
sampleUnit: ''
}
},
mounted() {
this._getConditionList()
this._getUserList()
},
methods: {
_locChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.backupPlace = data.backupPlace
this._getCondition(data.backupPlace)
break
case 'query':
this.formObj.backupPlace = data.backupPlace
this._getLocList(data.backupPlace)
break
}
},
selCondi(data) {
this.$forceUpdate()
this.formObj.conditions = data
},
selUser(data) {
this.$forceUpdate()
if (data) {
for (let i = 0; i < this.backupUserList.length; i++) {
if (this.backupUserList[i].id === data) {
this.formObj.backupUser = this.backupUserList[i].realname
}
}
} else {
this.getPage.records[this.currentIndex].backupUser = ''
}
this.formObj.backupUserId = data
// this.$forceUpdate()
// this.getPage.records[this.currentIndex].backupUser = data
// this.getPage.records[this.currentIndex].backupUser = data
},
// 存储条件 回调
_locChangeCondition(msg, data) {
switch (msg) {
case 'select':
this.formObj.storageCondition = data.name
this._getLocCondition(data.name)
break
case 'query':
this.formObj.storageCondition = data.name
this._getLocConditionList(data.name)
break
}
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_open(data) {
this.showModal = true
this.formObj = this.$resetFields(this.formObj)
this.sampleUnit = ''
this.$refs.footerModal._hideLoading()
this.ids = data
// 循环遍历数据
},
_getConditionList: async function() {
const result = await soilSample.getDictList('存储条件')
if (result) {
this.conditionList = result
}
},
_getUserList: async function() {
const result = await soilSample.getUserList()
if (result) {
console.log(result)
this.backupUserList = result.records
}
},
//
_dateChange(data) {
this.formObj.endDate = data
},
_cancel() {
this.showModal = false
this.$refs.footerModal._hideLoading()
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.formObj
this._saveInfo({ id: this.ids.join(','), obj: data })
} else {
this.$Message.error('表单验证失败!')
this.$refs.footerModal._hideLoading()
}
})
},
_saveInfo: async function(data) {
const result = await soilSample.editBackup(data)
if (result) {
this.$Message.success('保存成功')
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form-query" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-item" label="委托单位:" style="margin-left: 8px;">
<Input @on-enter="_formSearch" v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托编号:" style="margin-left: 8px;">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange">
<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" sortable>
<template slot-scope="scope">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</div>
<Operation ref="recordModal"></Operation>
</div>
</template>
<script>
import { soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
export default {
components: { Operation },
data() {
return {
currentComponent: '',
selectIds: [],
formObj: {
entrustCode: '',
client: '',
sampleCode: ''
},
btn: [
// { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-handle-already-export-sample-store',
name: '导出样品贮存表'
}
],
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
pageColumns: [
{ title: '委托商', key: 'client', width: 180 },
{ title: '委托编号', key: 'entrustCode', width: 180 },
{ title: '试样编号', key: 'sampleCode', width: 180 },
{ title: '状态', key: 'status', width: 160, status: true },
{ title: '试样深度', key: 'sampleDepth', width: 180 },
{ title: '样品包装类型', key: 'samplePack', width: 180 },
{ title: '现场编号', key: 'siteNo', width: 180 },
{ title: '存储条件', key: 'conditions', width: 180 },
{ title: '备样位置', key: 'backupLocation', width: 180 },
{ title: '备样数量', key: 'quantity', width: 180 },
{ title: '备样人', key: 'backupUser', width: 140 },
{ title: '钻孔位置', key: 'boreholeLocation', width: 110 },
{ title: '钻孔名称', key: 'boreholeName', width: 160 },
{ title: '水深(米)', key: 'waterDepth', width: 160 }
],
searchOpen: false,
getPage: {},
selectData: [],
endDateBegin: '',
endDateEnd: ''
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 250)
} else {
return this.$tableHeight('', 210)
}
}
},
methods: {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageBackupHis(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'changeSize':
this._page()
break
// default :
// this._page();
}
},
_iconClick(res, data, componentName, index) {
this.currentIndex = index
switch (res) {
case '操作日志':
this._record(data.id)
break
default:
this._page()
}
},
_record(id) {
this.$refs.recordModal._openBcakup(id)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_dateChange(data) {
this.endDateBegin = data[0]
this.endDateEnd = data[1]
},
_btnClick(msg) {
switch (msg) {
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case '导出样品贮存表':
this._exportSampleStore()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_exportSampleStore() {
const obj = {
param: 'ids',
ids: this.selectIds,
url: '',
queryObj: this.$serialize('search-form-query')
}
this.$store
.dispatch(
'ReportExport/getById',
'food-sample-handle-already-export-sample-store'
)
.then(() => {
const result = this.$store.state.ReportExport.model
obj.url = result
this.$exportByQuery(obj)
})
},
// 样品详情
_sampleDetailModal(data) {
if (data.type === 1) {
// 政府
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleCompanyDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel
)
})
})
}
},
/** *********************************导出-begin*********************************************/
_export() {
let result = []
if (this.selectData.length === 0) {
// 导出全部数据
this.$store
.dispatch('FoodSampleBackup/perSampleQuery', this._searchParams())
.then(() => {
result = this.$store.state.FoodSampleBackup.page.records
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'perSampleQuery',
'样品处理',
this.pageColumns,
result
)
}
})
})
} else {
// 只导出选中的数据
result = this.selectData
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'perSampleQuery',
'样品处理',
this.pageColumns,
result
)
}
})
}
},
// 参数
_searchParams() {
const data = this.$serialize('search-form-query')
return this.$extend(data, { page: 1, rows: 5000 })
}
/** *********************************导出样品台账-end*********************************************/
}
}
</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