Commit 4c541135 by lichengming
parents 2c8193c1 57a2dc8e
......@@ -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)
},
......
......@@ -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 = []
......
......@@ -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
......
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