Commit 1777868a by lichengming

修改了样品管理

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