Commit b8359229 by lichengming

修改了查看原始记录删除按钮

parent 261e9363
......@@ -157,5 +157,7 @@ export default {
collectFilePage: data =>
http.post('soil/v1/experiment_collect_file/page', data).then(res => res),
pageExpAuditHis: data =>
http.post('soil/v1/entrust/page_exp_audit_his', data).then(res => res)
http.post('soil/v1/entrust/page_exp_audit_his', data).then(res => res),
deleteRecord: data =>
http.delete('soil/v1/original_record/?ids=' + data).then(res => res)
}
......@@ -6,10 +6,10 @@
<Form :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="模板名称:">
<Input v-model="formObj.templateTitle" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
<Input v-model="formObj.title" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
</Form-item>
<Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.cusNames" @on-enter="_formSearch" placeholder="请输入委托单位" clearable></Input>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" placeholder="请输入委托编号" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -39,18 +39,6 @@
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
<!-- <template slot="col">-->
<!-- <vxe-table-column-->
<!-- :width="190"-->
<!-- title="操作"-->
<!-- align="center"-->
<!-- fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <VXEIconList :msg="(scope.row.hasInputItem===1) ? iconMsg : iconMsgDisable"-->
<!-- @on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>-->
<!-- </template>-->
<!-- </vxe-table-column>-->
<!-- </template>-->
</PTVXETable>
</Col>
</Row>
......@@ -76,16 +64,7 @@ export default {
return {
currentComponent: '',
getPage: {},
btn: [
{
type: '',
id: '',
name: '纠正填写时间',
componentName: 'EditDateModal'
},
{ type: '', id: '', name: '设置填写人乙' },
{ type: 'error', id: '', name: '删除' }
],
btn: [],
selectIds: [],
iconMsg: [
{
......@@ -102,55 +81,8 @@ export default {
type: 'ios-list',
id: '',
name: '查看试验项目'
}
// {
// type: 'erlenmeyer-flask',
// id: '',
// name: '查看样品',
// componentName: 'SampleView'
// },
// {
// type: 'document-text',
// id: '',
// name: '查看检测项目',
// componentName: 'ItemView'
// },
// { type: 'cloud', id: '', name: '附件', componentName: 'FileManage' },
// { type: 'trash-a', id: '', name: '删除' },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'ElnFormRecord'
// }
],
iconMsgDisable: [
{ type: 'md-create', id: '', name: '编辑', disabled: true },
{
type: '',
id: '',
name: '查看原始记录',
componentName: 'OriginalItemView'
},
{
type: 'ios-list',
id: '',
name: '查看试验项目'
}
// {
// type: 'document-text',
// id: '',
// name: '查看检测项目',
// componentName: 'ItemView'
// },
// { type: 'cloud', id: '', name: '附件', componentName: 'FileManage' },
// { type: 'trash-a', id: '', name: '删除', disabled: true },
// {
// type: 'ios-clock',
// id: '',
// name: '操作记录',
// componentName: 'ElnFormRecord'
// }
{ type: 'md-trash', id: '', name: '删除' }
],
pageColumns: [
{ title: '模板名称', key: 'title' },
......@@ -159,16 +91,7 @@ export default {
{ title: '创建时间', key: 'ctime', dateTime: true }
],
formObj: {
entrustId: '',
batchNos: '',
sampleNums: '',
templateTitle: '',
fillInTimeBegin: '',
fillInTimeEnd: '',
cusNames: '',
codes: '',
itemNames: '',
testAccordings: ''
entrustId: ''
},
searchOpen: false
}
......@@ -212,40 +135,12 @@ export default {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '纠正填写时间':
this._editWriteTime()
break
case '设置填写人乙':
this._setAnotherTester()
break
case '删除':
this._batchDelete()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
// 设置填写人乙
_setAnotherTester() {
if (this.selectIds.length === 0) {
this.$msgTip('warning')
} else {
this.$refs.testerModal._open(this.selectIds)
}
},
_editWriteTime() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.refModal._open('填写时间')
}
},
_dateChange(data) {
this.formObj.fillInTimeBegin = data[0]
this.formObj.fillInTimeEnd = data[1]
},
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
this.$nextTick(() => {
......@@ -262,21 +157,9 @@ export default {
case '查看试验项目':
this._itemView(data.id)
break
case '查看检测项目':
this.$refs.refModal._open(data)
break
case '查看样品':
this.$refs.refModal._open(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'originalId')
break
case '删除':
this._deleteByIds([data.id])
break
case '操作记录':
this.$refs.refModal._open(data.id)
break
}
})
},
......@@ -286,7 +169,6 @@ export default {
},
// 查看原始记录
_recordView(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
......@@ -343,28 +225,22 @@ export default {
this.getPage = result
}
},
// 批量删除原始记录
_batchDelete() {
if (this.selectIds.length > 0) {
const content = '确定删除这' + this.selectIds.length + '条数据?'
this._deleteByIds(this.selectIds, content)
} else {
this.$msgTip('warning')
}
},
// 删除原始记录
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this.$store.dispatch('EnvItem/deleteOriRecord', ids).then(() => {
if (this.$store.state.EnvItem.success) {
this._page()
this.$Message.success('删除成功!')
}
})
this._deleteOk(ids)
}
})
},
_deleteOk: async function(ids) {
const result = await soilTest.deleteRecord(ids)
if (result) {
this.$Message.success('删除成功')
this._page()
}
}
}
}
......
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