Commit b1104649 by lichengming

修改了样品管理

parent f6ba9718
......@@ -111,7 +111,7 @@ export default {
viewUri: '/soil/v1/standard_annex/preview/'
}
break
case 'sampleId':
case 'aloneSampleId':
// 样品
this.entrustId = id
this.urlData = {
......
......@@ -208,7 +208,7 @@ export default {
},
methods: {
_batchUpload() {
if (this.formObj.sampleId) {
if (this.formObj.aloneSampleId) {
this.$refs.batchUploadSample._open(this.id)
} else {
this.$refs.batchUpload._open(this.id)
......
......@@ -8,6 +8,9 @@
<!--搜索表单-->
<Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="钻孔名称:">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item class="search-item" label="库房号:">
<Input @on-enter="_formSearch" v-model="formObj.warehouse" name="warehouse" placeholder="请输入库房号" clearable/>
</Form-item>
......@@ -60,18 +63,22 @@
</div>
<!--组件加载-->
<ViewSample ref="viewSample"></ViewSample>
<StandardsManageEdit ref="editModal" @on-result-change="_page"></StandardsManageEdit>
<ViewDetail ref="viewDetail"></ViewDetail>
<FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<stockSampleEdit ref="editModal" @on-result-change="_page"></stockSampleEdit>
</div>
</template>
<script>
import { soilSample } from '../../../api'
import StandardsManageEdit from './AddressManageEdit' // 添加、编辑
import { soilEntrust, soilSample } from '../../../api'
import ViewDetail from '../../soil-alone-sample/ViewDetail'
import ViewSample from './ViewLocationEntrust'
import stockSampleEdit from './stockSampleEdit'
export default {
components: {
StandardsManageEdit,
ViewSample
stockSampleEdit,
ViewSample,
ViewDetail
},
data() {
return {
......@@ -84,10 +91,9 @@ export default {
{
type: 'success',
id: '',
name: '添加',
componentName: 'StandardsManageEdit'
name: '出库'
},
{ type: 'error', id: '', name: '删除' }
{ type: 'success', id: '', name: '批量填写' }
],
// 表格
pageColumns: [
......@@ -107,10 +113,20 @@ export default {
componentName: 'StandardsManageEdit'
},
{
type: 'ios-list',
id: '',
name: '查看'
},
{
type: 'md-apps',
id: '',
name: '查看试样'
},
{
type: 'md-cloud',
id: '',
name: '附件'
},
{ type: 'md-remove-circle', id: '', name: '删除' }
],
searchOpen: false,
......@@ -170,24 +186,65 @@ export default {
case '查看试样':
this._viewSample(data.name)
break
case '查看':
this._viewModal(true, data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteById(data.id)
break
}
})
},
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'aloneSampleId')
},
_viewModal(edit, id) {
if (edit) {
this.$refs.pageTable._showLoading()
// 编辑
this._getDetailById(id)
} else {
// 添加
this.$nextTick(() => {
this.$refs.refModal._open()
})
}
},
_getDetailById: async function(id) {
const result = await soilEntrust.aloneSampleGetById(id)
if (result) {
this.$refs.viewDetail._open(result)
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
_viewSample(data) {
this.$refs.viewSample._open(data)
},
_editModal: async function(edit, id) {
_editModal(edit, id) {
if (edit) {
const result = await soilSample.aloneWarehouseLocationGetById(id)
if (result) {
this.$refs.editModal._open(result)
}
this.$refs.pageTable._showLoading()
// 编辑
this._getById(id)
} else {
// 添加
this.$refs.editModal._open()
this.$nextTick(() => {
this.$refs.refModal._open()
})
}
},
_getById: async function(id) {
const result = await soilEntrust.aloneSampleGetById(id)
if (result) {
this.$refs.editModal._openEdit(result)
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
// 获取数据
......
......@@ -376,7 +376,7 @@ export default {
// 上传文件
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'sampleId')
this.$refs.refModal._open(id, 'aloneSampleId')
})
},
_getById: async function(id) {
......
......@@ -52,7 +52,7 @@ export default {
contractId: '',
//
page: 0,
rows: 30,
rows: 10,
formObj: {},
processObj: {
height: document.documentElement.clientHeight - 300 + 'px'
......
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