Commit d60f4559 by wangweidong

整体优化

parent 9c713d4a
...@@ -8,22 +8,40 @@ import { https } from '../https' ...@@ -8,22 +8,40 @@ import { https } from '../https'
export default { export default {
// page // page
page: data => http.post('meter/v1/contract/page', data).then(res => res), page: data => http.post('meter/v1/contract/page', data).then(res => res),
pageHis: data =>
http
.post('meter/v1/contract/page_quote_register_his', data)
.then(res => res),
pageQuoteFirstReview: data => pageQuoteFirstReview: data =>
http http
.post('meter/v1/contract/page_quote_first_review', data) .post('meter/v1/contract/page_quote_first_review', data)
.then(res => res), .then(res => res),
pageQuoteFirstReviewHis: data =>
http
.post('meter/v1/contract/page_quote_first_review_his', data)
.then(res => res),
pageQuoteSecondReview: data => pageQuoteSecondReview: data =>
http http
.post('meter/v1/contract/page_quote_second_review', data) .post('meter/v1/contract/page_quote_second_review', data)
.then(res => res), .then(res => res),
pageQuoteSecondReviewHis: data =>
http
.post('meter/v1/contract/page_quote_second_review_his', data)
.then(res => res),
pageQuoteThirdReview: data => pageQuoteThirdReview: data =>
http http
.post('meter/v1/contract/page_quote_third_review', data) .post('meter/v1/contract/page_quote_third_review', data)
.then(res => res), .then(res => res),
pageQuoteThirdReviewHis: data =>
http
.post('meter/v1/contract/page_quote_third_review_his', data)
.then(res => res),
pageAccepted: data => pageAccepted: data =>
http.post('meter/v1/contract/page_accepted', data).then(res => res), http.post('meter/v1/contract/page_accepted', data).then(res => res),
pageAcceptedHis: data =>
http.post('meter/v1/contract/page_accepted_his', data).then(res => res),
pageContractRegister: data => pageContractRegister: data =>
http http
.post('meter/v1/contract/page_contract_register', data) .post('meter/v1/contract/page_contract_register', data)
......
...@@ -18,6 +18,10 @@ export default { ...@@ -18,6 +18,10 @@ export default {
http http
.post('meter/v1/entrust/page_send_draft_entrust', data) .post('meter/v1/entrust/page_send_draft_entrust', data)
.then(res => res), .then(res => res),
pageSendEntrustHis: data =>
http
.post('meter/v1/entrust/page_send_draft_entrust_his', data)
.then(res => res),
pageDistributeEntrust: data => pageDistributeEntrust: data =>
http http
...@@ -26,6 +30,10 @@ export default { ...@@ -26,6 +30,10 @@ export default {
pageGoOutEntrust: data => pageGoOutEntrust: data =>
http.post('meter/v1/entrust/page_out_draft_entrust', data).then(res => res), http.post('meter/v1/entrust/page_out_draft_entrust', data).then(res => res),
pageGoOutEntrustHis: data =>
http
.post('meter/v1/entrust/page_out_draft_entrust_his', data)
.then(res => res),
pageOutTaskDistribute: data => pageOutTaskDistribute: data =>
http http
.post('meter/v1/entrust/page_out_task_distribute', data) .post('meter/v1/entrust/page_out_task_distribute', data)
...@@ -40,6 +48,10 @@ export default { ...@@ -40,6 +48,10 @@ export default {
http http
.post('meter/v1/entrust/page_subpackage_entrust', data) .post('meter/v1/entrust/page_subpackage_entrust', data)
.then(res => res), .then(res => res),
pageSubpackageEntrustHis: data =>
http
.post('meter/v1/entrust/page_subpackage_entrust_his', data)
.then(res => res),
// 委托评审驳回 // 委托评审驳回
back: data => back: data =>
http http
......
...@@ -8,6 +8,8 @@ import { https } from '../https' ...@@ -8,6 +8,8 @@ import { https } from '../https'
export default { export default {
// page // page
page: data => http.post('meter/v1/sample/page', data).then(res => res), page: data => http.post('meter/v1/sample/page', data).then(res => res),
pageSampleProgress: data =>
http.post('meter/v1/sample/page_sample_progress', data).then(res => res),
pageSampleReceive: data => pageSampleReceive: data =>
http.post('meter/v1/sample/page_sample_receive', data).then(res => res), http.post('meter/v1/sample/page_sample_receive', data).then(res => res),
...@@ -29,11 +31,12 @@ export default { ...@@ -29,11 +31,12 @@ export default {
// 仪器列表 // 仪器列表
pageInstrutEdit: data => pageInstrutEdit: data =>
http.post('meter/v1/test_device/page', data).then(res => res), http.post('meter/v1/test_device/page', data).then(res => res),
// 个人任务
pagePersonTask: data =>
http.post('meter/v1/item/page', data).then(res => res),
pageSubpackageSample: data => pageSubpackageSample: data =>
http.post('meter/v1/sample/page_subpackage_sample', data).then(res => res), http.post('meter/v1/sample/page_subpackage_sample', data).then(res => res),
pageSubpackageSampleQuery: data =>
http
.post('meter/v1/sample/page_subpackage_sample_query', data)
.then(res => res),
pageSubpackageSampleInput: data => pageSubpackageSampleInput: data =>
http http
.post('meter/v1/sample/page_subpackage_sample_input', data) .post('meter/v1/sample/page_subpackage_sample_input', data)
......
<template>
<div>
<el-dialog title="上传文件" :visible.sync="dialogFileUploadVisible" width="120">
<el-upload
drag
:action="action"
multiple>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'HBody',
components: {},
props: {
isCollapse: null
},
data() {
return {
menuList: [],
dialogFileUploadVisible: false,
action: '',
icon: 'el-icon-message',
clientHeight: 'height 500px'
}
},
mounted() {
this._getHeight()
},
methods: {
handleSelect(key, keyPath) {
console.log('KEYpATH===========', keyPath)
this.$router.push(keyPath[1])
},
_open(url) {
this.dialogFileUploadVisible = true
this.action = url
},
_getHeight() {
this.clientHeight =
'height: ' + (document.documentElement.clientHeight - 100) + 'px;'
}
}
}
</script>
<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 120px;
min-height: 200px;
}
</style>
<!--下载模板导入-->
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" class="zIndex-1100">
<p slot="header">{{modalTitle}}</p>
<Alert v-if="showError" type="error" show-icon style="margin-top: 10px">{{errorMessage}}</Alert>
<Alert v-if="showSuccess" type="success" show-icon style="margin-top: 10px">{{successMessage}}</Alert>
<Alert v-if="msg === '上传图片'" type="warning" show-icon>请选择png,jpg格式的图片上传</Alert>
<div v-show="isLoad">
<Spin>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在导入,请稍后...</div>
</Spin>
</div>
<!-- <div>-->
<!-- <Button v-if="hideDownloadBtn===undefined" size="large" @click="_download">下载模板</Button>-->
<!-- </div>-->
<div slot="footer" class="btn-width">
<Button @click="_cancel">取消</Button>
<label style="margin-bottom: 0;margin-left:15px; float: right">
<Upload
:action="importUrl"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:on-format-error="_formatError"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
:format="format"
>
<Button :disabled="isDisabled" type="primary">导入</Button>
</Upload>
</label>
</div>
</Modal>
</div>
</template>
<script>
/**
* 导入并下载模板
*/
// import global from '../../api/config'
import global from '../../api/config'
export default {
components: {},
props: {
hideDownloadBtn: null
},
data() {
return {
msg: '',
modalTitle: '上传图片信息',
showModal: false,
isLoad: false,
isDisabled: false,
showError: false,
showSuccess: false,
dataObj: {
file: ''
},
errorMessage: '',
successMessage: '',
format: ['png', 'jpg'],
importUrl: '',
downloadUrl: '',
// 500的提示语
errStr: '很抱歉!无法处理您的操作,请检查您的操作步骤或者联系系统管理员!'
}
},
methods: {
_open(data, msg) {
this.isLoad = false
this.showModal = true
this.isDisabled = false
this.showError = false
this.showSuccess = false
this.modalTitle = data.title
this.importUrl = global.baseURL + data.importUrl
this.downloadUrl = data.downloadUrl
this.msg = msg
},
_cancel() {
this.showModal = false
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
this.isDisabled = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
console.log('---response', response)
this.isLoad = false
this.$Message.success('导入成功!')
this.$emit('on-result-change', response.data)
this.showModal = false
this.isDisabled = false
this.showError = false
this.showSuccess = true
this.successMessage = response.msg
} else {
this.isLoad = false
this.showSuccess = false
this.isDisabled = false
this.errorMessage = response.code === '500' ? this.errStr : response.msg
this.showError = true
// this.$Message.error(response.msg);
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' + file.name + ' 格式不正确,请上传格式为 .xlsx、xls 的文件!'
})
this.isLoad = false
}
}
}
</script>
...@@ -9,24 +9,24 @@ ...@@ -9,24 +9,24 @@
<Form id="search-contract-record" :label-width="70" inline onsubmit="return false"> <Form id="search-contract-record" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="操作阶段:"> <Form-item label="操作阶段:">
<Input v-model="formObj.origin" @on-enter="_search" placeholder="请输入操作阶段" <Input v-model="formObj.origin" placeholder="请输入操作阶段" style="width: 200px"
style="width: 200px" clearable/> clearable @on-enter="_search"/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button> <Button type="primary" @click="_search">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight" <PTVXETable ref="pageTable" :table-height="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" hide-checkbox> :get-page="getPage" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key" :field="item.key"
:title="item.title" :title="item.title"
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200" :fixed="item.fixed?item.fixed:undefined">
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.key==='type'"> <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] === 0 ? '流转' : scope.row[item.key] === 1 ? '退回': scope.row[item.key] === 2 ?'更新' :
...@@ -64,8 +64,8 @@ export default { ...@@ -64,8 +64,8 @@ export default {
{ title: '责任人', key: 'liable', width: 80 } { title: '责任人', key: 'liable', width: 80 }
], ],
formObj: { formObj: {
origin: '', entrustId: '',
contractId: '' origin: undefined
} }
} }
}, },
...@@ -75,10 +75,9 @@ export default { ...@@ -75,10 +75,9 @@ export default {
} }
}, },
methods: { methods: {
_open(contractId) { _open(entrustId) {
this.showModal = true this.showModal = true
this.formObj.contractId = contractId this.formObj.entrustId = entrustId
this.formObj.origin = ''
this._page() this._page()
}, },
_page: async function() { _page: async function() {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24"> <Col span="24">
111111
<Form id="data-input-contract-right" :label-width="90" inline onsubmit="return false"> <Form id="data-input-contract-right" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item-select"> <Form-item class="search-item-select">
......
...@@ -6,32 +6,32 @@ ...@@ -6,32 +6,32 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top:10px"> <Col span="24" style="margin-top:10px">
<Form :d="formId" :label-width="90" v-show="searchOpen" inline onsubmit="return false"> <Form v-show="searchOpen" :d="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="检定依据:" style="margin-left: -20px"> <Form-item class="search-item" label="检定依据:" style="margin-left: -20px">
<Input @on-enter="_formSearch" v-model="formObj.code" name="judgeBasis" placeholder="请输入检定依据" clearable/> <Input v-model="formObj.code" name="judgeBasis" placeholder="请输入检定依据" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-item" label="检定依据名称:"> <Form-item class="search-item" label="检定依据名称:">
<Input @on-enter="_formSearch" v-model="formObj.basis" name="judgeBasisName" placeholder="请输入检定依据名称" clearable/> <Input v-model="formObj.basis" name="judgeBasisName" placeholder="请输入检定依据名称" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
ref="pageTable" ref="pageTable"
:form-id="formId" :form-id="formId"
:tableHeight="tableHeight" :table-height="tableHeight"
:getPage="getPage" :get-page="getPage"
:iconMsg="iconMsg" :icon-msg="iconMsg"
@on-result-change="_tableResultChange"> @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span> <span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else-if="item.image">
{{scope.row.picUri!==undefined?'是':'否'}}
</span>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -58,12 +61,15 @@ ...@@ -58,12 +61,15 @@
<importModal ref="importModal"></importModal> <importModal ref="importModal"></importModal>
<MeterAptitudeManageEdit ref="editModal" @on-result-change="_page"></MeterAptitudeManageEdit> <MeterAptitudeManageEdit ref="editModal" @on-result-change="_page"></MeterAptitudeManageEdit>
<sampleItemList ref="testItemModal" @on-result-change="_formSearch" /> <sampleItemList ref="testItemModal" @on-result-change="_formSearch" />
<imageTemplateImport ref="imageTemplateImport" @on-result-change="_page"></imageTemplateImport>
</div> </div>
</template> </template>
<script> <script>
import { meterManage } from '../../../api' import { meterManage } from '../../../api'
import importModal from '../../../components/import/DownloadTemplateImport' import importModal from '../../../components/import/DownloadTemplateImport'
import imageTemplateImport from '../../../components/import/ImageTemplateImport'
import MeterAptitudeManageEdit from './MeterAptitudeManageEdit.vue' import MeterAptitudeManageEdit from './MeterAptitudeManageEdit.vue'
import sampleItemList from './SampleItemList' import sampleItemList from './SampleItemList'
export default { export default {
...@@ -71,6 +77,7 @@ export default { ...@@ -71,6 +77,7 @@ export default {
components: { components: {
MeterAptitudeManageEdit, MeterAptitudeManageEdit,
sampleItemList, sampleItemList,
imageTemplateImport,
importModal importModal
}, },
data() { data() {
...@@ -82,7 +89,8 @@ export default { ...@@ -82,7 +89,8 @@ export default {
{ title: '检定依据名称', key: 'basis' }, { title: '检定依据名称', key: 'basis' },
{ title: '检定周期', key: 'cycle' }, { title: '检定周期', key: 'cycle' },
// {title: '限制范围或说明', key: 'limitDescription'}, // {title: '限制范围或说明', key: 'limitDescription'},
{ title: '价格', key: 'price' } { title: '价格', key: 'price' },
{ title: '图片是否上传', key: 'picUri', image: true }
], ],
btn: [ btn: [
{ type: 'success', id: '', name: '添加' }, { type: 'success', id: '', name: '添加' },
...@@ -92,6 +100,8 @@ export default { ...@@ -92,6 +100,8 @@ export default {
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '编辑' }, { type: 'md-create', id: '', name: '编辑' },
{ type: 'md-add', id: '', name: '上传仪器图片' },
{ type: 'md-image', id: '', name: '图片预览' },
{ type: 'md-trash', id: '', name: '删除' }, { type: 'md-trash', id: '', name: '删除' },
{ type: 'md-apps', id: '', name: '管理检测项目' } { type: 'md-apps', id: '', name: '管理检测项目' }
], ],
...@@ -146,14 +156,36 @@ export default { ...@@ -146,14 +156,36 @@ export default {
this._deleteById(data.id) this._deleteById(data.id)
break break
case '管理检测项目': case '管理检测项目':
// this._deleteById(data.id)
this.$refs.testItemModal._open(data.id) this.$refs.testItemModal._open(data.id)
break break
case '上传仪器图片':
this._uploadPic(data.id)
break
case '图片预览':
this._lookPic(data)
break
case '操作日志': case '操作日志':
this._record(data.id) this._record(data.id)
break break
} }
}, },
_lookPic(data) {
if (data.picUri) {
window.open(data.picUri)
} else {
this.$Message.warning('暂无图片!')
}
},
_uploadPic(id) {
const action = '/meter/v1/aptitude/upload_?aptitudeId=' + id
const data = {
importUrl: action,
downloadUrl: '',
title: '上传'
}
this.$refs.imageTemplateImport._open(data, '上传图片')
},
_page: async function() { _page: async function() {
console.log(9522123) console.log(9522123)
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page') // this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
......
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
], ],
dateList: [], dateList: [],
formObj: { formObj: {
entrustId: undefined, contractId: undefined,
name: undefined, name: undefined,
code: undefined, code: undefined,
type: undefined type: undefined
...@@ -140,19 +140,6 @@ export default { ...@@ -140,19 +140,6 @@ export default {
} }
}, },
methods: { methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) { _dateChange(data) {
this.formObj.ctimeBegin = data[0] this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1] this.formObj.ctimeEnd = data[1]
...@@ -222,7 +209,7 @@ export default { ...@@ -222,7 +209,7 @@ export default {
} }
}, },
_open(id) { _open(id) {
this.formObj.entrustId = id this.formObj.contractId = id
this.showModal = true this.showModal = true
this._page() this._page()
}, },
...@@ -231,7 +218,6 @@ export default { ...@@ -231,7 +218,6 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterSampleQuote.page(this.formObj) const result = await meterSampleQuote.page(this.formObj)
if (result) { if (result) {
this.getPage = result this.getPage = result
......
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" @on-enter="_formSearch" name="client" 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>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
...@@ -37,7 +34,7 @@ ...@@ -37,7 +34,7 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -48,7 +45,7 @@ ...@@ -48,7 +45,7 @@
</div> </div>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason> <Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage> <MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_componentResult"></MeterEntrustDetail> <MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
<Operation ref="operation"></Operation> <Operation ref="operation"></Operation>
</div> </div>
</template> </template>
...@@ -96,8 +93,7 @@ export default { ...@@ -96,8 +93,7 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
...@@ -131,11 +127,6 @@ export default { ...@@ -131,11 +127,6 @@ export default {
console.log(data) console.log(data)
this.$refs.meterSampleEdit._open(data) this.$refs.meterSampleEdit._open(data)
}, },
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -185,7 +176,7 @@ export default { ...@@ -185,7 +176,7 @@ export default {
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '样品管理': case '样品管理':
this._manageSample(data) this._manageSample(data.id)
break break
case '详情': case '详情':
this._detailModal(data) this._detailModal(data)
...@@ -210,23 +201,7 @@ export default { ...@@ -210,23 +201,7 @@ export default {
}, },
_manageSample(data) { _manageSample(data) {
// 管理样品 // 管理样品
this.$refs.meterSampleManageModal._open(data.id) this.$refs.meterSampleManageModal._open(data)
},
_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) { _record(id) {
this.$refs.operation._open(id) this.$refs.operation._open(id)
...@@ -246,11 +221,8 @@ export default { ...@@ -246,11 +221,8 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterContract.pageAccepted(this.formObj) const result = await meterContract.pageAccepted(this.formObj)
if (result) { if (result) {
console.log('结果')
console.log(result)
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
} }
...@@ -271,8 +243,6 @@ export default { ...@@ -271,8 +243,6 @@ export default {
// 编辑&添加 // 编辑&添加
_editModal(edit, id) { _editModal(edit, id) {
if (edit) { if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id) this._getById(id)
} else { } else {
// 添加 // 添加
...@@ -302,7 +272,6 @@ export default { ...@@ -302,7 +272,6 @@ export default {
} }
}, },
// 追加项目
_itemModal(data) { _itemModal(data) {
this.$refs.refModal._open(data) this.$refs.refModal._open(data)
}, },
......
...@@ -6,29 +6,26 @@ ...@@ -6,29 +6,26 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox> :get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -37,7 +34,8 @@ ...@@ -37,7 +34,8 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row[item.key]}}</span> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
...@@ -45,37 +43,29 @@ ...@@ -45,37 +43,29 @@
</Row> </Row>
</div> </div>
</div> </div>
<MeterSampleQuoteManage ref="meterSampleQuoteManageModal" @on-result-change="_formSearch"></MeterSampleQuoteManage>
<MeterContractRecord ref="meterContractRecordModal" @on-result-change="_formSearch"></MeterContractRecord>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust, meterSubcontractor } from '../../../api' import MeterSampleQuoteManage from '../MeterSampleQuoteManage'
import MeterContractRecord from '../MeterContractRecord'
import { meterContract, meterSubcontractor } from '../../../api'
export default { export default {
components: {}, components: { MeterSampleQuoteManage, MeterContractRecord },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [],
{
type: 'success',
id: 'meter-subcontractor-add-btn',
name: '添加'
}
],
iconMsg: [ iconMsg: [
{ {
type: 'ios-clock', type: 'ios-beaker',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '', id: '',
name: '资质项目' name: '报检样品查询'
}, },
{ type: 'ios-clock', id: '', name: '附件' }, { type: 'ios-cloud', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -83,8 +73,7 @@ export default { ...@@ -83,8 +73,7 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
...@@ -93,11 +82,10 @@ export default { ...@@ -93,11 +82,10 @@ export default {
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '邮编', key: 'postcode' }, { title: '要求完成时间', key: 'odate', width: 120, date: true },
{ title: 'E-mail', key: 'email', width: 120 }, { title: '折扣', key: 'discount', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 }, { title: '总价', key: 'totalPrice', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 }, { title: '折扣价', key: 'discountPrice', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' } { title: '备注', key: 'remark' }
] ]
} }
...@@ -115,11 +103,6 @@ export default { ...@@ -115,11 +103,6 @@ export default {
this._page() this._page()
}, },
methods: { methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -140,7 +123,7 @@ export default { ...@@ -140,7 +123,7 @@ export default {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '资质项目': case '报检样品查询':
this._itemModal(data.id) this._itemModal(data.id)
break break
case '附件': case '附件':
...@@ -156,13 +139,10 @@ export default { ...@@ -156,13 +139,10 @@ export default {
}) })
}, },
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.meterContractRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -173,8 +153,7 @@ export default { ...@@ -173,8 +153,7 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) const result = await meterContract.pageAcceptedHis(this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -204,11 +183,9 @@ export default { ...@@ -204,11 +183,9 @@ export default {
this.$refs.editSubcontractorModal._open() this.$refs.editSubcontractorModal._open()
} }
}, },
// 追加项目
_itemModal(data) { _itemModal(data) {
this.$refs.refModal._open(data) this.$refs.meterSampleQuoteManageModal._open(data)
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.refModal._open(id, 'subcontractorId') this.$refs.refModal._open(id, 'subcontractorId')
...@@ -218,13 +195,6 @@ export default { ...@@ -218,13 +195,6 @@ export default {
if (result) { if (result) {
this.$refs.editSubcontractorModal._open(result) this.$refs.editSubcontractorModal._open(result)
} }
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait"> <el-tab-pane label="待完成" name="wait">
<MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust> <MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust>
</el-tab-pane> </el-tab-pane>
...@@ -28,6 +28,22 @@ export default { ...@@ -28,6 +28,22 @@ export default {
return { return {
activeName: 'wait' activeName: 'wait'
} }
},
mounted() {
this.activeName = 'wait'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this._page()
} else {
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.waitTabs._page()
}
} }
} }
</script> </script>
......
...@@ -6,24 +6,21 @@ ...@@ -6,24 +6,21 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
...@@ -37,7 +34,8 @@ ...@@ -37,7 +34,8 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -47,8 +45,8 @@ ...@@ -47,8 +45,8 @@
</div> </div>
</div> </div>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason> <Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_componentResult"></MeterSampleManage> <MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_componentResult"></MeterEntrustDetail> <MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
<Operation ref="operation"></Operation> <Operation ref="operation"></Operation>
</div> </div>
</template> </template>
...@@ -98,13 +96,13 @@ export default { ...@@ -98,13 +96,13 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
...@@ -132,24 +130,6 @@ export default { ...@@ -132,24 +130,6 @@ export default {
_detailModal(data) { _detailModal(data) {
console.log(data) console.log(data)
this.$refs.meterSampleEdit._open(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) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
...@@ -201,7 +181,7 @@ export default { ...@@ -201,7 +181,7 @@ export default {
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '样品管理': case '样品管理':
this._manageSample(data) this._manageSample(data.id)
break break
case '详情': case '详情':
this._detailModal(data) this._detailModal(data)
...@@ -226,23 +206,7 @@ export default { ...@@ -226,23 +206,7 @@ export default {
}, },
_manageSample(data) { _manageSample(data) {
// 管理样品 // 管理样品
this.$refs.meterSampleManageModal._open(data.id) this.$refs.meterSampleManageModal._open(data)
},
_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) { _record(id) {
this.$refs.operation._open(id) this.$refs.operation._open(id)
......
...@@ -6,29 +6,26 @@ ...@@ -6,29 +6,26 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox> :get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -37,7 +34,8 @@ ...@@ -37,7 +34,8 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row[item.key]}}</span> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
...@@ -45,37 +43,29 @@ ...@@ -45,37 +43,29 @@
</Row> </Row>
</div> </div>
</div> </div>
<MeterSampleQuoteManage ref="meterSampleQuoteManageModal" @on-result-change="_formSearch"></MeterSampleQuoteManage>
<MeterContractRecord ref="meterContractRecordModal" @on-result-change="_formSearch"></MeterContractRecord>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust, meterSubcontractor } from '../../../api' import MeterSampleQuoteManage from '../MeterSampleQuoteManage'
import MeterContractRecord from '../MeterContractRecord'
import { meterContract, meterSubcontractor } from '../../../api'
export default { export default {
components: {}, components: { MeterSampleQuoteManage, MeterContractRecord },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [],
{
type: 'success',
id: 'meter-subcontractor-add-btn',
name: '添加'
}
],
iconMsg: [ iconMsg: [
{ {
type: 'ios-clock', type: 'ios-beaker',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '', id: '',
name: '资质项目' name: '报检样品查询'
}, },
{ type: 'ios-clock', id: '', name: '附件' }, { type: 'ios-cloud', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -83,8 +73,7 @@ export default { ...@@ -83,8 +73,7 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
...@@ -93,11 +82,10 @@ export default { ...@@ -93,11 +82,10 @@ export default {
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '邮编', key: 'postcode' }, { title: '要求完成时间', key: 'odate', width: 120, date: true },
{ title: 'E-mail', key: 'email', width: 120 }, { title: '折扣', key: 'discount', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 }, { title: '总价', key: 'totalPrice', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 }, { title: '折扣价', key: 'discountPrice', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' } { title: '备注', key: 'remark' }
] ]
} }
...@@ -115,11 +103,6 @@ export default { ...@@ -115,11 +103,6 @@ export default {
this._page() this._page()
}, },
methods: { methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -140,7 +123,7 @@ export default { ...@@ -140,7 +123,7 @@ export default {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '资质项目': case '报检样品查询':
this._itemModal(data.id) this._itemModal(data.id)
break break
case '附件': case '附件':
...@@ -156,13 +139,10 @@ export default { ...@@ -156,13 +139,10 @@ export default {
}) })
}, },
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.meterContractRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -173,8 +153,7 @@ export default { ...@@ -173,8 +153,7 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) const result = await meterContract.pageQuoteThirdReviewHis(this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -204,11 +183,9 @@ export default { ...@@ -204,11 +183,9 @@ export default {
this.$refs.editSubcontractorModal._open() this.$refs.editSubcontractorModal._open()
} }
}, },
// 追加项目
_itemModal(data) { _itemModal(data) {
this.$refs.refModal._open(data) this.$refs.meterSampleQuoteManageModal._open(data)
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.refModal._open(id, 'subcontractorId') this.$refs.refModal._open(id, 'subcontractorId')
...@@ -218,13 +195,6 @@ export default { ...@@ -218,13 +195,6 @@ export default {
if (result) { if (result) {
this.$refs.editSubcontractorModal._open(result) this.$refs.editSubcontractorModal._open(result)
} }
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait"> <el-tab-pane label="待完成" name="wait">
<MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust> <MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust>
</el-tab-pane> </el-tab-pane>
...@@ -28,6 +28,22 @@ export default { ...@@ -28,6 +28,22 @@ export default {
return { return {
activeName: 'wait' activeName: 'wait'
} }
},
mounted() {
this.activeName = 'wait'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this._page()
} else {
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.waitTabs._page()
}
} }
} }
</script> </script>
......
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" @on-enter="_formSearch" name="client" 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>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
...@@ -37,7 +34,8 @@ ...@@ -37,7 +34,8 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -47,8 +45,8 @@ ...@@ -47,8 +45,8 @@
</div> </div>
</div> </div>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason> <Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_componentResult"></MeterSampleManage> <MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_componentResult"></MeterEntrustDetail> <MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
<Operation ref="operation"></Operation> <Operation ref="operation"></Operation>
</div> </div>
</template> </template>
...@@ -98,13 +96,13 @@ export default { ...@@ -98,13 +96,13 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
...@@ -132,24 +130,6 @@ export default { ...@@ -132,24 +130,6 @@ export default {
_detailModal(data) { _detailModal(data) {
console.log(data) console.log(data)
this.$refs.meterSampleEdit._open(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) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
...@@ -201,7 +181,7 @@ export default { ...@@ -201,7 +181,7 @@ export default {
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '样品管理': case '样品管理':
this._manageSample(data) this._manageSample(data.id)
break break
case '详情': case '详情':
this._detailModal(data) this._detailModal(data)
...@@ -226,23 +206,7 @@ export default { ...@@ -226,23 +206,7 @@ export default {
}, },
_manageSample(data) { _manageSample(data) {
// 管理样品 // 管理样品
this.$refs.meterSampleManageModal._open(data.id) this.$refs.meterSampleManageModal._open(data)
},
_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) { _record(id) {
this.$refs.operation._open(id) this.$refs.operation._open(id)
...@@ -262,11 +226,8 @@ export default { ...@@ -262,11 +226,8 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterContract.pageQuoteSecondReview(this.formObj) const result = await meterContract.pageQuoteSecondReview(this.formObj)
if (result) { if (result) {
console.log('结果')
console.log(result)
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
} }
...@@ -287,8 +248,6 @@ export default { ...@@ -287,8 +248,6 @@ export default {
// 编辑&添加 // 编辑&添加
_editModal(edit, id) { _editModal(edit, id) {
if (edit) { if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id) this._getById(id)
} else { } else {
// 添加 // 添加
......
...@@ -6,29 +6,26 @@ ...@@ -6,29 +6,26 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox> :get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -37,7 +34,7 @@ ...@@ -37,7 +34,7 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -46,37 +43,29 @@ ...@@ -46,37 +43,29 @@
</Row> </Row>
</div> </div>
</div> </div>
<MeterSampleQuoteManage ref="meterSampleQuoteManageModal" @on-result-change="_formSearch"></MeterSampleQuoteManage>
<MeterContractRecord ref="meterContractRecordModal" @on-result-change="_formSearch"></MeterContractRecord>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust, meterSubcontractor } from '../../../api' import MeterSampleQuoteManage from '../MeterSampleQuoteManage'
import MeterContractRecord from '../MeterContractRecord'
import { meterContract, meterSubcontractor } from '../../../api'
export default { export default {
components: {}, components: { MeterSampleQuoteManage, MeterContractRecord },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [],
{
type: 'success',
id: 'meter-subcontractor-add-btn',
name: '添加'
}
],
iconMsg: [ iconMsg: [
{ {
type: 'ios-clock', type: 'ios-beaker',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '', id: '',
name: '资质项目' name: '报检样品查询'
}, },
{ type: 'ios-clock', id: '', name: '附件' }, { type: 'ios-cloud', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -84,8 +73,7 @@ export default { ...@@ -84,8 +73,7 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
...@@ -94,11 +82,10 @@ export default { ...@@ -94,11 +82,10 @@ export default {
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '邮编', key: 'postcode' }, { title: '要求完成时间', key: 'odate', width: 120, date: true },
{ title: 'E-mail', key: 'email', width: 120 }, { title: '折扣', key: 'discount', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 }, { title: '总价', key: 'totalPrice', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 }, { title: '折扣价', key: 'discountPrice', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' } { title: '备注', key: 'remark' }
] ]
} }
...@@ -116,11 +103,6 @@ export default { ...@@ -116,11 +103,6 @@ export default {
this._page() this._page()
}, },
methods: { methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -141,7 +123,7 @@ export default { ...@@ -141,7 +123,7 @@ export default {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '资质项目': case '报检样品查询':
this._itemModal(data.id) this._itemModal(data.id)
break break
case '附件': case '附件':
...@@ -157,13 +139,10 @@ export default { ...@@ -157,13 +139,10 @@ export default {
}) })
}, },
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.meterContractRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -174,8 +153,7 @@ export default { ...@@ -174,8 +153,7 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) const result = await meterContract.pageQuoteSecondReviewHis(this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -205,11 +183,9 @@ export default { ...@@ -205,11 +183,9 @@ export default {
this.$refs.editSubcontractorModal._open() this.$refs.editSubcontractorModal._open()
} }
}, },
// 追加项目
_itemModal(data) { _itemModal(data) {
this.$refs.refModal._open(data) this.$refs.meterSampleQuoteManageModal._open(data)
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.refModal._open(id, 'subcontractorId') this.$refs.refModal._open(id, 'subcontractorId')
...@@ -219,13 +195,6 @@ export default { ...@@ -219,13 +195,6 @@ export default {
if (result) { if (result) {
this.$refs.editSubcontractorModal._open(result) this.$refs.editSubcontractorModal._open(result)
} }
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait"> <el-tab-pane label="待完成" name="wait">
<MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust> <MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust>
</el-tab-pane> </el-tab-pane>
...@@ -28,6 +28,22 @@ export default { ...@@ -28,6 +28,22 @@ export default {
return { return {
activeName: 'wait' activeName: 'wait'
} }
},
mounted() {
this.activeName = 'wait'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this._page()
} else {
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.waitTabs._page()
}
} }
} }
</script> </script>
......
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" @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>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
...@@ -37,7 +34,8 @@ ...@@ -37,7 +34,8 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -47,8 +45,8 @@ ...@@ -47,8 +45,8 @@
</div> </div>
</div> </div>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason> <Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_componentResult"></MeterSampleManage> <MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_componentResult"></MeterEntrustDetail> <MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
<Operation ref="operation"></Operation> <Operation ref="operation"></Operation>
</div> </div>
</template> </template>
...@@ -98,13 +96,13 @@ export default { ...@@ -98,13 +96,13 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
...@@ -132,24 +130,6 @@ export default { ...@@ -132,24 +130,6 @@ export default {
_detailModal(data) { _detailModal(data) {
console.log(data) console.log(data)
this.$refs.meterSampleEdit._open(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) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
...@@ -229,23 +209,7 @@ export default { ...@@ -229,23 +209,7 @@ export default {
}, },
_manageSample(data) { _manageSample(data) {
// 管理样品 // 管理样品
this.$refs.meterSampleManageModal._open(data.id) this.$refs.meterSampleManageModal._open(data)
},
_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) { _record(id) {
this.$refs.operation._open(id) this.$refs.operation._open(id)
......
...@@ -6,29 +6,26 @@ ...@@ -6,29 +6,26 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox> :get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -37,7 +34,8 @@ ...@@ -37,7 +34,8 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row[item.key]}}</span> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
...@@ -45,37 +43,29 @@ ...@@ -45,37 +43,29 @@
</Row> </Row>
</div> </div>
</div> </div>
<MeterSampleQuoteManage ref="meterSampleQuoteManageModal" @on-result-change="_formSearch"></MeterSampleQuoteManage>
<MeterContractRecord ref="meterContractRecordModal" @on-result-change="_formSearch"></MeterContractRecord>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust, meterSubcontractor } from '../../../api' import MeterSampleQuoteManage from '../MeterSampleQuoteManage'
import MeterContractRecord from '../MeterContractRecord'
import { meterContract, meterSubcontractor } from '../../../api'
export default { export default {
components: {}, components: { MeterSampleQuoteManage, MeterContractRecord },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [],
{
type: 'success',
id: 'meter-subcontractor-add-btn',
name: '添加'
}
],
iconMsg: [ iconMsg: [
{ {
type: 'ios-clock', type: 'ios-beaker',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '', id: '',
name: '资质项目' name: '报检样品查询'
}, },
{ type: 'ios-clock', id: '', name: '附件' }, { type: 'ios-cloud', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -83,8 +73,7 @@ export default { ...@@ -83,8 +73,7 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
...@@ -93,11 +82,10 @@ export default { ...@@ -93,11 +82,10 @@ export default {
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '邮编', key: 'postcode' }, { title: '要求完成时间', key: 'odate', width: 120, date: true },
{ title: 'E-mail', key: 'email', width: 120 }, { title: '折扣', key: 'discount', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 }, { title: '总价', key: 'totalPrice', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 }, { title: '折扣价', key: 'discountPrice', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' } { title: '备注', key: 'remark' }
] ]
} }
...@@ -115,11 +103,6 @@ export default { ...@@ -115,11 +103,6 @@ export default {
this._page() this._page()
}, },
methods: { methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -140,7 +123,7 @@ export default { ...@@ -140,7 +123,7 @@ export default {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '资质项目': case '报检样品查询':
this._itemModal(data.id) this._itemModal(data.id)
break break
case '附件': case '附件':
...@@ -156,13 +139,10 @@ export default { ...@@ -156,13 +139,10 @@ export default {
}) })
}, },
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.meterContractRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -173,8 +153,7 @@ export default { ...@@ -173,8 +153,7 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) const result = await meterContract.pageQuoteFirstReviewHis(this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -204,11 +183,9 @@ export default { ...@@ -204,11 +183,9 @@ export default {
this.$refs.editSubcontractorModal._open() this.$refs.editSubcontractorModal._open()
} }
}, },
// 追加项目
_itemModal(data) { _itemModal(data) {
this.$refs.refModal._open(data) this.$refs.meterSampleQuoteManageModal._open(data)
}, },
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.refModal._open(id, 'subcontractorId') this.$refs.refModal._open(id, 'subcontractorId')
...@@ -218,13 +195,6 @@ export default { ...@@ -218,13 +195,6 @@ export default {
if (result) { if (result) {
this.$refs.editSubcontractorModal._open(result) this.$refs.editSubcontractorModal._open(result)
} }
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait"> <el-tab-pane label="待完成" name="wait">
<MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust> <MeterReviewEntrust ref="waitTabs"></MeterReviewEntrust>
</el-tab-pane> </el-tab-pane>
...@@ -28,6 +28,22 @@ export default { ...@@ -28,6 +28,22 @@ export default {
return { return {
activeName: 'wait' activeName: 'wait'
} }
},
mounted() {
this.activeName = 'wait'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this._page()
} else {
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.waitTabs._page()
}
} }
} }
</script> </script>
......
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/> <Input v-model="formObj.client" name="client" 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>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
...@@ -37,11 +34,9 @@ ...@@ -37,11 +34,9 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div> <span v-else>{{scope.row[item.key]}}</span>
<div v-else>{{scope.row[item.key]}}</div>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
...@@ -100,13 +95,13 @@ export default { ...@@ -100,13 +95,13 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
...@@ -131,14 +126,9 @@ export default { ...@@ -131,14 +126,9 @@ export default {
this._page() this._page()
}, },
methods: { methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_manageSample(data) { _manageSample(data) {
// 管理样品 // 管理样品
this.$refs.meterSampleManageModal._open(data.id) this.$refs.meterSampleManageModal._open(data)
}, },
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.key==='name'" @click.stop="_handleRow(scope)"> <div v-if="item.key==='name'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" @on-result-change="_judgeBasisChange" @click.native="_selectjudgeBasis(scope.$rowIndex)" <el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" @click.native="_selectjudgeBasis(scope.$rowIndex)"
></el-input> ></el-input>
</div> </div>
<div v-if="item.key==='spec'" @click.stop="_handleRow(scope)"> <div v-if="item.key==='spec'" @click.stop="_handleRow(scope)">
...@@ -645,6 +645,7 @@ export default { ...@@ -645,6 +645,7 @@ export default {
this.id = formObj.id this.id = formObj.id
this.formObj = formObj this.formObj = formObj
this._showAddress(formObj) this._showAddress(formObj)
this._showTime(formObj)
this.getPage.records = formObj.sampleList this.getPage.records = formObj.sampleList
}, },
_getList: async function() { _getList: async function() {
...@@ -682,7 +683,11 @@ export default { ...@@ -682,7 +683,11 @@ export default {
} }
}, },
_showTime(formObj) { _showTime(formObj) {
// 回显资质类型 if (this.formObj.odate === undefined) {
this.formObj.odate = ''
} else {
this.formObj.odate = new Date(formObj.odate)
}
}, },
_save: async function(data) { _save: async function(data) {
const result = await meterContract.addQuote(data) const result = await meterContract.addQuote(data)
......
...@@ -6,29 +6,26 @@ ...@@ -6,29 +6,26 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox> :get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -47,39 +44,35 @@ ...@@ -47,39 +44,35 @@
</div> </div>
</div> </div>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit> <MeterSampleQuoteManage ref="meterSampleQuoteManageModal" @on-result-change="_formSearch"></MeterSampleQuoteManage>
<MeterContractRecord ref="meterContractRecordModal" @on-result-change="_formSearch"></MeterContractRecord>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust, meterSubcontractor } from '../../../api' import { meterContract, meterSubcontractor } from '../../../api'
import MeterSubcontractorEdit from './MeterQuoteRegisterEdit' import MeterSampleQuoteManage from '../MeterSampleQuoteManage'
import MeterContractRecord from '../MeterContractRecord'
export default { export default {
components: { MeterSubcontractorEdit }, components: { MeterSampleQuoteManage, MeterContractRecord },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterQuoteRegisterHis.vueFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [
{ // {
type: 'success', // type: 'success',
id: 'meter-subcontractor-add-btn', // id: 'meter-subcontractor-add-btn',
name: '添加' // name: '添加'
} // }
], ],
iconMsg: [ iconMsg: [
{ {
type: 'ios-clock', type: 'ios-beaker',
id: '', id: '',
name: '编辑' name: '报检样品查询'
}, },
{ { type: 'md-cloud', id: '', name: '附件' },
type: 'ios-clock',
id: '',
name: '资质项目'
},
{ type: 'ios-clock', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -87,8 +80,7 @@ export default { ...@@ -87,8 +80,7 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
...@@ -97,11 +89,10 @@ export default { ...@@ -97,11 +89,10 @@ export default {
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '邮编', key: 'postcode' }, { title: '要求完成时间', key: 'odate', width: 120, date: true },
{ title: 'E-mail', key: 'email', width: 120 }, { title: '折扣', key: 'discount', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 }, { title: '总价', key: 'totalPrice', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 }, { title: '折扣价', key: 'discountPrice', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' } { title: '备注', key: 'remark' }
] ]
} }
...@@ -119,11 +110,6 @@ export default { ...@@ -119,11 +110,6 @@ export default {
this._page() this._page()
}, },
methods: { methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -138,13 +124,12 @@ export default { ...@@ -138,13 +124,12 @@ export default {
}) })
}, },
_iconClick(res, data, componentName) { _iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '资质项目': case '报检样品查询':
this._itemModal(data.id) this._itemModal(data.id)
break break
case '附件': case '附件':
...@@ -160,13 +145,10 @@ export default { ...@@ -160,13 +145,10 @@ export default {
}) })
}, },
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.meterContractRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -178,7 +160,7 @@ export default { ...@@ -178,7 +160,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj) const result = await meterContract.pageHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -208,9 +190,8 @@ export default { ...@@ -208,9 +190,8 @@ export default {
this.$refs.editSubcontractorModal._open() this.$refs.editSubcontractorModal._open()
} }
}, },
// 追加项目
_itemModal(data) { _itemModal(data) {
this.$refs.refModal._open(data) this.$refs.meterSampleQuoteManageModal._open(data)
}, },
_upload(id) { _upload(id) {
......
...@@ -37,7 +37,18 @@ ...@@ -37,7 +37,18 @@
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row[item.key]}}</span> <span v-if="item.key==='type'">
<span v-if="scope.row[item.key]===0">
检定
</span>
<span v-else-if="scope.row[item.key]===1">
校准
</span>
<span v-else-if="scope.row[item.key]===2">
外观检查
</span>
</span>
<span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
......
<template>
<div>
<Modal v-model="showModal" width="1200" class="modal-footer-none">
<p slot="header">{{modalTitle}}</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="样品名称:" class="search-item">
<Input v-model="formObj.name" placeholder="请输入样品名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input v-model="formObj.code" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<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" :get-page="getPage"
:icon-msg="iconMsg" select-data @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">
<div v-if="item.detail"><a @click.stop="_detailModal(scope.row.id)">{{scope.row[item.key]}}</a></div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</div>
<div v-else-if="item.key==='jobOut'">
{{scope.row[item.key]===1?'是':'否'}}
</div>
<div v-else-if="item.key==='type'">
<span v-if="scope.row[item.key]===0">
检定
</span>
<span v-if="scope.row[item.key]===1">
校准
</span>
<span v-if="scope.row[item.key]===2">
外观检查
</span>
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
<importModal ref="importModal" @on-result-change="_page"></importModal>
<MeterSampleManageEdit ref="sampleEditModal" @on-result-change="_page"></MeterSampleManageEdit>
<MeterSampleEdit ref="meterSampleEditModal" @on-result-change="_page"></MeterSampleEdit>
</div>
</template>
<script>
import { meterSample } from '../../api'
import importModal from '../contract-tab/ContractTab'
import MeterSampleManageEdit from './MeterItemManage'
import MeterSampleEdit from './MeterSampleEdit'
export default {
components: {
MeterSampleManageEdit,
MeterSampleEdit,
importModal
// FoodSampleGovernDetail,
// CopyModal,
// FoodSampleGovernLYEdits
},
data() {
return {
currentComponent: '',
searchOpen: false,
iconMsg: [{ type: 'ios-flask-outline', id: '', name: '管理检测项目' }],
btn: [
// {
// type: 'success',
// id: '',
// name: '新增'
// },
// {
// type: 'success',
// id: '',
// name: '导入样品'
// },
// {
// type: 'success',
// id: '',
// name: '分包'
// },
// {
// type: 'success',
// id: '',
// name: '取消分包'
// },
// {
// type: 'success',
// id: '',
// name: '导入检测项目'
// }
],
options: [
{
name: '检定'
},
{
name: '校准'
},
{
name: '外观检查'
}
],
formId: 'meterReviewSampleManageFormId',
showModal: false,
modalTitle: '管理样品',
selectIds: [],
selectData: [],
getPage: {},
pageColumns: [
{ title: '样品编号', key: 'code', detail: true, width: 120 },
{ title: '样品名称', key: 'name', width: 140 },
{ title: '型号规格', key: 'spec', width: 140 },
{ title: '出厂编号', key: 'factoryNumber', width: 140 },
{ title: '是否分包', key: 'jobOut', width: 110 },
{ title: '检测类型', key: 'type', width: 140 },
{ title: '数量', key: 'quantity', width: 140 }
],
dateList: [],
formObj: {
entrustId: undefined,
name: undefined,
code: undefined,
type: undefined
}
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '取消分包':
this._subpackageCancelBtn()
break
case '新增':
this._addSample(this.formObj.entrustId)
break
case '导入样品':
this._importSample(this.formObj.entrustId)
break
case '分包':
this._subpackageSample()
break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
}
})
},
_addSample(entrustId) {
this.$refs.meterSampleEditModal._open(entrustId)
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '管理检测项目':
this._sampleEditModal(data)
break
case '编辑':
localStorage.setItem('type', data.type)
if (data.type === 2) {
this._editLY(data.id) // 粮油的编辑页
} else {
this._editModal(true, data.id)
}
break
case '复制':
this._copy(data.id, data.type)
break
case '删除':
this._deleteById(data.id)
break
case '检测项目':
this._itemDetail(data.id)
break
}
})
},
_subpackageCancelBtn() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const data = {}
data.ids = this.selectIds.join(',')
this._subpackageCancel(data)
}
},
_subpackageCancel: async function(data) {
console.log(data)
const result = await meterSample.subpackageCancel(data)
if (result) {
this.$Message.success('取消成功!')
await this._page()
}
},
_sampleEditModal(data) {
this.$refs.sampleEditModal._open(data.id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectData':
const selectIds = []
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_open(id) {
this.formObj.entrustId = id
this.showModal = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterSample.page(this.formObj)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this.$store.dispatch('FoodSample/deleteByIds', ids).then(() => {
this._resultChange('删除成功!')
})
}
})
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(id) {
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(function() {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(this.$store.state.FoodSample.governModel)
})
})
},
_editModal(edit, id) {
this.currentComponent = 'FoodSampleGovernEdit'
this.$nextTick(function() {
if (edit) {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.contractId
)
})
} else {
this.$refs.refModal._open('', this.contractId)
}
})
},
_editLY(id) {
// 粮油的编辑
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$nextTick(function() {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.contractId
)
})
})
},
_search() {
this._page()
},
_searchParams() {
const data = this.$serialize('search-sample-govern')
return this.$extend(data, this.pageParams)
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this._page()
this.$Message.success(msg)
}
},
// 导入样品
_importSample() {
const data = {
importUrl: '/meter/v1/sample/import_' + this.formObj.entrustId,
downloadUrl: '/meter/v1/excel/template/MeterSampleImport',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.importModal._open(this.selectIds, this.selectData[0])
}
},
_subpackageSample() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选中一条样品进行分包!')
return false
} else {
for (let i = 0; i < this.selectData.length; i++) {
if (this.selectData[i].jobOut === 1) {
this.$Message.warning(
'样品编号为' +
this.selectData[i].code +
'已经分包了,请选择未分包的样品!'
)
return false
}
}
this._subpackage(this.selectIds)
}
},
_subpackage: async function(ids) {
const result = await meterSample.subpackageSample(ids)
if (result) {
this.$Message.success('分包成功!')
await this._page()
}
},
_itemDetail(id) {
this.$refs.foodItem._open(id)
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
...@@ -51,14 +51,17 @@ ...@@ -51,14 +51,17 @@
<FileManage ref="FileManage"></FileManage> <FileManage ref="FileManage"></FileManage>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit> <MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<operationModal ref="operationModal"></operationModal> <operationModal ref="operationModal"></operationModal>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust } from '../../../api' import { meterEntrust } from '../../../api'
import MeterSampleManage from '../MeterSampleManage'
import MeterSubcontractorEdit from './MeterGoOutTestEdit' import MeterSubcontractorEdit from './MeterGoOutTestEdit'
import operationModal from './MeterGoOutOperation' import operationModal from './MeterGoOutOperation'
export default { export default {
components: { MeterSubcontractorEdit, operationModal }, components: { MeterSubcontractorEdit, operationModal, MeterSampleManage },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
...@@ -104,6 +107,7 @@ export default { ...@@ -104,6 +107,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '进度', key: 'progress', width: 200, status: true }, { title: '进度', key: 'progress', width: 200, status: true },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
...@@ -172,6 +176,10 @@ export default { ...@@ -172,6 +176,10 @@ export default {
}) })
} }
}, },
_sampleManage(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data)
},
_iconClick(res, data, componentName) { _iconClick(res, data, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -179,8 +187,8 @@ export default { ...@@ -179,8 +187,8 @@ export default {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '资质项目': case '管理样品':
this._itemModal(data.id) this._sampleManage(data.id)
break break
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
......
<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>
...@@ -46,14 +46,17 @@ ...@@ -46,14 +46,17 @@
</div> </div>
</div> </div>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit> <MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustRecord ref="entrustRecordModal" @on-result-change="_page"></MeterEntrustRecord>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust } from '../../../api' import { meterEntrust } from '../../../api'
import MeterSubcontractorEdit from './MeterGoOutTestEdit' import MeterSampleManage from '../MeterSampleManageRead'
import MeterEntrustRecord from '../../../components/operation/Operation'
export default { export default {
components: { MeterSubcontractorEdit }, components: { MeterSampleManage, MeterEntrustRecord },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
...@@ -73,17 +76,10 @@ export default { ...@@ -73,17 +76,10 @@ export default {
], ],
iconMsg: [ iconMsg: [
{ {
type: 'md-create', type: 'md-flask',
id: '',
name: '编辑'
},
{
type: 'ios-beaker',
id: '', id: '',
name: '管理样品' name: '查看样品'
}, },
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -99,6 +95,7 @@ export default { ...@@ -99,6 +95,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 }, { title: '详细地址', key: 'address', width: 250 },
...@@ -178,23 +175,24 @@ export default { ...@@ -178,23 +175,24 @@ export default {
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
break break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志': case '操作日志':
this._record(data.id) this._record(data.id)
break break
case '查看样品':
this._sampleManage(data.id)
break
} }
}) })
}, },
_sampleManage(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data)
},
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.entrustRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -208,8 +206,7 @@ export default { ...@@ -208,8 +206,7 @@ export default {
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) const result = await meterEntrust.pageGoOutEntrustHis(this.formObj)
const result = await meterEntrust.pageGoOutEntrust(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
<el-tab-pane label="待完成" name="wait"> <el-tab-pane label="待完成" name="wait">
<MeterGoOutEntrust ref="waitTabs"></MeterGoOutEntrust> <MeterGoOutEntrust ref="waitTabs"></MeterGoOutEntrust>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已完成" name="finish">
<MeterGoOutEntrustFinish ref="finishTabs"></MeterGoOutEntrustFinish>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his"> <el-tab-pane label="历史记录" name="his">
<MeterGoOutEntrustHis ref="hisTabs"></MeterGoOutEntrustHis> <MeterGoOutEntrustHis ref="hisTabs"></MeterGoOutEntrustHis>
</el-tab-pane> </el-tab-pane>
...@@ -20,13 +17,11 @@ ...@@ -20,13 +17,11 @@
<script> <script>
import MeterGoOutEntrust from './MeterGoOutEntrust' import MeterGoOutEntrust from './MeterGoOutEntrust'
import MeterGoOutEntrustFinish from './MeterGoOutEntrustFinish'
import MeterGoOutEntrustHis from './MeterGoOutEntrustHis' import MeterGoOutEntrustHis from './MeterGoOutEntrustHis'
export default { export default {
name: 'MeterGoOutEntrustIndex', name: 'MeterGoOutEntrustIndex',
components: { components: {
MeterGoOutEntrust, MeterGoOutEntrust,
MeterGoOutEntrustFinish,
MeterGoOutEntrustHis MeterGoOutEntrustHis
}, },
data() { data() {
...@@ -42,8 +37,6 @@ export default { ...@@ -42,8 +37,6 @@ export default {
_changeTabs(tab, event) { _changeTabs(tab, event) {
if (tab.name === 'wait') { if (tab.name === 'wait') {
this._page() this._page()
} else if (tab.name === 'finish') {
this.$refs.finishTabs._page()
} else { } else {
this.$refs.hisTabs._page() this.$refs.hisTabs._page()
} }
......
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/> <Input v-model="formObj.client" 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>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
...@@ -67,10 +64,9 @@ export default { ...@@ -67,10 +64,9 @@ export default {
btn: [ btn: [
{ {
type: 'success', type: 'success',
id: 'meter-subcontractor-add-btn', id: '',
name: '添加' name: '添加'
}, },
// meter-subcontractor-submit-btn
{ {
type: 'success', type: 'success',
id: '', id: '',
...@@ -97,14 +93,14 @@ export default { ...@@ -97,14 +93,14 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 }, { title: '详细地址', key: 'address', width: 250 },
......
...@@ -6,29 +6,26 @@ ...@@ -6,29 +6,26 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.client" name="name" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox> :get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -47,53 +44,52 @@ ...@@ -47,53 +44,52 @@
</div> </div>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit> <MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustRecord ref="entrustRecordModal" @on-result-change="_page"></MeterEntrustRecord>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust, meterSubcontractor } from '../../../api' import { meterEntrust, meterSubcontractor } from '../../../api'
import MeterSampleManage from '../MeterSampleManageRead'
import MeterEntrustRecord from '../../../components/operation/Operation'
import MeterSubcontractorEdit from './MeterSendTestEdit' import MeterSubcontractorEdit from './MeterSendTestEdit'
export default { export default {
components: { MeterSubcontractorEdit }, components: { MeterSubcontractorEdit, MeterSampleManage, MeterEntrustRecord },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: false,
btn: [ btn: [
{ // {
type: 'success', // type: 'success',
id: 'meter-subcontractor-add-btn', // id: '',
name: '添加' // name: '添加'
} // }
], ],
iconMsg: [ iconMsg: [
{ {
type: 'ios-clock', type: 'md-flask',
id: '', id: '',
name: '编辑' name: '查看样品'
}, },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
name: '资质项目'
},
{ type: 'ios-clock', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志' name: '操作日志'
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined
aptitude: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 }, { title: '详细地址', key: 'address', width: 250 },
...@@ -156,17 +152,21 @@ export default { ...@@ -156,17 +152,21 @@ export default {
case '操作日志': case '操作日志':
this._record(data.id) this._record(data.id)
break break
case '查看样品':
this._sampleManage(data.id)
break
} }
}) })
}, },
_sampleManage(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data)
},
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.entrustRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj) const result = await meterEntrust.pageSendEntrustHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.key==='name'" @click.stop="_handleRow(scope)"> <div v-if="item.key==='name'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" @on-result-change="_judgeBasisChange" @click.native="_selectjudgeBasis(scope.$rowIndex)" <el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" @click.native="_selectjudgeBasis(scope.$rowIndex)"
></el-input> ></el-input>
</div> </div>
......
...@@ -132,7 +132,6 @@ export default { ...@@ -132,7 +132,6 @@ export default {
name: '仪器领用' name: '仪器领用'
}, },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
......
...@@ -77,7 +77,6 @@ export default { ...@@ -77,7 +77,6 @@ export default {
name: '任务分配' name: '任务分配'
}, },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
......
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top:10px">
<Form v-show="searchOpen" :d="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托单位:" style="margin-left: -20px">
<Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch"/>
</Form-item>
<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.code" name="code" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="出厂编号:">
<Input v-model="formObj.factoryNumber" name="factoryNumber" 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"
:form-id="formId"
:table-height="tableHeight"
: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"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!-- 添加、编辑 -->
<MeterAptitudeStandardEdit ref="editModal" @on-result-change="_page"></MeterAptitudeStandardEdit>
<!--导入资质项目-->
<!-- <DownloadTemplateImport ref="sampleModal" @on-result-change="_page"></DownloadTemplateImport>-->
</div>
</template>
<script>
import { meterAptitude, meterSample } from '../../../api'
export default {
name: 'MeterSampleProgress',
components: {},
data() {
return {
formId: 'meterAptitudeFormId',
pageColumns: [
{ title: '委托单位', key: 'client', width: 160 },
{ title: '委托单号', key: 'entrustCode' },
{ title: '样品名称', key: 'name' },
{ title: '样品编号', key: 'code' },
{ title: '出厂编号', key: 'factoryNumber' },
{ title: '处理进度', key: 'status', status: true }
],
btn: [],
iconMsg: [
// { type: 'ios-clock', id: '', name: '编辑' },
// { type: 'ios-clock', id: '', name: '删除' }
],
formObj: {
entrustCode: undefined,
client: undefined,
name: undefined,
factoryNumber: undefined,
code: undefined
},
searchOpen: true,
selectIds: [],
getPage: {},
typeData: []
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_btnClick(msg) {
switch (msg) {
case '添加':
this._editModal(false)
break
case '删除':
this._deleteSelected()
break
case '导入':
this._import()
break
case '导出':
this._export()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '删除':
this._deleteById(data.id)
break
case '操作日志':
this._record(data.id)
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterSample.pageSampleProgress(this.formObj)
if (result) {
console.log(55555)
console.log(result)
this.getPage = result
console.log(123456789)
console.log(this.getPage)
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodJudgeBasis.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await meterAptitude.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除这 ' + ids.length + ' 条记录?')
}
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
this._getById(id)
// 编辑
// this.$store.dispatch('FoodJudgeBasis/getById', id).then(() => {
// this.$refs.editModal._open(this.$store.state.FoodJudgeBasis.model)
// })
} else {
// 添加
this.$refs.editModal._open()
}
},
_getById: async function(id) {
const result = await meterAptitude.getById(id)
if (result) {
this.$refs.editModal._open(result)
}
},
// 导入
_import() {
const data = {
importUrl:
'/food/v1/food_aptitude_judge_basis/food_aptitude_judge_import',
downloadUrl: '/food/v1/excel/template/FoodAptitudeJudgeBasis',
title: '导入检验方法管理'
}
this.$refs.sampleModal._open(data)
},
// 导出
_export() {
console.log('.this.selectIds', this.selectIds)
if (this.selectIds.length === 0) {
this.$Message.warning('请选择需要导出的数据')
} else {
const content = '确定导出 ' + this.selectIds.length + ' 条记录?'
this.$Modal.confirm({
title: '提示',
content: content,
onOk: () => {
// eslint-disable-next-line no-undef
http.open(
'/food/v1/food_aptitude_judge_basis/food_aptitude_judge_export?ids=' +
this.selectIds
)
}
})
}
}
}
}
</script>
<style scoped>
</style>
...@@ -106,6 +106,7 @@ export default { ...@@ -106,6 +106,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 }, { title: '详细地址', key: 'address', width: 250 },
......
<template>
<div>
<Modal v-model="showModal" width="1200" class="modal-footer-none">
<p slot="header">{{modalTitle}}</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="样品名称:" class="search-item">
<Input v-model="formObj.name" placeholder="请输入样品名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input v-model="formObj.code" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<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" :get-page="getPage"
:icon-msg="iconMsg" select-data @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">
<div v-if="item.detail"><a @click.stop="_detailModal(scope.row.id)">{{scope.row[item.key]}}</a></div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</div>
<div v-else-if="item.key==='jobOut'">
{{scope.row[item.key]===1?'是':'否'}}
</div>
<span v-if="item.key==='type'">
<span v-if="scope.row[item.key]===0">
检定
</span>
<span v-else-if="scope.row[item.key]===1">
校准
</span>
<span v-else-if="scope.row[item.key]===2">
外观检查
</span>
</span>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
import { meterSample } from '../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
searchOpen: false,
// btn: [
// {type: 'success', id: '', name: '添加', componentName: 'FoodSampleGovernEdit'},
// {id: 'food-gov-sample-batch-add', name: '批量添加', componentName: 'FoodSampleGovernBatchAdd'},
// {id: '', name: '导入样品', componentName: 'FoodImportSample'},
// {id: '', name: '导入检测项目', componentName: 'RelItem'},
// {id: '', name: '导入检测项目包', componentName: 'RelItemPackage'},
// {id: '', name: '复制历史样品检测项目', componentName: 'CopyHisItem'},
// {id: '', name: '删除'},
// ],
iconMsg: [
// { type: 'compose', id: '', name: '编辑' },
// { type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' },
// { type: 'trash-a', id: '', name: '删除' }
],
btn: [
// {
// // meter-review-entrust-pass-btn
// type: 'success',
// id: '',
// name: '分包信息登记'
// },
// // meter-review-entrust-back-btn
// {
// type: 'success',
// id: '',
// name: '取消分包'
// },
// {
// type: 'success',
// id: '',
// name: '分包出库'
// }
],
options: [
{
name: '检定'
},
{
name: '校准'
},
{
name: '外观检查'
}
],
formId: 'meterReviewSampleManageFormId',
showModal: false,
modalTitle: '管理样品',
selectIds: [],
selectData: [],
getPage: {},
pageColumns: [
{ title: '样品编号', key: 'code', width: 120 },
{ title: '样品名称', key: 'name', width: 140 },
{ title: '型号规格', key: 'spec', width: 140 },
{ title: '出厂编号', key: 'factoryNumber', width: 140 },
{ title: '是否分包', key: 'jobOut', width: 110 },
{ title: '分包费用', key: 'outFee', width: 110 },
{ title: '分包原因', key: 'outReason', width: 110 },
{ title: '分包方', key: 'subcontractor', width: 110 },
{ title: '检测类型', key: 'type', width: 140 },
{ title: '数量', key: 'quantity', width: 140 }
],
dateList: [],
formObj: {
entrustId: undefined,
name: undefined,
code: undefined,
type: undefined
}
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '取消分包':
this._subpackageCancelBtn()
break
case '分包出库':
this._outWarehouse()
break
case '分包信息登记':
this._batchEpiboly()
break
case '添加':
this._editModal(false)
break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
}
})
},
_subpackageCancelBtn() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const data = {}
data.ids = this.selectIds.join(',')
this._subpackageCancel(data)
}
},
_subpackageCancel: async function(data) {
console.log(data)
const result = await meterSample.subpackageCancel(data)
if (result) {
this.$Message.success('取消成功!')
await this._page()
}
},
_outWarehouse() {
if (this.selectData.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
for (let i = 0; i < this.selectData.length; i++) {
const obj = this.selectData[i]
if (obj.subcontractor === undefined) {
this.$Message.warning('请先填写分包信息在进行此操作!')
return false
}
}
this.$refs.OutWarehouseModal._open(this.selectIds, this.selectData)
}
},
_batchEpiboly() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this.$refs.batchEditModal._open(this.selectIds, this.selectData)
}
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
localStorage.setItem('type', data.type)
if (data.type === 2) {
this._editLY(data.id) // 粮油的编辑页
} else {
this._editModal(true, data.id)
}
break
case '复制':
this._copy(data.id, data.type)
break
case '删除':
this._deleteById(data.id)
break
case '检测项目':
this._itemDetail(data.id)
break
}
})
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectData':
const selectIds = []
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_open(id) {
this.formObj.entrustId = id
this.showModal = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterSample.pageSubpackageSampleQuery(this.formObj)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this.$store.dispatch('FoodSample/deleteByIds', ids).then(() => {
this._resultChange('删除成功!')
})
}
})
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(id) {
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(function() {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(this.$store.state.FoodSample.governModel)
})
})
},
_editModal(edit, id) {
this.currentComponent = 'FoodSampleGovernEdit'
this.$nextTick(function() {
if (edit) {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.contractId
)
})
} else {
this.$refs.refModal._open('', this.contractId)
}
})
},
_editLY(id) {
// 粮油的编辑
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$nextTick(function() {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.contractId
)
})
})
},
_search() {
this._page()
},
_searchParams() {
const data = this.$serialize('search-sample-govern')
return this.$extend(data, this.pageParams)
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this._page()
this.$Message.success(msg)
}
},
_copy(sampleId, type) {
this.$refs.refModal._open(sampleId, type)
},
// 复制样品
_copySample(data) {
if (data.type === 2) {
// 粮油的编辑页
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopySample(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleGovernEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopySample(
this.$store.state.FoodSample.governModel
)
})
})
}
},
_copyAll(data) {
if (data.type === 2) {
// 粮油的编辑页
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleGovernEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(
this.$store.state.FoodSample.governModel
)
})
})
}
},
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/government/import_' + this.contractId,
downloadUrl: '/food/v1/excel/template/FoodSampleGovernment',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds, this.selectData[0])
}
},
_importItemPackage() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds, 'batch-rel-package-item')
}
},
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_itemDetail(id) {
this.$refs.foodItem._open(id)
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</div> </div>
</Modal> </Modal>
<MeterSubSampleEdit ref="batchEditModal" @on-result-change="_page"></MeterSubSampleEdit> <MeterSubSampleEdit ref="batchEditModal" @on-result-change="_page"></MeterSubSampleEdit>
<SubOutWarehouse ref="OutWarehouseModal" ></SubOutWarehouse> <SubOutWarehouse ref="OutWarehouseModal" @on-result-change="_page"></SubOutWarehouse>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
</div> </div>
</div> </div>
<FileManage ref="FileManage"></FileManage> <FileManage ref="FileManage"></FileManage>
<subSampleManage ref="subSampleManage"></subSampleManage> <subSampleManage ref="subSampleManage" @on-result-change="_page"></subSampleManage>
<operationModal ref="operationModal"></operationModal> <operationModal ref="operationModal" @on-result-change="_page"></operationModal>
</div> </div>
</template> </template>
<script> <script>
...@@ -87,7 +87,6 @@ export default { ...@@ -87,7 +87,6 @@ export default {
name: '分包样品管理' name: '分包样品管理'
}, },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{ {
type: 'md-book', type: 'md-book',
id: '', id: '',
...@@ -103,6 +102,7 @@ export default { ...@@ -103,6 +102,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 }, { title: '详细地址', key: 'address', width: 250 },
...@@ -151,7 +151,7 @@ export default { ...@@ -151,7 +151,7 @@ export default {
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '分包样品管理': case '分包样品管理':
this.subSampleManage(data) this._subSampleManage(data)
break break
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
...@@ -171,7 +171,7 @@ export default { ...@@ -171,7 +171,7 @@ export default {
} }
}) })
}, },
subSampleManage(data) { _subSampleManage(data) {
// 管理样品 // 管理样品
this.$refs.subSampleManage._open(data.id) this.$refs.subSampleManage._open(data.id)
}, },
......
...@@ -6,29 +6,29 @@ ...@@ -6,29 +6,29 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="margin-top: 10px"> <Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:"> <Form-item class="search-item" label="实验室名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/> <Input v-model="formObj.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-item" label="资质:"> <Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/> <Input v-model="formObj.aptitude" name="aptitude" placeholder="请输入资质" clearable @on-enter="_formSearch"/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button type="primary" @click="_formSearch">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
class="contHide"></btn-list> @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!--表格--> <!--表格-->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox> :get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -45,43 +45,28 @@ ...@@ -45,43 +45,28 @@
</Row> </Row>
</div> </div>
</div> </div>
<MeterSubSampleManage ref="subSampleManage" @on-result-change="_page"></MeterSubSampleManage>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust, meterSubcontractor } from '../../../api' import { meterEntrust, meterSubcontractor } from '../../../api'
import MeterSubSampleManage from '../MeterSubSampleQuery'
export default { export default {
components: {}, components: { MeterSubSampleManage },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubpackageTaskHisFormId', formId: 'meterSubpackageTaskHisFormId',
searchOpen: false, searchOpen: false,
btn: [ btn: [],
{
type: 'success',
id: 'meter-subcontractor-add-btn',
name: '添加'
}
],
iconMsg: [ iconMsg: [
{ {
type: 'ios-clock', type: 'ios-beaker',
id: '',
name: '编辑'
},
{
type: 'ios-clock',
id: '', id: '',
name: '资质项目' name: '分包样品查询'
}, },
{ type: 'ios-clock', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' }
{ type: 'ios-clock', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
], ],
formObj: { formObj: {
name: undefined, name: undefined,
...@@ -92,6 +77,7 @@ export default { ...@@ -92,6 +77,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 }, { title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 }, { title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 }, { title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 }, { title: '详细地址', key: 'address', width: 250 },
...@@ -148,6 +134,9 @@ export default { ...@@ -148,6 +134,9 @@ export default {
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
break break
case '分包样品查询':
this._subSampleManage(data)
break
case '删除': case '删除':
this._deleteByIds([data.id]) this._deleteByIds([data.id])
break break
...@@ -157,14 +146,17 @@ export default { ...@@ -157,14 +146,17 @@ export default {
} }
}) })
}, },
_subSampleManage(data) {
// 分包样品查询
this.$refs.subSampleManage._open(data.id)
},
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.refModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
break break
...@@ -176,7 +168,7 @@ export default { ...@@ -176,7 +168,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj) const result = await meterEntrust.pageSubpackageEntrustHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="分包任务" name="wait"> <el-tab-pane label="分包任务" name="wait">
<MeterSubpackageTask ref="waitTabs"></MeterSubpackageTask> <MeterSubpackageTask ref="waitTabs"></MeterSubpackageTask>
</el-tab-pane> </el-tab-pane>
...@@ -28,6 +28,22 @@ export default { ...@@ -28,6 +28,22 @@ export default {
return { return {
activeName: 'wait' activeName: 'wait'
} }
},
mounted() {
this.activeName = 'wait'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this._page()
} else {
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.waitTabs._page()
}
} }
} }
</script> </script>
......
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
const result = await meterSample.subpackageOutStock(data) const result = await meterSample.subpackageOutStock(data)
if (result) { if (result) {
this.$Message.success('出库成功!') this.$Message.success('出库成功!')
this.showModal = false
this.$emit('on-result-change') this.$emit('on-result-change')
this._hideLoading() this._hideLoading()
} }
......
...@@ -32,6 +32,7 @@ import MeterContractAcceptedIndex from '../pages/meter-business/accepted/MeterCo ...@@ -32,6 +32,7 @@ import MeterContractAcceptedIndex from '../pages/meter-business/accepted/MeterCo
import MeterContractRegisterIndex from '../pages/meter-contract/contract-register/MeterContractRegisterIndex' import MeterContractRegisterIndex from '../pages/meter-contract/contract-register/MeterContractRegisterIndex'
import MeterContractReviewIndex from '../pages/meter-contract/contract-review/MeterContractReviewIndex' import MeterContractReviewIndex from '../pages/meter-contract/contract-review/MeterContractReviewIndex'
import MeterContractFileIndex from '../pages/meter-contract/contract-file/MeterContractFileIndex' import MeterContractFileIndex from '../pages/meter-contract/contract-file/MeterContractFileIndex'
import MeterSampleProgress from '../pages/meter-progress/progress-sample/MeterSampleProgress'
import Blank from '~/pages/blank' import Blank from '~/pages/blank'
export default [ export default [
{ {
...@@ -205,5 +206,16 @@ export default [ ...@@ -205,5 +206,16 @@ export default [
meta: { title: '' } meta: { title: '' }
} }
] ]
},
{
path: 'progress',
component: Blank,
children: [
{
path: 'sample_progress',
component: MeterSampleProgress,
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