Commit b95f3a40 by lichengming

修改了出检委托单导入

parent c6363264
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="1230">
<Modal v-model="showModal" :mask-closable="false" width="1250">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
......@@ -158,11 +158,11 @@
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<VerificationModal ref="VerificationModal" @on-result-change="_backVerification"></VerificationModal>
<ContractModal ref="ContractModal" @on-result-change="_backContract" is-change></ContractModal>
<EditModal ref="EditModal" @on-result-change="_backData" is-change />
<importModal ref="importModal" @on-result-change="_inputBack" aptitude-item></importModal>
</Modal>
</div>
</template>
<script>
......@@ -393,11 +393,37 @@ export default {
title: '导入'
}
this.$refs.importModal._open(data, '样品导入')
console.log('导入')
},
_inputBack(data) {
console.log(data)
if (undefined !== data) {
if (this.getPage.records.length > 0) {
const j = this.getPage.records.length
for (let i = j; i < data.length + j; i++) {
console.log(i)
this.getPage.records.push(data[i - j])
if (data[i - j].lastTime !== undefined) {
this.getPage.records[i].lastTime = new Date(data[i - j].lastTime)
}
console.log(this.getPage.records)
// this.getPage.records[i].lastTime = new Date(data[0].lastTime)
}
} else {
for (let i = 0; i < data.length; i++) {
// if (this.getPage.records[i].lastTime !== undefined) {
// const t = this.getPage.records[i].lastTime
// const d = t.valueOf(t)
// console.log('时间戳', d)
// this.getPage.records[i].lastTime = d
// this.getPage.records = []
// }
this.getPage.records.push(data[i])
if (data[i].lastTime !== undefined) {
this.getPage.records[i].lastTime = new Date(data[i].lastTime)
}
console.log(data[i].lastTime)
}
}
}
},
......@@ -734,6 +760,13 @@ export default {
this._showTime(formObj)
this.getPage.records = formObj.sampleList
console.log(this.formObj)
for (let i = 0; i < formObj.sampleList.length; i++) {
if (formObj.sampleList[i].lastTime !== undefined) {
this.getPage.records[i].lastTime = new Date(
formObj.sampleList[i].lastTime
)
}
}
},
_getList: async function() {
const result = await meterEntrust.pageList()
......
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