Commit 89598aa5 by wangweidong

分包委托评审

parent 616bd16e
......@@ -26,4 +26,5 @@ export { default as meterSubcontractor } from './meter/meter-subcontractor'
export { default as meterAptitude } from './meter/meter-aptitude'
export { default as meterManage } from './meter/meter-manage'
export { default as meterEntrust } from './meter/meter-entrust'
export { default as meterManageItem } from './meter/meter-manage-item'
export { default as lmsBaseDict } from './lims/lms-base-dict'
......@@ -12,6 +12,14 @@ export default {
http
.post('meter/v1/entrust/page_send_draft_entrust', data)
.then(res => res),
pageGoOutEntrust: data =>
http.post('meter/v1/entrust/page_out_draft_entrust', data).then(res => res),
pageEntrustReview: data =>
http.post('meter/v1/entrust/page_review_entrust', data).then(res => res),
pageSubpackageEntrust: data =>
http
.post('meter/v1/entrust/page_subpackage_entrust', data)
.then(res => res),
getById: data => http.get('meter/v1/entrust/' + data).then(res => res),
deleteById: data =>
http.delete('meter/v1/entrust/?ids=' + data).then(res => res),
......@@ -20,6 +28,10 @@ export default {
https
.post('meter/v1/entrust/add_send_entrust', JSON.stringify(data))
.then(res => res),
saveOutEntrust: data =>
https
.post('meter/v1/entrust/add_out_entrust', JSON.stringify(data))
.then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/entrust/' + data.id, data.obj).then(res => res)
......
/**
* 工作台
*/
import http from '../http'
import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/aptitude_item/page', data).then(res => res),
getById: data => http.get('meter/v1/aptitude/' + data).then(res => res),
// 删除
deleteById: data =>
http.delete('meter/v1/aptitude/?ids=' + data).then(res => res),
// 保存
save: data =>
https
.post('meter/v1/aptitude/add_aptitude', JSON.stringify(data))
.then(res => res),
// 编辑
edit: data =>
http.put('meter/v1/aptitude/' + data.id, data.obj).then(res => res)
}
......@@ -73,10 +73,10 @@ export default {
return {
formId: 'meterAptitudeManageFormId',
pageColumns: [
{ title: '授权仪器名称', key: 'name' },
{ title: '检定依据', key: 'code', width: 160 },
{ title: '检定依据名称', key: 'basis' },
{ title: '检定周期', key: 'cycle' },
{ title: '授权仪器名称', key: 'name' },
// {title: '限制范围或说明', key: 'limitDescription'},
{ title: '价格', key: 'price' }
],
......@@ -143,7 +143,7 @@ export default {
break
case '管理检测项目':
// this._deleteById(data.id)
this.$refs.testItemModal._open(true)
this.$refs.testItemModal._open(data.id)
break
case '操作日志':
this._record(data.id)
......
......@@ -73,6 +73,7 @@
// import { drugCatalogueItem } from '../../api'
// import SampleItemSelect from './SampleItemSelect'
import ModalFooter from '../../../components/base/modalFooter'
import { meterManageItem } from '../../../api'
export default {
components: {
ModalFooter
......@@ -82,7 +83,7 @@ export default {
return {
formId: 'SampleItemListFormId',
formObj: {
catalogueId: '',
aptitudeId: '',
name: '',
code: '',
standardName: ''
......@@ -97,15 +98,10 @@ export default {
],
pageColumns: [
{ title: '检测项目', key: 'name', width: 140 },
{ title: '检测类别', key: 'type', width: 140 },
{ title: '检测依据', key: 'code', width: 160 },
{ title: '检测依据名称', key: 'standardName', width: 220 },
{ title: '检测科室', key: 'groupName', width: 110 },
{ title: '比较符', key: 'compareSymbol', width: 90 },
{ title: '限值', key: 'limitValue', width: 90 },
{ title: '排序', key: 'orderBy', width: 180 },
{ title: '单位', key: 'unit', width: 100 },
{ title: '是否系统判定', key: 'judged', width: 120, judged: true },
{ title: '比较符', key: 'compare', width: 140 },
{ title: '限量值', key: 'limitValue', width: 160 },
{ title: '单位', key: 'unit', width: 220 },
{ title: '是否判定', key: 'judged', width: 110 },
{ title: '备注', key: 'remark' }
],
catalogueId: '',
......@@ -114,15 +110,19 @@ export default {
}
},
methods: {
_open(catalogueId, label) {
_open(aptitudeId) {
this.formObj = this.$resetFields(this.formObj)
this.showModal = true
this.catalogueId = catalogueId
this.formObj.catalogueId = catalogueId
this.getPage.records = []
// this.$refs.pageTable._hideLoading()
if (catalogueId) {
// this._page()
this.formObj.aptitudeId = aptitudeId
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterManageItem.page(this.formObj)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_footerResult(name) {
......
......@@ -9,20 +9,20 @@
<Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<label class="label-sign" />
<Form-item :label-width="70" label="检测依据" >
<Form-item :label-width="70" label="授权资质仪器名称" >
<Input
v-model="code"
@on-enter="_pageChange(1)"
placeholder="请输入检测依据"
placeholder="授权资质仪器名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
<Form-item label="检测依据名称">
<Input
v-model="name"
@on-enter="_pageChange(1)"
placeholder="请输入检测依据名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
</Form>
......@@ -30,13 +30,13 @@
<Col span="24" style="margin-bottom: 10px">
<el-table
:height="300"
@row-click="_rowChange"
@row-dblclick="_dbClick"
:data="getPage"
border
size="small"
highlight-current-row
style="width: 100%"
@row-click="_rowChange"
@row-dblclick="_dbClick"
>
<el-table-column
v-for="item in pageColumns"
......@@ -59,21 +59,21 @@
<Page
:total="getPage.total"
:page-size="getPage.size"
@on-change="_pageChange"
@on-page-size-change="_pageRows"
placement="top"
show-total
show-elevator
show-sizer
@on-change="_pageChange"
@on-page-size-change="_pageRows"
/>
<div style="clear: both" />
</Col>
</Row>
<div slot="footer" class="btn-width">
<Button @click="_cancel" style="margin-left: 8px">
<Button style="margin-left: 8px" @click="_cancel">
取消
</Button>
<Button @click="_ok" type="primary">
<Button type="primary" @click="_ok">
确定
</Button>
</div>
......@@ -90,7 +90,11 @@ export default {
return {
loading: true,
pageParams: { rows: 20 },
pageColumns: [{ title: '样品名称', key: 'name' }],
pageColumns: [
{ title: '样品名称', key: 'name' },
{ title: '检定依据', key: 'code' },
{ title: '检定依据名称', key: 'basis' }
],
getPage: [],
showUserGroupModal: false,
modalTitle: '',
......
......@@ -62,8 +62,13 @@ export default {
btn: [
{
type: 'success',
id: 'meter-subcontractor-add-btn',
id: 'meter-go-out-entrust-add-btn',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-btn',
name: '提交'
}
],
iconMsg: [
......@@ -131,6 +136,9 @@ export default {
case '添加':
this._editModal(false)
break
case '提交':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
......@@ -178,7 +186,7 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
const result = await meterEntrust.pageGoOutEntrust(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......
......@@ -47,15 +47,15 @@
<Col span="24">
<!-- <btn-list :msg="btn" :open="searchOpen" :showSearchBtn="false" @on-result-change="_btnClick"-->
<!-- class="contHide"></btn-list>-->
<Button @click="_add()" type="success">添加</Button>
<Button type="success" @click="_add()">添加</Button>
</Col>
<Col span="24">
<PTVXETable
ref="pageTable"
:form-id="formId"
:tableHeight="500"
:getPage="getPage"
:iconMsg="iconMsg"
:table-height="500"
:get-page="getPage"
:icon-msg="iconMsg"
@on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
......@@ -69,7 +69,7 @@
>
<template slot-scope="scope">
<div v-if="item.key==='name'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.name" @on-result-change="_judgeBasisChange" @click.native="_selectjudgeBasis(scope.$rowIndex)" blur placeholder="请输入或选择样品名称"
<el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" @on-result-change="_judgeBasisChange" @click.native="_selectjudgeBasis(scope.$rowIndex)"
></el-input>
</div>
<div v-if="item.key==='spec'" @click.stop="_handleRow(scope)">
......@@ -94,9 +94,9 @@
<!-- ></el-input>-->
<el-input
v-model="scope.row.quantity"
@keydown.native="channelInputLimit"
type="number"
placeholder="请输入或选择数量"
@keydown.native="channelInputLimit"
/>
</div>
</template>
......@@ -107,7 +107,7 @@
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
<EditModal ref="EditModal" @on-result-change="_backData" is-change />
<EditModal ref="EditModal" is-change @on-result-change="_backData" />
</Modal>
</div>
</template>
......@@ -193,11 +193,9 @@ export default {
},
methods: {
_backData(data) {
// this.formObj.code = data.code
// this.formObj.basis = data.name
// this.formObj.standardId = data.id
console.log(typeof this.index)
this.getPage.records[this.index].name = data.name
this.getPage.records[this.index].aptitudeId = data.id
console.log('返回的数据')
console.log(data)
console.log(this.getPage.records)
......@@ -326,7 +324,10 @@ export default {
console.log('data', data)
console.log('this.formObj', this.formObj)
console.log(this.getPage.records)
// this._save(this.formObj)
const saveData = this.formObj
saveData.sampleList = this.getPage.records
console.log('----------', saveData)
this._save(saveData)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
......@@ -392,7 +393,7 @@ export default {
}
},
_save: async function(data) {
const result = await meterEntrust.save(data)
const result = await meterEntrust.saveOutEntrust(data)
console.log(result)
if (result) {
this._resultChange('添加成功!')
......
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName">
<el-tab-pane label="待完成" name="wait">
<MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust>
</el-tab-pane>
<el-tab-pane label="历史评审" name="his">
<MeterReviewEntrustHis ref="hisTabs"></MeterReviewEntrustHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import MeterReviewEntrust from './MeterReviewEntrust'
import MeterReviewEntrustHis from './MeterReviewEntrustHis'
export default {
name: 'MeterSendEntrustIndex',
components: {
MeterReviewEntrust,
MeterReviewEntrustHis
},
data() {
return {
activeName: 'wait'
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:">
<Input v-model="formObj.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" name="aptitude" placeholder="请输入资质" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import { meterEntrust, meterSubcontractor } from '../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
// meter-review-entrust-pass-btn
type: 'success',
id: '',
name: '通过'
},
// meter-review-entrust-back-btn
{
type: 'success',
id: '',
name: '驳回'
}
],
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '',
name: '资质项目'
},
{ type: 'ios-clock', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
name: undefined,
aptitude: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮编', key: 'postcode' },
{ title: 'E-mail', key: 'email', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
}
})
},
_record(id) {
this.$refs.refModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageEntrustReview(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
}
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import { meterEntrust, meterSubcontractor } from '../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: 'meter-subcontractor-add-btn',
name: '添加'
}
],
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '',
name: '资质项目'
},
{ type: 'ios-clock', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
name: undefined,
aptitude: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮编', key: 'postcode' },
{ title: 'E-mail', key: 'email', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
}
})
},
_record(id) {
this.$refs.refModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
}
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:">
<Input v-model="formObj.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" name="aptitude" placeholder="请输入资质" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import { meterEntrust, meterSubcontractor } from '../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formId: 'meterSubpackageTaskFormId',
searchOpen: false,
btn: [
{
// meter-review-entrust-pass-btn
type: 'success',
id: '',
name: '通过'
},
// meter-review-entrust-back-btn
{
type: 'success',
id: '',
name: '驳回'
}
],
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '',
name: '资质项目'
},
{ type: 'ios-clock', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
name: undefined,
aptitude: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮编', key: 'postcode' },
{ title: 'E-mail', key: 'email', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
}
})
},
_record(id) {
this.$refs.refModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSubpackageEntrust(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
}
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import { meterEntrust, meterSubcontractor } from '../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formId: 'meterSubpackageTaskHisFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: 'meter-subcontractor-add-btn',
name: '添加'
}
],
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '',
name: '资质项目'
},
{ type: 'ios-clock', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
name: undefined,
aptitude: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮编', key: 'postcode' },
{ title: 'E-mail', key: 'email', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
}
})
},
_record(id) {
this.$refs.refModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
}
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName">
<el-tab-pane label="分包任务" name="wait">
<MeterSubpackageTask ref="waitTabs"></MeterSubpackageTask>
</el-tab-pane>
<el-tab-pane label="历史任务" name="his">
<MeterSubpackageTaskHis ref="hisTabs"></MeterSubpackageTaskHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import MeterSubpackageTask from './MeterSubpackageTask'
import MeterSubpackageTaskHis from './MeterSubpackageTaskHis'
export default {
name: 'MeterSubpackageTaskIndex',
components: {
MeterSubpackageTask,
MeterSubpackageTaskHis
},
data() {
return {
activeName: 'wait'
}
}
}
</script>
<style scoped>
</style>
......@@ -11,7 +11,9 @@ import MeterAptitudeManage from '../pages/meter-aptitude/manage/MeterAptitudeMan
import MeterAptitudeStandard from '../pages/meter-aptitude/standard/MeterAptitudeStandard'
import MeterSubcontractor from '../pages/meter-subcontract/subcontractor/MeterSubcontractor'
import MeterSendEntrustIndex from '../pages/meter-entrust/send-test/MeterSendEntrustIndex'
import MeterGoOutEntruse from '../pages/meter-entrust/go-out-test/MeterGoOutEntrust'
import MeterGoOutEntrust from '../pages/meter-entrust/go-out-test/MeterGoOutEntrust'
import MeterReviewEntrust from '../pages/meter-review/MeterReviewEntrust'
import MeterSubpackageTaskIndex from '../pages/meter-subcontract/subpackage-task/MeterSubpackageTaskIndex'
import Blank from '~/pages/blank'
export default [
{
......@@ -43,6 +45,11 @@ export default [
path: 'subcontractor',
component: MeterSubcontractor,
meta: { title: '分包方管理' }
},
{
path: 'task_manage',
component: MeterSubpackageTaskIndex,
meta: { title: '分包任务' }
}
]
},
......@@ -57,8 +64,13 @@ export default [
},
{
path: 'go_out_test',
component: MeterGoOutEntruse,
component: MeterGoOutEntrust,
meta: { title: '出检委托登记' }
},
{
path: 'entrust_review',
component: MeterReviewEntrust,
meta: { title: '委托评审' }
}
]
}
......
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