Commit ba9651fc by wangweidong

土工试验Lims

parent 3623d1ee
......@@ -63,5 +63,13 @@ export default {
.put('soil/v1/exp_report_template/' + data.id, data.formObj)
.then(res => res),
expReportTemplateDelete: data =>
http.delete('soil/v1/exp_report_template/?ids=' + data).then(res => res)
http.delete('soil/v1/exp_report_template/?ids=' + data).then(res => res),
pageTemplateConfig: data =>
http.post('soil/v1/exp_report_template_config/page', data).then(res => res),
saveReportTemplateConfig: data =>
http.post('soil/v1/exp_report_template_config/', data).then(res => res),
deleteReportTemplateConfig: data =>
http
.delete('soil/v1/exp_report_template_config/?ids=' + data)
.then(res => res)
}
<template>
<div>
<Modal v-model="showModal" width="1000" class="modal-footer-none">
<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.attributeName" @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>
<ConfigTemplateEdit ref="indexEdit" @on-result-change="_page"></ConfigTemplateEdit>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
import ConfigTemplateEdit from './ConfigTemplateEdit'
export default {
components: { ConfigTemplateEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [
{ type: 'success', id: '', name: '添加配置' },
{ type: 'error', id: '', name: '删除' }
],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '属性名称', key: 'attributeName' },
{ title: '属性', key: 'dataAttribute', width: 120 },
{ title: '列位置', key: 'columnPlace', width: 120 },
{ title: '合并开始列', key: 'mergeBegin', width: 120 },
{ title: '合并结束列', key: 'mergeEnd', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
selectIds: [],
formObj: {
attributeName: undefined,
templateId: undefined
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.formObj.templateId = data.id
this.id = data.id
this.modalTitle = data.name + ' 指标管理'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.pageTemplateConfig(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.deleteReportTemplateConfig(ids)
if (result) {
this.$message.success('删除成功')
this._page()
}
}
}
}
</script>
......@@ -46,6 +46,7 @@
<!-- 添加、编辑 -->
<SoilRecordTemplateEdit ref="editModal" @on-result-change="_search"></SoilRecordTemplateEdit>
<SoilRecordEdit ref="reportEdit" @on-result-change="_search"></SoilRecordEdit>
<ConfigTemplate ref="configTemplateModal" @on-result-change="_page"></ConfigTemplate>
</div>
</template>
<script>
......@@ -53,8 +54,9 @@ import global from '../../../api/config'
import { soilAptitude } from '../../../api'
import SoilRecordTemplateEdit from './SoilReportTemplateEdit'
import SoilRecordEdit from './SoilReportEdit'
import ConfigTemplate from './ConfigTemplate'
export default {
components: { SoilRecordTemplateEdit, SoilRecordEdit },
components: { SoilRecordTemplateEdit, SoilRecordEdit, ConfigTemplate },
data() {
return {
pageColumns: [
......@@ -67,8 +69,8 @@ export default {
},
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' },
{ type: 'ios-build-outline', id: '', name: '配置' },
{ type: 'ios-book', id: '', name: '预览/编辑' },
// { type: 'ios-download', id: '', name: '下载' },
{ type: 'md-remove-circle', id: '', name: '删除' }
],
getPage: {},
......@@ -137,6 +139,9 @@ export default {
case '编辑':
this._reportEdit(data)
break
case '配置':
this._configData(data)
break
case '下载':
this._download(data.id)
break
......@@ -194,6 +199,9 @@ export default {
_reportEdit(data) {
this.$refs.reportEdit._open(data)
},
_configData(data) {
this.$refs.configTemplateModal._open(data)
},
// 批量删除
_delAll() {
const ids = this.selectIds
......
......@@ -11,8 +11,6 @@
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95" inline class="inputBox">
<Form-item label="类别" prop="classType" style="width: 100%">
<!-- <Input v-model="formObj.classType" @on-keyup="_onKeyUp" name="classType" placeholder="请选择类别" icon="plus-circled"-->
<!-- ></Input>-->
<el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
<el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList"
:key="index"></el-option>
......@@ -34,24 +32,24 @@
placeholder="请输入样品开始行"
/>
</Form-item>
<Form-item label="样品开始列" prop="sampleBeginCol" class="width-48">
<Form-item label="数据占用行" prop="dataTotalRow" class="width-48">
<el-input
v-model="formObj.sampleBeginCol"
v-model="formObj.dataTotalRow"
@keydown.native="channelInputLimit"
name="sampleBeginCol"
type="number"
onmousewheel="return false"
placeholder="请输入样品开始列"
placeholder="请输入数据占用行"
/>
</Form-item>
<Form-item label="样品合并数" prop="sampleMergerNum" class="width-48">
<Form-item label="总列数" prop="totalColumn" class="width-48">
<el-input
v-model="formObj.sampleMergerNum"
v-model="formObj.totalColumn"
@keydown.native="channelInputLimit"
name="sampleMergerNum"
type="number"
onmousewheel="return false"
placeholder="请输入样品合并数"
placeholder="请输入总列数"
/>
</Form-item>
<Form-item label="模板样品数" prop="templateSampleNum" class="width-48">
......@@ -69,48 +67,30 @@
<div slot="footer" class="btn-width clearfix">
<Button @click="_cancel" style="margin-left: 8px;">取消</Button>
<Button @click="_ok" type="primary" style="margin-bottom: 0;float: right">保存</Button>
<!-- <label style="margin-bottom: 0;float: right">-->
<!-- <Upload-->
<!-- :action="action"-->
<!-- :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="isDisable" type="primary">导入文件</Button>-->
<!-- </Upload>-->
<!-- </label>-->
</div>
</Modal>
<!--类别弹出树-->
<!-- <LmsTemplateClassifyZTree ref="ztreeModal" @on-result-change="_ztree"></LmsTemplateClassifyZTree>-->
</div>
</template>
<script>
/**
* 添加编辑
*/
// import LmsTemplateClassifyZTree from '../lms-template-classify/LmsTemplateClassifyZTree.vue'
// import global from '../../../api/config'
import { soilAptitude } from '../../../api'
const defVal = {
alias: '',
classType: '',
remark: '',
sampleBeginRow: '',
sampleBeginCol: '',
sampleMergerNum: '',
templateSampleNum: '',
alias: undefined,
classType: undefined,
dataTotalRow: undefined,
totalColumn: undefined,
remark: undefined,
sampleBeginRow: undefined,
sampleBeginCol: undefined,
sampleMergerNum: undefined,
templateSampleNum: undefined,
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
const validatesampleBeginRow = (rule, value, callback) => {
if (this.formObj.sampleBeginRow === '') {
......@@ -119,13 +99,6 @@ export default {
callback()
}
}
const validatesampleMergerNum = (rule, value, callback) => {
if (this.formObj.sampleMergerNum === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
const validatetemplateSampleNum = (rule, value, callback) => {
if (this.formObj.templateSampleNum === '') {
callback(new Error('内容不能为空'))
......@@ -133,13 +106,6 @@ export default {
callback()
}
}
const validatesampleBeginCol = (rule, value, callback) => {
if (this.formObj.sampleBeginCol === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
return {
modalTitle: '编辑',
formObj: defVal,
......@@ -155,22 +121,6 @@ export default {
trigger: 'blur'
}
],
sampleBeginCol: [
{
required: true,
validator: validatesampleBeginCol,
message: '样品开始列不能为空',
trigger: 'blur'
}
],
sampleMergerNum: [
{
required: true,
validator: validatesampleMergerNum,
message: '样品合并数不能为空',
trigger: 'blur'
}
],
templateSampleNum: [
{
required: true,
......
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