Commit d234bf7b by lichengming

修改了试验任务分配

parent 9241ce6a
......@@ -8,5 +8,16 @@ import http from '../http'
export default {
// page
pageExpAllot: data =>
http.post('soil/v1/entrust/page_exp_allot', data).then(res => res)
http.post('soil/v1/entrust/page_exp_allot', data).then(res => res),
// 试验任务分配按样品分配分页列表
pageExpAllotSample: data =>
http.post('soil/v1/sample/page_exp_allot_sample', data).then(res => res),
// 试验任务按样品分配-试验项目分配操作
allotExp: data =>
http.post('soil/v1/experiment/allot_exp', data).then(res => res),
// 试验任务分配样品对应检测项目分页列表
pageAllot: data =>
http.post('soil/v1/experiment/page_allot', data).then(res => res),
pageExpTest: data =>
http.post('soil/v1/entrust/page_exp_test', data).then(res => res)
}
......@@ -261,7 +261,6 @@ export default {
if (this.hideCheckbox === undefined || this.hideCheckbox === false) {
const selData = data.selection
this.checkData = selData
console.log('checkData', this.checkData)
// 默认返回的是id数组
if (this.selectData === undefined) {
const idList = []
......
......@@ -124,6 +124,19 @@ export default {
this.$refs.userCheck._refresh()
this.$refs.marshalling._uidOpen(uid)
},
_openGoup(modalTitle, treeName) {
this.modalTitle = modalTitle
this.changeBool = false
this.showUserModal = true
this.titleChange = '用户编组'
if (treeName === undefined) {
this.treeName = 'userMan'
} else {
this.treeName = treeName
}
this.$refs.userCheck._refresh()
this.$refs.marshalling._open()
},
// 当前登录用户所处的组织
_getCurrentOrg: async function() {
const result = await sysOrg.getOrg()
......
......@@ -31,7 +31,7 @@
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange">
:get-page="getPage" @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -54,7 +54,7 @@
</el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div>
<div v-else-if="item.key==='progress'">
<div v-else-if="item.key==='status'">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.judged">
......@@ -119,6 +119,7 @@ export default {
components: {},
data() {
return {
formId: 'SampleItemManage',
currentComponent: '',
btn: [
{ type: 'success', id: '', name: '提交分包' },
......@@ -142,19 +143,13 @@ export default {
{ id: '', name: '关闭', type: 'primary' }
],
pageColumns: [
{ title: '项目类别', key: 'type', width: 160 },
{ title: '检测项目', key: 'name', width: 140 },
{ title: '子项目', key: 'sonItem', width: 140 },
{ title: '是否分包', key: 'epibolyItem' },
{ title: '方法', key: 'method', width: 180 },
{ title: '设备', key: 'device', width: 180 },
{ title: '检测依据', key: 'code', width: 180 },
{ title: '检测科室', key: 'groupName', width: 110 },
{ title: '比较符', key: 'compareSymbol', width: 100 },
{ title: '限值', key: 'limitValue' },
{ title: '单位', key: 'unit' },
{ title: '是否系统判定', key: 'judged', width: 120, judged: true },
{ title: '备注', key: 'remark' }
{ title: '试验名称', key: 'name', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType' },
{ title: '检测依据', key: 'testBasis', width: 180 },
{ title: '试验方法', key: 'testMethod', width: 180 },
{ title: '状态', key: 'status', width: 180 }
],
subOptions: [
{
......
......@@ -685,6 +685,7 @@ export default {
this.showModal = false
},
_open(formObj) {
this._getList()
this.showBtn = true
this.showModal = true
this.$refs.formObj.resetFields()
......@@ -702,6 +703,7 @@ export default {
}
},
_openEdit(formObj) {
this._getList()
this.showBtn = false
this.showModal = true
this.$refs.formObj.resetFields()
......@@ -723,7 +725,6 @@ export default {
// }
// }
},
_showTime(formObj) {
if (this.formObj.entrustDate === undefined) {
this.formObj.entrustDate = ''
......
......@@ -93,16 +93,6 @@ export default {
id: '',
name: '管理样品'
},
{
type: 'ios-list',
id: '',
name: '项目管理'
},
{
type: 'md-create',
id: '',
name: '编辑协议'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{
......
......@@ -29,6 +29,7 @@ export default {
return {
type: '',
contractId: '', // 合同id
entrustId: '',
showSampleModal: false,
modalTitle: '',
selectIds: [],
......@@ -58,7 +59,7 @@ export default {
},
// 待发放
_waitSend() {
this.$refs.waitScanModal._open()
this.$refs.waitScanModal._open(this.entrustId)
},
// 已接收
_issuedPage() {
......@@ -66,11 +67,13 @@ export default {
},
_changeTabs(tab, event) {
if (tab.name === 'alreadyIssued') {
this._issuedPage()
// this._issuedPage()
} else if (tab.name === 'waitReceive') {
// this._waitPage()
this.$refs.waitReceiveModal._open()
} else if (tab.name === 'waitScan') {
this._waitSend()
this.$refs.waitScanModal._open(this.entrustId)
// this._waitSend()
}
},
_search() {
......
......@@ -14,7 +14,7 @@
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 6px;"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
......@@ -59,7 +59,6 @@ export default {
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
btn: [{ id: '', name: '自动分配' }],
getPage: {},
pageColumns: [
{ title: '检测项目', key: 'name', width: 120 },
......@@ -139,7 +138,8 @@ export default {
}
},
_autoAssign() {
this.$refs.autoAssignModal._open()
console.log('自动分配')
// this.$refs.autoAssignModal._open()
// this.$store.dispatch('FoodItem/autoAllotNum').then(() => {
// const num = this.$store.state.FoodItem.count
// if (num !== undefined) {
......
......@@ -46,13 +46,15 @@
</PTVXETable>
</Col>
</Row>
<AssignPerson ref="personModal" @on-result-change="_page"></AssignPerson>
</div>
</template>
<script>
import Global from '../../../../../api/config'
import { soilTest } from '../../../../../api'
import AssignPerson from '../../../../../components/user-info-single/AssignPerson'
export default {
components: {},
components: { AssignPerson },
data() {
return {
// 定义表格名称----英文
......@@ -267,8 +269,9 @@ export default {
async _btnClick(msg) {
switch (msg) {
case '按人分配':
await this._reportDueDate()
await this._userAssign()
this._allotByPerson()
// await this._reportDueDate()
// await this._userAssign()
break
case '按组分配':
await this._reportDueDate()
......@@ -295,6 +298,10 @@ export default {
break
}
},
_allotByPerson() {
const user = Global.getUserInfo('userInfo')
this.$refs.personModal._openGoupByUserId('分配人员', user.id, 'itemTree')
},
// 信息维护
_maintainInfo() {
if (this.selectSampleIds.length === 0) {
......
......@@ -14,13 +14,13 @@
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
<btn-list @on-result-change="_btnClick" class="contHide" style="margin-bottom: 6px;"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :rows="100" select-data>
@on-result-change="_tableResultChange" :getPage="getPage" :rows="100">
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
......@@ -50,20 +50,23 @@ export default {
data() {
return {
currentComponent: '',
formObj: {},
formObj: {
entrustId: undefined
},
entrustId: '',
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
selectIds: [],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
btn: [{ id: '', name: '自动分配' }],
getPage: {},
pageColumns: [
{ title: '检测项目', key: 'name', width: 120 },
{ title: '检测依据', key: 'testBasis', width: 140 },
{ title: '检测依据名称', key: 'testBasisName', width: 200 }
{ title: '试样编号', key: 'sampleCode', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 140 },
{ title: '委托商', key: 'client', width: 200 }
]
}
},
......@@ -90,7 +93,8 @@ export default {
break
}
},
_open() {
_open(id) {
this.entrustId = id
this._page()
},
_searchParams() {
......@@ -101,7 +105,8 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageExpAllot(
this.formObj.entrustId = this.entrustId
const result = await soilTest.pageExpAllotSample(
this.$serializeForm(this.formObj)
)
if (result) {
......@@ -112,10 +117,14 @@ export default {
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
this._page()
break
case 'selectData':
this.$emit('on-result-change', data)
// case 'selectData':
// this.$emit('on-result-change', data)
// break
case 'selectIds':
this.selectIds = data
this.$emit('on-result-change', this.selectIds.join(','))
break
case 'changeSize':
this._page()
......
......@@ -35,6 +35,7 @@
</div>
<a v-else-if="item.key==='code'" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<a v-else-if="item.key==='num'" @click.stop="_sampleDetail(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.key==='status'">{{scope.row[item.key].display}}</span>
<span
v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.datetime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM'):''}}</span>
......@@ -46,13 +47,15 @@
</PTVXETable>
</Col>
</Row>
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
</div>
</template>
<script>
import Global from '../../../../../api/config'
import { soilTest } from '../../../../../api'
import AssignPerson from '../../../../../components/user-info-single/AssignPerson'
export default {
components: {},
components: { AssignPerson },
data() {
return {
// 定义表格名称----英文
......@@ -83,8 +86,7 @@ export default {
{ key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' }
],
btn: [
{ type: 'success', id: '', name: '按人分配' },
{ type: 'warning', id: '', name: '按组分配' },
{ type: 'success', id: '', name: '试验项目分配' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
......@@ -95,27 +97,16 @@ export default {
],
getPage: {},
pageColumns: [
{ title: '检测项目', key: 'name', width: 120, fixed: 'left' },
{ title: '样品编号', key: 'num', width: 180 },
{ title: '样品名称', key: 'sampleName', width: 140 },
{ title: '服务类型', key: 'serviceType', width: 160 },
{ title: '产品', key: 'subClass', width: 160 },
{ title: '计划完成时间', key: 'planEndDate', width: 120, date: true },
{ title: '应出报告日期', key: 'reportDueDate', width: 120, date: true },
{ title: '数据出具日期', key: 'resultDate', width: 120, date: true },
{ title: '检测依据', key: 'testBasis', width: 140 },
{ title: '检测依据名称', key: 'testBasisName', width: 200 },
{ title: '检测方法', key: 'testMethod', width: 260 },
{ title: '主检人', key: 'tester', width: 100 },
{ title: '检测科室', key: 'groupName', width: 150 },
{ title: '判定依据', key: 'judgeBasis', width: 140 },
{ title: '判定依据名称', key: 'judgeBasisName', width: 200 },
{ title: '接样日期', key: 'receiveDate', width: 100, date: true },
{ title: '项目备注', key: 'remark', width: 200 },
{ title: '样品备注', key: 'sampleRemark', width: 200 },
{ title: '委托备注', key: 'contractRemark', width: 200 }
{ title: '试验名称', key: 'name', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
{ title: '检测依据', key: 'testBasis', width: 180 },
{ title: '试验方法', key: 'testMethod', width: 180 },
{ title: '状态', key: 'status', width: 180 }
],
leftSelectData: [],
sampleIds: [],
selectIds: [], // 检测项目id
selectData: [], // 检测项目data
selectSampleIds: [], // 样品ids
......@@ -259,16 +250,15 @@ export default {
})
},
_resultChange(msg) {
if (this.$store.state.FoodItem.success) {
this.$Message.success(msg)
this._page()
}
this.$emit('on-result-change')
this.selectIds = []
},
async _btnClick(msg) {
switch (msg) {
case '按人分配':
await this._reportDueDate()
await this._userAssign()
case '试验项目分配':
this._userAssign()
break
case '按组分配':
await this._reportDueDate()
......@@ -317,7 +307,8 @@ export default {
}
},
_open(data) {
this.leftSelectData = data
this.getPage.records = []
this.sampleIds = data
if (data.length === 0) {
this.$set(this.getPage, 'records', [])
this.$set(this.getPage, 'total', 0)
......@@ -327,7 +318,7 @@ export default {
this.selectData = []
this.result = []
} else {
this._formSearch()
this._page()
}
},
_refresh() {
......@@ -346,10 +337,8 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilTest.pageExpAllot(
this.$serializeForm(this.formObj)
)
this.formObj.sampleIds = this.sampleIds
const result = await soilTest.pageAllot(this.$serializeForm(this.formObj))
if (result) {
this.$refs.pageTable._hideLoading()
this.$refs.pageTable._checkAll()
......@@ -388,37 +377,40 @@ export default {
},
// 按人分配 选人选时间
_userAssign() {
if (this.defaultPlanDate) {
// 有字典
if (this.sampleNames === '') {
// 有计划完成时间
const user = Global.getUserInfo('userInfo')
this.currentComponent = 'AssignPerson'
this.$nextTick(function() {
this.$refs.refModal._openGoupByUserId(
'分配人员',
user.id,
'itemTree'
)
})
} else {
// 有字典,无计划完成时间的
this.$Modal.confirm({
title: '提示',
content:
'所选项目中含有未设置计划完成时间的' +
`${this._reportDueDate()}` +
'请确认!',
onOk: () => {}
})
}
} else {
// 无字典
this.currentComponent = 'EndDateModal'
this.$nextTick(() => {
this._endDate()
})
}
console.log(user)
this.$refs.personModal._openGoup('分配人员', 'itemTree')
// if (this.defaultPlanDate) {
// // 有字典
// if (this.sampleNames === '') {
// // 有计划完成时间
// const user = Global.getUserInfo('userInfo')
// this.currentComponent = 'AssignPerson'
// this.$nextTick(function() {
// this.$refs.refModal._openGoupByUserId(
// '分配人员',
// user.id,
// 'itemTree'
// )
// })
// } else {
// // 有字典,无计划完成时间的
// this.$Modal.confirm({
// title: '提示',
// content:
// '所选项目中含有未设置计划完成时间的' +
// `${this._reportDueDate()}` +
// '请确认!',
// onOk: () => {}
// })
// }
// } else {
// // 无字典
// this.currentComponent = 'EndDateModal'
// this.$nextTick(() => {
// this._endDate()
// })
// }
},
// 遍历出计划时间为空的样品名
_reportDueDate() {
......@@ -500,6 +492,20 @@ export default {
})
})
},
_assignBackData(data) {
console.log(data)
const tempData = {}
tempData.ids = this.selectIds.join(',')
tempData.user = data.realname
tempData.userId = data.userId
this._allotItems(tempData)
},
_allotItems: async function(data) {
const result = await soilTest.allotExp(data)
if (result) {
this._resultChange('分配成功')
}
},
// 样品详情
_sampleDetail(data) {
this.$nextTick(function() {
......
......@@ -32,9 +32,8 @@ export default {
_rightResult() {
this.$refs.SampleleftModal._page()
},
_open() {
console.log('按样品分配')
this.$refs.SampleleftModal._open()
_open(id) {
this.$refs.SampleleftModal._open(id)
// this.$refs.rightModal._getColumn()
}
}
......
......@@ -14,6 +14,7 @@ import BackupsManage from '../pages/soil-sample-manage/backups-manage/SampleBack
import SampleTakeIndex from '../pages/soil-sample-manage/sample-take/SampleTakeIndex'
import SurplusManage from '../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex'
import TestTaskIndex from '../pages/soil-test-manage/test-task-manage/TestTaskIndex'
import TestInputIndex from '../pages/soil-test-manage/test-input/TestInputIndex'
import Blank from '~/pages/blank'
export default [
{
......@@ -84,7 +85,7 @@ export default [
},
{
path: 'do_test',
component: ExperimentItemManage,
component: TestInputIndex,
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