Commit f53e6898 by lichengming

修改了库房样品管理

parent d125f80c
...@@ -165,5 +165,9 @@ export default { ...@@ -165,5 +165,9 @@ export default {
pageWaitStorageHis: data => pageWaitStorageHis: data =>
http http
.post('soil/v1/alone_sample/page_wait_storage_his', data) .post('soil/v1/alone_sample/page_wait_storage_his', data)
.then(res => res),
bathChangeStorehouse: data =>
http
.post('soil/v1/alone_sample/bath_change_storehouse', data)
.then(res => res) .then(res => res)
} }
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<ViewSample ref="viewSample"></ViewSample> <ViewSample ref="viewSample"></ViewSample>
<ViewDetail ref="viewDetail"></ViewDetail> <ViewDetail ref="viewDetail"></ViewDetail>
<FileManage ref="FileManage" @on-result-change="_page"></FileManage> <FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<BatchModal ref="batchModal" @on-result-change="_page"></BatchModal>
<stockSampleEdit ref="editModal" @on-result-change="_page"></stockSampleEdit> <stockSampleEdit ref="editModal" @on-result-change="_page"></stockSampleEdit>
</div> </div>
</template> </template>
...@@ -74,11 +75,13 @@ import { soilEntrust, soilSample } from '../../../api' ...@@ -74,11 +75,13 @@ import { soilEntrust, soilSample } from '../../../api'
import ViewDetail from '../../soil-alone-sample/ViewDetail' import ViewDetail from '../../soil-alone-sample/ViewDetail'
import ViewSample from './ViewLocationEntrust' import ViewSample from './ViewLocationEntrust'
import stockSampleEdit from './stockSampleEdit' import stockSampleEdit from './stockSampleEdit'
import BatchModal from './BatchModal'
export default { export default {
components: { components: {
stockSampleEdit, stockSampleEdit,
ViewSample, ViewSample,
ViewDetail ViewDetail,
BatchModal
}, },
data() { data() {
return { return {
...@@ -118,11 +121,6 @@ export default { ...@@ -118,11 +121,6 @@ export default {
name: '查看' name: '查看'
}, },
{ {
type: 'md-apps',
id: '',
name: '查看试样'
},
{
type: 'md-cloud', type: 'md-cloud',
id: '', id: '',
name: '附件' name: '附件'
...@@ -158,6 +156,9 @@ export default { ...@@ -158,6 +156,9 @@ export default {
this._editModal(false) this._editModal(false)
}) })
break break
case '批量填写':
this._bathChange()
break
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
...@@ -175,6 +176,13 @@ export default { ...@@ -175,6 +176,13 @@ export default {
break break
} }
}, },
_bathChange() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.batchModal._open(this.selectIds.join(','))
}
},
// 表格中操作 // 表格中操作
_iconClick(res, data, currentComponent) { _iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent this.currentComponent = currentComponent
...@@ -249,6 +257,7 @@ export default { ...@@ -249,6 +257,7 @@ export default {
}, },
// 获取数据 // 获取数据
_page: async function() { _page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageStorehouseSample( const result = await soilSample.pageStorehouseSample(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
......
<template>
<div>
<Modal v-model="showEditModal" v-drag :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="库房号" prop="storehouse " style="width: 100%">
<Input v-model="formObj.storehouse " name="storehouse" placeholder="请输入库房号"></Input>
</Form-item>
<Form-item label="架位号" prop="shelfCode " style="width: 100%">
<Input v-model="formObj.shelfCode " name="shelfCode" placeholder="请输入架位号"></Input>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
modalTitle: '批量填写存放架位',
formObj: {
detail: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
selectLocation(data) {
this._getLocationById(data)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_receive: async function(data) {
const result = await soilEntrust.bathChangeStorehouse(data)
if (result) {
this._resultChange('填写成功!')
}
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.storehouse = ''
this.formObj.shelfCode = ''
this.ids = ids
this.showEditModal = true
},
_getLocation: async function() {
const result = await soilSample.locationList()
if (result) {
console.log(result)
this.options = result
console.log(this.options)
}
},
_getLocationById: async function(id) {
console.log(id)
const result = await soilSample.locationGetById(id)
if (result) {
this.formObj.receiveLocation = result.name
}
console.log(this.formObj.receiveLocation)
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div> <div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline> <Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="土质描述详情" prop="detail " style="width: 100%"> <Form-item label="土质描述详情" prop="detail " style="width: 100%">
<el-input v-model="formObj.detail " name="detail "></el-input> <Input v-model="formObj.detail " name="detail "></Input>
</Form-item> </Form-item>
</Form> </Form>
</div> </div>
......
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