Commit 4c541135 by lichengming
parents 2c8193c1 57a2dc8e
...@@ -100,18 +100,8 @@ export default { ...@@ -100,18 +100,8 @@ export default {
selectIds: [] selectIds: []
} }
}, },
computed: { computed: {},
// tableHeight: function() {
// if (this.searchOpen) {
// return this.$newTableHeight('search')
// } else {
// return this.$newTableHeight('noSearch')
// }
// }
},
mounted() { mounted() {
// this._contHide()
// this._classTree()
this._page() this._page()
}, },
methods: { methods: {
......
...@@ -52,6 +52,12 @@ ...@@ -52,6 +52,12 @@
placeholder="请输入模板样品数" placeholder="请输入模板样品数"
/> />
</Form-item> </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> </Form>
</div> </div>
<div slot="footer" class="btn-width clearfix"> <div slot="footer" class="btn-width clearfix">
...@@ -68,6 +74,7 @@ ...@@ -68,6 +74,7 @@
import { soilAptitude } from '../../../api' import { soilAptitude } from '../../../api'
const defVal = { const defVal = {
moreSheet: undefined,
alias: undefined, alias: undefined,
classType: undefined, classType: undefined,
dataTotalRow: undefined, dataTotalRow: undefined,
...@@ -123,6 +130,7 @@ export default { ...@@ -123,6 +130,7 @@ export default {
{ required: true, message: '类别不能为空', trigger: 'blur' } { required: true, message: '类别不能为空', trigger: 'blur' }
] ]
}, },
sheetType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
typeList: [ typeList: [
{ {
value: '力学' value: '力学'
...@@ -207,6 +215,7 @@ export default { ...@@ -207,6 +215,7 @@ export default {
this.formObj.sampleBeginCol = data.sampleBeginCol this.formObj.sampleBeginCol = data.sampleBeginCol
this.formObj.sampleMergerNum = data.sampleMergerNum this.formObj.sampleMergerNum = data.sampleMergerNum
this.formObj.templateSampleNum = data.templateSampleNum this.formObj.templateSampleNum = data.templateSampleNum
this.formObj.moreSheet = data.moreSheet
this.modalTitle = '编辑模板' this.modalTitle = '编辑模板'
console.log(this.id) console.log(this.id)
}, },
......
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
<Form id="task-assign-item-right" :label-width="70" inline onsubmit="return false"> <Form id="task-assign-item-right" :label-width="70" 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 @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>
<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" @on-result-change="_btnClick" class="contHide"></btn-list> <btn-list :msg="btn" class="contHide" @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight" <PTVXETable ref="pageTable" :page-columns="pageColumns" :table-height="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :icon-msg="iconMsg" :table-name="tableName" is-task select-data> :get-page="getPage" :icon-msg="iconMsg" :table-name="tableName" is-task select-data @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns" v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key" :key="item.key"
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns" <VXESettingCol slot="setting" :page-columns="pageColumns" :user-columns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol> :table-name="tableName" @on-result-change="_resetColumn"></VXESettingCol>
</PTVXETable> </PTVXETable>
</Col> </Col>
</Row> </Row>
...@@ -316,13 +316,6 @@ export default { ...@@ -316,13 +316,6 @@ export default {
this._userResult(data) this._userResult(data)
} }
break break
case 'EndDateModal':
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this._page()
// }
break
case 'UserGroup': case 'UserGroup':
this._userGroupResult(data) this._userGroupResult(data)
break break
...@@ -348,35 +341,12 @@ export default { ...@@ -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) { _resultChange(msg) {
this.$Message.success(msg) this.$Message.success(msg)
this._page() this._page()
this.$emit('on-result-change') this.$emit('on-result-change')
}, },
async _btnClick(msg) { _btnClick(msg) {
switch (msg) { switch (msg) {
case '按人分配': case '按人分配':
this._allotByPerson() this._allotByPerson()
...@@ -395,10 +365,6 @@ export default { ...@@ -395,10 +365,6 @@ export default {
case '填写原始记录': case '填写原始记录':
this._addRecord() this._addRecord()
break break
case '按组分配':
await this._reportDueDate()
await this._groupAssign()
break
case '调整分组': case '调整分组':
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择=一条数据') this.$Message.warning('请至少选择=一条数据')
...@@ -409,15 +375,6 @@ export default { ...@@ -409,15 +375,6 @@ export default {
}) })
} }
break break
case '设置计划完成时间':
this.currentComponent = 'EndDateModal'
this.$nextTick(function() {
this._changeDate()
})
break
case '信息维护':
this._maintainInfo()
break
} }
}, },
_submitToMake() { _submitToMake() {
...@@ -575,37 +532,6 @@ export default { ...@@ -575,37 +532,6 @@ export default {
const user = Global.getUserInfo('userInfo') const user = Global.getUserInfo('userInfo')
console.log(user) console.log(user)
this.$refs.personModal._openGoup('分配人员', 'itemTree') 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() { _reportDueDate() {
...@@ -631,87 +557,6 @@ export default { ...@@ -631,87 +557,6 @@ export default {
this.$refs.refModal._open(tempData, 'user') 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() { _clearAll() {
this.getPage.records = [] this.getPage.records = []
this.selectIds = [] this.selectIds = []
......
...@@ -258,28 +258,6 @@ export default { ...@@ -258,28 +258,6 @@ export default {
this.userColumns = colList this.userColumns = colList
this.$refs.pageTable._loadColumn(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) { _selInputResult1(msg, data) {
switch (msg) { switch (msg) {
case 'keyword': case 'keyword':
...@@ -310,11 +288,7 @@ export default { ...@@ -310,11 +288,7 @@ export default {
} }
break break
case 'EndDateModal': case 'EndDateModal':
// if(this.defaultPlanDate){
// this._endDate()
// } else {
this._page() this._page()
// }
break break
case 'UserGroup': case 'UserGroup':
this._userGroupResult(data) this._userGroupResult(data)
...@@ -323,47 +297,6 @@ export default { ...@@ -323,47 +297,6 @@ export default {
this._page() 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) { _resultChange(msg) {
this.$Message.success(msg) this.$Message.success(msg)
this._page() this._page()
...@@ -373,8 +306,6 @@ export default { ...@@ -373,8 +306,6 @@ export default {
switch (msg) { switch (msg) {
case '按人分配': case '按人分配':
this._allotByPerson() this._allotByPerson()
// await this._reportDueDate()
// await this._userAssign()
break break
case '试验项目分配': case '试验项目分配':
this._userAssign() this._userAssign()
...@@ -402,15 +333,6 @@ export default { ...@@ -402,15 +333,6 @@ export default {
}) })
} }
break break
case '设置计划完成时间':
this.currentComponent = 'EndDateModal'
this.$nextTick(function() {
this._changeDate()
})
break
case '信息维护':
this._maintainInfo()
break
} }
}, },
_checkBack() { _checkBack() {
...@@ -453,27 +375,6 @@ export default { ...@@ -453,27 +375,6 @@ export default {
const user = Global.getUserInfo('userInfo') const user = Global.getUserInfo('userInfo')
this.$refs.personModal._openGoupByUserId('分配人员', user.id, 'itemTree') 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) { _open(id, data) {
this.leftSelectData = data this.leftSelectData = data
this.entrustId = id 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