Commit 30d108a4 by wangweidong

土工试验Lims

parent c0efd641
......@@ -52,9 +52,11 @@ export default {
pageColumns: [
{ title: '属性名称', key: 'attributeName' },
{ title: '属性', key: 'dataAttribute', width: 120 },
{ title: '公式配置', key: 'formula', width: 120 },
{ title: '列位置', key: 'columnPlace', width: 120 },
{ title: '合并开始列', key: 'mergeBegin', width: 120 },
{ title: '合并结束列', key: 'mergeEnd', width: 120 }
{ title: '合并结束列', key: 'mergeEnd', width: 120 },
{ title: '合并行数', key: 'mergeRowNum', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
......
......@@ -12,6 +12,10 @@
<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">
<el-input
v-model="formObj.columnPlace"
......@@ -44,6 +48,17 @@
placeholder="请输入合并结束列"
/>
</Form-item>
<Form-item label="合并行数" prop="mergeRowNum" class="width-48">
<el-input
v-model="formObj.mergeRowNum"
@keydown.native="channelInputLimit"
name="mergeRowNum"
type="number"
onmousewheel="return false"
placeholder="请输入合并结束列"
/>
</Form-item>
</div>
</Form>
</div>
......@@ -71,6 +86,7 @@ export default {
templateId: '',
formObj: {
attributeName: undefined,
formula: undefined,
columnPlace: undefined,
unit: undefined,
status: undefined,
......@@ -78,6 +94,7 @@ export default {
smallType: undefined,
testValue: undefined,
mergeBegin: undefined,
mergeRowNum: undefined,
mergeEnd: undefined
},
ruleValidate: {
......@@ -122,17 +139,6 @@ export default {
// this._getType()
},
methods: {
// 字典
_dicSearch() {
this.$store.dispatch('LmsBaseDict/getItem', '食品检出类别').then(() => {
const result = this.$store.state.LmsBaseDict.item
this.detectionTypeList = result
if (this.$string(this.id).isEmpty()) {
// 添加界面默认第一个
this.formObj.detectionType = result.length > 0 ? result[0].name : ''
}
})
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
......@@ -142,31 +148,6 @@ export default {
}
return true
},
_testBasisChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.stdId = data.id
this.formObj.testBasis = data.stdNum
this.formObj.testBasisName = data.name
this.formObj.testMethod = data.stdNum
this.$refs.formObj.validateField('testBasis')
break
case 'query':
this.formObj.stdId = ''
this.formObj.testMethod = ''
this.formObj.testBasis = data.stdNum
this.formObj.testBasisName = ''
this._getTestBasisList(data)
break
case 'blur':
if (this.formObj.stdId === '') {
this.formObj.testBasis = ''
this.formObj.testMethod = ''
this._getTestBasisList()
}
this.$refs.formObj.validateField('testBasis')
}
},
_selectJudgeType(data) {
this.formObj.microbed = data
},
......@@ -178,10 +159,6 @@ export default {
case '保存':
this._ok()
break
case '填写说明':
this.$refs.introduction._open()
this._hideLoading()
break
}
},
_hideLoading() {
......@@ -194,83 +171,15 @@ export default {
if (this.$string(formObj).isEmpty()) {
this.id = ''
this.templateId = id
this.modalTitle = '添加试验指标'
this.modalTitle = '添加模板配置'
} else {
this.hideUserSel = true
this.id = formObj.id
this.formObj = formObj
this.modalTitle = '编辑试验指标'
this.modalTitle = '编辑模板配置'
}
this.showModal = true
},
// 获取检测项目
_getItemList(value) {
const data = {}
if (value) {
Object.assign(data, { name: value })
}
this.$store.dispatch('FoodAptitudeItem/getTestItem', data).then(() => {
this.testItemData = this.$store.state.FoodAptitudeItem.list
})
},
// 检测项目结果
_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
}
},
_changeMicrobed() {
// 新增或者导入新增资质时 如果检测项目名称带‘菌’字,则是否微生物默认为‘是’
if (this.id === '') {
if (this.formObj.name.indexOf('菌') > -1) {
this.$set(this.formObj, 'microbed', 1)
} else {
this.$set(this.formObj, 'microbed', 0)
}
}
},
_clearMarks() {
this.marksList = []
},
// 主检人&检测科室
_groupChange(data) {
if (data) {
this.groupName = data.label
this.formObj.groupId = data.value
this.formObj.tester = ''
this.formObj.testerId = ''
this._getUserList(data.value)
}
},
_userChange(data) {
if (data) {
this.formObj.testerId = data.value
this.formObj.tester = data.label
}
},
// 单位
_unitChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.unit = data
break
case 'query':
this._getUnitList(data)
break
}
},
// 获取表数据
_resultChange(msg) {
this.showModal = false
......@@ -315,15 +224,6 @@ export default {
this.showModal = false
this._hideLoading()
},
// 切换tab
_changeTabs(tab, event) {
if (tab.name === 'testStep') {
this.$refs.testStepByAptitude._open(
this.formObj.stepId,
this.formObj.id
)
}
},
_visibleChange(data) {
if (!data && this.$showBtn('food-aptitude-item-step-edit')) {
this.$emit('on-result-change')
......
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