Commit bcb45755 by wangweidong

土工试验Lims

parent 12001bd8
...@@ -24,6 +24,10 @@ export default { ...@@ -24,6 +24,10 @@ export default {
http.delete('soil/v1/aptitude_exp/?ids=' + data).then(res => res), http.delete('soil/v1/aptitude_exp/?ids=' + data).then(res => res),
// 保存 // 保存
save: data => http.post('soil/v1/aptitude_exp/', data).then(res => res), save: data => http.post('soil/v1/aptitude_exp/', data).then(res => res),
editSeniorSample: data =>
http
.post('soil/v1/sample/edit_senior_sample?ids=' + data.ids, data.obj)
.then(res => res),
edit: data => edit: data =>
http.put('soil/v1/aptitude_exp/' + data.id, data.obj).then(res => res), http.put('soil/v1/aptitude_exp/' + data.id, data.obj).then(res => res),
// 指标页面 // 指标页面
...@@ -43,6 +47,10 @@ export default { ...@@ -43,6 +47,10 @@ export default {
http.post('soil/v1/standard/list', data).then(res => res), http.post('soil/v1/standard/list', data).then(res => res),
originalTemplatePage: data => originalTemplatePage: data =>
http.post('soil/v1/original_template/page', data).then(res => res), http.post('soil/v1/original_template/page', data).then(res => res),
pageOpenSoil: data =>
http
.post('soil/v1/original_template/page_open_soil', data)
.then(res => res),
originalTemplateDeleteById: data => originalTemplateDeleteById: data =>
http.delete('soil/v1/original_template/?ids=' + data).then(res => res), http.delete('soil/v1/original_template/?ids=' + data).then(res => res),
originalTemplateEdit: data => originalTemplateEdit: data =>
......
...@@ -208,6 +208,10 @@ export default { ...@@ -208,6 +208,10 @@ export default {
http http
.post('soil/v1/experiment/save_excel_original_record', data) .post('soil/v1/experiment/save_excel_original_record', data)
.then(res => res), .then(res => res),
saveExcelOpenSoilRecord: data =>
http
.post('soil/v1/experiment/save_excel_open_soil_record', data)
.then(res => res),
// saveExcelExpReport: data => // saveExcelExpReport: data =>
// http // http
// .post( // .post(
......
...@@ -6,23 +6,22 @@ ...@@ -6,23 +6,22 @@
<Form id="MeterSendTestEdit" ref="formObj" :model="formObj" :label-width="90" inline> <Form id="MeterSendTestEdit" ref="formObj" :model="formObj" :label-width="90" inline>
<Form-item label="委托商" prop="client" class="width-48"> <Form-item label="委托商" prop="client" class="width-48">
<AutoComplete ref="autoInput" v-model="formObj.client" :down-data="customerData" <AutoComplete ref="autoInput" v-model="formObj.client" :down-data="customerData"
@on-result-change="_cusNameChange" name="client" placeholder="请输入或选择委托单位" name="client" placeholder="请输入或选择委托单位" @on-result-change="_cusNameChange"
></AutoComplete> ></AutoComplete>
</Form-item> </Form-item>
<Form-item label="委托日期:" prop="entrustDate" class="width-48"> <Form-item label="委托日期:" prop="entrustDate" class="width-48">
<Date-picker v-model="formObj.entrustDate" @on-change="_ctimeChange" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.entrustDate" type="date" split-panels style="width:100%;" placeholder="请选择委托日期"
placeholder="请选择委托日期" name="entrustDate"></Date-picker> name="entrustDate" @on-change="_ctimeChange"></Date-picker>
</Form-item> </Form-item>
<Form-item label="项目名称" prop="projectName" class="width-48"> <Form-item label="项目名称" prop="projectName" class="width-48">
<AutoComplete ref="autoInput" v-model="formObj.projectName" :down-data="projectData" <AutoComplete ref="autoInput" v-model="formObj.projectName" :down-data="projectData"
@on-result-change="_projectChange" name="projectName" placeholder="请输入或选择项目名称" name="projectName" placeholder="请输入或选择项目名称" @on-result-change="_projectChange"
></AutoComplete> ></AutoComplete>
</Form-item> </Form-item>
<Form-item label="项目负责人" prop="projectLeader" class="width-48"> <Form-item label="项目负责人" prop="projectLeader" class="width-48">
<AutoComplete ref="autoInput" v-model="formObj.projectLeader" :down-data="projectLeaderData" <AutoComplete ref="autoInput" v-model="formObj.projectLeader" :down-data="projectLeaderData"
@on-result-change="_projectLeaderChange" show-key="realname" name="projectLeader" placeholder="请输入或选择项目负责人" show-key="realname" name="projectLeader" placeholder="请输入或选择项目负责人" @on-result-change="_projectLeaderChange"
></AutoComplete> ></AutoComplete>
<!-- <Input v-model="formObj.projectLeader" name="projectLeader" placeholder="请输入项目负责人"/>-->
</Form-item> </Form-item>
<Form-item label="钻孔位置" prop="boreholeLocation" class="width-48"> <Form-item label="钻孔位置" prop="boreholeLocation" class="width-48">
<Input v-model="formObj.boreholeLocation" name="boreholeLocation" placeholder="请输入钻孔位置"/> <Input v-model="formObj.boreholeLocation" name="boreholeLocation" placeholder="请输入钻孔位置"/>
...@@ -37,23 +36,23 @@ ...@@ -37,23 +36,23 @@
<Input v-model="formObj.latitude" name="latitude" placeholder="请输入纬度"/> <Input v-model="formObj.latitude" name="latitude" placeholder="请输入纬度"/>
</Form-item> </Form-item>
<Form-item label="水深(米)" prop="waterDepth" class="width-48"> <Form-item label="水深(米)" prop="waterDepth" class="width-48">
<Input v-model="formObj.waterDepth" @keydown.native="channelInputLimit" type="number" name="waterDepth" placeholder="请输入深度"/> <Input v-model="formObj.waterDepth" type="number" name="waterDepth" placeholder="请输入深度" @keydown.native="channelInputLimit"/>
</Form-item> </Form-item>
<Form-item label="平均容重" prop="projectNo" class="width-48"> <Form-item label="平均容重" prop="projectNo" class="width-48">
<Input v-model="formObj.projectNo" name="projectNo" placeholder="请输入平均容重"/> <Input v-model="formObj.projectNo" name="projectNo" placeholder="请输入平均容重"/>
</Form-item> </Form-item>
<Form-item @click.native="_selectPerson" label="制表人" prop="tabulater" class="width-48"> <Form-item label="制表人" prop="tabulater" class="width-48" @click.native="_selectPerson">
<Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/> <Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/>
</Form-item> </Form-item>
<Form-item label="制单日期:" prop="tabulateDate" class="width-48"> <Form-item label="制单日期:" prop="tabulateDate" class="width-48">
<Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.tabulateDate" name="tabulateDate" type="date" split-panels style="width:100%;" placeholder="请选择委托日期"
placeholder="请选择委托日期"></Date-picker> @on-change="_tabulateChange"></Date-picker>
</Form-item> </Form-item>
<Form-item label="检验类别:" prop="testType" class="width-48"> <Form-item label="检验类别:" prop="testType" class="width-48">
<el-select @change="typeChange" v-model="formObj.testType" name="testType" placeholder="请选择" <el-select v-model="formObj.testType" name="testType" placeholder="请选择" size="small"
size="small"
style="width:100%" style="width:100%"
clearable> clearable
@change="typeChange">
<el-option <el-option
v-for="item in typeoptions" v-for="item in typeoptions"
:key="item.name" :key="item.name"
...@@ -65,8 +64,8 @@ ...@@ -65,8 +64,8 @@
</Form> </Form>
</div> </div>
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
<btn-list :msg="edit?btnEdit:btn" :open="searchOpen" @on-result-change="_btnClick" <btn-list :msg="edit?btnEdit:btn" :open="searchOpen" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</div> </div>
<div> <div>
<PTVXETable <PTVXETable
...@@ -75,7 +74,7 @@ ...@@ -75,7 +74,7 @@
:table-height="500" :table-height="500"
:get-page="getPage" :get-page="getPage"
:icon-msg="iconMsg" :icon-msg="iconMsg"
:hidePage = true :hide-page = true
@on-result-change="_tableResultChange"> @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
...@@ -97,13 +96,13 @@ ...@@ -97,13 +96,13 @@
></el-input> ></el-input>
</div> </div>
<div v-if="item.key==='samplePack'" @click.stop="_handleRow(scope)"> <div v-if="item.key==='samplePack'" @click.stop="_handleRow(scope)">
<AutoComplete v-model="scope.row.samplePack" :downData="packList" <AutoComplete v-model="scope.row.samplePack" :down-data="packList"
@on-result-change="_packChange" name="samplePack" placeholder="请输入或选择包装类型" name="samplePack" placeholder="请输入或选择包装类型" @on-result-change="_packChange"
></AutoComplete> ></AutoComplete>
</div> </div>
<div v-if="item.key==='sampleDescribe'" @click.stop="_handleRow(scope)"> <div v-if="item.key==='sampleDescribe'" @click.stop="_handleRow(scope)">
<AutoComplete v-model="scope.row.sampleDescribe" :downData="soilList" <AutoComplete v-model="scope.row.sampleDescribe" :down-data="soilList"
@on-result-change="_soilChange" name="sampleDescribe" placeholder="请输入或选择土质描述" name="sampleDescribe" placeholder="请输入或选择土质描述" @on-result-change="_soilChange"
></AutoComplete> ></AutoComplete>
</div> </div>
<div v-else-if="item.key==='experiments'" @click.stop="_handleRow(scope)"> <div v-else-if="item.key==='experiments'" @click.stop="_handleRow(scope)">
...@@ -118,8 +117,8 @@ ...@@ -118,8 +117,8 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div> </div>
</Modal> </Modal>
<importModal ref="importModal" @on-result-change="_inputBack" aptitude-item></importModal> <importModal ref="importModal" aptitude-item @on-result-change="_inputBack"></importModal>
<SampleItemSelect ref="sampleItemSelectModal" @on-result-change="_itemImportBack" is-change /> <SampleItemSelect ref="sampleItemSelectModal" is-change @on-result-change="_itemImportBack" />
<assignPerson ref="userModal" @on-result-change="_userResult"></assignPerson> <assignPerson ref="userModal" @on-result-change="_userResult"></assignPerson>
<SampleItemRemove ref="sampleItemRemove" @on-result-change = '_removeItemBack'></SampleItemRemove> <SampleItemRemove ref="sampleItemRemove" @on-result-change = '_removeItemBack'></SampleItemRemove>
<SampleItemEdit ref="sampleItemEdit" @on-result-change = '_removeItemBack'></SampleItemEdit> <SampleItemEdit ref="sampleItemEdit" @on-result-change = '_removeItemBack'></SampleItemEdit>
...@@ -315,10 +314,14 @@ export default { ...@@ -315,10 +314,14 @@ export default {
_getLeaderList: async function() { _getLeaderList: async function() {
const result = await soilSample.getUserList() const result = await soilSample.getUserList()
if (result) { if (result) {
this.projectLeaderData = result.records
for (let i = 0; i < result.records.length; i++) { for (let i = 0; i < result.records.length; i++) {
console.log('---records---', result.records[i])
result.records[i].realname =
result.records[i].realname + result.records[i].mobile
this.projectLeaderName.push(result.records[i].realname) this.projectLeaderName.push(result.records[i].realname)
console.log('---this.projectLeaderName--', this.projectLeaderName)
} }
this.projectLeaderData = result.records
} }
}, },
_projectLeaderChange(msg, data) { _projectLeaderChange(msg, data) {
...@@ -850,18 +853,6 @@ export default { ...@@ -850,18 +853,6 @@ export default {
this.formObj.tabulateDate = new Date(formObj.tabulateDate) this.formObj.tabulateDate = new Date(formObj.tabulateDate)
} }
}, },
_showAddress(formObj) {
this.testedCityData = []
if (
formObj.province !== undefined &&
formObj.city !== undefined &&
formObj.county !== undefined
) {
this.testedCityData.push(formObj.province)
this.testedCityData.push(formObj.city)
this.testedCityData.push(formObj.county)
}
},
_getList: async function() { _getList: async function() {
const result = await meterEntrust.pageList() const result = await meterEntrust.pageList()
const list = [] const list = []
......
<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-if="item.key==='itemed'">{{scope.row[item.key] === 1?'是':'否'}}</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: 'formula', width: 120 },
{ title: '是否是项目指标', key: 'itemed', width: 120 },
{ title: '列位置', key: 'columnPlace', width: 120 },
{ title: '合并开始列', key: 'mergeBegin', width: 120 },
{ title: '合并结束列', key: 'mergeEnd', width: 120 },
{ title: '合并行数', key: 'mergeRowNum', width: 120 },
{ title: '单位', key: 'unit', 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.originalTemplateConfig(
this.$serializeForm(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.getOriginalTemplateConfig(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.deleteOriginalTemplateConfig(ids)
if (result) {
this.$Message.success('删除成功')
this._page()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" @on-visible-change="_visibleChange" width="900">
<p slot="header">{{modalTitle}}</p>
<div>
<Form ref="formObj" :id="formId" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<div>
<Form-item label="属性名称" prop="attributeName" class="width-48">
<Input v-model="formObj.attributeName" name="attributeName" placeholder="请输入属性名称"/>
</Form-item>
<Form-item label="属性" prop="dataAttribute" class="width-48">
<Input v-model="formObj.dataAttribute" name="dataAttribute"
placeholder="请输入属性"/>
</Form-item>
<Form-item label="公式配置" prop="formula" class="width-48">
<Input v-model="formObj.formula" name="formula"
placeholder="请输入公式配置"/>
</Form-item>
<Form-item label="列位置" prop="columnPlace" class="width-48">
<Input
v-model="formObj.columnPlace"
@keydown.native="channelInputLimit"
name="columnPlace"
type="number"
onmousewheel="return false"
placeholder="请输入列位置"
></Input>
</Form-item>
<Form-item label="合并开始列" prop="mergeBegin" class="width-48">
<Input
v-model="formObj.mergeBegin"
@keydown.native="channelInputLimit"
name="mergeBegin"
type="number"
onmousewheel="return false"
placeholder="请输入合并开始列"
/>
</Form-item>
<Form-item label="合并结束列" prop="mergeEnd" class="width-48">
<Input
v-model="formObj.mergeEnd"
@keydown.native="channelInputLimit"
name="mergeEnd"
type="number"
onmousewheel="return false"
placeholder="请输入合并结束列"
/>
</Form-item>
<Form-item label="合并行数" prop="mergeRowNum" class="width-48">
<Input
v-model="formObj.mergeRowNum"
@keydown.native="channelInputLimit"
name="mergeRowNum"
type="number"
onmousewheel="return false"
placeholder="请输入合并行数"
/>
</Form-item>
<Form-item label="是否是项目指标" prop="itemed" class="width-48">
<Select v-model="formObj.itemed" @change="_optionChange" placeholder="请选择">
<Option
v-for="(item,index) in options"
:key="index"
:label="item.value"
:value="index"
/>
</Select>
</Form-item>
<Form-item label="单位" prop="unit" class="width-48">
<Input v-model="formObj.unit" name="unit"
placeholder="请输入单位"/>
</Form-item>
</div>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑环境资质项目表
*/
import { soilAptitude } from '../../../api'
export default {
components: {},
data() {
return {
activeName: '',
hideUserSel: true,
id: '',
modalTitle: '',
templateId: '',
formObj: {
attributeName: undefined,
formula: undefined,
columnPlace: '',
unit: undefined,
status: undefined,
mainType: undefined,
smallType: undefined,
testValue: undefined,
mergeBegin: '',
mergeRowNum: '',
mergeEnd: '',
itemed: undefined
},
options: [
{
label: '否',
value: '否'
},
{
label: '是',
value: '是'
}
],
ruleValidate: {
name: [{ required: true, message: '指标名称不能为空', trigger: 'blur' }]
},
showModal: false,
footerList: [
{ name: '取消', type: '' },
{ name: '保存', type: 'primary' }
],
microbedList: [{ value: 0, name: '否' }, { value: 1, name: '是' }],
// 检测依据
testBasisData: [],
// 类别下拉数组
typeData: [],
// 检测科室
groupData: [],
groupName: '',
// 主检人
userData: [],
// 单位
unitData: [],
aptitudeData: [],
aptitude: '',
// testBasisName: '',
computeTypeList: [],
tester: '',
marksList: [],
detectionTypeList: [],
testItemData: [],
formId: ''
}
},
mounted() {
// 检测科室
// this._getUserGroup()
// 检测依据
// this._getTestBasisList()
// 资质
// this._getAptitudeList()
// this._getType()
},
methods: {
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
inputChange(data) {
console.log('data>>>', data)
console.log('formObj>>>', this.formObj)
},
_selectJudgeType(data) {
this.formObj.microbed = data
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open(id, formObj) {
this.formId = 'edit-form-template-config'
this._hideLoading()
this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) {
this.id = ''
this.templateId = id
this.modalTitle = '添加模板配置'
console.log('formObj>>>', this.formObj)
} else {
this.hideUserSel = true
this.id = formObj.id
this.formObj = formObj
this.modalTitle = '编辑模板配置'
console.log('formObj>>>', this.formObj)
}
this.showModal = true
},
// 获取表数据
_resultChange(msg) {
this.showModal = false
this.$refs.footerModal._hideLoading()
this.$Message.success(msg)
this.$emit('on-result-change')
this.$refs.footerModal._hideLoading()
},
_optionChange(data) {
this.formObj.itemed = data
console.log(this.formObj.itemed)
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('edit-form-template-config')
if (this.$string(this.id).isEmpty()) {
data.templateId = this.templateId
data.itemed = this.formObj.itemed
// 添加
this._save(data)
} else {
// 编辑
data.itemed = this.formObj.itemed
this._edit({ id: this.formObj.id, obj: data })
}
} else {
this.$refs.footerModal._hideLoading()
this.$Message.error('表单验证失败!')
}
})
},
_save: async function(data) {
console.log(data)
const result = await soilAptitude.saveOriginalTemplateConfig(data)
console.log(result)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.editOriginalTemplateConfig(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this.showModal = false
this._hideLoading()
},
_visibleChange(data) {
if (!data && this.$showBtn('food-aptitude-item-step-edit')) {
this.$emit('on-result-change')
this.$refs.testStepByAptitude._clear()
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding marginLeft-10">
<div class="layout-content-main tree-position">
<div class="position-right">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form" v-show="searchOpen" :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" name="name" placeholder="请输入模板名称" clearable></Input>
<input type="hidden" name="classifyId">
</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"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :page-columns="pageColumns"
:get-page="getPage" :opt-col-width="120" :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>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
<!-- 添加、编辑 -->
<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>
import global from '../../../api/config'
import { soilAptitude } from '../../../api'
import SoilRecordTemplateEdit from './OpenSoilTemplateEdit'
import SoilRecordEdit from './SoilRecordEdit'
import ConfigTemplate from './ConfigTemplate'
export default {
components: { SoilRecordTemplateEdit, SoilRecordEdit, ConfigTemplate },
data() {
return {
pageColumns: [
{ title: '开土记录模板名称', key: 'name' },
{ title: '类别', key: 'classType', width: 120 },
{ title: '样品开始行', key: 'sampleBeginRow', width: 120 },
{ title: '样品合并数', key: 'sampleMergerNum', width: 120 },
{ title: '模板样品数', key: 'templateSampleNum', width: 120 },
{ title: '备注', key: 'remark' }
],
formObj: {
name: undefined
},
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: {},
tableStyleObj: {},
btn: [
{ type: 'success', id: '', name: '添加' },
{ type: 'error', id: '', name: '删除' }
],
searchOpen: true,
selectIds: []
}
},
computed: {
// tableHeight: function() {
// if (this.searchOpen) {
// return this.$newTableHeight('search')
// } else {
// return this.$newTableHeight('noSearch')
// }
// }
},
mounted() {
this._page()
},
methods: {
_btnClick(msg) {
switch (msg) {
case '添加':
this._editModal()
break
case '删除':
this._delAll()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_refresh() {
// 刷新
this.id = ''
this.name = ''
this._search()
this._classTree()
},
_classData(result, msg) {
$('input[name=classifyId]').val(result)
this._formSearch()
},
_classTree() {
this.$refs.classTree._Ztree()
},
_treeHide() {
// 左侧树隐藏
this.isTree = false
this.tableStyleObj.marginLeft = '15px'
},
_treeShow() {
this.isTree = true
this.tableStyleObj.marginLeft = '215px'
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._reportEdit(data)
break
case '下载':
this._download(data.id)
break
case '预览/编辑':
this._lookReport(data)
break
case '配置':
this._configData(data)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_configData(data) {
this.$refs.configTemplateModal._open(data)
},
_lookReport: async function(data) {
const result = await soilAptitude.originalTemplateGetById(data.id)
if (result) {
this._viewReport(result)
}
},
_viewReport(data) {
console.log('getUserInfo', global.getUserInfo())
// window.open(global.baseURL + '/print/v1/oos?key=' + objectKey+'&edit=true', '', 'height=' + (screen.availHeight - 50) + ',' +
// 'width=' + (screen.availWidth - 10) + ',top=0,left=0,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,' +
// 'location=no,status=no')
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
id: data.id,
idType: 12,
isReport: 4
})
}
},
_contHide() {
this._page()
},
_page: async function() {
console.log('page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.pageOpenSoil(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_editModal() {
this.$refs.editModal._open()
},
_reportEdit(data) {
this.$refs.reportEdit._open(data)
},
// 批量删除
_delAll() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._deleteByIds(ids)
}
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilAptitude.originalTemplateDeleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_download(id) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载?',
onOk: () => {
window.open(
global.baseURL + '/base/v1/file_template/download/' + id,
'_blank'
)
}
})
},
_search() {
this._page()
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
// this.getPage = this.$store.state.SysFileTemplate.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false">
<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>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95">
<Form-item label="类别" prop="classType">
<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>
</el-select>
</Form-item>
<Form-item label="开土制备记录模板名称" prop="name">
<Input v-model="formObj.name" @on-keyup="_onKeyUp" name="name" placeholder="请输入原始记录名称"></Input>
</Form-item>
<Form-item label="备注" prop="remark">
<Input v-model="formObj.remark" @on-keyup="_onKeyUp" name="remark" placeholder="请输入备注"></Input>
</Form-item>
</Form>
</div>
<div slot="footer" class="btn-width clearfix">
<Button @click="_cancel" style="margin-left: 8px;">取消</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>
</div>
</template>
<script>
/**
* 添加编辑
*/
import global from '../../../api/config'
const defVal = {
name: '',
remark: '',
classType: '',
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
return {
modalTitle: '添加',
formObj: defVal,
ruleValidate: {
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
classType: [
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
typeList: [
{
value: '开土制备模板'
}
],
showEditModal: false,
dataObj: {
file: ''
},
pname: '',
action: '',
isLoad: false,
isDisable: true,
format: ['docx', 'xlsx', 'xls']
}
},
methods: {
_onKeyUp() {
if (this.formObj.name === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/soil/v1/original_template/upload_open_soil_template/?name=' +
this.formObj.name +
'&remark=' +
this.formObj.remark +
'&classType=' +
this.formObj.classType
}
},
_selectZtree() {
// this.$refs.ztreeModal._openZtree()
},
_cancel() {
this.showEditModal = false
},
_open() {
this.showEditModal = true
this.isLoad = false
this.formObj.name = ''
this.formObj.alias = ''
this.formObj.remark = ''
this.formObj.classType = ''
this.modalTitle = '添加开土制备模板'
},
_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.showEditModal = false
} else {
this.isLoad = true
this.$Message.error(response.msg)
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree(result) {
this.pname = ''
if (result === undefined) {
this.formObj.classifyId = '0'
this.pname = ''
} else {
this.formObj.classifyId = result.id
this.pname = result.name
}
// 判断必填项是否为空
this._onKeyUp()
}
}
}
</script>
<style scoped>
.clearfix:after {
content: '';
clear: both;
display: block;
}
</style>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false">
<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>
<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>
</el-select>
</Form-item>
<Form-item label="原始记录名称" prop="alias" style="width: 100%">
<Input v-model="formObj.alias" name="alias" placeholder="请输入原始记录名称"></Input>
</Form-item>
<Form-item label="备注" prop="remark" style="width: 100%">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注"></Input>
</Form-item>
<Form-item label="样品开始行" prop="sampleBeginRow" style="width: 100%">
<el-input
v-model="formObj.sampleBeginRow"
@keydown.native="channelInputLimit"
name="sampleBeginRow"
type="number"
onmousewheel="return false"
placeholder="请输入样品开始行"
/>
</Form-item>
<Form-item label="样品合并数" prop="sampleMergerNum" style="width: 100%">
<el-input
v-model="formObj.sampleMergerNum"
@keydown.native="channelInputLimit"
name="sampleMergerNum"
type="number"
onmousewheel="return false"
placeholder="请输入样品合并数"
/>
</Form-item>
<Form-item label="模板样品数" prop="templateSampleNum" style="width: 100%">
<el-input
v-model="formObj.templateSampleNum"
@keydown.native="channelInputLimit"
name="templateSampleNum"
type="number"
onmousewheel="return false"
placeholder="请输入模板样品数"
/>
</Form-item>
<Form-item label="多sheet模板" prop="moreSheet" style="width: 100%">
<Radio-group v-model="formObj.moreSheet">
<Radio v-for="item in sheetType" :key="item.value" :label="item.value">{{item.name}}</Radio>
</Radio-group>
</Form-item>
</Form>
</div>
<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>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import { soilAptitude } from '../../../api'
const defVal = {
alias: '',
classType: '',
remark: '',
sampleBeginRow: '',
sampleBeginCol: '',
sampleMergerNum: '',
templateSampleNum: '',
moreSheet: 0,
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
const validatesampleBeginRow = (rule, value, callback) => {
if (this.formObj.sampleBeginRow === '') {
callback(new Error('内容不能为空'))
} else {
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('内容不能为空'))
} else {
callback()
}
}
const validatesampleBeginCol = (rule, value, callback) => {
if (this.formObj.sampleBeginCol === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
return {
modalTitle: '编辑',
formObj: defVal,
ruleValidate: {
alias: [
{ required: true, message: '模板名称不能为空', trigger: 'blur' }
],
sampleBeginRow: [
{
required: true,
validator: validatesampleBeginRow,
message: '样品开始行不能为空',
trigger: 'blur'
}
],
sampleBeginCol: [
{
required: true,
validator: validatesampleBeginCol,
message: '样品开始列不能为空',
trigger: 'blur'
}
],
sampleMergerNum: [
{
required: true,
validator: validatesampleMergerNum,
message: '样品合并数不能为空',
trigger: 'blur'
}
],
templateSampleNum: [
{
required: true,
validator: validatetemplateSampleNum,
message: '模板样品数不能为空',
trigger: 'blur'
}
],
classType: [
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
sheetType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
typeList: [
{
value: '力学'
},
{
value: '物性'
},
{
value: '高级'
}
],
id: '',
showEditModal: false,
dataObj: {
file: ''
},
pname: '',
action: '',
isLoad: false,
isDisable: true,
format: ['docx', 'xlsx', 'xls']
}
},
methods: {
_onKeyUp() {
if (this.formObj.alias === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/meter/v1/file_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
_selectZtree() {
// this.$refs.ztreeModal._openZtree()
},
_cancel() {
this.showEditModal = false
},
_ok() {
this.$refs.formObj.validate(valid => {
console.log('valid', valid)
if (valid) {
this._editOk()
} else {
this.$Message.error('请输入必填值')
}
})
},
_editOk: async function() {
const result = await soilAptitude.originalTemplateEdit({
id: this.id,
formObj: this.formObj
})
if (result) {
this.$message.success('编辑成功')
this.showEditModal = false
this.$emit('on-result-change')
}
},
_open(data) {
console.log(data)
this.showEditModal = true
this.isLoad = false
this.id = data.id
this.formObj.alias = data.alias
this.formObj.remark = data.remark
this.formObj.classType = data.classType
this.formObj.sampleBeginRow = data.sampleBeginRow
this.formObj.sampleBeginCol = data.sampleBeginCol
this.formObj.sampleMergerNum = data.sampleMergerNum
this.formObj.templateSampleNum = data.templateSampleNum
this.formObj.moreSheet = data.moreSheet
this.modalTitle = '编辑模板'
console.log(this.id)
},
_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.showEditModal = false
// } else {
// this.isLoad = true
// this.$Message.error(response.msg)
// }
// },
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree(result) {
this.pname = ''
if (result === undefined) {
this.formObj.classifyId = '0'
this.pname = ''
} else {
this.formObj.classifyId = result.id
this.pname = result.name
}
// 判断必填项是否为空
}
}
}
</script>
<style scoped>
.clearfix:after {
content: '';
clear: both;
display: block;
}
.inputBox >>> input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
.inputBox >>> input[type='number'] {
-moz-appearance: textfield !important;
}
</style>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="900" @on-visible-change="_visibleChange">
<p slot="header">{{modalTitle}}</p>
<div>
<Form :id="formId" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
<div>
<Form-item label="高级样品位置" prop="receiveLocation" style="width: 80%">
<Input v-model="formObj.receiveLocation" name="receiveLocation" placeholder="请输入高级样品位置"/>
</Form-item>
<Form-item label="高级样品分类:" prop="seniorType" style="width: 80%">
<el-select v-model="formObj.seniorType" placeholder="请选择" name="seniorType" style="width: 100%" >
<el-option
v-for="(item,index) in groupoptions"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</Form-item>
<Form-item label="接收时间:" prop="testBasis" style="width: 80%">
<Date-picker v-model="formObj.receiveTime" name="receiveTime" type="date" split-panels style="width:100%;" placeholder="请选择委托日期"
@on-change="_tabulateChange"></Date-picker>
</Form-item>
<Form-item label="接收人" prop="receiver" class="width-48" @click.native="_selectPerson">
<Input v-model="formObj.receiver" name="receiver" placeholder="请输入名称"/>
</Form-item>
</div>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<assignPerson ref="userModal" @on-result-change="_userResult"></assignPerson>
</div>
</template>
<script>
/**
* 添加编辑环境资质项目表
*/
import { soilAptitude, soilEntrust } from '../../../../api'
import assignPerson from '../../../../components/user-info-single/assignPerson'
export default {
components: { assignPerson },
data() {
return {
activeName: '',
hideUserSel: true,
id: '',
modalTitle: '',
formObj: {
receiveLocation: undefined,
seniorType: undefined,
receiveTime: undefined,
receiver: undefined,
receiverId: undefined
},
sampleIds: [],
ruleValidate: {
name: []
},
options: [],
groupoptions: [],
showModal: false,
footerList: [
{ name: '取消', type: '' },
{ name: '保存', type: 'primary' }
],
aptitude: '',
// testBasisName: '',
formId: ''
}
},
mounted() {
// 检测科室
// this._getUserGroup()
// 检测依据
// this._getTestBasisList()
// 资质
// this._getAptitudeList()
// this._getType()
},
methods: {
groupSelect(data) {
console.log(data)
// this.formObj.groupId = da
},
_selGroup(data) {
console.log(data)
this.formObj.groupId = data
},
_selectPerson() {
this.$refs.userModal._openOrg('选择制表人', 'itemTree')
},
_userResult(data, msg) {
this.$forceUpdate()
this.formObj.receiver = data.realname
this.formObj.receiverId = data.id
},
_tabulateChange(data) {
this.formObj.receiveTime = data
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open(sampleIds) {
this.formObj.receiveLocation = undefined
this.formObj.seniorType = undefined
this.formObj.receiveTime = undefined
this.formObj.receiver = undefined
this.formObj.receiverId = undefined
this.formId = 'index-edit-form'
this.sampleIds = sampleIds
this._hideLoading()
this._getTestType()
this.$refs.formObj.resetFields()
this.hideUserSel = true
this.modalTitle = '编辑'
this.showModal = true
},
// 获取检测依据
_getStandardList: async function() {
const result = await soilAptitude.getStandardList()
if (result) {
this.options = result
}
},
_getTestType: async function() {
const result = await soilEntrust.testType('高级分类')
console.log(result)
if (result) {
this.groupoptions = result
}
},
// 检测项目结果
_testItemChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.name = data
this.$refs.formObj.validateField('name')
this._changeMicrobed()
break
case 'query':
this.formObj.name = data
this._getItemList(data)
break
case 'blur':
this._changeMicrobed()
break
}
},
_clearMarks() {
this.marksList = []
},
// 获取表数据
_resultChange(msg) {
this.showModal = false
this.$refs.footerModal._hideLoading()
this.$Message.success(msg)
this.$emit('on-result-change')
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('index-edit-form')
data.receiverId = this.formObj.receiverId
console.log('index-edit-form', data)
this._save({ ids: this.sampleIds, obj: data })
} else {
this.$refs.footerModal._hideLoading()
this.$Message.error('表单验证失败!')
}
})
},
_save: async function(data) {
console.log(data)
const result = await soilAptitude.editSeniorSample(data)
console.log(result)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.edit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this.showModal = false
this._hideLoading()
},
_visibleChange(data) {
this.$emit('on-result-change')
}
}
}
</script>
<template>
<div>
<Modal v-model="showBatchModal" v-drag :mask-closable="false" width="900">
<p slot="header">
原始记录填写
</p>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--样品信息-->
<!--报告模板-->
<Col span="24">
<ReportTemplate ref="reportTemplate" @on-result-change="_templateResultChange"></ReportTemplate>
</Col>
</Row>
</div>
</div>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerBtn" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<!--生成报告的进度条-->
</div>
</template>
<script>
import ReportTemplate from './ReportTemplate'
/**
* 样品列表--生成报告或者选择模板生成报告
*/
export default {
components: {
ReportTemplate
},
data() {
return {
selectIds: [],
getPage: {
records: []
},
showBatchModal: false,
isLoading: false,
footerBtn: [
{ type: '', id: '', name: '取消' },
{ type: 'primary', id: '', name: '确定' }
],
pageColumns: [
{ title: '样品名称', key: 'name', width: 160 },
{ title: '样品编号', key: 'code', width: 150 },
{ title: '证书编号', key: 'certificate', width: 150 }
],
reportModelId: '',
backData: {},
// 样品数据
tableData: [],
// 签发日期
issueDateTemp: '',
issueDate: '',
entrustId: undefined,
showIssueModal: false
}
},
methods: {
_open(id) {
this.entrustId = id
this.getPage.records = []
this.backData = {}
this.showBatchModal = true
this._reportTemplate()
this.reportModelId = ''
this.isLoading = false
},
// 报告模板
_reportTemplate() {
this.$refs.reportTemplate._open()
},
_footerResult(name) {
switch (name) {
case '确定':
this._ok()
break
case '取消':
this.showBatchModal = false
break
}
},
_templateResultChange(selectData) {
this.backData = selectData[0]
},
_issueChange(data) {
if (data) {
this.issueDate = data
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.footerModal._hideLoading()
if (!this.backData.name) {
this.$Message.warning('请选择一个原始记录模板!')
// this._hideLoading()
} else {
this.backData.entrustId = this.entrustId
this.$emit('on-result-change', this.backData)
this.showBatchModal = false
}
},
_issueCancel() {
this.showIssueModal = false
},
// 选择时间ok
_issueOk() {
this.isLoading = true
this.showIssueModal = false
this._createOk()
},
// 生成报告
_createOk() {
const obj = []
for (let i = 0; i < this.tableData.length; i++) {
obj.push({
sampleId: this.tableData[i].id,
reportSn: this.tableData[i].reportSn,
issueDate: this.issueDate
})
}
this.$layxLoading(true, '数据验证中')
const validateObj = {
sampleReports: obj,
reportModelId: this.reportModelId
}
// 先进行验证
this.$store
.dispatch('FoodSampleReport/createReportValidate', validateObj)
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const currentTime = new Date().getTime()
this.$refs.progressModal._open(this.tableData.length, currentTime)
validateObj.seriesNo = currentTime
console.log('生成报告的当前序列号,', validateObj.seriesNo)
this.$store
.dispatch('FoodSampleReport/createReport', validateObj)
.then(() => {})
}
this._hideLoading()
this.isLoading = false
this.$layxLoading(false)
})
},
_closeResult() {
this.showBatchModal = false
this.$emit('on-result-change')
}
}
}
</script>
<template>
<div>
<Row>
<Col span="24">
<Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="模板名称:" class="search-item">
<Input v-model="formObj.alias" @on-enter="_formSearch" placeholder="请输入模板名称" clearable/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<PTVXETableHeight
ref="pageTable"
:table-height="300"
:get-page="getPage"
:is-radio="true"
@on-result-change="_tableResultChange"
select-data="true"
hide-checkbox>
<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.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else-if="item.judged">{{scope.row[item.key]===1?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
export default {
components: {},
data() {
return {
tableHeight: '400',
pageColumns: [
{ title: '模板名称', key: 'alias', width: 220 },
{ title: '类别', key: 'classType', width: 140 },
{ title: '备注', key: 'remark' }
],
getPage: {},
modalTitle: '报告模板',
sampleId: '',
formObj: {
name: undefined
},
selectData: []
}
},
methods: {
_tableResultChange(msg, data) {
console.log(msg)
switch (msg) {
case 'page':
this._page()
break
case 'changeSize':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'singleSelect':
this.selectData = [data]
this.$emit('on-result-change', this.selectData)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
}
},
_open(sampleId) {
this.sampleId = sampleId || ''
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.pageOpenSoil(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
}
}
}
</script>
...@@ -6,27 +6,27 @@ ...@@ -6,27 +6,27 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="委托商:"> <Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-item" label="委托编号:"> <Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable/> <Input v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-item" label="钻孔名称:"> <Form-item class="search-item" label="钻孔名称:">
<Input v-model="formObj.boreholeName" @on-enter="_formSearch" placeholder="请输入钻孔名称" clearable></Input> <Input v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable @on-enter="_formSearch"></Input>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</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" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
...@@ -52,15 +52,15 @@ ...@@ -52,15 +52,15 @@
</div> </div>
<keep-alive> <keep-alive>
<!-- eslint-disable-next-line vue/require-component-is --> <!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component> <component :is="currentComponent" ref="refModal" @on-result-change="_componentResult"></component>
</keep-alive> </keep-alive>
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../api' import { soilEntrust, soilSample } from '../../../api'
import http from '../../../api/http' import http from '../../../api/http'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import global from '../../../api/config' import CreateReport from './CreateReport'
import SampleManage from './SampleManage' import SampleManage from './SampleManage'
import SamplePreparationEdit from './SamplePreparationEdit' import SamplePreparationEdit from './SamplePreparationEdit'
import SoilSampleItemManageEdit from './SoilSampleItemManageEdit' import SoilSampleItemManageEdit from './SoilSampleItemManageEdit'
...@@ -75,6 +75,7 @@ export default { ...@@ -75,6 +75,7 @@ export default {
SampleManage, SampleManage,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
SoilSampleItemManageEdit, SoilSampleItemManageEdit,
CreateReport,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
SoilEntrustItemNum SoilEntrustItemNum
}, },
...@@ -217,22 +218,73 @@ export default { ...@@ -217,22 +218,73 @@ export default {
}, },
_componentResult(data, msg) { _componentResult(data, msg) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'CreateReport':
this._openSoilRecordMake(data)
break
default: default:
this._page() this._page()
} }
}, },
_exportPrepare(id) { _openSoilRecordMake(data) {
this.$Modal.confirm({ if (data) {
title: '提示', this.$refs.pageTable._showLoading()
content: '确定导出这条记录', this._makeCodeExcel(data)
onOk: () => { } else {
window.open( const ids = this.selectIds
global.baseURL + if (ids.length === 0) {
'/soil/v1/entrust/export_soil_prepare_record?ids=' + this.$Message.warning('请至少选择一条数据!')
id, } else {
'_blank' // this._appendOriginalRecord()
) }
}
},
_makeCodeExcel: async function(data) {
this.$refs.pageTable._showLoading()
const result = await soilSample.saveExcelOpenSoilRecord({
entrustId: data.entrustId,
templateId: data.id
})
this.$refs.pageTable._hideLoading()
if (result) {
await this._page()
if (result === null || result === undefined) {
this.$Message.warning('证书编制失败,请联系管理员!')
this.$refs.pageTable._hideLoading()
return false
} else {
this.$emit('on-result-change')
this._viewReport(result)
} }
}
},
_viewReport(data) {
this.$refs.pageTable._hideLoading()
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
_exportPrepare(id) {
// this.$Modal.confirm({
// title: '提示',
// content: '确定导出这条记录',
// onOk: () => {
// window.open(
// global.baseURL +
// '/soil/v1/entrust/export_soil_prepare_record?ids=' +
// id,
// '_blank'
// )
// }
// })
this.currentComponent = 'CreateReport'
this.$nextTick(() => {
this.$refs.refModal._open(id)
}) })
}, },
_sampleManage(data) { _sampleManage(data) {
......
...@@ -50,7 +50,7 @@ import SoilExpReportMakeIndex from '../pages/soil-exp-report/report-make/SoilExp ...@@ -50,7 +50,7 @@ import SoilExpReportMakeIndex from '../pages/soil-exp-report/report-make/SoilExp
import SoilExpReportCheckIndex from '../pages/soil-exp-report/report-check/SoilExpReportCheckIndex' import SoilExpReportCheckIndex from '../pages/soil-exp-report/report-check/SoilExpReportCheckIndex'
import SoilExpReportIssueIndex from '../pages/soil-exp-report/report-issue/SoilExpReportIssueIndex' import SoilExpReportIssueIndex from '../pages/soil-exp-report/report-issue/SoilExpReportIssueIndex'
import SoilExpReportEndIndex from '../pages/soil-exp-report/report-end/SoilExpReportEndIndex' import SoilExpReportEndIndex from '../pages/soil-exp-report/report-end/SoilExpReportEndIndex'
import OpenSoilTemplate from '../pages/soil-sample-manage/open-soil-template-manage/OpenSoilTemplate'
import Blank from '~/pages/blank' import Blank from '~/pages/blank'
export default [ export default [
{ {
...@@ -176,6 +176,11 @@ export default [ ...@@ -176,6 +176,11 @@ export default [
path: 'box', path: 'box',
component: BoxManage, component: BoxManage,
meta: { title: '盒号管理' } meta: { title: '盒号管理' }
},
{
path: 'open_soil_template',
component: OpenSoilTemplate,
meta: { title: '开土制备记录模板' }
} }
] ]
}, },
......
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