Commit e185ebd6 by zhangmengqi

Merge branch 'dev'

parents 16bf0da5 57a2dc8e
......@@ -354,6 +354,12 @@ export default {
}
const result = await soilSample.queryUserList(query)
if (result) {
for (let i = 0; i < result.records.length; i++) {
console.log('---records---', result.records[i])
result.records[i].realname =
result.records[i].realname + result.records[i].mobile
this.projectLeaderName.push(result.records[i].realname)
}
this.projectLeaderData = result.records
}
},
......
......@@ -108,8 +108,8 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-cloud', name: '项目报告' },
// { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'md-image', name: '项目报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' }
]
......
......@@ -87,7 +87,12 @@
<script>
// eslint-disable-next-line import/named
import { soilReport, soilStatistics } from '../../../../api'
import {
soilEntrust,
soilReport,
soilSample,
soilStatistics
} from '../../../../api'
import global from '../../../../api/config'
import OperationModal from '../../../../components/operation/Operation'
export default {
......@@ -124,10 +129,11 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
// { id: '', type: 'pt-a-view', name: '预览PDF' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
{ id: '', type: 'md-image', name: '预览报告' },
// { id: '', type: 'ios-cloud', name: '项目报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' },
{ id: '', type: 'md-trash', name: '删除' }
]
}
},
......@@ -283,6 +289,25 @@ export default {
case '操作日志':
this._record(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
// 没有生成pdf先生成在预览
......@@ -311,12 +336,13 @@ export default {
this.$refs.operationModal._open(id)
},
_getObjectKey: async function(data) {
const result = await soilStatistics.getObjectKey(data.id)
const result = await soilSample.getReport(data.id)
if (result) {
this.$openWindowModeless({
objectKey: result,
objectKey: result.objectKey,
id: data.id,
isReport: 0
isReport: 4,
idType: 11
})
}
},
......@@ -359,6 +385,9 @@ export default {
this.selectIds.push(this.selectData[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
default:
this._page()
}
......
......@@ -108,8 +108,8 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-cloud', name: '项目报告' },
// { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'md-image', name: '项目报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' }
]
......
......@@ -108,8 +108,8 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-cloud', name: '项目报告' },
// { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'md-image', name: '项目报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' }
]
......
......@@ -87,7 +87,12 @@
<script>
// eslint-disable-next-line import/named
import { soilReport, soilStatistics } from '../../../../api'
import {
soilEntrust,
soilReport,
soilSample,
soilStatistics
} from '../../../../api'
import global from '../../../../api/config'
import OperationModal from '../../../../components/operation/Operation'
export default {
......@@ -124,10 +129,11 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
// { id: '', type: 'pt-a-view', name: '预览PDF' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
{ id: '', type: 'md-image', name: '预览报告' },
// { id: '', type: 'ios-cloud', name: '项目报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' },
{ id: '', type: 'md-trash', name: '删除' }
]
}
},
......@@ -283,6 +289,25 @@ export default {
case '操作日志':
this._record(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
// 没有生成pdf先生成在预览
......@@ -311,12 +336,13 @@ export default {
this.$refs.operationModal._open(id)
},
_getObjectKey: async function(data) {
const result = await soilStatistics.getObjectKey(data.id)
const result = await soilSample.getReport(data.id)
if (result) {
this.$openWindowModeless({
objectKey: result,
objectKey: result.objectKey,
id: data.id,
isReport: 0
isReport: 4,
idType: 11
})
}
},
......@@ -359,6 +385,9 @@ export default {
this.selectIds.push(this.selectData[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
default:
this._page()
}
......
......@@ -108,8 +108,8 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-cloud', name: '项目报告' },
// { id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'md-image', name: '项目报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' }
]
......
......@@ -87,7 +87,12 @@
<script>
// eslint-disable-next-line import/named
import { soilReport, soilStatistics } from '../../../../api'
import {
soilEntrust,
soilReport,
soilSample,
soilStatistics
} from '../../../../api'
import global from '../../../../api/config'
import OperationModal from '../../../../components/operation/Operation'
export default {
......@@ -124,10 +129,10 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
// { id: '', type: 'pt-a-view', name: '预览PDF' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
{ id: '', type: 'md-image', name: '预览报告' },
{ id: '', type: 'ios-cloud', name: '附件' },
{ id: '', type: 'ios-clock', name: '操作日志' },
{ id: '', type: 'md-trash', name: '删除' }
]
}
},
......@@ -283,6 +288,25 @@ export default {
case '操作日志':
this._record(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
// 没有生成pdf先生成在预览
......@@ -311,12 +335,13 @@ export default {
this.$refs.operationModal._open(id)
},
_getObjectKey: async function(data) {
const result = await soilStatistics.getObjectKey(data.id)
const result = await soilSample.getReport(data.id)
if (result) {
this.$openWindowModeless({
objectKey: result,
objectKey: result.objectKey,
id: data.id,
isReport: 0
isReport: 4,
idType: 11
})
}
},
......@@ -359,6 +384,9 @@ export default {
this.selectIds.push(this.selectData[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
default:
this._page()
}
......
......@@ -71,7 +71,7 @@
<script>
// eslint-disable-next-line import/named
import { soilReport, soilStatistics } from '../../../../api'
import { soilEntrust, soilReport, soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import OperationModal from '../../../../components/operation/Operation'
export default {
......@@ -108,9 +108,13 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
{ type: 'md-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
},
{ id: '', type: 'md-trash', name: '删除' }
]
}
},
......@@ -263,6 +267,25 @@ export default {
case '操作日志':
this._record(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_record(id) {
......@@ -321,6 +344,9 @@ export default {
this.selectIds.push(this.selectData[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
default:
this._page()
}
......
......@@ -87,7 +87,7 @@
<script>
// eslint-disable-next-line import/named
import { soilReport, soilStatistics } from '../../../../api'
import { soilEntrust, soilReport, soilStatistics } from '../../../../api'
import global from '../../../../api/config'
import OperationModal from '../../../../components/operation/Operation'
export default {
......@@ -124,10 +124,13 @@ export default {
selectIds: [],
selectData: [],
iconMsg: [
{ id: '', type: 'pt-a-view', name: '预览报告' },
// { id: '', type: 'pt-a-view', name: '预览PDF' },
{ id: '', type: 'pt-a-cloud', name: '附件' },
{ id: '', type: 'pt-a-clock', name: '操作日志' }
{ type: 'md-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
},
{ id: '', type: 'md-trash', name: '删除' }
]
}
},
......@@ -283,6 +286,25 @@ export default {
case '操作日志':
this._record(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
// 没有生成pdf先生成在预览
......@@ -359,6 +381,9 @@ export default {
this.selectIds.push(this.selectData[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
default:
this._page()
}
......
......@@ -72,7 +72,7 @@
</template>
<script>
import UserInfo from '../../../components/user-info-single/assignPerson'
import { soilReport } from '../../../api'
import { soilEntrust, soilReport } from '../../../api'
import Operation from '../../../components/operation/Operation'
export default {
// eslint-disable-next-line vue/no-unused-components
......@@ -95,6 +95,11 @@ export default {
type: 'ios-clock',
id: '',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
name: '删除'
}
],
getPage: {},
......@@ -361,9 +366,28 @@ export default {
case '操作日志':
this._operationRecord(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
})
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, name)
},
......
......@@ -100,18 +100,8 @@ export default {
selectIds: []
}
},
computed: {
// tableHeight: function() {
// if (this.searchOpen) {
// return this.$newTableHeight('search')
// } else {
// return this.$newTableHeight('noSearch')
// }
// }
},
computed: {},
mounted() {
// this._contHide()
// this._classTree()
this._page()
},
methods: {
......
......@@ -52,6 +52,12 @@
placeholder="请输入模板样品数"
/>
</Form-item>
<Form-item label="多sheet模板" prop="moreSheet" style="width: 100%">
<Radio-group v-model="formObj.moreSheet">
<Radio v-for="item in sheetType" :key="item.value" :label="item.value">{{item.name}}</Radio>
</Radio-group>
</Form-item>
</Form>
</div>
<div slot="footer" class="btn-width clearfix">
......@@ -68,6 +74,7 @@
import { soilAptitude } from '../../../api'
const defVal = {
moreSheet: undefined,
alias: undefined,
classType: undefined,
dataTotalRow: undefined,
......@@ -123,6 +130,7 @@ export default {
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
sheetType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
typeList: [
{
value: '力学'
......@@ -207,6 +215,7 @@ export default {
this.formObj.sampleBeginCol = data.sampleBeginCol
this.formObj.sampleMergerNum = data.sampleMergerNum
this.formObj.templateSampleNum = data.templateSampleNum
this.formObj.moreSheet = data.moreSheet
this.modalTitle = '编辑模板'
console.log(this.id)
},
......
......@@ -69,7 +69,7 @@
</template>
<script>
import UserInfo from '../../../components/user-info-single/assignPerson'
import { soilTest } from '../../../api'
import { soilEntrust, soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from './SoilSampleManageHis'
export default {
......@@ -93,6 +93,11 @@ export default {
type: 'ios-clock',
id: '',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
name: '删除'
}
],
getPage: {},
......@@ -357,9 +362,28 @@ export default {
case '操作日志':
this._operationRecord(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
})
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_editModal(id, type, name) {
this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
......
......@@ -6,21 +6,21 @@
<Form id="task-assign-item-right" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable></Input>
<Input v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable @on-enter="_formSearch"></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
<btn-list :msg="btn" class="contHide" @on-result-change="_btnClick"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :icon-msg="iconMsg" :table-name="tableName" is-task select-data>
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" :table-name="tableName" is-task select-data @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
......@@ -41,8 +41,8 @@
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol>
<VXESettingCol slot="setting" :page-columns="pageColumns" :user-columns="userColumns"
:table-name="tableName" @on-result-change="_resetColumn"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
......@@ -316,13 +316,6 @@ export default {
this._userResult(data)
}
break
case 'EndDateModal':
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this._page()
// }
break
case 'UserGroup':
this._userGroupResult(data)
break
......@@ -348,35 +341,12 @@ export default {
}
})
},
// 设置时间
_endDate() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const user = Global.getUserInfo('userInfo')
this.currentComponent = 'AssignPerson'
this.$nextTick(function() {
this.$refs.refModal._openGoupByUserId('分配人员', user.id, 'itemTree')
})
}
},
// 调整分组
_userGroupResult(data) {
const tempData = {
groupId: data.id,
groupName: data.name,
ids: this.selectIds.join(',')
}
this.$store.dispatch('FoodItem/adjustTestGroup', tempData).then(() => {
this._resultChange('调整成功')
})
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
this.$emit('on-result-change')
},
async _btnClick(msg) {
_btnClick(msg) {
switch (msg) {
case '按人分配':
this._allotByPerson()
......@@ -395,10 +365,6 @@ export default {
case '填写原始记录':
this._addRecord()
break
case '按组分配':
await this._reportDueDate()
await this._groupAssign()
break
case '调整分组':
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择=一条数据')
......@@ -409,15 +375,6 @@ export default {
})
}
break
case '设置计划完成时间':
this.currentComponent = 'EndDateModal'
this.$nextTick(function() {
this._changeDate()
})
break
case '信息维护':
this._maintainInfo()
break
}
},
_submitToMake() {
......@@ -575,37 +532,6 @@ export default {
const user = Global.getUserInfo('userInfo')
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() {
......@@ -631,87 +557,6 @@ export default {
this.$refs.refModal._open(tempData, 'user')
})
},
// 按组分配 选时间
_groupAssign() {
if (this.defaultPlanDate) {
// 有字典
if (this.sampleNames === '') {
// 有计划完成时间
const tempData = {
ids: this.selectIds.join(',')
}
Object.assign(tempData, { planDate: null })
this.$store.dispatch('FoodItem/groupAllot', tempData).then(() => {
if (this.$store.state.FoodItem.success) {
this.$Message.success('分配成功!')
this._page()
}
})
} else {
// 有字典,无计划完成时间
this.$Modal.confirm({
title: '提示',
content:
'所选项目中含有未设置计划完成时间的' +
`${this._reportDueDate()}` +
'请确认!',
onOk: () => {}
})
}
} else {
// 无字典的
// eslint-disable-next-line no-lonely-if
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const tempData = {
ids: this.selectIds.join(',')
}
this.currentComponent = 'EndDateModal'
this.$nextTick(function() {
this.$refs.refModal._open(tempData, 'group')
})
}
}
},
// 委托详情
_detailModal(data) {
this.$store.dispatch('FoodContract/getById', data.contractId).then(() => {
if (data.type === 1) {
this.currentComponent = 'FoodContractGovernDetail'
} else {
this.currentComponent = 'FoodContractCompanyDetail'
}
this.$nextTick(function() {
this.$refs.refModal._open(this.$store.state.FoodContract.model)
})
})
},
// 样品详情
_sampleDetail(data) {
this.$nextTick(function() {
if (data.type === 1) {
this.currentComponent = 'FoodSampleGovernDetail'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel
)
})
} else {
this.currentComponent = 'FoodSampleCompanyDetail'
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel
)
})
}
this.$refs.refModal._open(data.sampleId)
})
},
_clearAll() {
this.getPage.records = []
this.selectIds = []
......
......@@ -69,7 +69,7 @@
</template>
<script>
import UserInfo from '../../../components/user-info-single/assignPerson'
import { soilTest } from '../../../api'
import { soilEntrust, soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from './SoilSampleManageHis'
export default {
......@@ -93,6 +93,11 @@ export default {
type: 'ios-clock',
id: '',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
name: '删除'
}
],
getPage: {},
......@@ -353,9 +358,28 @@ export default {
case '操作日志':
this._operationRecord(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
})
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_editModal(id, type, name) {
this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
......
......@@ -258,28 +258,6 @@ export default {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 从字典查预警期
_dicSearch() {
const data = ['食品检测预警天数', '食品默认计划完成时间']
this.$store.dispatch('LmsBaseDict/listDict', data).then(() => {
const result = this.$store.state.LmsBaseDict.list
// eslint-disable-next-line camelcase
const result_1 = result[0]
// eslint-disable-next-line camelcase
const result_2 = result[1]
// 1食品检测预警天数
if (result_1.length !== 0) {
this.warningValue = result_1[0].name
}
// 2食品默认计划完成时间
this.defaultPlanDate =
result_2.length !== 0
? result_2[0].name === '是'
? (this.defaultPlanDate = true)
: (this.defaultPlanDate = false)
: (this.defaultPlanDate = false)
})
},
_selInputResult1(msg, data) {
switch (msg) {
case 'keyword':
......@@ -310,11 +288,7 @@ export default {
}
break
case 'EndDateModal':
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this._page()
// }
break
case 'UserGroup':
this._userGroupResult(data)
......@@ -323,47 +297,6 @@ export default {
this._page()
}
},
// 为 true时,有字典按人分配
_trueDefault(data) {
const tempData = {
ids: this.selectIds.join(','),
personId: data.userId,
personName: data.realname,
groupId: data.groupId,
groupName: data.groupName
}
Object.assign(tempData, { planDate: null })
this.$store.dispatch('FoodItem/personAllot', tempData).then(() => {
if (this.$store.state.FoodItem.success) {
this.sampleNames = ''
this._page()
this._resultChange('分配成功!')
}
})
},
// 设置时间
_endDate() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const user = Global.getUserInfo('userInfo')
this.currentComponent = 'AssignPerson'
this.$nextTick(function() {
this.$refs.refModal._openGoupByUserId('分配人员', user.id, 'itemTree')
})
}
},
// 调整分组
_userGroupResult(data) {
const tempData = {
groupId: data.id,
groupName: data.name,
ids: this.selectIds.join(',')
}
this.$store.dispatch('FoodItem/adjustTestGroup', tempData).then(() => {
this._resultChange('调整成功')
})
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
......@@ -373,8 +306,6 @@ export default {
switch (msg) {
case '按人分配':
this._allotByPerson()
// await this._reportDueDate()
// await this._userAssign()
break
case '试验项目分配':
this._userAssign()
......@@ -402,15 +333,6 @@ export default {
})
}
break
case '设置计划完成时间':
this.currentComponent = 'EndDateModal'
this.$nextTick(function() {
this._changeDate()
})
break
case '信息维护':
this._maintainInfo()
break
}
},
_checkBack() {
......@@ -453,27 +375,6 @@ export default {
const user = Global.getUserInfo('userInfo')
this.$refs.personModal._openGoupByUserId('分配人员', user.id, 'itemTree')
},
// 信息维护
_maintainInfo() {
if (this.selectSampleIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.currentComponent = 'MaintainInfoModal'
this.$nextTick(() => {
this.$refs.refModal._open(this.selectSampleIds, 2)
})
}
},
_changeDate() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const tempData = {
ids: this.selectIds.join(',')
}
this.$refs.refModal._open(tempData, 'planDate')
}
},
_open(id, data) {
this.leftSelectData = data
this.entrustId = id
......
......@@ -69,7 +69,7 @@
</template>
<script>
import UserInfo from '../../../components/user-info-single/assignPerson'
import { soilTest } from '../../../api'
import { soilEntrust, soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from './SoilSampleManageHis'
export default {
......@@ -93,6 +93,11 @@ export default {
type: 'ios-clock',
id: '',
name: '操作日志'
},
{
type: 'md-trash',
id: '',
name: '删除'
}
],
getPage: {},
......@@ -357,9 +362,28 @@ export default {
case '操作日志':
this._operationRecord(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
}
})
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_editModal(id, type, name) {
this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
......
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