Commit bfc63f1a by lichengming

修改了原始记录模板编辑

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