Commit 6f0ac2d3 by wangweidong

优化修改

parent e5235d8a
...@@ -28,6 +28,11 @@ export default { ...@@ -28,6 +28,11 @@ export default {
.post('meter/v1/entrust/page_distribute_entrust', data) .post('meter/v1/entrust/page_distribute_entrust', data)
.then(res => res), .then(res => res),
pageDistributeEntrustHis: data =>
http
.post('meter/v1/entrust/page_distribute_entrust_his', data)
.then(res => res),
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),
pageClientOnlineEntrust: data => pageClientOnlineEntrust: data =>
...@@ -42,6 +47,10 @@ export default { ...@@ -42,6 +47,10 @@ export default {
http http
.post('meter/v1/entrust/page_out_task_distribute', data) .post('meter/v1/entrust/page_out_task_distribute', data)
.then(res => res), .then(res => res),
pageOutTaskDistributeHis: data =>
http
.post('meter/v1/entrust/page_out_task_distribute_his', data)
.then(res => res),
pageEntrustReview: data => pageEntrustReview: data =>
http.post('meter/v1/entrust/page_review_entrust', data).then(res => res), http.post('meter/v1/entrust/page_review_entrust', data).then(res => res),
pageEntrustReceive: data => pageEntrustReceive: data =>
......
...@@ -20,7 +20,10 @@ export default { ...@@ -20,7 +20,10 @@ export default {
pageSampleDistribute: data => pageSampleDistribute: data =>
http.post('meter/v1/sample/page_sample_distribute', data).then(res => res), http.post('meter/v1/sample/page_sample_distribute', data).then(res => res),
pageSampleDistributeHis: data =>
http
.post('meter/v1/sample/page_sample_distribute_his', data)
.then(res => res),
pageSampleFlow: data => pageSampleFlow: data =>
http.post('meter/v1/sample/page_sample_flow', data).then(res => res), http.post('meter/v1/sample/page_sample_flow', data).then(res => res),
...@@ -47,6 +50,8 @@ export default { ...@@ -47,6 +50,8 @@ export default {
.then(res => res), .then(res => res),
pageOutDistribute: data => pageOutDistribute: data =>
http.post('meter/v1/sample/page_distribute', data).then(res => res), http.post('meter/v1/sample/page_distribute', data).then(res => res),
pageOutDistributeHis: data =>
http.post('meter/v1/sample/page_distribute_his', data).then(res => res),
pageOutPersonalTask: data => pageOutPersonalTask: data =>
http.post('meter/v1/sample/page_out_personal_task', data).then(res => res), http.post('meter/v1/sample/page_out_personal_task', data).then(res => res),
...@@ -171,6 +176,18 @@ export default { ...@@ -171,6 +176,18 @@ export default {
) )
.then(res => res), .then(res => res),
distributeAgain: data =>
http
.post(
'meter/v1/sample/distribute_again?ids=' +
data.ids +
'&user=' +
data.user +
'&userId=' +
data.userId
)
.then(res => res),
reportCheckBack: data => reportCheckBack: data =>
http http
.post( .post(
......
...@@ -6,24 +6,24 @@ ...@@ -6,24 +6,24 @@
<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.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/> <Input v-model="formObj.client" name="client" 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.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托单号" clearable/> <Input v-model="formObj.entrustCode" name="entrustCode" 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">
...@@ -77,6 +77,11 @@ export default { ...@@ -77,6 +77,11 @@ export default {
{ {
type: 'success', type: 'success',
id: '', id: '',
name: '提交评审'
},
{
type: 'success',
id: '',
name: '提交' name: '提交'
} }
], ],
...@@ -143,15 +148,39 @@ export default { ...@@ -143,15 +148,39 @@ export default {
case '添加': case '添加':
this._editModal(false) this._editModal(false)
break break
case '提交': case '提交评审':
this._submitToReview() this._submitToReview()
break break
case '提交':
this._submitToSkipReview()
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}) })
}, },
_submitToSkipReview() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要提交 ' + ids.length + ' 条记录?',
onOk: () => {
this._subToSkipRe(ids)
}
})
}
},
_subToSkipRe: async function(ids) {
const result = await meterEntrust.submitSkipReview(ids)
if (result) {
this._resultChange('提交成功')
}
},
_submitToReview() { _submitToReview() {
this._submitByContractIds('委托评审') this._submitByContractIds('委托评审')
}, },
...@@ -164,15 +193,20 @@ export default { ...@@ -164,15 +193,20 @@ export default {
title: '提示', title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?', content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => { onOk: () => {
const result = meterEntrust.submit(ids) this._submitOutReview(ids)
if (result) {
this.$Message.warning('提交成功!')
this._page()
}
} }
}) })
} }
}, },
_submitOutReview: async function(ids) {
const result = await meterEntrust.submit(ids)
if (result) {
this.$Message.warning('提交成功!')
await this._page()
}
},
_sampleManage(data) { _sampleManage(data) {
// 管理样品 // 管理样品
this.$refs.meterSampleManageModal._open(data) this.$refs.meterSampleManageModal._open(data)
......
...@@ -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: '', origin: undefined,
contractId: '' entrustId: ''
} }
} }
}, },
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
methods: { methods: {
_open(contractId) { _open(contractId) {
this.showModal = true this.showModal = true
this.formObj.contractId = contractId this.formObj.entrustId = contractId
this.formObj.origin = '' this.formObj.origin = ''
this._page() this._page()
}, },
......
...@@ -34,7 +34,9 @@ ...@@ -34,7 +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>{{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-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
...@@ -109,6 +111,7 @@ export default { ...@@ -109,6 +111,7 @@ export default {
{ 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: 'entrustCode', width: 120 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ 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 },
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
], ],
formObj: { formObj: {
origin: '', origin: '',
contractId: '' entrustId: ''
} }
} }
}, },
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
methods: { methods: {
_open(contractId) { _open(contractId) {
this.showModal = true this.showModal = true
this.formObj.contractId = contractId this.formObj.entrustId = contractId
this.formObj.origin = '' this.formObj.origin = ''
this._page() this._page()
}, },
......
<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.status">{{scope.row[item.key].display}}</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-else-if="scope.row[item.key]===1">
校准
</span>
<span v-else-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>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson>
<MeterItemManage ref="itemManageModal" @on-result-change="_page"></MeterItemManage>
<importModal ref="importModal" @on-result-change="_importBack"></importModal>
</div>
</template>
<script>
import { meterSample } from '../../../api'
import assignPerson from '../../../components/user-info-single/assignPerson'
import MeterItemManage from '../MeterItemManage'
import importModal from '../../contract-tab/ContractTab'
export default {
components: {
assignPerson,
MeterItemManage,
importModal
},
data() {
return {
currentComponent: '',
iconMsg: [{ type: 'ios-beaker', id: '', name: '检测项目' }],
btn: [
{
type: 'success',
id: '',
name: '任务重新分配'
},
{
type: 'success',
id: '',
name: '导入检测项目'
}
],
searchOpen: false,
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: 'testUser', width: 130 },
{ title: '状态', key: 'progress', width: 130, status: true },
{ title: '检测项目', key: 'itemNames', 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: {
_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._changePeople()
break
case '导入检测项目':
this._importTestItem()
break
case '添加':
this._editModal(false)
break
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
}
})
},
_userData(data, msg) {
if (msg === 'salesman') {
this._distributeSample(data)
}
},
_distributeSample: async function(data) {
const userId = data.id
const realname = data.realname
const ids = this.selectIds
const result = await meterSample.distributeAgain({
ids: ids,
userId: userId,
user: realname
})
if (result) {
this.$Message.success('分配成功!')
await this._page()
this.$emit('on-result-change')
}
},
_changePeople() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一项数据!')
return false
} else {
this.$refs.userModal._open('salesman')
}
},
_importTestItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一项数据!')
return false
} else {
this.$refs.importModal._open(this.selectIds)
}
},
_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._itemManage(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) {
console.log(id)
this.formObj.entrustId = id
this.showModal = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_importBack() {
this.selectIds = []
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterSample.pageOutDistributeHis(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)
}
},
_itemManage(id) {
this.$refs.itemManageModal._open(id)
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
...@@ -90,12 +90,13 @@ export default { ...@@ -90,12 +90,13 @@ export default {
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 140 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ 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: 'address', width: 250 }, { title: '详细地址', key: 'address', width: 250 },
{ title: '邮编', key: 'postcode' }, { title: '邮编', key: 'postcode', width: 110 },
{ title: 'E-mail', key: 'email', width: 120 }, { title: 'E-mail', key: 'email', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 }, { title: '委托日期', key: 'edate', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 }, { title: '费用合计', key: 'fee', width: 120 },
......
...@@ -6,24 +6,24 @@ ...@@ -6,24 +6,24 @@
<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>
<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.entrustCode" name="entrustCode" 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">
...@@ -45,42 +45,38 @@ ...@@ -45,42 +45,38 @@
</Row> </Row>
</div> </div>
</div> </div>
<FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<MeterOutTaskAlloca ref="taskAllocaModal" @on-result-change="_page"></MeterOutTaskAlloca>
<MeterOutTaskOperation ref="operationModal" @on-result-change="_page"></MeterOutTaskOperation>
</div> </div>
</template> </template>
<script> <script>
import { meterEntrust } from '../../../api' import { meterEntrust } from '../../../api'
import MeterOutTaskAlloca from './MeterOutTaskAllocaHis'
import MeterOutTaskOperation from './MeterOutTaskOperation'
export default { export default {
components: {}, components: {
MeterOutTaskAlloca,
MeterOutTaskOperation
},
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [],
{
type: 'success',
id: 'meter-go-out-entrust-add-btn',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-btn',
name: '提交'
}
],
iconMsg: [ iconMsg: [
// {
// type: 'md-create',
// id: '',
// name: '编辑'
// },
{ {
type: 'md-create', type: 'ios-contact',
id: '', id: '',
name: '编辑' name: '任务分配'
},
{
type: 'ios-beaker',
id: '',
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: '',
...@@ -88,13 +84,14 @@ export default { ...@@ -88,13 +84,14 @@ export default {
} }
], ],
formObj: { formObj: {
name: undefined, client: undefined,
aptitude: undefined entrustCode: undefined
}, },
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '委托单位', key: 'client', width: 200 }, { title: '委托单位', key: 'client', width: 140 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ 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 },
...@@ -161,6 +158,9 @@ export default { ...@@ -161,6 +158,9 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '任务分配':
this._taskAllocaModal(data)
break
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
...@@ -179,8 +179,12 @@ export default { ...@@ -179,8 +179,12 @@ export default {
} }
}) })
}, },
_taskAllocaModal(data) {
// 管理样品
this.$refs.taskAllocaModal._open(data.id)
},
_record(id) { _record(id) {
this.$refs.refModal._open(id) this.$refs.operationModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
...@@ -201,7 +205,7 @@ export default { ...@@ -201,7 +205,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.pageGoOutEntrust(this.formObj) const result = await meterEntrust.pageOutTaskDistributeHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -237,7 +241,7 @@ export default { ...@@ -237,7 +241,7 @@ export default {
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.refModal._open(id, 'subcontractorId') this.$refs.FileManage._open(id, 'subcontractorId')
}, },
_getById: async function(id) { _getById: async function(id) {
const result = await meterEntrust.getVOById(id) const result = await meterEntrust.getVOById(id)
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
], ],
formObj: { formObj: {
origin: '', origin: '',
contractId: '' entrustId: ''
} }
} }
}, },
...@@ -77,8 +77,8 @@ export default { ...@@ -77,8 +77,8 @@ export default {
methods: { methods: {
_open(contractId) { _open(contractId) {
this.showModal = true this.showModal = true
this.formObj.contractId = contractId this.formObj.entrustId = contractId
this.formObj.origin = '' this.formObj.origin = undefined
this._page() this._page()
}, },
_page: async function() { _page: async function() {
......
<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.status">{{scope.row[item.key].display}}</div>
<div v-else-if="item.key==='jobOut'">
{{scope.row[item.key]===1?'是':'否'}}
</div>
<div v-else-if="item.key==='type'">
<Select v-model="scope.row.type">
<Option v-for="(item,index) in options" :key="item.name" :value="index">
{{ item.name }}
</Option>
</Select>
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson>
<MeterItemManage ref="itemManageModal" @on-result-change="_page"></MeterItemManage>
<importModal ref="importModal" @on-result-change="_importBack"></importModal>
</div>
</template>
<script>
import { meterSample } from '../../../api'
import assignPerson from '../../../components/user-info-single/assignPerson'
import MeterItemManage from '../MeterItemManage'
import importModal from '../../contract-tab/ContractTab'
export default {
components: {
assignPerson,
MeterItemManage,
importModal
// FoodSampleGovernDetail,
// CopyModal,
// FoodSampleGovernLYEdits
},
data() {
return {
currentComponent: '',
// 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: 'ios-beaker', id: '', name: '检测项目管理' }],
footerList: [
{ id: '', name: '关闭', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
btn: [
{
type: 'success',
id: '',
name: '任务重新分配'
},
{
type: 'success',
id: '',
name: '导入检测项目'
}
],
searchOpen: false,
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: 'testUser', width: 130 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '检测项目', key: 'itemNames', 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: {
_footerResult(name) {
switch (name) {
case '关闭':
this._cancel()
break
case '确定':
this._cancel()
break
}
},
_cancel() {
this.showModal = false
this.$emit('on-result-change')
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_importBack() {
this.selectIds = []
this._page()
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '任务重新分配':
this._changePeople()
break
case '添加':
this._editModal(false)
break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
}
})
},
_userData(data, msg) {
if (msg === 'salesman') {
this._distributeSample(data)
}
},
_distributeSample: async function(data) {
const userId = data.id
const realname = data.realname
const ids = this.selectIds
const result = await meterSample.distributeAgain({
ids: ids,
userId: userId,
user: realname
})
if (result) {
this.$Message.success('分配成功!')
await this._page()
}
},
_changePeople() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一项数据!')
return false
} else {
this.$refs.userModal._open('salesman')
}
},
_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._itemManage(data.id)
break
}
})
},
_itemManage(id) {
this.$refs.itemManageModal._open(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) {
console.log(id)
this.formObj.entrustId = id
this.showModal = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterSample.pageSampleDistributeHis(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('请选择至少一项数据!')
return false
} else {
this.$refs.importModal._open(this.selectIds)
}
},
_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>
...@@ -65,19 +65,19 @@ export default { ...@@ -65,19 +65,19 @@ export default {
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterTaskDistributeFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [
{ // {
type: 'success', // type: 'success',
id: 'meter-go-out-entrust-add-btn', // id: '',
name: '添加' // name: '添加'
}, // },
{ // {
type: 'success', // type: 'success',
id: 'meter-go-out-entrust-submit-btn', // id: '',
name: '提交' // name: '提交'
} // }
], ],
iconMsg: [ iconMsg: [
// { // {
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
</div> </div>
<FileManage ref="FileManage"></FileManage> <FileManage ref="FileManage"></FileManage>
<MeterOutTaskAlloca ref="taskAllocaModal" @on-result-change="_page"></MeterOutTaskAlloca> <MeterTaskAlloca ref="taskAllocaModal" @on-result-change="_page"></MeterTaskAlloca>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit> <MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<MeterOutTaskOperation ref="operationModal"></MeterOutTaskOperation> <MeterOutTaskOperation ref="operationModal"></MeterOutTaskOperation>
</div> </div>
...@@ -54,30 +54,30 @@ ...@@ -54,30 +54,30 @@
<script> <script>
import { meterEntrust } from '../../../api' import { meterEntrust } from '../../../api'
import MeterSubcontractorEdit from './MeterTestEdit' import MeterSubcontractorEdit from './MeterTestEdit'
import MeterOutTaskAlloca from './MeterTaskAlloca' import MeterTaskAlloca from './MeterTaskAllocaHis'
import MeterOutTaskOperation from './MeterTaskOperation' import MeterOutTaskOperation from './MeterTaskOperation'
export default { export default {
components: { components: {
MeterSubcontractorEdit, MeterSubcontractorEdit,
MeterOutTaskAlloca, MeterTaskAlloca,
MeterOutTaskOperation MeterOutTaskOperation
}, },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: true,
btn: [ btn: [
{ // {
type: 'success', // type: 'success',
id: 'meter-go-out-entrust-add-btn', // id: 'meter-go-out-entrust-add-btn',
name: '添加' // name: '添加'
}, // },
{ // {
type: 'success', // type: 'success',
id: 'meter-go-out-entrust-submit-btn', // id: 'meter-go-out-entrust-submit-btn',
name: '提交' // name: '提交'
} // }
], ],
iconMsg: [ iconMsg: [
// { // {
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
{ {
type: 'ios-contact', type: 'ios-contact',
id: '', id: '',
name: '任务分配' name: '任务分配历史'
}, },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
// { type: 'md-remove-circle', id: '', name: '删除' }, // { type: 'md-remove-circle', id: '', name: '删除' },
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '任务分配': case '任务分配历史':
this._taskAllocaModal(data) this._taskAllocaModal(data)
break break
case '编辑': case '编辑':
...@@ -219,8 +219,7 @@ export default { ...@@ -219,8 +219,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.pageDistributeEntrustHis(this.formObj)
const result = await meterEntrust.pageDistributeEntrust(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
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