Commit 11229cc7 by wangweidong

整体优化

parent 8e038027
...@@ -146,6 +146,18 @@ export default { ...@@ -146,6 +146,18 @@ export default {
submitReceive: data => submitReceive: data =>
http.post('meter/v1/sample/submit_receive?ids=' + data).then(res => res), http.post('meter/v1/sample/submit_receive?ids=' + data).then(res => res),
taskTransfer: data =>
http
.post(
'meter/v1/sample/task_transfer?ids=' +
data.ids +
'&user=' +
data.user +
'&userId=' +
data.userId
)
.then(res => res),
reportCheckBack: data => reportCheckBack: data =>
http http
.post( .post(
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
@on-result-change="_btnClick"></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" :get-page="getPage" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :get-page="getPage" :icon-msg="iconMsg"
select-data @on-result-change="_tableResultChange"> select-data @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
...@@ -74,11 +74,7 @@ export default { ...@@ -74,11 +74,7 @@ export default {
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
iconMsg: [ iconMsg: [{ type: 'md-trash', id: '', name: '删除' }],
{ type: 'compose', id: '', name: '编辑' },
{ type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' },
{ type: 'trash-a', id: '', name: '删除' }
],
btn: [], btn: [],
options: [ options: [
{ {
...@@ -229,12 +225,18 @@ export default { ...@@ -229,12 +225,18 @@ export default {
title: '提示', title: '提示',
content: content || '确定删除该记录?', content: content || '确定删除该记录?',
onOk: () => { onOk: () => {
this.$store.dispatch('FoodSample/deleteByIds', ids).then(() => { this._delete(ids)
this._resultChange('删除成功!')
})
} }
}) })
}, },
_delete: async function(ids) {
const result = await meterItem.deleteById(ids)
if (result) {
await this._page()
this.$Message.success('删除成功!')
this.$emit('on-result-change')
}
},
_deleteById(id) { _deleteById(id) {
// 删除一条记录 // 删除一条记录
this._deleteByIds([id]) this._deleteByIds([id])
......
...@@ -60,16 +60,20 @@ ...@@ -60,16 +60,20 @@
<importModal ref="importModal" @on-result-change="_page"></importModal> <importModal ref="importModal" @on-result-change="_page"></importModal>
<MeterSampleManageEdit ref="sampleEditModal" @on-result-change="_page"></MeterSampleManageEdit> <MeterSampleManageEdit ref="sampleEditModal" @on-result-change="_page"></MeterSampleManageEdit>
<MeterSampleEdit ref="meterSampleEditModal" @on-result-change="_page"></MeterSampleEdit> <MeterSampleEdit ref="meterSampleEditModal" @on-result-change="_page"></MeterSampleEdit>
<DownloadTemplateImport ref="downloadTemplateImportModal" @on-result-change="_page" />
</div> </div>
</template> </template>
<script> <script>
import { meterSample } from '../../api' import { meterSample } from '../../api'
import DownloadTemplateImport from '../../components/import/DownloadTemplateImport'
import importModal from '../contract-tab/ContractTab' import importModal from '../contract-tab/ContractTab'
import MeterSampleManageEdit from './MeterItemManage' import MeterSampleManageEdit from './MeterItemManage'
import MeterSampleEdit from './MeterSampleEdit' import MeterSampleEdit from './MeterSampleEdit'
export default { export default {
components: { components: {
MeterSampleManageEdit, MeterSampleManageEdit,
DownloadTemplateImport,
MeterSampleEdit, MeterSampleEdit,
importModal importModal
// FoodSampleGovernDetail, // FoodSampleGovernDetail,
...@@ -352,11 +356,12 @@ export default { ...@@ -352,11 +356,12 @@ export default {
// 导入样品 // 导入样品
_importSample() { _importSample() {
const data = { const data = {
importUrl: '/meter/v1/sample/import_' + this.formObj.entrustId, importUrl:
'/meter/v1/sample/import_sample?entrustId=' + this.formObj.entrustId,
downloadUrl: '/meter/v1/excel/template/MeterSampleImport', downloadUrl: '/meter/v1/excel/template/MeterSampleImport',
title: '导入' title: '导入'
} }
this.$refs.refModal._open(data) this.$refs.downloadTemplateImportModal._open(data, '样品导入')
}, },
// 导入检测项目 // 导入检测项目
_importItem() { _importItem() {
......
...@@ -62,28 +62,36 @@ ...@@ -62,28 +62,36 @@
</div> </div>
</Modal> </Modal>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson> <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> </div>
</template> </template>
<script> <script>
import { meterSample } from '../../../api' import { meterSample } from '../../../api'
import assignPerson from '../../../components/user-info-single/assignPerson' import assignPerson from '../../../components/user-info-single/assignPerson'
import MeterItemManage from '../MeterItemManage'
import importModal from '../../contract-tab/ContractTab'
export default { export default {
components: { components: {
assignPerson assignPerson,
MeterItemManage,
importModal
}, },
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
iconMsg: [ iconMsg: [{ type: 'ios-beaker', id: '', name: '检测项目' }],
// { type: 'compose', id: '', name: '编辑' },
// { type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' },
// { type: 'trash-a', id: '', name: '删除' }
],
btn: [ btn: [
{ {
type: 'success', type: 'success',
id: '', id: '',
name: '分配任务' name: '分配任务'
},
{
type: 'success',
id: '',
name: '导入检测项目'
} }
], ],
searchOpen: false, searchOpen: false,
...@@ -107,6 +115,7 @@ export default { ...@@ -107,6 +115,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '样品编号', key: 'code', width: 120 }, { title: '样品编号', key: 'code', width: 120 },
{ title: '样品名称', key: 'name', width: 140 }, { title: '样品名称', key: 'name', width: 140 },
{ title: '检测项目', key: 'itemNames', width: 140 },
{ title: '型号规格', key: 'spec', width: 140 }, { title: '型号规格', key: 'spec', width: 140 },
{ title: '出厂编号', key: 'factoryNumber', width: 140 }, { title: '出厂编号', key: 'factoryNumber', width: 140 },
{ title: '是否分包', key: 'jobOut', width: 110 }, { title: '是否分包', key: 'jobOut', width: 110 },
...@@ -139,12 +148,12 @@ export default { ...@@ -139,12 +148,12 @@ export default {
case '分配任务': case '分配任务':
this._changePeople() this._changePeople()
break break
case '导入检测项目':
this._importTestItem()
break
case '添加': case '添加':
this._editModal(false) this._editModal(false)
break break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包': case '导入检测项目包':
this._importItemPackage() this._importItemPackage()
break break
...@@ -185,6 +194,16 @@ export default { ...@@ -185,6 +194,16 @@ export default {
this.$refs.userModal._open('salesman') 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) { _iconClick(res, data, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -204,7 +223,7 @@ export default { ...@@ -204,7 +223,7 @@ export default {
this._deleteById(data.id) this._deleteById(data.id)
break break
case '检测项目': case '检测项目':
this._itemDetail(data.id) this._itemManage(data.id)
break break
} }
}) })
...@@ -236,9 +255,12 @@ export default { ...@@ -236,9 +255,12 @@ export default {
_formSearch() { _formSearch() {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
_importBack() {
this.selectIds = []
this._page()
},
_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 meterSample.pageOutDistribute(this.formObj) const result = await meterSample.pageOutDistribute(this.formObj)
if (result) { if (result) {
this.getPage = result this.getPage = result
...@@ -404,8 +426,8 @@ export default { ...@@ -404,8 +426,8 @@ export default {
this.$refs.refModal._open(this.selectIds) this.$refs.refModal._open(this.selectIds)
} }
}, },
_itemDetail(id) { _itemManage(id) {
this.$refs.foodItem._open(id) this.$refs.itemManageModal._open(id)
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
......
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
</Row> </Row>
</div> </div>
</div> </div>
<FileManage ref="FileManage"></FileManage> <FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<MeterOutTaskAlloca ref="taskAllocaModal"></MeterOutTaskAlloca> <MeterOutTaskAlloca ref="taskAllocaModal" @on-result-change="_page"></MeterOutTaskAlloca>
<MeterOutTaskOperation ref="operationModal"></MeterOutTaskOperation> <MeterOutTaskOperation ref="operationModal" @on-result-change="_page"></MeterOutTaskOperation>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -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" select-data> :get-page="getPage" :icon-msg="iconMsg" select-data @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"
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
</Row> </Row>
</div> </div>
</div> </div>
<FileManage ref="FileManage"></FileManage> <FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<MeterPersonItemTaskManage ref="personModal"></MeterPersonItemTaskManage> <MeterPersonItemTaskManage ref="personModal" @on-result-change="_page"></MeterPersonItemTaskManage>
<personModal ref="personModal"></personModal> <personModal ref="personModal" @on-result-change="_taskTransferBack"></personModal>
<ListModal ref="ListModal" @on-result-change="_page"></ListModal> <ListModal ref="ListModal" @on-result-change="_page"></ListModal>
</div> </div>
</template> </template>
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
case '任务转发': case '任务转发':
this.$refs.personModal._open('salesman') this._taskGive()
break break
case '流转': case '流转':
this._sampleReceive() this._sampleReceive()
...@@ -161,6 +161,15 @@ export default { ...@@ -161,6 +161,15 @@ export default {
} }
}) })
}, },
_taskGive() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.personModal._open('salesman')
}
},
_sampleReceive() { _sampleReceive() {
const ids = this.selectIds const ids = this.selectIds
const selectData = this.selectData const selectData = this.selectData
...@@ -206,12 +215,6 @@ export default { ...@@ -206,12 +215,6 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '仪器领用':
this.$refs.InstruEdit._open()
break
case '车辆管理':
this.$refs.carEdit._open()
break
case '编辑': case '编辑':
// this._editModal(true, data.id) // this._editModal(true, data.id)
this._personModal(data) this._personModal(data)
...@@ -283,13 +286,30 @@ export default { ...@@ -283,13 +286,30 @@ 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 meterSample.pageSampleFlow(this.formObj) const result = await meterSample.pageSampleFlow(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
} }
}, },
_taskTransferBack(data, treeName) {
console.log('AAAA', data)
this._taskTransfer(data)
},
_taskTransfer: async function(data) {
const result = await meterSample.taskTransfer({
ids: this.selectIds,
userId: data.id,
user: data.realname
})
if (result) {
await this._page()
this.$Message.success('转发成功!')
}
},
_formSearch() { _formSearch() {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
......
...@@ -61,14 +61,22 @@ ...@@ -61,14 +61,22 @@
</div> </div>
</Modal> </Modal>
<assignPerson ref="userModal" is-change @on-result-change="_userData"></assignPerson> <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> </div>
</template> </template>
<script> <script>
import { meterSample } from '../../../api' import { meterSample } from '../../../api'
import assignPerson from '../../../components/user-info-single/assignPerson' import assignPerson from '../../../components/user-info-single/assignPerson'
import MeterItemManage from '../MeterItemManage'
import importModal from '../../contract-tab/ContractTab'
export default { export default {
components: { components: {
assignPerson assignPerson,
MeterItemManage,
importModal
// FoodSampleGovernDetail, // FoodSampleGovernDetail,
// CopyModal, // CopyModal,
// FoodSampleGovernLYEdits // FoodSampleGovernLYEdits
...@@ -85,11 +93,7 @@ export default { ...@@ -85,11 +93,7 @@ export default {
// {id: '', name: '复制历史样品检测项目', componentName: 'CopyHisItem'}, // {id: '', name: '复制历史样品检测项目', componentName: 'CopyHisItem'},
// {id: '', name: '删除'}, // {id: '', name: '删除'},
// ], // ],
iconMsg: [ iconMsg: [{ type: 'ios-beaker', id: '', name: '检测项目管理' }],
{ type: 'compose', id: '', name: '编辑' },
{ type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' },
{ type: 'trash-a', id: '', name: '删除' }
],
footerList: [ footerList: [
{ id: '', name: '关闭', type: '' }, { id: '', name: '关闭', type: '' },
{ id: '', name: '确定', type: 'primary' } { id: '', name: '确定', type: 'primary' }
...@@ -99,6 +103,11 @@ export default { ...@@ -99,6 +103,11 @@ export default {
type: 'success', type: 'success',
id: '', id: '',
name: '分配任务' name: '分配任务'
},
{
type: 'success',
id: '',
name: '导入检测项目'
} }
], ],
searchOpen: false, searchOpen: false,
...@@ -122,6 +131,7 @@ export default { ...@@ -122,6 +131,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '样品编号', key: 'code', width: 120 }, { title: '样品编号', key: 'code', width: 120 },
{ title: '样品名称', key: 'name', width: 140 }, { title: '样品名称', key: 'name', width: 140 },
{ title: '检测项目', key: 'itemNames', width: 140 },
{ title: '型号规格', key: 'spec', width: 140 }, { title: '型号规格', key: 'spec', width: 140 },
{ title: '出厂编号', key: 'factoryNumber', width: 140 }, { title: '出厂编号', key: 'factoryNumber', width: 140 },
{ title: '是否分包', key: 'jobOut', width: 110 }, { title: '是否分包', key: 'jobOut', width: 110 },
...@@ -161,6 +171,10 @@ export default { ...@@ -161,6 +171,10 @@ export default {
this.formObj.ctimeBegin = data[0] this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1] this.formObj.ctimeEnd = data[1]
}, },
_importBack() {
this.selectIds = []
this._page()
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -232,12 +246,15 @@ export default { ...@@ -232,12 +246,15 @@ export default {
case '删除': case '删除':
this._deleteById(data.id) this._deleteById(data.id)
break break
case '检测项目': case '检测项目管理':
this._itemDetail(data.id) this._itemManage(data.id)
break break
} }
}) })
}, },
_itemManage(id) {
this.$refs.itemManageModal._open(id)
},
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'selectData': case 'selectData':
...@@ -414,9 +431,10 @@ export default { ...@@ -414,9 +431,10 @@ export default {
// 导入检测项目 // 导入检测项目
_importItem() { _importItem() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!') this.$Message.warning('请选择至少一项数据!')
return false
} else { } else {
this.$refs.refModal._open(this.selectIds, this.selectData[0]) this.$refs.importModal._open(this.selectIds)
} }
}, },
_importItemPackage() { _importItemPackage() {
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
<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>
<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" @on-enter="_formSearch" name="entrustCode" 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>
...@@ -99,13 +99,14 @@ export default { ...@@ -99,13 +99,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: 180 },
{ 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 },
......
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