Commit 3596c945 by lichengming

修改了开土制备

parent 5c24368e
...@@ -65,30 +65,6 @@ ...@@ -65,30 +65,6 @@
<el-date-picker @change="timeChange(scope.row)" v-model="scope.row.prepareDate" type="datetime" format="yyyy-MM-dd HH:mm" style="width:100%;" <el-date-picker @change="timeChange(scope.row)" v-model="scope.row.prepareDate" 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==='prepareDate' && isAccurate === '是'" @click="_handleRow(scope)">-->
<!-- <date-picker :editable="false" :transfer="true" v-model="scope.row.prepareDate" type="datetime"-->
<!-- placeholder="选择时间"-->
<!-- format="yyyy-MM-dd HH:mm" style="width:100%"></date-picker>-->
<!-- </div>-->
<!-- <div v-else-if="item.key==='prepareDate' && isAccurate === '否'" @click="_handleRow(scope)">-->
<!-- <date-picker :editable="false" :transfer="true" v-model="scope.row.prepareDate" type="datetime"-->
<!-- placeholder="选择时间"-->
<!-- format="yyyy-MM-dd" style="width:100%"></date-picker>-->
<!-- </div>-->
<!-- <div v-else-if="item.key==='prepareDate' && !isAccurate" @click="_handleRow(scope)">-->
<!-- <date-picker :editable="false" :transfer="true" v-model="scope.row.prepareDate" type="datetime"-->
<!-- placeholder="选择时间"-->
<!-- format="yyyy-MM-dd" style="width:100%"></date-picker>-->
<!-- </div>-->
<!-- <div v-else-if="item.key==='prepareDate'" @click="_handleRow(scope)">-->
<!-- <el-date-picker-->
<!-- v-model="scope.row.prepareDate"-->
<!-- @change="timeChange($event)"-->
<!-- type="datetime"-->
<!-- size="mini"-->
<!-- placeholder="选择日期时间">-->
<!-- </el-date-picker>-->
<!-- </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)" <el-input v-model="scope.row.preparer" @focus="_handleRow(scope)"
placeholder="制备人" size="small" name="preparer"></el-input> placeholder="制备人" size="small" name="preparer"></el-input>
...@@ -124,13 +100,12 @@ ...@@ -124,13 +100,12 @@
<!--打印标签--> <!--打印标签-->
<!--选择人员--> <!--选择人员-->
</Modal> </Modal>
<SampleParpareBatchEdit ref="batchEdit"></SampleParpareBatchEdit> <SampleParpareBatchEdit ref="batchEdit" @on-result-change="backData"></SampleParpareBatchEdit>
</div> </div>
</template> </template>
<script> <script>
import AutoComplete from '../../../components/base/AutoCompletes' import AutoComplete from '../../../components/base/AutoCompletes'
import Global from '../../../api/config'
import { soilEntrust } from '../../../api' import { soilEntrust } from '../../../api'
import SampleParpareBatchEdit from './SampleParpareBatchEdit' import SampleParpareBatchEdit from './SampleParpareBatchEdit'
...@@ -287,6 +262,15 @@ export default { ...@@ -287,6 +262,15 @@ export default {
this.isAccurate = result[5][0].name this.isAccurate = result[5][0].name
}) })
}, },
backData(data) {
this.$forceUpdate()
console.log(data)
console.log(this.selectData)
for (let i = 0; i < this.selectData.length; i++) {
Object.assign(this.selectData[i], data)
}
console.log('合并后', this.selectData)
},
_preparationChange(msg, data, handleObj) { _preparationChange(msg, data, handleObj) {
this._handleRow(handleObj) this._handleRow(handleObj)
this.currentRow.prepareWay = data this.currentRow.prepareWay = data
...@@ -438,59 +422,9 @@ export default { ...@@ -438,59 +422,9 @@ export default {
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
const user = Global.getUserInfo()
switch (msg) { switch (msg) {
case 'page': case 'page':
let times = '' this._page()
const list = this.$store.state.FoodSample.list
console.log(list)
for (let i = 0; i < list.length; i++) {
this.getPage.records.push({
currentIndex: i,
id: list[i].id === undefined ? '' : list[i].id,
num: list[i].num,
name: list[i].name,
groupName: list[i].groupName,
groupId: list[i].groupId,
itemName: list[i].itemName,
preparationWay: list[i].preparationWay,
receiveQuantity: list[i].receiveQuantity,
resultQuantity: list[i].resultQuantity
? list[i].resultQuantity
: 0,
unit: list[i].unit,
resultState: list[i].resultState ? list[i].resultState : '泥状',
saveWay: list[i].saveWay ? list[i].saveWay : '冷冻',
pack: list[i].pack ? list[i].pack : '',
storePlace: list[i].storePlace ? list[i].storePlace : '',
preparationDate: list[i].preparationDate
? list[i].preparationDate
: (times =
times === ''
? new Date()
: new Date(
new Date(times).getTime() +
Math.round(Math.random() * 1 * 5) * 1000
)),
remark: list[i].remark,
sampleQuantity: list[i].sampleQuantity
? list[i].sampleQuantity
: '',
preparationPerson: list[i].preparationPerson
? list[i].preparationPerson
: user.realname,
preparationPersonId: list[i].preparationPersonId
? list[i].preparationPersonId
: user.id,
sampleId: list[i].sampleId,
resultDate: list[i].resultDate,
groupNameRel: list[i].groupNameRel,
contractName: list[i].contractName,
printNum: 1,
itemPreparation: list[i].itemPreparation
})
}
this.$refs.pageTable._hideLoading()
break break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
......
...@@ -204,11 +204,10 @@ export default { ...@@ -204,11 +204,10 @@ export default {
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
}, },
_ok() { _ok() {
console.log(this.formObj)
this.$refs.formObj.validate(valid => { this.$refs.formObj.validate(valid => {
if (valid) { if (valid) {
const data = this.formObj this.$emit('on-result-change', this.formObj)
this._saveInfo({ id: this.ids.join(','), obj: data }) this.showModal = false
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
} else { } else {
this.$Message.error('表单验证失败!') this.$Message.error('表单验证失败!')
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
<PTVXETable <PTVXETable
ref="pageTable" :tableHeight="tableHeight" @on-result-change="_tableResultChange" ref="pageTable" :tableHeight="tableHeight" @on-result-change="_tableResultChange"
:getPage="getPage" :getPage="getPage"
is-edit
is-group is-group
select-data> select-data>
<vxe-table-column <vxe-table-column
...@@ -149,27 +148,7 @@ export default { ...@@ -149,27 +148,7 @@ export default {
// {type: '', id: 'food-sampling-list-reset-sc-id', name: '重置省局ID',}, // {type: '', id: 'food-sampling-list-reset-sc-id', name: '重置省局ID',},
], ],
sampleId: '', sampleId: '',
formObj: { formObj: {},
contractId: '',
samplingNum: '',
name: '',
num: '',
samplingDateBegin: '',
samplingDateEnd: '',
receiveDateBegin: '',
receiveDateEnd: '',
ctimeBegin: '',
ctimeEnd: '',
testBasis: '',
detectType: '',
mateTestBasisSm: 0,
hasProvinceId: 0,
groupIds: '',
sampleName: '',
firstClass: '',
onlyAbort: 0,
qced: 0
},
receiveDateList: [], receiveDateList: [],
ctimeList: [], ctimeList: [],
samplingDateList: [], samplingDateList: [],
...@@ -663,13 +642,6 @@ export default { ...@@ -663,13 +642,6 @@ export default {
_open(id, type) { _open(id, type) {
this.sampleId = id this.sampleId = id
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
this.formObj.hasProvinceId = 0
this.formObj.mateTestBasisSm = 0
this.formObj.onlyAbort = 0
this.formObj.contractId = id
this.receiveDateList = []
this.ctimeList = []
this.samplingDateList = []
this.type = type this.type = type
this.showModal = true this.showModal = true
this.currentRow = {} this.currentRow = {}
......
...@@ -85,14 +85,7 @@ export default { ...@@ -85,14 +85,7 @@ export default {
selectData: [], selectData: [],
currentComponent: '', currentComponent: '',
showSampleModal: false, showSampleModal: false,
formObj: { formObj: {},
samplingNum: '',
name: '',
num: '',
detectType: '',
standard: '',
samplingLinkList: []
},
stdList: [], stdList: [],
sampleLinkList: [ sampleLinkList: [
{ value: 0, name: '食品生产' }, { value: 0, name: '食品生产' },
...@@ -217,7 +210,7 @@ export default { ...@@ -217,7 +210,7 @@ export default {
this._editModal(true, data) this._editModal(true, data)
break break
case '试验项目': case '试验项目':
this._itemManage(data.id) this._itemManage(data.sampleId)
break break
case '复制': case '复制':
this._copySample(data) this._copySample(data)
......
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