Commit 1777868a by lichengming

修改了样品管理

parent 513a57bb
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange"> :get-page="getPage" @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -116,10 +116,7 @@ export default { ...@@ -116,10 +116,7 @@ export default {
return { return {
formId: 'SoilSampleItemManage', formId: 'SoilSampleItemManage',
currentComponent: '', currentComponent: '',
btn: [ btn: [],
{ type: 'success', id: '', name: '提交分包' },
{ type: 'success', id: '', name: '取消分包' }
],
iconMsg: [{ type: 'pt-a-end', id: '', name: '删除' }], iconMsg: [{ type: 'pt-a-end', id: '', name: '删除' }],
sampleId: '', // 样品id sampleId: '', // 样品id
showModal: false, showModal: false,
......
...@@ -94,18 +94,18 @@ export default { ...@@ -94,18 +94,18 @@ export default {
id: '', id: '',
name: '管理样品' name: '管理样品'
}, },
{ // {
type: 'ios-list', // type: 'ios-list',
id: '', // id: '',
name: '项目管理' // name: '项目管理'
}, // },
// { // {
// type: 'md-create', // type: 'md-create',
// id: '', // id: '',
// name: '编辑协议' // name: '编辑协议'
// }, // },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
// { type: 'md-trash', id: '', name: '删除' }, { type: 'md-trash', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -370,12 +370,30 @@ export default { ...@@ -370,12 +370,30 @@ export default {
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
break break
case '删除':
this._delete(data.id)
break
case '操作日志': case '操作日志':
this._operationRecord(data.id) this._operationRecord(data.id)
break break
} }
}) })
}, },
_delete(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除这条数据?',
onOk: () => {
this._deleteOk(id)
}
})
},
_deleteOk: async function(id) {
const result = await soilEntrust.deleteById(id)
if (result) {
this._resultChange('删除成功')
}
},
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, name) this.$refs.sampleManageModal._open(id, type, name)
}, },
...@@ -445,11 +463,9 @@ export default { ...@@ -445,11 +463,9 @@ export default {
this.$refs.operation._open(id) this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { this._page()
this._page() this.$Message.success(msg)
this.$Message.success(msg) this.selectIds = []
this.selectIds = []
}
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
......
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
{ title: '小类', key: 'smallType' }, { title: '小类', key: 'smallType' },
{ title: '检测依据', key: 'testBasis', width: 180 }, { title: '检测依据', key: 'testBasis', width: 180 },
{ title: '试验方法', key: 'testMethod', width: 180 }, { title: '试验方法', key: 'testMethod', width: 180 },
{ title: '状态', key: 'status', width: 180 } { title: '状态', key: 'status', width: 180, status: true }
], ],
btn: [ btn: [
// {type: 'primary', id: 'food-sampling-list-item-match', name: '匹配省抽项目'}, // {type: 'primary', id: 'food-sampling-list-item-match', name: '匹配省抽项目'},
...@@ -148,6 +148,7 @@ export default { ...@@ -148,6 +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: '',
formObj: { formObj: {
contractId: '', contractId: '',
samplingNum: '', samplingNum: '',
...@@ -648,14 +649,19 @@ export default { ...@@ -648,14 +649,19 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) this.formObj = this.$serializeForm(this.formObj)
const result = await soilEntrust.page(this.$serializeForm(this.formObj)) this.formObj.sampleId = this.sampleId
const result = await soilEntrust.experimentPage(
this.$serializeForm(this.formObj)
)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
console.log(result)
} }
}, },
_open(id, type) { _open(id, type) {
this.sampleId = id
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
this.formObj.hasProvinceId = 0 this.formObj.hasProvinceId = 0
this.formObj.mateTestBasisSm = 0 this.formObj.mateTestBasisSm = 0
......
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>
<SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage> <SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage>
<ItemManage ref="itemManageModal" @on-result-change="_page"></ItemManage>
<Operation ref="operation"></Operation> <Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage>
</div> </div>
</template> </template>
<script> <script>
...@@ -72,12 +72,10 @@ import UserInfo from '../../../components/user-info-single/AssignPerson' ...@@ -72,12 +72,10 @@ import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilEntrust } from '../../../api' import { soilEntrust } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import SampleManage from './TakeSampleManage' import SampleManage from './TakeSampleManage'
import ItemManage from './ItemManage'
export default { export default {
components: { components: {
UserInfo, UserInfo,
SampleManage, SampleManage,
ItemManage,
Operation Operation
}, },
data() { data() {
...@@ -93,16 +91,16 @@ export default { ...@@ -93,16 +91,16 @@ export default {
id: '', id: '',
name: '管理样品' name: '管理样品'
}, },
{ // {
type: 'ios-list', // type: 'ios-list',
id: '', // id: '',
name: '项目管理' // name: '项目管理'
}, // },
{ // {
type: 'md-create', // type: 'md-create',
id: '', // id: '',
name: '编辑协议' // name: '编辑协议'
}, // },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' }, { type: 'md-trash', id: '', name: '删除' },
{ {
...@@ -369,12 +367,30 @@ export default { ...@@ -369,12 +367,30 @@ export default {
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
break break
case '删除':
this._delete(data.id)
break
case '操作日志': case '操作日志':
this._operationRecord(data.id) this._operationRecord(data.id)
break break
} }
}) })
}, },
_delete(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除这条数据?',
onOk: () => {
this._deleteOk(id)
}
})
},
_deleteOk: async function(id) {
const result = await soilEntrust.deleteById(id)
if (result) {
this._resultChange('删除成功')
}
},
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, name) this.$refs.sampleManageModal._open(id, type, name)
}, },
...@@ -451,7 +467,7 @@ export default { ...@@ -451,7 +467,7 @@ export default {
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.refModal._open(id, 'contractId') this.$refs.FileManage._open(id, 'entrustId')
} }
} }
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
:tableHeight="tableHeight" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" @on-result-change="_tableResultChange"
:getPage="getPage" :getPage="getPage"
:icon-msg="iconMsg"
select-data> select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
...@@ -58,12 +59,14 @@ ...@@ -58,12 +59,14 @@
</div> </div>
<!--选择领样人--> <!--选择领样人-->
</Modal> </Modal>
<ItemManage ref="ItemManage"></ItemManage>
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust, soilSample } from '../../../api' import { soilEntrust, soilSample } from '../../../api'
import ItemManage from './ItemManage'
export default { export default {
components: {}, components: { ItemManage },
data() { data() {
return { return {
btn: [{ type: 'primary', id: '', name: '领样' }], btn: [{ type: 'primary', id: '', name: '领样' }],
...@@ -236,7 +239,7 @@ export default { ...@@ -236,7 +239,7 @@ export default {
if (this.recordHis) { if (this.recordHis) {
this.$refs.sampleItemManage._openRecord(data) this.$refs.sampleItemManage._openRecord(data)
} else { } else {
this.$refs.sampleItemManage._open(data) this.$refs.ItemManage._open(data)
} }
}, },
_btnClick(msg, currentComponent) { _btnClick(msg, currentComponent) {
......
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