Commit bfc63f1a by lichengming

修改了原始记录模板编辑

parent a294f0a4
......@@ -54,6 +54,11 @@
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">
......@@ -96,6 +101,7 @@ const defVal = {
sampleBeginCol: '',
sampleMergerNum: '',
templateSampleNum: '',
moreSheet: 0,
classifyId: 0
}
......@@ -173,6 +179,7 @@ export default {
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
sheetType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
typeList: [
{
value: '力学'
......@@ -257,6 +264,7 @@ export default {
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)
},
......
......@@ -40,7 +40,7 @@
</el-input>
</div>
<div v-else-if="item.key==='unit'" @click="_handleRow(scope)">
<el-input v-model="scope.row.unit" name="unit" placeholder="输入或选择单位">
<el-input v-model="scope.row.unit" name="unit" placeholder="输入单位">
</el-input>
</div>
<div v-else-if="item.key==='quantity'" @click="_handleRow(scope)">
......@@ -51,12 +51,12 @@
<div v-else-if="item.key==='keepWay'" @click="_handleRow(scope)">
<AutoComplete v-model="scope.row.keepWay" :handle-obj="scope" :down-data="saveWayData"
@on-result-change="_saveChange" clearable
placeholder="输入或选择保存方式" show-key="name"></AutoComplete>
placeholder="输入或选择保存方式"></AutoComplete>
</div>
<div v-else-if="item.key==='keepContainer'" @click="_handleRow(scope)">
<AutoComplete v-model="scope.row.keepContainer" :handle-obj="scope" :down-data="packList"
@on-result-change="_packSaveChange" clearable
placeholder="输入或选择保存容器" show-key="name"></AutoComplete>
placeholder="输入或选择保存容器"></AutoComplete>
</div>
<!-- <div v-else-if="item.key==='prepareDate'" @click="_handleTimeRow(scope)">-->
<!-- <el-date-picker-->
......@@ -69,9 +69,14 @@
<el-date-picker v-model="scope.row.prepareDate" @change="timeChange(scope.row)" type="datetime" format="yyyy-MM-dd HH:mm" style="width:100%;"
placeholder="请选择日期"></el-date-picker>
</div>
<!-- <div v-else-if="item.key==='preparer'" @click="_handleRow(scope)">-->
<!-- <el-input v-model="scope.row.preparer" @focus="_handleRow(scope)"-->
<!-- placeholder="制备人" size="small" name="preparer"></el-input>-->
<!-- </div>-->
<div v-else-if="item.key==='preparer'" @click="_handleRow(scope)">
<el-input v-model="scope.row.preparer" @focus="_handleRow(scope)"
placeholder="制备人" size="small" name="preparer"></el-input>
<AutoComplete v-model="scope.row.preparer" :handle-obj="scope" :down-data="preparerList"
@on-result-change="_preparerChange" clearable
placeholder="制备人"></AutoComplete>
</div>
<div v-else-if="item.key==='remark'" @click="_handleRow(scope)">
<el-input v-model="scope.row.remark" @focus="_handleRow(scope)" placeholder="备注"
......@@ -112,7 +117,7 @@
<script>
import AutoComplete from '../../../components/base/AutoCompletes'
import { soilEntrust } from '../../../api'
import { soilEntrust, soilSample } from '../../../api'
import { getLodop } from '../../../plugins/clodop/LodopFuncs'
// eslint-disable-next-line no-unused-vars
import downloadPlugin from '../../../plugins/download/downloadPlugin'
......@@ -195,6 +200,7 @@ export default {
preparationWayData: [],
resultStateWayData: [],
saveWayData: [],
preparerList: [],
sampleIds: '',
unitData: [],
......@@ -251,35 +257,22 @@ export default {
}
},
// 多个参数查询
_dicSearch() {
const data = [
'制备单位',
'制备方式',
'制备后状态',
'保存方式',
'制备保存容器',
'制备时间是否精确至时分'
]
this.$store.dispatch('LmsBaseDict/listDict', data).then(() => {
const result = this.$store.state.LmsBaseDict.list
// 0-数据录入常用单位
for (let j = 0; j < result[0].length; j++) {
this.unitData.push(result[0][j].name)
}
// 1-制备方式
for (let j = 0; j < result[1].length; j++) {
this.preparationWayData.push(result[1][j].name)
this.wayData.set(result[1][j].name, result[1][j].code)
// _dicSearch: async function() {
// const data = ['制备方式', '保存方式', '保存容器']
// const result = await soilSample.getDictList(data)
// if (result) {
// this.keepWayList = result
// }
// },
_getUserList: async function() {
const result = await soilSample.getUserList()
if (result) {
console.log('result==============', result)
for (let i = 0; i < result.records.length; i++) {
this.preparerList.push(result.records[i].realname)
}
// 2-制备后状态
this.resultStateWayData = result[2]
// 3-保存方式
this.saveWayData = result[3]
// 4-制备保存容器
this.packList = result[4]
// 5-制备时间是否精确至时分
this.isAccurate = result[5][0].name
})
console.log(this.preparerList)
}
},
backData(data) {
this.$forceUpdate()
......@@ -291,6 +284,7 @@ export default {
console.log('合并后', this.selectData)
},
_preparationChange(msg, data, handleObj) {
console.log('data', data)
this._handleRow(handleObj)
this.currentRow.prepareWay = data
},
......@@ -299,8 +293,13 @@ export default {
this.currentRow.resultState = data.name
},
_saveChange(msg, data, handleObj) {
console.log('data', data)
this._handleRow(handleObj)
this.currentRow.keepWay = data.name
this.currentRow.keepWay = data
},
_preparerChange(msg, data, handleObj) {
this._handleRow(handleObj)
this.currentRow.preparer = data
},
timeChange(data) {
console.log(data)
......@@ -309,15 +308,20 @@ export default {
console.log(this.getPage.records)
},
_packSaveChange(msg, data, handleObj) {
console.log('data', data)
this._handleRow(handleObj)
this.currentRow.keepContainer = data.name
this.currentRow.keepContainer = data
},
_open(sampleIds) {
this.$refs.pageTable._showLoading()
this.sampleIds = sampleIds
this.showModal = true
this.getPage.records = []
this.preparationWayData = []
this.saveWayData = []
this.packList = []
this.unitData = []
this.preparerList = []
this.footerList = []
for (let i = 0; i < this.list.length; i++) {
if (this.$showBtn(this.list[i].id)) {
......@@ -325,7 +329,10 @@ export default {
}
}
this._page()
// this._dicSearch()
this._getPrepareWay()
this._getkeepWayList()
this._getkeepContainerList()
this._getUserList()
},
_page: async function() {
const result = await soilEntrust.preparePage({ ids: this.sampleIds })
......@@ -338,6 +345,31 @@ export default {
this.$refs.pageTable._hideLoading()
}
},
_getPrepareWay: async function() {
const result = await soilSample.getDictList('制备方式')
if (result) {
for (let i = 0; i < result.length; i++) {
this.preparationWayData.push(result[i].name)
}
}
},
_getkeepWayList: async function() {
const result = await soilSample.getDictList('保存方式')
if (result) {
for (let i = 0; i < result.length; i++) {
this.saveWayData.push(result[i].name)
}
console.log(this.saveWayData)
}
},
_getkeepContainerList: async function() {
const result = await soilSample.getDictList('保存容器')
if (result) {
for (let j = 0; j < result.length; j++) {
this.packList.push(result[j].name)
}
}
},
_footerResult(name) {
switch (name) {
case '取消':
......
......@@ -119,7 +119,11 @@ export default {
{ key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' }
],
btn: [
{ type: 'success', id: '', name: '填写原始记录' },
{
type: 'success',
id: 'sample-preparation-write-record',
name: '填写原始记录'
},
{ type: 'success', id: '', name: '原始记录填写' },
{ type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' }
......@@ -472,7 +476,10 @@ export default {
console.log(this.selectIds)
console.log('----dddd---', data)
this.$refs.pageTable._hideLoading()
const result = await soilSample.generateExcelReport(data)
const result = await soilSample.saveExcelOriginalRecord({
ids: this.selectIds.join(','),
templateId: data.id
})
if (result) {
await this._page()
if (result === null || result === undefined) {
......
......@@ -119,7 +119,11 @@ export default {
{ key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' }
],
btn: [
{ type: 'success', id: '', name: '填写原始记录' },
{
type: 'success',
id: 'test-input-write-record',
name: '填写原始记录'
},
{ type: 'success', id: '', name: '原始记录填写' },
{ type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' }
......
......@@ -109,7 +109,11 @@ export default {
{ key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' }
],
btn: [
{ type: 'success', id: '', name: '填写原始记录' },
{
type: 'success',
id: 'test-input-write-record',
name: '填写原始记录'
},
{ type: 'success', id: '', name: '原始记录填写' },
{ type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' }
......@@ -367,10 +371,11 @@ export default {
}
},
_makeCodeExcel: async function(data) {
console.log(this.selectIds)
console.log('----dddd---', data)
this.$refs.pageTable._hideLoading()
const result = await soilSample.generateExcelReport(data)
const result = await soilSample.saveExcelOriginalRecord({
ids: this.selectIds.join(','),
templateId: data.id
})
if (result) {
await this._page()
if (result === null || result === undefined) {
......
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