Commit b397bc68 by wangweidong

送样流程

parent 8f61d1f6
......@@ -12,6 +12,12 @@ export default {
http
.post('meter/v1/entrust/page_send_draft_entrust', data)
.then(res => res),
pageDistributeEntrust: data =>
http
.post('meter/v1/entrust/page_distribute_entrust', data)
.then(res => res),
pageGoOutEntrust: data =>
http.post('meter/v1/entrust/page_out_draft_entrust', data).then(res => res),
pageOutTaskDistribute: data =>
......@@ -20,6 +26,10 @@ export default {
.then(res => res),
pageEntrustReview: data =>
http.post('meter/v1/entrust/page_review_entrust', data).then(res => res),
pageEntrustReceive: data =>
http
.post('meter/v1/entrust/page_sample_receive_entrust', data)
.then(res => res),
pageSubpackageEntrust: data =>
http
.post('meter/v1/entrust/page_subpackage_entrust', data)
......
......@@ -8,6 +8,16 @@ import { https } from '../https'
export default {
// page
page: data => http.post('meter/v1/sample/page', data).then(res => res),
pageSampleReceive: data =>
http.post('meter/v1/sample/page_sample_receive', data).then(res => res),
pageSampleDistribute: data =>
http.post('meter/v1/sample/page_sample_distribute', data).then(res => res),
pageSampleFlow: data =>
http.post('meter/v1/sample/page_sample_flow', data).then(res => res),
// 报告模板
pageReport: data =>
http.post('/base/v1/file_template/page', data).then(res => res),
......@@ -70,6 +80,10 @@ export default {
http
.post('meter/v1/sample/subpackage_out_stock?ids=' + data.ids, data.obj)
.then(res => res),
submitReceive: data =>
http.post('meter/v1/sample/submit_receive?ids=' + data).then(res => res),
reportCheckBack: data =>
http
.post(
......@@ -90,5 +104,17 @@ export default {
'&user=' +
data.user
)
.then(res => res),
sendTaskDistribute: data =>
http
.post(
'meter/v1/sample/send_task_distribute?ids=' +
data.ids +
'&userId=' +
data.userId +
'&user=' +
data.user
)
.then(res => res)
}
......@@ -185,6 +185,7 @@ export default {
// this._resultChange('提交成功')
const result = meterEntrust.submit(ids)
if (result) {
this._resultChange('提交成功')
console.log(result)
}
// })
......@@ -192,6 +193,10 @@ export default {
})
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
_record(id) {
this.$refs.operationModal._open(id)
},
......
<template>
<div>
<Modal v-model="showDetailModal" :width="1100" title="委托详情" class="modal-footer-none">
<div :style="{height}" style="overflow-y: auto">
<table class="tableClass">
<tbody>
<tr>
<th colspan="6" class="tableClass_back">委托单位信息</th>
</tr>
<tr>
<th>委托单位</th>
<td>{{obj.client}}</td>
<th>联系人</th>
<td>{{obj.person}}</td>
</tr>
<tr>
<th>联系电话</th>
<td>{{obj.tel}}</td>
<th>传真</th>
<td>{{obj.fax}}</td>
</tr>
<tr>
<th>详细地址</th>
<td>{{obj.street}}</td>
<th>E-mail</th>
<td>{{obj.email}}</td>
</tr>
<tr>
<th>是否第一次送检</th>
<td>{{obj.firsted===1? '是':'否'}}</td>
<th>邮编</th>
<td>{{obj.postcode}}</td>
</tr>
<tr>
<th>地址</th>
<td>{{obj.province}}&nbsp;{{obj.city}}&nbsp;{{obj.county}}</td>
<th>委托日期</th>
<td>{{obj.edate}}</td>
</tr>
<tr>
<th>合同号</th>
<td>{{obj.contractCode}}</td>
<th>备注</th>
<td>{{obj.remark}}</td>
</tr>
</tbody>
</table>
</div>
</Modal>
</div>
</template>
<script>
/**
* 政府委托信息表详情
*/
export default {
data() {
return {
obj: {
// detail: {},
// customer: {},
// finance: {},
// tested: {}
firsted: 0,
client: '',
linkman: '',
tel: '',
email: '',
address: '',
remark: '',
province: '',
city: '',
county: '',
street: '',
aptitude: [],
assessFormSn: '',
subArea: '',
personCondition: '',
edate: '',
contractCode: ''
},
showDetailModal: false,
// sampleType:['退样','留样','作废'],
dispose: '',
height: '',
showMoney: false
}
},
methods: {
_open(obj, flag) {
this.showDetailModal = true
this.obj = obj
console.log('传过来的数据')
console.log(this.obj)
// if(obj.dispose !== undefined || ''){
// this.dispose = this.sampleType[obj.dispose];
// }else{
// this.dispose = '';
// }
if (flag === 'showMoney') {
this.showMoney = true
} else {
this.showMoney = false
}
this.height = '550px'
}
}
}
</script>
<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 './MeterReceiveEntrust'
import MeterReviewEntrustHis from './MeterReceiveEntrustHis'
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" @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>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_componentResult"></MeterEntrustDetail>
</div>
</template>
<script>
import { meterEntrust, meterSubcontractor } from '../../../api'
import MeterSampleManage from './MeterSampleManage'
import MeterEntrustDetail from './MeterEntrustDetail'
export default {
components: { MeterSampleManage, MeterEntrustDetail },
data() {
return {
currentComponent: 'FoodSampleGovern',
formId: 'meterReviewEntrustFormId',
searchOpen: false,
btn: [
{
// meter-review-entrust-pass-btn
type: 'success',
id: '',
name: '通过'
},
// meter-review-entrust-back-btn
{
type: 'success',
id: '',
name: '驳回'
}
],
iconMsg: [
{
type: 'md-paper',
id: '',
name: '详情'
},
{
type: 'ios-beaker',
id: '',
name: '样品管理'
},
{ type: 'md-cloud', 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: {
_detailModal(data) {
console.log(data)
this.$refs.meterSampleEdit._open(data)
// 查看
// this.$store.dispatch('FoodContract/getById', data.id).then(() => {
// if (data.type === 0) {
// // 企业委托 ’0‘
// this.currentComponent = 'FoodContractCompanyDetail'
// } else {
// // 政府委托 ’1‘
// this.currentComponent = 'FoodContractGovernDetail'
// }
// this.$nextTick(() => {
// this.$refs.refModal._open(this.$store.state.FoodContract.model)
// })
// })
},
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case '通过':
this._passReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data) {
this.$nextTick(function() {
switch (res) {
case '样品管理':
this._manageSample(data)
break
case '详情':
this._detailModal(data)
break
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
}
})
},
_manageSample(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data.id)
},
_componentResult(data, msg) {
switch (this.currentComponent) {
case 'FoodContractCompanyEdit':
this._page()
break
case 'FoodContractGovernEdit':
this._page()
break
case 'FoodContractCompanyEditByDLTB':
this._page()
break
case 'FoodContractCompanyEditByHES':
this._page()
break
}
},
_record(id) {
this.$refs.refModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
case 'selectIds':
this.selectIds = data
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageEntrustReceive(this.formObj)
if (result) {
console.log('结果')
console.log(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()
}
},
_passReview() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择要通过评审的委托单!')
return false
}
this.$Modal.confirm({
title: '提示',
content: '确定通过该委托单?',
onOk: () => {
this._passEntrustReview(this.selectIds)
}
})
},
_passEntrustReview: async function(ids) {
const result = await meterEntrust.passReview(ids)
if (result) {
this.$Message.success('提交成功!')
await this._page()
}
},
// 追加项目
_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" @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>
<MeterPersonItemTaskManage ref="personModal"></MeterPersonItemTaskManage>
</div>
</template>
<script>
import { meterDevice, meterSample } from '../../../api'
import MeterPersonItemTaskManage from './MeterPersonItemTaskManage'
export default {
components: {
MeterPersonItemTaskManage
},
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: '',
name: '任务转发'
},
{
type: 'success',
id: '',
name: '流转'
}
],
iconMsg: [
{ type: 'md-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
name: undefined,
aptitude: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '样品名称', key: 'name', width: 120 },
{ title: '样品编号', key: 'code', width: 120 },
{ title: '型号规格', key: 'spec' },
{ title: '出厂编号', key: 'factoryNumber' },
{ title: '检测类型', key: 'type' },
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '数量', key: 'quantity' },
{ 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._receiveApparatus()
break
case '车辆管理':
this._carManage()
break
case '添加':
this._editModal(false)
break
case '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_carManage() {
this.$refs.carEdit._open()
},
_receiveApparatus() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.SelEquip._open('sample-input')
}
},
_submitToReview() {
this._submitByContractIds('委托评审')
},
_submitByContractIds(cont) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => {
const result = meterSample.submit(ids)
if (result) {
console.log(result)
}
}
})
}
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '仪器领用':
this.$refs.InstruEdit._open()
break
case '车辆管理':
this.$refs.carEdit._open()
break
case '编辑':
// this._editModal(true, data.id)
this._personModal(data)
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
}
})
},
_personModal(data) {
console.log(data)
this.$refs.personModal._open(data.id)
},
_equipSelectBack(data) {
console.log('_equipSelectBack', data)
const equipData = []
for (let i = 0; i < data.length; i++) {
const object = data[i]
const obj = {}
obj.name = object.name
obj.certificateNo = object.ceNum
obj.measuringRange = object.range
obj.uncertaintyAccuray = object.uncertainty
obj.validUntil = object.effectDate
equipData.push(obj)
}
this._addEquipUse({ sampleIds: this.selectIds, devicesList: equipData })
},
_addEquipUse: async function(data) {
const result = await meterDevice.addEquipUse(data)
if (result) {
await this._page()
}
},
_record(id) {
this.$refs.refModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'selectIds':
this.selectIds = data
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 meterSample.pageSampleFlow(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._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 meterSample.getById(id)
if (result) {
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterSample.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" >
<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 } from '../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: 'meter-go-out-entrust-add-btn',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-btn',
name: '提交'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
name: '编辑'
},
{
type: 'ios-beaker',
id: '',
name: '管理样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', 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 '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_submitToReview() {
this._submitByContractIds('委托评审')
},
_submitByContractIds(cont) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => {
const result = meterEntrust.submit(ids)
if (result) {
console.log(result)
}
}
})
}
},
_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 'selectIds':
this.selectIds = data
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.pageGoOutEntrust(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._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 meterEntrust.getVOById(id)
if (result) {
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterEntrust.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">
<MeterGoOutEntrust ref="waitTabs"></MeterGoOutEntrust>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his">
<MeterGoOutEntrustHis ref="hisTabs"></MeterGoOutEntrustHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import MeterGoOutEntrust from './MeterSampleFlow'
import MeterGoOutEntrustHis from './MeterSampleFlowHis'
export default {
name: 'MeterGoOutEntrustIndex',
components: {
MeterGoOutEntrust,
MeterGoOutEntrustHis
},
data() {
return {
activeName: 'wait'
}
}
}
</script>
<style scoped>
</style>
<template>
<!--仓库-->
<Modal v-model="showModal" width="1000">
<p slot="header">选择车辆</p>
<Form :label-width="50" onsubmit="return false" inline>
<Form-item label="车牌号">
<Input v-model="license" @on-enter="_search" placeholder="请输入车牌号,回车查询"
icon="ios-search-strong"/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
<Row>
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.date">{{$dateformat(scope.row[item.key],'yyyy-mm-dd')}}</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</template>
<script>
/**
* 选择车辆
*/
import ModalFooter from '../../../components/base/modalFooter'
import { meterSample } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
showModal: false,
license: '',
selectNames: '',
selectIds: '',
getPage: {},
tableHeight: '300',
pageColumns: [
{ title: '车牌号', key: 'license' },
{ title: '品牌', key: 'brand' },
{ title: '所属类型', key: 'type' },
{ title: '购买/租用时间', key: 'buyDate' },
{ title: '备注', key: 'remark' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
]
}
},
methods: {
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open() {
this.showModal = true
this.license = ''
this._page()
},
_page: async function() {
const data = {}
if (this.license) {
data.license = this.license
}
// this.$refs.pageTable._page('search-form-car', 'LmsCarInfo/page', data)
const result = await meterSample.pageCarManage(data)
const result2 = await meterSample.pageCarList(data)
console.log('result', result)
console.log('result2', result2)
if (result) {
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.selectNames = []
this.getPage = this.$store.state.LmsCarInfo.page
break
case 'selectData':
const nameList = []
const idList = []
for (let i = 0; i < data.length; i++) {
nameList.push(data[i].license)
idList.push(data[i].id)
}
this.selectIds = idList
this.selectNames = nameList
break
case 'changeSize':
this._page()
break
}
},
_ok() {
this.$emit('on-result-change', {
ids: this.selectIds,
names: this.selectNames
})
this.showModal = false
this._hideLoading()
},
_cancel() {
this.showModal = false
this._hideLoading()
},
_search() {
// tree查询
this._page()
}
}
}
</script>
<template>
<div>
<Modal v-model="showUserGroupModal">
<p slot="header">
{{ modalTitle }}
</p>
<Row>
<!--查询条件-->
<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="授权资质仪器名称" >
<Input
v-model="code"
placeholder="授权资质仪器名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
<Form-item label="检测依据名称">
<Input
v-model="name"
placeholder="请输入检测依据名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
</Form>
</Col>
<Col span="24" style="margin-bottom: 10px">
<el-table
:height="300"
: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"
:key="item.key"
:prop="item.key"
:label="item.title"
:min-width="item.width"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="item.key==='status'">
{{ scope.row[item.key]?scope.row[item.key].display:'' }}
</span>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</el-table>
</Col>
<Col span="24">
<Page
:total="getPage.total"
:page-size="getPage.size"
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 style="margin-left: 8px" @click="_cancel">
取消
</Button>
<Button type="primary" @click="_ok">
确定
</Button>
</div>
</Modal>
</div>
</template>
<script>
// import { meterAptitude } from '../../../api'
import { meterManage } from '../../../api'
export default {
name: 'EditModal',
data() {
return {
loading: true,
pageParams: { rows: 20 },
pageColumns: [
{ title: '样品名称', key: 'name' },
{ title: '检定依据', key: 'code' },
{ title: '检定依据名称', key: 'basis' }
],
getPage: [],
showUserGroupModal: false,
modalTitle: '',
currentRowData: {},
name: '',
code: ''
}
},
methods: {
_open() {
this.modalTitle = '选择检测依据'
this.name = ''
this.code = ''
this._judge()
},
_judge() {
this.showUserGroupModal = true
this.currentRowData = {}
this._page()
},
_page: async function() {
const result = await meterManage.page(this._searchParams())
if (result) {
console.log('查询结果')
console.log(result)
this.getPage = result.records
this.loading = false
console.log(this.getPage)
}
},
_pageChange(page) {
this.pageParams.page = page
this._page()
},
_pageRows(rows) {
this.pageParams.rows = rows
this._page()
},
_searchParams() {
const data = this.$serialize('test-item-form')
if (this.name) {
data.name = this.name
}
if (this.code) {
data.code = this.code
}
return this.$extend(data, this.pageParams)
},
_search() {
this._page()
},
_rowChange(data) {
this.currentRowData = data // 选中的行数据;
},
_cancel() {
this.showUserGroupModal = false
},
_ok() {
if (JSON.stringify(this.currentRowData) === '{}') {
switch (this.modalTitle) {
case '选择检测依据':
this.$Message.warning('请选择一条检测依据!')
break
}
} else {
this.$emit('on-result-change', this.currentRowData)
this.showUserGroupModal = false
}
},
// 双击
_dbClick(data, event) {
this.currentRowData = data
// 选中的行数据;
this._ok()
}
}
}
</script>
<style scoped>
</style>
<template>
<!--仓库-->
<Modal v-model="showModal" width="1000">
<p slot="header">仪器领用</p>
<Form :label-width="60" onsubmit="return false" inline>
<Form-item label="仪器名称">
<Input v-model="license" @on-enter="_search" placeholder="请输入仪器名称,回车查询"
icon="ios-search-strong"/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
<Row>
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.date">{{$dateformat(scope.row[item.key],'yyyy-mm-dd')}}</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</template>
<script>
/**
* 选择车辆
*/
import ModalFooter from '../../../components/base/modalFooter'
import { meterSample } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
showModal: false,
license: '',
selectNames: '',
selectIds: '',
getPage: {},
tableHeight: '300',
pageColumns: [
{ title: '仪器名称', key: 'name' },
{ title: '测量范围', key: 'measuringRange' },
{ title: '不确定度/准确度', key: 'uncertaintyAccuray' }
// { title: '购买/租用时间', key: 'buyDate' },
// { title: '备注', key: 'remark' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
]
}
},
methods: {
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open() {
this.showModal = true
this.license = ''
this._page()
},
_page: async function() {
const data = {}
if (this.license) {
data.license = this.license
}
// this.$refs.pageTable._page('search-form-car', 'LmsCarInfo/page', data)
const result = await meterSample.pageInstrutEdit(data)
console.log('result', result)
if (result) {
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.selectNames = []
this.getPage = this.$store.state.LmsCarInfo.page
break
case 'selectData':
const nameList = []
const idList = []
for (let i = 0; i < data.length; i++) {
nameList.push(data[i].license)
idList.push(data[i].id)
}
this.selectIds = idList
this.selectNames = nameList
break
case 'changeSize':
this._page()
break
}
},
_ok() {
this.$emit('on-result-change', {
ids: this.selectIds,
names: this.selectNames
})
this.showModal = false
this._hideLoading()
},
_cancel() {
this.showModal = false
this._hideLoading()
},
_search() {
// tree查询
this._page()
}
}
}
</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" >
<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>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
</div>
</template>
<script>
import { meterEntrust } from '../../../api'
import MeterSubcontractorEdit from './MeterGoOutTestEdit'
export default {
components: { MeterSubcontractorEdit },
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: 'meter-go-out-entrust-add-btn',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-btn',
name: '提交'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
name: '编辑'
},
{
type: 'ios-beaker',
id: '',
name: '管理样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', 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 '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_submitToReview() {
this._submitByContractIds('委托评审')
},
_submitByContractIds(cont) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => {
const result = meterEntrust.submit(ids)
if (result) {
console.log(result)
}
}
})
}
},
_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 'selectIds':
this.selectIds = data
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.pageGoOutEntrust(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._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 meterEntrust.getVOById(id)
if (result) {
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterEntrust.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">
<MeterGoOutEntrust ref="waitTabs"></MeterGoOutEntrust>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his">
<MeterGoOutEntrustHis ref="hisTabs"></MeterGoOutEntrustHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import MeterGoOutEntrust from './MeterSampleInput'
import MeterGoOutEntrustHis from './MeterSampleInputHis'
export default {
name: 'MeterGoOutEntrustIndex',
components: {
MeterGoOutEntrust,
MeterGoOutEntrustHis
},
data() {
return {
activeName: 'wait'
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Modal v-model="showUserGroupModal">
<p slot="header">
{{ modalTitle }}
</p>
<Row>
<!--查询条件-->
<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="授权资质仪器名称" >
<Input
v-model="code"
placeholder="授权资质仪器名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
<Form-item label="检测依据名称">
<Input
v-model="name"
placeholder="请输入检测依据名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
</Form>
</Col>
<Col span="24" style="margin-bottom: 10px">
<el-table
:height="300"
: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"
:key="item.key"
:prop="item.key"
:label="item.title"
:min-width="item.width"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="item.key==='status'">
{{ scope.row[item.key]?scope.row[item.key].display:'' }}
</span>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</el-table>
</Col>
<Col span="24">
<Page
:total="getPage.total"
:page-size="getPage.size"
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 style="margin-left: 8px" @click="_cancel">
取消
</Button>
<Button type="primary" @click="_ok">
确定
</Button>
</div>
</Modal>
</div>
</template>
<script>
// import { meterAptitude } from '../../../api'
import { meterManage } from '../../../api'
export default {
name: 'EditModal',
data() {
return {
loading: true,
pageParams: { rows: 20 },
pageColumns: [
{ title: '样品名称', key: 'name' },
{ title: '检定依据', key: 'code' },
{ title: '检定依据名称', key: 'basis' }
],
getPage: [],
showUserGroupModal: false,
modalTitle: '',
currentRowData: {},
name: '',
code: ''
}
},
methods: {
_open() {
this.modalTitle = '选择检测依据'
this.name = ''
this.code = ''
this._judge()
},
_judge() {
this.showUserGroupModal = true
this.currentRowData = {}
this._page()
},
_page: async function() {
const result = await meterManage.page(this._searchParams())
if (result) {
console.log('查询结果')
console.log(result)
this.getPage = result.records
this.loading = false
console.log(this.getPage)
}
},
_pageChange(page) {
this.pageParams.page = page
this._page()
},
_pageRows(rows) {
this.pageParams.rows = rows
this._page()
},
_searchParams() {
const data = this.$serialize('test-item-form')
if (this.name) {
data.name = this.name
}
if (this.code) {
data.code = this.code
}
return this.$extend(data, this.pageParams)
},
_search() {
this._page()
},
_rowChange(data) {
this.currentRowData = data // 选中的行数据;
},
_cancel() {
this.showUserGroupModal = false
},
_ok() {
if (JSON.stringify(this.currentRowData) === '{}') {
switch (this.modalTitle) {
case '选择检测依据':
this.$Message.warning('请选择一条检测依据!')
break
}
} else {
this.$emit('on-result-change', this.currentRowData)
this.showUserGroupModal = false
}
},
// 双击
_dbClick(data, event) {
this.currentRowData = data
// 选中的行数据;
this._ok()
}
}
}
</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 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" >
<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>
<MeterOutTaskAlloca ref="taskAllocaModal" @on-result-change="_page"></MeterOutTaskAlloca>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<MeterOutTaskOperation ref="operationModal"></MeterOutTaskOperation>
</div>
</template>
<script>
import { meterEntrust } from '../../../api'
import MeterSubcontractorEdit from './MeterTestEdit'
import MeterOutTaskAlloca from './MeterTaskAlloca'
import MeterOutTaskOperation from './MeterTaskOperation'
export default {
components: {
MeterSubcontractorEdit,
MeterOutTaskAlloca,
MeterOutTaskOperation
},
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: 'meter-go-out-entrust-add-btn',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-btn',
name: '提交'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
name: '编辑'
},
{
type: 'ios-contact',
id: '',
name: '任务分配'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', 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 '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_submitToReview() {
this._submitByContractIds('委托评审')
},
_submitByContractIds(cont) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => {
const result = meterEntrust.submit(ids)
if (result) {
console.log(result)
}
}
})
}
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '任务分配':
this._taskAllocaModal(data)
break
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
}
})
},
_taskAllocaModal(data) {
// 管理样品
this.$refs.taskAllocaModal._open(data.id)
},
_record(id) {
this.$refs.operationModal._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 'selectIds':
this.selectIds = data
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.pageDistributeEntrust(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._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 meterEntrust.getVOById(id)
if (result) {
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterEntrust.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" >
<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>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
</div>
</template>
<script>
import { meterEntrust } from '../../../api'
import MeterSubcontractorEdit from './MeterTestEdit'
export default {
components: { MeterSubcontractorEdit },
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: 'meter-go-out-entrust-add-btn',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-btn',
name: '提交'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
name: '编辑'
},
{
type: 'ios-beaker',
id: '',
name: '管理样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', 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 '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_submitToReview() {
this._submitByContractIds('委托评审')
},
_submitByContractIds(cont) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => {
const result = meterEntrust.submit(ids)
if (result) {
console.log(result)
}
}
})
}
},
_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 'selectIds':
this.selectIds = data
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.pageGoOutEntrust(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._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 meterEntrust.getVOById(id)
if (result) {
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterEntrust.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">
<MeterGoOutEntrust ref="waitTabs"></MeterGoOutEntrust>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his">
<MeterGoOutEntrustHis ref="hisTabs"></MeterGoOutEntrustHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import MeterGoOutEntrust from './MeterTaskDistribute'
import MeterGoOutEntrustHis from './MeterTaskDistributeHis'
export default {
name: 'MeterGoOutEntrustIndex',
components: {
MeterGoOutEntrust,
MeterGoOutEntrustHis
},
data() {
return {
activeName: 'wait'
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Modal v-model="showModal" width="900" class="modal-footer-none zIndex-1100">
<p slot="header">操作日志</p>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="search-contract-record" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="操作阶段:">
<Input v-model="formObj.origin" @on-enter="_search" placeholder="请输入操作阶段"
style="width: 200px" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" hide-checkbox>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='type'">
{{scope.row[item.key] === 0 ? '流转' : scope.row[item.key] === 1 ? '退回': scope.row[item.key] === 2 ?'更新' :
scope.row[item.key] === 3 ? '转发':'文件'}}
</span>
<span v-else-if="item.key==='ctime'">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
/**
* 操作日志-委托
*/
import { meterEntrust } from '../../../api'
export default {
data() {
return {
showModal: false,
getPage: {},
pageColumns: [
{ title: '操作类型', key: 'type', width: 80 },
{ title: '操作阶段', key: 'origin', width: 120 },
{ title: '目标阶段', key: 'target', width: 120 },
{ title: '操作人', key: 'operator', width: 80 },
{ title: '操作时间', key: 'ctime', width: 150 },
{ title: '操作原因', key: 'remark' },
{ title: '责任人', key: 'liable', width: 80 }
],
formObj: {
origin: '',
contractId: ''
}
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_open(contractId) {
this.showModal = true
this.formObj.contractId = contractId
this.formObj.origin = ''
this._page()
},
_page: async function() {
console.log('要传的参数')
console.log(this.formObj)
const result = await meterEntrust.pageOutTaskOperation(this.formObj)
console.log(result)
if (result) {
this.getPage = result
}
// this.$refs.pageTable._page(
// 'search-contract-record',
// 'FoodContractRecord/page',
// this.$serializeFormSearch(this.formObj)
// )
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContractRecord.page
break
case 'changeSize':
this._page()
break
}
},
_search() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
......@@ -20,6 +20,10 @@ import MeterOutPersonalTaskIndex from '../pages/meter-out/personal-task/MeterOut
import MeterCertificateMakeIndex from '../pages/meter-certificate/make/MeterCertificateMakeIndex'
import MeterCertificateCheckIndex from '../pages/meter-certificate/check/MeterCertificateCheckIndex'
import MeterCertificateIssueIndex from '../pages/meter-certificate/issue/MeterCertificateIssueIndex'
import MeterEntrustReceiveIndex from '../pages/meter-send/receive-sample/MeterEntrustReceiveIndex'
import MeterTaskDistributeIndex from '../pages/meter-send/task-distribute/MeterTaskDistributeIndex'
import MeterSampleFlowIndex from '../pages/meter-send/sample-flow/MeterSampleFlowIndex'
import MeterSampleInputIndex from '../pages/meter-send/sample-input/MeterSampleInputIndex'
import Blank from '~/pages/blank'
export default [
{
......@@ -98,6 +102,26 @@ export default [
path: 'personal_test_task',
component: MeterOutPersonalTaskIndex,
meta: { title: '个人检测任务' }
},
{
path: 'send_sample_receive',
component: MeterEntrustReceiveIndex,
meta: { title: '收样管理' }
},
{
path: 'send_sample_distribute',
component: MeterTaskDistributeIndex,
meta: { title: '任务分配' }
},
{
path: 'send_sample_flow',
component: MeterSampleFlowIndex,
meta: { title: '样品流转' }
},
{
path: 'send_sample_input',
component: MeterSampleInputIndex,
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