Commit 87e70132 by wangweidong

土工试验Lims

parent 7241309b
......@@ -51,6 +51,10 @@ export default {
http
.post('soil/v1/original_template/page_open_soil', data)
.then(res => res),
pageInOutExportTemplate: data =>
http
.post('soil/v1/original_template/page_in_out_export_template', data)
.then(res => res),
originalTemplateDeleteById: data =>
http.delete('soil/v1/original_template/?ids=' + data).then(res => res),
originalTemplateEdit: data =>
......
......@@ -191,5 +191,9 @@ export default {
.post('soil/v1/sample/call_out_alone_keep_sample/', data)
.then(res => res),
listSummaryQuery: data =>
http.post('soil/v1/entrust/list_summary_query', data).then(res => res)
http.post('soil/v1/entrust/list_summary_query', data).then(res => res),
getInExport: data =>
http.get('soil/v1/alone_sample/get_in_export_' + data).then(res => res),
getOutExport: data =>
http.get('soil/v1/alone_sample/get_out_export_' + data).then(res => res)
}
......@@ -230,6 +230,17 @@ export default {
http
.post('soil/v1/experiment/save_excel_open_soil_record', data)
.then(res => res),
saveExcelExport: data =>
http
.post('soil/v1/alone_in_out_stock/save_excel_exp_report', data)
.then(res => res),
saveOutExcelExport: data =>
http
.post('soil/v1/alone_in_out_stock/save_excel_out_export', data)
.then(res => res),
// saveExcelExpReport: data =>
// http
// .post(
......
......@@ -249,10 +249,6 @@ export default {
_editModal(edit, id) {
if (edit) {
this._getById(id)
// 编辑
// this.$store.dispatch('FoodJudgeBasis/getById', id).then(() => {
// this.$refs.editModal._open(this.$store.state.FoodJudgeBasis.model)
// })
} else {
// 添加
this.$refs.editModal._open()
......
......@@ -68,76 +68,13 @@ export default {
{ name: '取消', type: '' },
{ name: '保存', type: 'primary' }
],
microbedList: [{ value: 0, name: '否' }, { value: 1, name: '是' }],
// 检测依据
testBasisData: [],
// 类别下拉数组
typeData: [],
// 检测科室
groupData: [],
groupName: '',
// 主检人
userData: [],
// 单位
unitData: [],
aptitudeData: [],
aptitude: '',
// testBasisName: '',
computeTypeList: [],
tester: '',
marksList: [],
detectionTypeList: [],
testItemData: [],
formId: ''
}
},
mounted() {
// 检测科室
// this._getUserGroup()
// 检测依据
// this._getTestBasisList()
// 资质
// this._getAptitudeList()
// this._getType()
},
mounted() {},
methods: {
// 字典
_dicSearch() {
this.$store.dispatch('LmsBaseDict/getItem', '食品检出类别').then(() => {
const result = this.$store.state.LmsBaseDict.item
this.detectionTypeList = result
if (this.$string(this.id).isEmpty()) {
// 添加界面默认第一个
this.formObj.detectionType = result.length > 0 ? result[0].name : ''
}
})
},
_testBasisChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.stdId = data.id
this.formObj.testBasis = data.stdNum
this.formObj.testBasisName = data.name
this.formObj.testMethod = data.stdNum
this.$refs.formObj.validateField('testBasis')
break
case 'query':
this.formObj.stdId = ''
this.formObj.testMethod = ''
this.formObj.testBasis = data.stdNum
this.formObj.testBasisName = ''
this._getTestBasisList(data)
break
case 'blur':
if (this.formObj.stdId === '') {
this.formObj.testBasis = ''
this.formObj.testMethod = ''
this._getTestBasisList()
}
this.$refs.formObj.validateField('testBasis')
}
},
_selectJudgeType(data) {
this.formObj.microbed = data
},
......@@ -149,10 +86,6 @@ export default {
case '保存':
this._ok()
break
case '填写说明':
this.$refs.introduction._open()
this._hideLoading()
break
}
},
_hideLoading() {
......@@ -174,139 +107,6 @@ export default {
}
this.showModal = true
},
// 获取检测项目
_getItemList(value) {
const data = {}
if (value) {
Object.assign(data, { name: value })
}
this.$store.dispatch('FoodAptitudeItem/getTestItem', data).then(() => {
this.testItemData = this.$store.state.FoodAptitudeItem.list
})
},
// 检测项目结果
_testItemChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.name = data
this.$refs.formObj.validateField('name')
this._changeMicrobed()
break
case 'query':
this.formObj.name = data
this._getItemList(data)
break
case 'blur':
this._changeMicrobed()
break
}
},
_changeMicrobed() {
// 新增或者导入新增资质时 如果检测项目名称带‘菌’字,则是否微生物默认为‘是’
if (this.id === '') {
if (this.formObj.name.indexOf('菌') > -1) {
this.$set(this.formObj, 'microbed', 1)
} else {
this.$set(this.formObj, 'microbed', 0)
}
}
},
_clearMarks() {
this.marksList = []
},
_getMarks() {
if (this.formObj.computeMark) {
this.$store
.dispatch('AptitudeFood/getMarks', {
computeMark: this.formObj.computeMark
})
.then(() => {
if (this.$store.state.AptitudeFood.model) {
this.marksList = this.$store.state.AptitudeFood.model
}
})
}
},
_getType() {
this.$store
.dispatch('LmsEnum/getByType', 'ItemCalculateType')
.then(() => {
this.computeTypeList = this.$store.state.LmsEnum.model
})
},
// 资质
_getAptitudeList() {
this.$store.dispatch('LmsBaseDict/getItem', '所需资质').then(() => {
this.aptitudeData = this.$store.state.LmsBaseDict.item
})
},
// 主检人&检测科室
_groupChange(data) {
if (data) {
this.groupName = data.label
this.formObj.groupId = data.value
this.formObj.tester = ''
this.formObj.testerId = ''
this._getUserList(data.value)
}
},
_userChange(data) {
if (data) {
this.formObj.testerId = data.value
this.formObj.tester = data.label
}
},
_getUserList(groupId) {
const data = { rows: 500 }
if (groupId) {
Object.assign(data, { groupId: groupId })
}
this.$store.dispatch('LmsUserGroup/getUserByGroupId', data).then(() => {
this.userData = this.$store.state.LmsUserGroup.userPage.records
})
},
_getUserGroup() {
this.$store.dispatch('LmsUserGroup/list').then(() => {
this.groupData = this.$store.state.LmsUserGroup.list
})
},
// 单位
_unitChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.unit = data
break
case 'query':
this._getUnitList(data)
break
}
},
_getUnitList(data) {
this.unitData = []
if (data) {
this.$store
.dispatch('AptitudeFood/historyUnit', { unit: data })
.then(() => {
this.unitData = this.$store.state.AptitudeFood.list
})
} else {
this.$store.dispatch('AptitudeFood/historyUnit').then(() => {
this.unitData = this.$store.state.AptitudeFood.list
})
}
},
// 检测依据
_getTestBasisList(data) {
const obj = { classify: 1 }
if (data) {
obj.stdNum = data.stdNum
}
this.$store.dispatch('StandardInfo/page', obj).then(() => {
this.testBasisData = this.$store.state.StandardInfo.page.records
})
},
// 获取表数据
_resultChange(msg) {
this.showModal = false
......
......@@ -122,27 +122,8 @@ export default {
formId: ''
}
},
mounted() {
// 检测科室
// this._getUserGroup()
// 检测依据
// this._getTestBasisList()
// 资质
// this._getAptitudeList()
// this._getType()
},
mounted() {},
methods: {
// 字典
_dicSearch() {
this.$store.dispatch('LmsBaseDict/getItem', '食品检出类别').then(() => {
const result = this.$store.state.LmsBaseDict.item
this.detectionTypeList = result
if (this.$string(this.id).isEmpty()) {
// 添加界面默认第一个
this.formObj.detectionType = result.length > 0 ? result[0].name : ''
}
})
},
groupSelect(data) {
console.log(data)
// this.formObj.groupId = da
......@@ -187,10 +168,6 @@ export default {
case '保存':
this._ok()
break
case '填写说明':
this.$refs.introduction._open()
this._hideLoading()
break
}
},
_hideLoading() {
......@@ -226,73 +203,9 @@ export default {
this.groupoptions = result
}
},
// 获取检测项目
_getItemList(value) {
const data = {}
if (value) {
Object.assign(data, { name: value })
}
this.$store.dispatch('FoodAptitudeItem/getTestItem', data).then(() => {
this.testItemData = this.$store.state.FoodAptitudeItem.list
})
},
// 检测项目结果
_testItemChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.name = data
this.$refs.formObj.validateField('name')
this._changeMicrobed()
break
case 'query':
this.formObj.name = data
this._getItemList(data)
break
case 'blur':
this._changeMicrobed()
break
}
},
_changeMicrobed() {
// 新增或者导入新增资质时 如果检测项目名称带‘菌’字,则是否微生物默认为‘是’
if (this.id === '') {
if (this.formObj.name.indexOf('菌') > -1) {
this.$set(this.formObj, 'microbed', 1)
} else {
this.$set(this.formObj, 'microbed', 0)
}
}
},
_clearMarks() {
this.marksList = []
},
_getMarks() {
if (this.formObj.computeMark) {
this.$store
.dispatch('AptitudeFood/getMarks', {
computeMark: this.formObj.computeMark
})
.then(() => {
if (this.$store.state.AptitudeFood.model) {
this.marksList = this.$store.state.AptitudeFood.model
}
})
}
},
_getType() {
this.$store
.dispatch('LmsEnum/getByType', 'ItemCalculateType')
.then(() => {
this.computeTypeList = this.$store.state.LmsEnum.model
})
},
// 资质
_getAptitudeList() {
this.$store.dispatch('LmsBaseDict/getItem', '所需资质').then(() => {
this.aptitudeData = this.$store.state.LmsBaseDict.item
})
},
// 主检人&检测科室
_groupChange(data) {
if (data) {
......@@ -309,20 +222,6 @@ export default {
this.formObj.tester = data.label
}
},
_getUserList(groupId) {
const data = { rows: 500 }
if (groupId) {
Object.assign(data, { groupId: groupId })
}
this.$store.dispatch('LmsUserGroup/getUserByGroupId', data).then(() => {
this.userData = this.$store.state.LmsUserGroup.userPage.records
})
},
_getUserGroup() {
this.$store.dispatch('LmsUserGroup/list').then(() => {
this.groupData = this.$store.state.LmsUserGroup.list
})
},
// 单位
_unitChange(msg, data) {
switch (msg) {
......@@ -334,31 +233,6 @@ export default {
break
}
},
_getUnitList(data) {
this.unitData = []
if (data) {
this.$store
.dispatch('AptitudeFood/historyUnit', { unit: data })
.then(() => {
this.unitData = this.$store.state.AptitudeFood.list
})
} else {
this.$store.dispatch('AptitudeFood/historyUnit').then(() => {
this.unitData = this.$store.state.AptitudeFood.list
})
}
},
// 检测依据
_getTestBasisList(data) {
const obj = { classify: 1 }
if (data) {
obj.stdNum = data.stdNum
}
this.$store.dispatch('StandardInfo/page', obj).then(() => {
this.testBasisData = this.$store.state.StandardInfo.page.records
})
},
// 获取表数据
_resultChange(msg) {
this.showModal = false
......
......@@ -202,28 +202,6 @@ export default {
}
})
},
_exportAgreement(id) {
this.$store
.dispatch(
'ReportExport/getById',
'food-contract-company-export-sample-agreement'
)
.then(() => {
if (this.$store.state.ReportExport.model) {
if (this.$store.state.ReportExport.model.indexOf('?') !== -1) {
window.open(
this.$store.state.ReportExport.model + '&sampleId=' + id,
'_blank'
)
} else {
window.open(
this.$store.state.ReportExport.model + '?sampleId=' + id,
'_blank'
)
}
}
})
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
......@@ -333,18 +311,6 @@ export default {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
// localStorage.setItem('type', data.type)
// // 编辑
// this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
// const result = this.$store.state.FoodSample.companyModel
// if (data.type === 0) {
// // 普通企业样品
// this.$refs.refModal._open(result, this.sampleId)
// } else if (data.type === 3) {
// // 模拟样品
// this._editImitateModal(true, result)
// }
// })
} else {
// 添加
this.$refs.refModal._open('', this.sampleId)
......@@ -369,53 +335,6 @@ export default {
this.$Message.success(msg)
this.$emit('on-result-change')
},
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/company/import_' + this.sampleId,
downloadUrl: '/food/v1/excel/template/FoodSampleCompany',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
......
......@@ -243,10 +243,6 @@ export default {
_editModal: async function(edit, id) {
if (edit) {
// 编辑
// this.$store.dispatch('StandardInfo/getById', id).then(() => {
// this.$refs.refModal._open(this.$store.state.StandardInfo.model)
// })
const result = await soilAptitude.standardGetById(id)
if (result) {
this.$refs.editModal._open(result)
......
......@@ -400,28 +400,6 @@ export default {
}
})
},
_exportAgreement(id) {
this.$store
.dispatch(
'ReportExport/getById',
'food-contract-company-export-sample-agreement'
)
.then(() => {
if (this.$store.state.ReportExport.model) {
if (this.$store.state.ReportExport.model.indexOf('?') !== -1) {
window.open(
this.$store.state.ReportExport.model + '&sampleId=' + id,
'_blank'
)
} else {
window.open(
this.$store.state.ReportExport.model + '?sampleId=' + id,
'_blank'
)
}
}
})
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
......@@ -432,9 +410,6 @@ export default {
this.selectIds = selectIds
this.selectData = data
break
// case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName)
// break
case 'page':
this._page()
break
......@@ -531,18 +506,6 @@ export default {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
// localStorage.setItem('type', data.type)
// // 编辑
// this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
// const result = this.$store.state.FoodSample.companyModel
// if (data.type === 0) {
// // 普通企业样品
// this.$refs.refModal._open(result, this.sampleId)
// } else if (data.type === 3) {
// // 模拟样品
// this._editImitateModal(true, result)
// }
// })
} else {
// 添加
this.$refs.refModal._open('', this.sampleId)
......@@ -570,50 +533,7 @@ export default {
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/company/import_' + this.sampleId,
downloadUrl: '/food/v1/excel/template/FoodSampleCompany',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
......
......@@ -114,7 +114,6 @@
</div>
</template>
<script>
import http from '../../api/http'
import { soilAptitude, soilEntrust } from '../../api'
import AutoCompletes from '../../components/base/AutoCompletes'
import RegisterItemBatchEdit from './RegisterItemBatchEdit'
......@@ -453,23 +452,6 @@ export default {
this._resultChange('取消分包成功')
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() {
this.$refs.refModal._open(this.sampleId)
},
......@@ -488,37 +470,12 @@ export default {
console.log(index)
this._deleteById(data.id)
break
case '导出样品委托协议':
this._exportAgreement(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_exportAgreement(id) {
this.$store
.dispatch(
'ReportExport/getById',
'food-contract-company-export-sample-agreement'
)
.then(() => {
if (this.$store.state.ReportExport.model) {
if (this.$store.state.ReportExport.model.indexOf('?') !== -1) {
window.open(
this.$store.state.ReportExport.model + '&sampleId=' + id,
'_blank'
)
} else {
window.open(
this.$store.state.ReportExport.model + '?sampleId=' + id,
'_blank'
)
}
}
})
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
......@@ -529,9 +486,6 @@ export default {
this.selectIds = selectIds
this.selectData = data
break
// case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName)
// break
case 'page':
this._pageByEntrustId()
break
......@@ -630,18 +584,6 @@ export default {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
// localStorage.setItem('type', data.type)
// // 编辑
// this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
// const result = this.$store.state.FoodSample.companyModel
// if (data.type === 0) {
// // 普通企业样品
// this.$refs.refModal._open(result, this.sampleId)
// } else if (data.type === 3) {
// // 模拟样品
// this._editImitateModal(true, result)
// }
// })
} else {
// 添加
this.$refs.refModal._open('', this.sampleId)
......@@ -669,50 +611,6 @@ export default {
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/company/import_' + this.sampleId,
downloadUrl: '/food/v1/excel/template/FoodSampleCompany',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
......
......@@ -113,7 +113,6 @@
</div>
</template>
<script>
import http from '../../api/http'
import { soilEntrust } from '../../api'
export default {
components: {},
......@@ -253,18 +252,9 @@ export default {
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
......@@ -306,7 +296,7 @@ export default {
const result = await soilEntrust.pageItemEdit(data)
if (result) {
this.$message.success('保存成功')
this._page()
await this._page()
} else {
this.$message.warning('保存失败')
}
......@@ -355,23 +345,6 @@ export default {
this._resultChange('取消分包成功')
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() {
this.$refs.refModal._open(this.sampleId)
},
......@@ -390,37 +363,12 @@ export default {
console.log(index)
this._deleteById(data.id)
break
case '导出样品委托协议':
this._exportAgreement(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_exportAgreement(id) {
this.$store
.dispatch(
'ReportExport/getById',
'food-contract-company-export-sample-agreement'
)
.then(() => {
if (this.$store.state.ReportExport.model) {
if (this.$store.state.ReportExport.model.indexOf('?') !== -1) {
window.open(
this.$store.state.ReportExport.model + '&sampleId=' + id,
'_blank'
)
} else {
window.open(
this.$store.state.ReportExport.model + '?sampleId=' + id,
'_blank'
)
}
}
})
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
......@@ -431,9 +379,6 @@ export default {
this.selectIds = selectIds
this.selectData = data
break
// case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName)
// break
case 'page':
this._page()
break
......@@ -509,34 +454,11 @@ export default {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
// localStorage.setItem('type', data.type)
// // 编辑
// this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
// const result = this.$store.state.FoodSample.companyModel
// if (data.type === 0) {
// // 普通企业样品
// this.$refs.refModal._open(result, this.sampleId)
// } else if (data.type === 3) {
// // 模拟样品
// this._editImitateModal(true, result)
// }
// })
} else {
// 添加
this.$refs.refModal._open('', this.sampleId)
}
},
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.sampleId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.sampleId)
}
},
_search() {
this._page()
},
......@@ -548,50 +470,6 @@ export default {
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/company/import_' + this.sampleId,
downloadUrl: '/food/v1/excel/template/FoodSampleCompany',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
......
......@@ -65,35 +65,17 @@
<script>
import { soilEntrust } from '../../../api'
export default {
components: {
// FoodSampleGovernDetail,
// CopyModal,
// FoodSampleGovernLYEdits
},
components: {},
data() {
return {
currentComponent: '',
searchOpen: true,
// btn: [
// {type: 'success', id: '', name: '添加', componentName: 'FoodSampleGovernEdit'},
// {id: 'food-gov-sample-batch-add', name: '批量添加', componentName: 'FoodSampleGovernBatchAdd'},
// {id: '', name: '导入样品', componentName: 'FoodImportSample'},
// {id: '', name: '导入检测项目', componentName: 'RelItem'},
// {id: '', name: '导入检测项目包', componentName: 'RelItemPackage'},
// {id: '', name: '复制历史样品检测项目', componentName: 'CopyHisItem'},
// {id: '', name: '删除'},
// ],
iconMsg: [
{
type: 'compose',
id: '',
name: '编辑'
},
// {
// type: 'ios-flask-outline',
// id: 'meter-review-meter-sample-manage-test-itm-manage-o',
// name: '管理检测项目'
// },
{
type: 'trash-a',
id: '',
......@@ -106,18 +88,6 @@ export default {
id: 'ZBC',
name: '分包'
}
// ,
// {
// type: 'success',
// id: '',
// name: '取消分包'
// }
// ,
// {
// type: 'success',
// id: 'review-meter-sample-manage-import-test-item',
// name: '导入检测项目'
// }
],
options: [
{
......@@ -220,14 +190,6 @@ export default {
this._subpackageCancel(data)
}
},
// _subpackageCancel: async function(data) {
// console.log(data)
// const result = await meterSample.subpackageCancel(data)
// if (result) {
// this.$Message.success('取消成功!')
// this._page()
// }
// },
_sampleEditModal(data) {
this.$refs.sampleEditModal._open(data.id)
},
......@@ -267,25 +229,11 @@ export default {
this.getPage = result
}
},
// _page: async function() {
// this.selectIds = []
// Object.assign(this.formObj, this.$refs.pageTable._searchParams())
// console.log('this.formObj', this.formObj)
// const result = await meterSample.page(this.formObj)
// if (result) {
// this.getPage = result
// this.$refs.pageTable._hideLoading()
// }
// },
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this.$store.dispatch('FoodSample/deleteByIds', ids).then(() => {
this._resultChange('删除成功!')
})
}
onOk: () => {}
})
},
_deleteById(id) {
......@@ -301,41 +249,6 @@ export default {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(id) {
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(function() {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(this.$store.state.FoodSample.governModel)
})
})
},
_editModal(edit, id) {
this.currentComponent = 'FoodSampleGovernEdit'
this.$nextTick(function() {
if (edit) {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.contractId
)
})
} else {
this.$refs.refModal._open('', this.contractId)
}
})
},
_editLY(id) {
// 粮油的编辑
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$nextTick(function() {
this.$store.dispatch('FoodSample/getByGovernId', id).then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.contractId
)
})
})
},
_search() {
this._page()
},
......@@ -352,68 +265,6 @@ export default {
_copy(sampleId, type) {
this.$refs.refModal._open(sampleId, type)
},
// 复制样品
_copySample(data) {
if (data.type === 2) {
// 粮油的编辑页
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopySample(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleGovernEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopySample(
this.$store.state.FoodSample.governModel
)
})
})
}
},
_copyAll(data) {
if (data.type === 2) {
// 粮油的编辑页
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleGovernEdit'
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(
this.$store.state.FoodSample.governModel
)
})
})
}
},
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/government/import_' + this.contractId,
downloadUrl: '/food/v1/excel/template/FoodSampleGovernment',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
......@@ -440,13 +291,6 @@ export default {
this._subpackage(this.selectIds)
}
},
// _subpackage: async function(ids) {
// const result = await meterSample.subpackageSample(ids)
// if (result) {
// this.$Message.success('分包成功!')
// await this._page()
// }
// },
_importItemPackage() {
if (this.selectIds.length === 0) {
......
<template>
<div>
<Modal v-model="showBatchModal" v-drag :mask-closable="false" width="900">
<p slot="header">
入库资料导出
</p>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--样品信息-->
<!--报告模板-->
<Col span="24">
<ReportTemplate ref="reportTemplate" @on-result-change="_templateResultChange"></ReportTemplate>
</Col>
</Row>
</div>
</div>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerBtn" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<!--生成报告的进度条-->
</div>
</template>
<script>
import ReportTemplate from './ReportTemplate'
/**
* 样品列表--生成报告或者选择模板生成报告
*/
export default {
components: {
ReportTemplate
},
data() {
return {
selectIds: [],
getPage: {
records: []
},
showBatchModal: false,
isLoading: false,
footerBtn: [
{ type: '', id: '', name: '取消' },
{ type: 'primary', id: '', name: '确定' }
],
pageColumns: [
{ title: '样品名称', key: 'name', width: 160 },
{ title: '样品编号', key: 'code', width: 150 },
{ title: '证书编号', key: 'certificate', width: 150 }
],
reportModelId: '',
backData: {},
// 样品数据
tableData: [],
// 签发日期
issueDateTemp: '',
issueDate: '',
showIssueModal: false
}
},
methods: {
_open() {
this.getPage.records = []
this.backData = {}
this.showBatchModal = true
this._reportTemplate()
this.reportModelId = ''
this.isLoading = false
},
// 报告模板
_reportTemplate() {
this.$refs.reportTemplate._open()
},
_footerResult(name) {
switch (name) {
case '确定':
this._ok()
break
case '取消':
this.showBatchModal = false
break
}
},
_templateResultChange(selectData) {
console.log('selectData[0]', selectData[0])
this.backData = selectData[0]
},
_issueChange(data) {
if (data) {
this.issueDate = data
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.footerModal._hideLoading()
if (!this.backData.name) {
this.$Message.warning('请选择一个原始记录模板!')
// this._hideLoading()
} else {
console.log('this.backData', this.backData)
this.$emit('on-result-change', this.backData)
this.showBatchModal = false
}
},
_issueCancel() {
this.showIssueModal = false
},
_closeResult() {
this.showBatchModal = false
this.$emit('on-result-change')
}
}
}
</script>
......@@ -6,21 +6,21 @@
<Row>
<!--查询-->
<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>
<Form-item class="search-item" label="项目名称:">
<Input v-model="formObj.projectName" @on-enter="_formSearch" name="projectName" placeholder="请输入项目名称" clearable/>
<Input v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称" clearable @on-enter="_formSearch"/>
</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" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
......@@ -45,18 +45,17 @@
</div>
</div>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent"></component>
<component :is="currentComponent" ref="refModal" @on-result-change="_componentResult"></component>
</keep-alive>
</div>
</template>
<script>
import { soilAptitude, soilEntrust } from '../../api'
import { soilAptitude, soilEntrust, soilSample } from '../../api'
import MeterEntrustRecord from '../../components/operation/Operation'
import ViewDetail from './ViewDetail'
import CreateReport from './CreateReport'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord, ViewDetail },
components: { MeterEntrustRecord, ViewDetail, CreateReport },
data() {
return {
currentComponent: '',
......@@ -101,6 +100,7 @@ export default {
entrustCode: undefined
},
selectIds: [],
currentId: '',
getPage: {},
pageColumns: [
{ title: '项目名称', key: 'projectName', width: 120 },
......@@ -157,7 +157,7 @@ export default {
this._deleteByIds([data.id])
break
case '导出入库资料':
this._exportInfo(this.id)
this._exportInfo(data)
break
case '操作日志':
this._record(data.id)
......@@ -171,8 +171,72 @@ export default {
}
})
},
_exportInfo(id) {
console.log(id)
_componentResult(data, msg) {
switch (this.currentComponent) {
case 'CreateReport':
this._makeInOutExportBack(data)
break
default:
this._page()
}
},
_makeInOutExport: async function(data) {
this.$refs.pageTable._showLoading()
const result = await soilSample.saveExcelExport({
ids: this.currentId,
templateId: data.id
})
this.$refs.pageTable._hideLoading()
if (result) {
await this._page()
if (result === null || result === undefined) {
this.$Message.warning('证书编制失败,请联系管理员!')
this.$refs.pageTable._hideLoading()
return false
} else {
this.$emit('on-result-change')
this._viewReport(result)
}
}
},
_viewReport(data) {
this.$refs.pageTable._hideLoading()
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 15,
id: data.id,
isReport: 4
})
}
},
_makeInOutExportBack(data) {
console.log('_makeInOutExportBack---', data)
if (data) {
this.$refs.pageTable._showLoading()
this._makeInOutExport(data)
} else {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
// this._appendOriginalRecord()
}
}
},
_exportInfo(data) {
this.currentId = data.id
if (undefined === data.exportId) {
this.currentComponent = 'CreateReport'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
} else {
this.$refs.pageTable._hideLoading()
if (data) {
this._getInExportRecord(data.id)
}
}
},
_viewModal(edit, id) {
this.currentComponent = 'ViewDetail'
......@@ -187,6 +251,21 @@ export default {
})
}
},
_getInExportRecord: async function(id) {
const result = await soilEntrust.getInExport(id)
if (result) {
this.$openWindowModeless({
objectKey: result.instoreObjectKey,
idType: 15,
id: result.exportId,
isReport: 4
})
} else {
this.$refs.pageTable._hideLoading()
}
},
_getDetailById: async function(id) {
const result = await soilEntrust.getAloneVOById(id)
if (result) {
......
<template>
<div>
<Row>
<Col span="24">
<Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="模板名称:" class="search-item">
<Input v-model="formObj.alias" @on-enter="_formSearch" placeholder="请输入模板名称" clearable/>
</Form-item>
<Form-item label="模板类别:" class="search-item">
<Input v-model="formObj.classType" @on-enter="_formSearch" placeholder="请输入模板类别" clearable/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<PTVXETableHeight
ref="pageTable"
:table-height="300"
:get-page="getPage"
:is-radio="true"
@on-result-change="_tableResultChange"
select-data="true"
hide-checkbox>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else-if="item.judged">{{scope.row[item.key]===1?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</template>
<script>
import { soilAptitude } from '../../api'
export default {
components: {},
data() {
return {
tableHeight: '400',
pageColumns: [
{ title: '模板名称', key: 'alias', width: 220 },
{ title: '类别', key: 'classType', width: 140 },
{ title: '备注', key: 'remark' }
],
getPage: {},
modalTitle: '报告模板',
sampleId: '',
formObj: {
name: undefined,
classType: '入库导出模板'
},
typeList: [
{
value: '力学'
},
{
value: '物性'
},
{
value: '高级'
}
],
selectData: []
}
},
methods: {
_tableResultChange(msg, data) {
console.log(msg)
switch (msg) {
case 'page':
this._page()
break
case 'changeSize':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'singleSelect':
this.selectData = [data]
this.$emit('on-result-change', this.selectData)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
}
},
_open(sampleId) {
this.sampleId = sampleId || ''
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.pageInOutExportTemplate(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showBatchModal" v-drag :mask-closable="false" width="900">
<p slot="header">
出库资料导出
</p>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--样品信息-->
<!--报告模板-->
<Col span="24">
<ReportTemplate ref="reportTemplate" @on-result-change="_templateResultChange"></ReportTemplate>
</Col>
</Row>
</div>
</div>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerBtn" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<!--生成报告的进度条-->
</div>
</template>
<script>
import ReportTemplate from './ReportTemplate'
/**
* 样品列表--生成报告或者选择模板生成报告
*/
export default {
components: {
ReportTemplate
},
data() {
return {
selectIds: [],
getPage: {
records: []
},
showBatchModal: false,
isLoading: false,
footerBtn: [
{ type: '', id: '', name: '取消' },
{ type: 'primary', id: '', name: '确定' }
],
pageColumns: [
{ title: '样品名称', key: 'name', width: 160 },
{ title: '样品编号', key: 'code', width: 150 },
{ title: '证书编号', key: 'certificate', width: 150 }
],
reportModelId: '',
backData: {},
// 样品数据
tableData: [],
// 签发日期
issueDateTemp: '',
issueDate: '',
showIssueModal: false
}
},
methods: {
_open() {
this.getPage.records = []
this.backData = {}
this.showBatchModal = true
this._reportTemplate()
this.reportModelId = ''
this.isLoading = false
},
// 报告模板
_reportTemplate() {
this.$refs.reportTemplate._open()
},
_footerResult(name) {
switch (name) {
case '确定':
this._ok()
break
case '取消':
this.showBatchModal = false
break
}
},
_templateResultChange(selectData) {
console.log('selectData[0]', selectData[0])
this.backData = selectData[0]
},
_issueChange(data) {
if (data) {
this.issueDate = data
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.footerModal._hideLoading()
if (!this.backData.name) {
this.$Message.warning('请选择一个原始记录模板!')
// this._hideLoading()
} else {
console.log('this.backData', this.backData)
this.$emit('on-result-change', this.backData)
this.showBatchModal = false
}
},
_issueCancel() {
this.showIssueModal = false
},
_closeResult() {
this.showBatchModal = false
this.$emit('on-result-change')
}
}
}
</script>
......@@ -6,21 +6,21 @@
<Row>
<!--查询-->
<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>
<Form-item class="search-item" label="项目名称:">
<Input v-model="formObj.projectName" @on-enter="_formSearch" name="projectName" placeholder="请输入项目名称" clearable/>
<Input v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称" clearable @on-enter="_formSearch"/>
</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" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
......@@ -46,17 +46,18 @@
</div>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent"></component>
<component :is="currentComponent" ref="refModal" @on-result-change="_componentResult"></component>
</keep-alive>
</div>
</template>
<script>
import { soilAptitude, soilEntrust } from '../../../api'
import { soilAptitude, soilEntrust, soilSample } from '../../../api'
import MeterEntrustRecord from '../../../components/operation/Operation'
import ViewDetail from './ViewDetail'
import CreateReport from './CreateReport'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord, ViewDetail },
components: { MeterEntrustRecord, ViewDetail, CreateReport },
data() {
return {
currentComponent: '',
......@@ -81,6 +82,11 @@ export default {
name: '附件'
},
{
type: 'ios-cloud-download',
id: '',
name: '导出出库资料'
},
{
type: 'ios-clock',
id: '',
name: '操作日志'
......@@ -154,6 +160,9 @@ export default {
case '操作日志':
this._record(data.id)
break
case '导出出库资料':
this._exportInfo(data)
break
case '查看样品':
this._sampleManage(data.id)
break
......@@ -200,6 +209,88 @@ export default {
})
// this.$refs.entrustRecordModal._open(id)
},
_componentResult(data, msg) {
switch (this.currentComponent) {
case 'CreateReport':
this._makeInOutExportBack(data)
break
default:
this._page()
}
},
_makeInOutExport: async function(data) {
this.$refs.pageTable._showLoading()
const result = await soilSample.saveOutExcelExport({
ids: this.currentId,
templateId: data.id
})
this.$refs.pageTable._hideLoading()
if (result) {
await this._page()
if (result === null || result === undefined) {
this.$Message.warning('证书编制失败,请联系管理员!')
this.$refs.pageTable._hideLoading()
return false
} else {
this.$emit('on-result-change')
this._viewReport(result)
}
}
},
_viewReport(data) {
this.$refs.pageTable._hideLoading()
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
_makeInOutExportBack(data) {
if (data) {
this.$refs.pageTable._showLoading()
this._makeInOutExport(data)
} else {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
// this._appendOriginalRecord()
}
}
},
_exportInfo(data) {
this.currentId = data.id
if (undefined === data.exportId) {
this.currentComponent = 'CreateReport'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
} else {
this.$refs.pageTable._hideLoading()
if (data) {
this._getInExportRecord(data.id)
}
}
},
_getInExportRecord: async function(id) {
const result = await soilEntrust.getOutExport(id)
if (result) {
this.$openWindowModeless({
objectKey: result.instoreObjectKey,
idType: 15,
id: result.exportId,
isReport: 4
})
} else {
this.$refs.pageTable._hideLoading()
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
......
<template>
<div>
<Row>
<Col span="24">
<Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="模板名称:" class="search-item">
<Input v-model="formObj.alias" @on-enter="_formSearch" placeholder="请输入模板名称" clearable/>
</Form-item>
<Form-item label="模板类别:" class="search-item">
<Input v-model="formObj.classType" @on-enter="_formSearch" placeholder="请输入模板类别" clearable/>
</Form-item>
<Form-item class="search-btn" style="margin-left: -10px">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<PTVXETableHeight
ref="pageTable"
:table-height="300"
:get-page="getPage"
:is-radio="true"
@on-result-change="_tableResultChange"
select-data="true"
hide-checkbox>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<span v-if="item.dateTime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else-if="item.judged">{{scope.row[item.key]===1?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
export default {
components: {},
data() {
return {
tableHeight: '400',
pageColumns: [
{ title: '模板名称', key: 'alias', width: 220 },
{ title: '类别', key: 'classType', width: 140 },
{ title: '备注', key: 'remark' }
],
getPage: {},
modalTitle: '报告模板',
sampleId: '',
formObj: {
name: undefined,
classType: '出库导出模板'
},
selectData: []
}
},
methods: {
_tableResultChange(msg, data) {
console.log(msg)
switch (msg) {
case 'page':
this._page()
break
case 'changeSize':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'singleSelect':
this.selectData = [data]
this.$emit('on-result-change', this.selectData)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
}
},
_open(sampleId) {
this.sampleId = sampleId || ''
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.pageInOutExportTemplate(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" width="1000" class="modal-footer-none">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="属性名称:">
<Input v-model="formObj.attributeName" @on-enter="_formSearch" placeholder="请输入属性名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else-if="item.key==='itemed'">{{scope.row[item.key] === 1?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<ConfigTemplateEdit ref="indexEdit" @on-result-change="_page"></ConfigTemplateEdit>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
import ConfigTemplateEdit from './ConfigTemplateEdit'
export default {
components: { ConfigTemplateEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [
{ type: 'success', id: '', name: '添加配置' },
{ type: 'error', id: '', name: '删除' }
],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '属性名称', key: 'attributeName' },
{ title: '属性', key: 'dataAttribute', width: 120 },
{ title: '公式配置', key: 'formula', width: 120 },
{ title: '是否是项目指标', key: 'itemed', width: 120 },
{ title: '列位置', key: 'columnPlace', width: 120 },
{ title: '合并开始列', key: 'mergeBegin', width: 120 },
{ title: '合并结束列', key: 'mergeEnd', width: 120 },
{ title: '合并行数', key: 'mergeRowNum', width: 120 },
{ title: '单位', key: 'unit', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
selectIds: [],
formObj: {
attributeName: undefined,
templateId: undefined
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.formObj.templateId = data.id
this.id = data.id
this.modalTitle = data.name + ' 指标管理'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.originalTemplateConfig(
this.$serializeForm(this.formObj)
)
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
}
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilAptitude.getOriginalTemplateConfig(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加配置':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds() {
if (this.selectIds.length === 0) {
// this.$msgTip('warning')
this.$message.warning('请至少选择一条记录')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定删除 ' + this.selectIds.length + ' 条记录?',
onOk: () => {
this._delOk(this.selectIds)
}
})
}
},
_delOk: async function(ids) {
const result = await soilAptitude.deleteOriginalTemplateConfig(ids)
if (result) {
this.$Message.success('删除成功')
this._page()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" @on-visible-change="_visibleChange" width="900">
<p slot="header">{{modalTitle}}</p>
<div>
<Form ref="formObj" :id="formId" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<div>
<Form-item label="属性名称" prop="attributeName" class="width-48">
<Input v-model="formObj.attributeName" name="attributeName" placeholder="请输入属性名称"/>
</Form-item>
<Form-item label="属性" prop="dataAttribute" class="width-48">
<Input v-model="formObj.dataAttribute" name="dataAttribute"
placeholder="请输入属性"/>
</Form-item>
<Form-item label="公式配置" prop="formula" class="width-48">
<Input v-model="formObj.formula" name="formula"
placeholder="请输入公式配置"/>
</Form-item>
<Form-item label="列位置" prop="columnPlace" class="width-48">
<Input
v-model="formObj.columnPlace"
@keydown.native="channelInputLimit"
name="columnPlace"
type="number"
onmousewheel="return false"
placeholder="请输入列位置"
></Input>
</Form-item>
<Form-item label="合并开始列" prop="mergeBegin" class="width-48">
<Input
v-model="formObj.mergeBegin"
@keydown.native="channelInputLimit"
name="mergeBegin"
type="number"
onmousewheel="return false"
placeholder="请输入合并开始列"
/>
</Form-item>
<Form-item label="合并结束列" prop="mergeEnd" class="width-48">
<Input
v-model="formObj.mergeEnd"
@keydown.native="channelInputLimit"
name="mergeEnd"
type="number"
onmousewheel="return false"
placeholder="请输入合并结束列"
/>
</Form-item>
<Form-item label="合并行数" prop="mergeRowNum" class="width-48">
<Input
v-model="formObj.mergeRowNum"
@keydown.native="channelInputLimit"
name="mergeRowNum"
type="number"
onmousewheel="return false"
placeholder="请输入合并行数"
/>
</Form-item>
<Form-item label="是否是项目指标" prop="itemed" class="width-48">
<Select v-model="formObj.itemed" @change="_optionChange" placeholder="请选择">
<Option
v-for="(item,index) in options"
:key="index"
:label="item.value"
:value="index"
/>
</Select>
</Form-item>
<Form-item label="单位" prop="unit" class="width-48">
<Input v-model="formObj.unit" name="unit"
placeholder="请输入单位"/>
</Form-item>
</div>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑环境资质项目表
*/
import { soilAptitude } from '../../../api'
export default {
components: {},
data() {
return {
activeName: '',
hideUserSel: true,
id: '',
modalTitle: '',
templateId: '',
formObj: {
attributeName: undefined,
formula: undefined,
columnPlace: '',
unit: undefined,
status: undefined,
mainType: undefined,
smallType: undefined,
testValue: undefined,
mergeBegin: '',
mergeRowNum: '',
mergeEnd: '',
itemed: undefined
},
options: [
{
label: '否',
value: '否'
},
{
label: '是',
value: '是'
}
],
ruleValidate: {
name: [{ required: true, message: '指标名称不能为空', trigger: 'blur' }]
},
showModal: false,
footerList: [
{ name: '取消', type: '' },
{ name: '保存', type: 'primary' }
],
microbedList: [{ value: 0, name: '否' }, { value: 1, name: '是' }],
// 检测依据
testBasisData: [],
// 类别下拉数组
typeData: [],
// 检测科室
groupData: [],
groupName: '',
// 主检人
userData: [],
// 单位
unitData: [],
aptitudeData: [],
aptitude: '',
// testBasisName: '',
computeTypeList: [],
tester: '',
marksList: [],
detectionTypeList: [],
testItemData: [],
formId: ''
}
},
mounted() {
// 检测科室
// this._getUserGroup()
// 检测依据
// this._getTestBasisList()
// 资质
// this._getAptitudeList()
// this._getType()
},
methods: {
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
inputChange(data) {
console.log('data>>>', data)
console.log('formObj>>>', this.formObj)
},
_selectJudgeType(data) {
this.formObj.microbed = data
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open(id, formObj) {
this.formId = 'edit-form-template-config'
this._hideLoading()
this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) {
this.id = ''
this.templateId = id
this.modalTitle = '添加模板配置'
console.log('formObj>>>', this.formObj)
} else {
this.hideUserSel = true
this.id = formObj.id
this.formObj = formObj
this.modalTitle = '编辑模板配置'
console.log('formObj>>>', this.formObj)
}
this.showModal = true
},
// 获取表数据
_resultChange(msg) {
this.showModal = false
this.$refs.footerModal._hideLoading()
this.$Message.success(msg)
this.$emit('on-result-change')
this.$refs.footerModal._hideLoading()
},
_optionChange(data) {
this.formObj.itemed = data
console.log(this.formObj.itemed)
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('edit-form-template-config')
if (this.$string(this.id).isEmpty()) {
data.templateId = this.templateId
data.itemed = this.formObj.itemed
// 添加
this._save(data)
} else {
// 编辑
data.itemed = this.formObj.itemed
this._edit({ id: this.formObj.id, obj: data })
}
} else {
this.$refs.footerModal._hideLoading()
this.$Message.error('表单验证失败!')
}
})
},
_save: async function(data) {
console.log(data)
const result = await soilAptitude.saveOriginalTemplateConfig(data)
console.log(result)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.editOriginalTemplateConfig(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this.showModal = false
this._hideLoading()
},
_visibleChange(data) {
if (!data && this.$showBtn('food-aptitude-item-step-edit')) {
this.$emit('on-result-change')
this.$refs.testStepByAptitude._clear()
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding marginLeft-10">
<div class="layout-content-main tree-position">
<div class="position-right">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form" v-show="searchOpen" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="模板名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入模板名称" clearable></Input>
<input type="hidden" name="classifyId">
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :page-columns="pageColumns"
:get-page="getPage" :opt-col-width="120" :icon-msg="iconMsg" @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
<!-- 添加、编辑 -->
<SoilRecordTemplateEdit ref="editModal" @on-result-change="_search"></SoilRecordTemplateEdit>
<SoilRecordEdit ref="reportEdit" @on-result-change="_search"></SoilRecordEdit>
<ConfigTemplate ref="configTemplateModal" @on-result-change="_page"></ConfigTemplate>
</div>
</template>
<script>
import global from '../../../api/config'
import { soilAptitude } from '../../../api'
import SoilRecordTemplateEdit from './InOutExportTemplateEdit'
import SoilRecordEdit from './SoilRecordEdit'
import ConfigTemplate from './ConfigTemplate'
export default {
components: { SoilRecordTemplateEdit, SoilRecordEdit, ConfigTemplate },
data() {
return {
pageColumns: [
{ title: '模板名称', key: 'name' },
{ title: '类别', key: 'classType', width: 120 },
{ title: '样品开始行', key: 'sampleBeginRow', width: 120 },
{ title: '样品合并数', key: 'sampleMergerNum', width: 120 },
{ title: '模板样品数', key: 'templateSampleNum', width: 120 },
{ title: '备注', key: 'remark' }
],
formObj: {
name: undefined
},
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' },
{ type: 'ios-build-outline', id: '', name: '配置' },
{ type: 'ios-book', id: '', name: '预览/编辑' },
// { type: 'ios-download', id: '', name: '下载' },
{ type: 'md-remove-circle', id: '', name: '删除' }
],
getPage: {},
tableStyleObj: {},
btn: [
{ type: 'success', id: '', name: '添加' },
{ type: 'error', id: '', name: '删除' }
],
searchOpen: true,
selectIds: []
}
},
computed: {
// tableHeight: function() {
// if (this.searchOpen) {
// return this.$newTableHeight('search')
// } else {
// return this.$newTableHeight('noSearch')
// }
// }
},
mounted() {
this._page()
},
methods: {
_btnClick(msg) {
switch (msg) {
case '添加':
this._editModal()
break
case '删除':
this._delAll()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_refresh() {
// 刷新
this.id = ''
this.name = ''
this._search()
this._classTree()
},
_classData(result, msg) {
$('input[name=classifyId]').val(result)
this._formSearch()
},
_classTree() {
this.$refs.classTree._Ztree()
},
_treeHide() {
// 左侧树隐藏
this.isTree = false
this.tableStyleObj.marginLeft = '15px'
},
_treeShow() {
this.isTree = true
this.tableStyleObj.marginLeft = '215px'
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._reportEdit(data)
break
case '下载':
this._download(data.id)
break
case '预览/编辑':
this._lookReport(data)
break
case '配置':
this._configData(data)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_configData(data) {
this.$refs.configTemplateModal._open(data)
},
_lookReport: async function(data) {
const result = await soilAptitude.originalTemplateGetById(data.id)
if (result) {
this._viewReport(result)
}
},
_viewReport(data) {
console.log('getUserInfo', global.getUserInfo())
// window.open(global.baseURL + '/print/v1/oos?key=' + objectKey+'&edit=true', '', 'height=' + (screen.availHeight - 50) + ',' +
// 'width=' + (screen.availWidth - 10) + ',top=0,left=0,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,' +
// 'location=no,status=no')
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
id: data.id,
idType: 12,
isReport: 4
})
}
},
_contHide() {
this._page()
},
_page: async function() {
console.log('page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.pageInOutExportTemplate(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_editModal() {
this.$refs.editModal._open()
},
_reportEdit(data) {
this.$refs.reportEdit._open(data)
},
// 批量删除
_delAll() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._deleteByIds(ids)
}
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilAptitude.originalTemplateDeleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_download(id) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载?',
onOk: () => {
window.open(
global.baseURL + '/base/v1/file_template/download/' + id,
'_blank'
)
}
})
},
_search() {
this._page()
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
// this.getPage = this.$store.state.SysFileTemplate.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false">
<p slot="header">{{modalTitle}}</p>
<div v-show="isLoad">
<Spin fix>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在上传,请稍后...</div>
</Spin>
</div>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95">
<Form-item label="类别" prop="classType">
<el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.value"
:value="item.value"></el-option>
</el-select>
</Form-item>
<Form-item label="模板名称" prop="name">
<Input v-model="formObj.name" name="name" placeholder="请输入原始记录名称" @on-keyup="_onKeyUp"></Input>
</Form-item>
<Form-item label="备注" prop="remark">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注" @on-keyup="_onKeyUp"></Input>
</Form-item>
</Form>
</div>
<div slot="footer" class="btn-width clearfix">
<Button style="margin-left: 8px;" @click="_cancel">取消</Button>
<label style="margin-bottom: 0;float: right">
<Upload
:action="action"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:on-format-error="_formatError"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
:format="format"
>
<Button :disabled="isDisable" type="primary">导入文件</Button>
</Upload>
</label>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import global from '../../../api/config'
const defVal = {
name: '',
remark: '',
classType: '',
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
return {
modalTitle: '添加',
formObj: defVal,
ruleValidate: {
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
classType: [
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
typeList: [
{
value: '入库导出模板'
},
{
value: '出库导出模板'
}
],
showEditModal: false,
dataObj: {
file: ''
},
pname: '',
action: '',
isLoad: false,
isDisable: true,
format: ['docx', 'xlsx', 'xls']
}
},
methods: {
_onKeyUp() {
if (this.formObj.name === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/soil/v1/original_template/upload_in_out_template/?name=' +
this.formObj.name +
'&remark=' +
this.formObj.remark +
'&classType=' +
this.formObj.classType
}
},
_selectZtree() {
// this.$refs.ztreeModal._openZtree()
},
_cancel() {
this.showEditModal = false
},
_open() {
this.showEditModal = true
this.isLoad = false
this.formObj.name = ''
this.formObj.alias = ''
this.formObj.remark = ''
this.formObj.classType = ''
this.modalTitle = '添加开土制备模板'
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
this.isLoad = false
this.$Message.success('上传成功!')
this.$emit('on-result-change')
this.showEditModal = false
} else {
this.isLoad = true
this.$Message.error(response.msg)
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree(result) {
this.pname = ''
if (result === undefined) {
this.formObj.classifyId = '0'
this.pname = ''
} else {
this.formObj.classifyId = result.id
this.pname = result.name
}
// 判断必填项是否为空
this._onKeyUp()
}
}
}
</script>
<style scoped>
.clearfix:after {
content: '';
clear: both;
display: block;
}
</style>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false">
<p slot="header">{{modalTitle}}</p>
<div v-show="isLoad">
<Spin fix>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在上传,请稍后...</div>
</Spin>
</div>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="95" inline class="inputBox">
<Form-item label="类别" prop="classType" style="width: 100%">
<!-- <Input v-model="formObj.classType" @on-keyup="_onKeyUp" name="classType" placeholder="请选择类别" icon="plus-circled"-->
<!-- ></Input>-->
<el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
<el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList"
:key="index"></el-option>
</el-select>
</Form-item>
<Form-item label="原始记录名称" prop="alias" style="width: 100%">
<Input v-model="formObj.alias" name="alias" placeholder="请输入原始记录名称"></Input>
</Form-item>
<Form-item label="备注" prop="remark" style="width: 100%">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注"></Input>
</Form-item>
<Form-item label="样品开始行" prop="sampleBeginRow" style="width: 100%">
<el-input
v-model="formObj.sampleBeginRow"
@keydown.native="channelInputLimit"
name="sampleBeginRow"
type="number"
onmousewheel="return false"
placeholder="请输入样品开始行"
/>
</Form-item>
<Form-item label="样品合并数" prop="sampleMergerNum" style="width: 100%">
<el-input
v-model="formObj.sampleMergerNum"
@keydown.native="channelInputLimit"
name="sampleMergerNum"
type="number"
onmousewheel="return false"
placeholder="请输入样品合并数"
/>
</Form-item>
<Form-item label="模板样品数" prop="templateSampleNum" style="width: 100%">
<el-input
v-model="formObj.templateSampleNum"
@keydown.native="channelInputLimit"
name="templateSampleNum"
type="number"
onmousewheel="return false"
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">
<Button @click="_cancel" style="margin-left: 8px;">取消</Button>
<Button @click="_ok" type="primary" style="margin-bottom: 0;float: right">保存</Button>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import { soilAptitude } from '../../../api'
const defVal = {
alias: '',
classType: '',
remark: '',
sampleBeginRow: '',
sampleBeginCol: '',
sampleMergerNum: '',
templateSampleNum: '',
moreSheet: 0,
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
const validatesampleBeginRow = (rule, value, callback) => {
if (this.formObj.sampleBeginRow === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
const validatesampleMergerNum = (rule, value, callback) => {
if (this.formObj.sampleMergerNum === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
const validatetemplateSampleNum = (rule, value, callback) => {
if (this.formObj.templateSampleNum === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
const validatesampleBeginCol = (rule, value, callback) => {
if (this.formObj.sampleBeginCol === '') {
callback(new Error('内容不能为空'))
} else {
callback()
}
}
return {
modalTitle: '编辑',
formObj: defVal,
ruleValidate: {
alias: [
{ required: true, message: '模板名称不能为空', trigger: 'blur' }
],
sampleBeginRow: [
{
required: true,
validator: validatesampleBeginRow,
message: '样品开始行不能为空',
trigger: 'blur'
}
],
sampleBeginCol: [
{
required: true,
validator: validatesampleBeginCol,
message: '样品开始列不能为空',
trigger: 'blur'
}
],
sampleMergerNum: [
{
required: true,
validator: validatesampleMergerNum,
message: '样品合并数不能为空',
trigger: 'blur'
}
],
templateSampleNum: [
{
required: true,
validator: validatetemplateSampleNum,
message: '模板样品数不能为空',
trigger: 'blur'
}
],
classType: [
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
sheetType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
typeList: [
{
value: '力学'
},
{
value: '物性'
},
{
value: '高级'
}
],
id: '',
showEditModal: false,
dataObj: {
file: ''
},
pname: '',
action: '',
isLoad: false,
isDisable: true,
format: ['docx', 'xlsx', 'xls']
}
},
methods: {
_onKeyUp() {
if (this.formObj.alias === '' || this.formObj.classType === '') {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/meter/v1/file_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
_selectZtree() {
// this.$refs.ztreeModal._openZtree()
},
_cancel() {
this.showEditModal = false
},
_ok() {
this.$refs.formObj.validate(valid => {
console.log('valid', valid)
if (valid) {
this._editOk()
} else {
this.$Message.error('请输入必填值')
}
})
},
_editOk: async function() {
const result = await soilAptitude.originalTemplateEdit({
id: this.id,
formObj: this.formObj
})
if (result) {
this.$message.success('编辑成功')
this.showEditModal = false
this.$emit('on-result-change')
}
},
_open(data) {
console.log(data)
this.showEditModal = true
this.isLoad = false
this.id = data.id
this.formObj.alias = data.alias
this.formObj.remark = data.remark
this.formObj.classType = data.classType
this.formObj.sampleBeginRow = data.sampleBeginRow
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)
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
},
// _handelsuccess(response, file, fileList) {
// // 上传成功
// if (response.success) {
// this.isLoad = false
// this.$Message.success('上传成功!')
// this.$emit('on-result-change')
// this.showEditModal = false
// } else {
// this.isLoad = true
// this.$Message.error(response.msg)
// }
// },
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree(result) {
this.pname = ''
if (result === undefined) {
this.formObj.classifyId = '0'
this.pname = ''
} else {
this.formObj.classifyId = result.id
this.pname = result.name
}
// 判断必填项是否为空
}
}
}
</script>
<style scoped>
.clearfix:after {
content: '';
clear: both;
display: block;
}
.inputBox >>> input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
.inputBox >>> input[type='number'] {
-moz-appearance: textfield !important;
}
</style>
......@@ -43,43 +43,6 @@ export default {
this.activeName = 'summary'
this.entrustId = entrustId
this.$refs.summaryTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.entrustId)
......@@ -107,12 +70,6 @@ export default {
_visibleChange() {
this.$emit('on-result-change')
}
// _sampleTabResult(msg) {
// if (msg === 'changeTab') {
// this.activeName = 'report'
// this.$refs.reportTabs._open(this.contractId, this.personal)
// }
// }
}
}
</script>
......@@ -43,43 +43,6 @@ export default {
this.activeName = 'summary'
this.entrustId = entrustId
this.$refs.summaryTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.entrustId)
......@@ -104,12 +67,6 @@ export default {
break
}
}
// _sampleTabResult(msg) {
// if (msg === 'changeTab') {
// this.activeName = 'report'
// this.$refs.reportTabs._open(this.contractId, this.personal)
// }
// }
}
}
</script>
......@@ -115,41 +115,6 @@ export default {
this.showIssueModal = false
this._createOk()
},
// 生成报告
_createOk() {
const obj = []
for (let i = 0; i < this.tableData.length; i++) {
obj.push({
sampleId: this.tableData[i].id,
reportSn: this.tableData[i].reportSn,
issueDate: this.issueDate
})
}
this.$layxLoading(true, '数据验证中')
const validateObj = {
sampleReports: obj,
reportModelId: this.reportModelId
}
// 先进行验证
this.$store
.dispatch('FoodSampleReport/createReportValidate', validateObj)
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const currentTime = new Date().getTime()
this.$refs.progressModal._open(this.tableData.length, currentTime)
validateObj.seriesNo = currentTime
console.log('生成报告的当前序列号,', validateObj.seriesNo)
this.$store
.dispatch('FoodSampleReport/createReport', validateObj)
.then(() => {})
}
this._hideLoading()
this.isLoading = false
this.$layxLoading(false)
})
},
_closeResult() {
this.showBatchModal = false
this.$emit('on-result-change')
......
......@@ -131,19 +131,6 @@ export default {
this._page()
}
},
_updateDate(date) {
this.$store
.dispatch('PrintForm/updateTimeBatch', {
ids: this.selectIds.join(','),
fillInTime: date
})
.then(() => {
if (this.$store.state.PrintForm.success) {
this._page()
this.$Message.success('更新成功!')
}
})
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -113,7 +113,6 @@
</div>
</template>
<script>
import http from '../../../api/http'
import { soilEntrust, soilTest } from '../../../api'
export default {
components: {},
......@@ -351,23 +350,6 @@ export default {
this._resultChange('取消分包成功')
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() {
this.$refs.refModal._open(this.sampleId)
},
......@@ -386,37 +368,12 @@ export default {
console.log(index)
this._deleteById(data.id)
break
case '导出样品委托协议':
this._exportAgreement(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_exportAgreement(id) {
this.$store
.dispatch(
'ReportExport/getById',
'food-contract-company-export-sample-agreement'
)
.then(() => {
if (this.$store.state.ReportExport.model) {
if (this.$store.state.ReportExport.model.indexOf('?') !== -1) {
window.open(
this.$store.state.ReportExport.model + '&sampleId=' + id,
'_blank'
)
} else {
window.open(
this.$store.state.ReportExport.model + '?sampleId=' + id,
'_blank'
)
}
}
})
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
......@@ -427,9 +384,6 @@ export default {
this.selectIds = selectIds
this.selectData = data
break
// case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName)
// break
case 'page':
this._page()
break
......@@ -506,18 +460,6 @@ export default {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
// localStorage.setItem('type', data.type)
// // 编辑
// this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
// const result = this.$store.state.FoodSample.companyModel
// if (data.type === 0) {
// // 普通企业样品
// this.$refs.refModal._open(result, this.sampleId)
// } else if (data.type === 3) {
// // 模拟样品
// this._editImitateModal(true, result)
// }
// })
} else {
// 添加
this.$refs.refModal._open('', this.sampleId)
......@@ -545,50 +487,6 @@ export default {
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/company/import_' + this.sampleId,
downloadUrl: '/food/v1/excel/template/FoodSampleCompany',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
......
......@@ -143,14 +143,6 @@ export default {
})
}
this._updateRecord(param)
// this.$store.dispatch('EnvItem/updateFormForItem', param).then(() => {
// if (this.$store.state.EnvItem.success) {
// this.$Message.success('保存成功')
// // this.showModal = false;
// this.$emit('on-result-change')
// this._cancel()
// }
// })
}
}
}
......
......@@ -65,9 +65,6 @@
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div>
</template>
<script>
......@@ -145,45 +142,8 @@ export default {
},
mounted() {
this._page()
// 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
},
methods: {
_userResult(data, msg) {
const sendData = {
ids: this.selectIds.join(',')
}
if (data) {
sendData.person = data.realname
sendData.personId = data.userId
}
switch (msg) {
case 'contractSendMan':
// 一键发放
this.$store.dispatch('FoodContract/oneKeySend', sendData).then(() => {
this._resultChange('发放成功')
})
break
case 'contractReceiveSendMan':
// 一键接收并发放
this.$store
.dispatch('FoodContract/oneKeyReceiveSend', sendData)
.then(() => {
this._resultChange('一键接收并发放成功')
})
break
case 'sampleSendScanMan':
// 扫码发放
this.$refs.refModal._open('扫码发放', data)
break
case 'sampleReceiveSendScanMan':
// 扫码接收并发放
this.$refs.refModal._open('扫码接收发放', data)
break
}
},
// 一键接收并发放
// 组件返回值
_componentResult(data, msg) {
switch (this.currentComponent) {
......@@ -250,91 +210,6 @@ export default {
this.$refs.userModal._open(msg, '请选择领样人')
}
},
// 一键接收并发放
_oneKeyReceiveSend() {
if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!')
} else {
// 根据字典是否选择人员
// eslint-disable-next-line no-lonely-if
if (this.acceptSelectUserValue === '是') {
// 选择人员接收并发放
this.$store
.dispatch('FoodContract/oneKeyReceiveSendCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
const result = this.$store.state.FoodContract.success
if (result) {
// 验证成功
this.$refs.userModal._open(
'contractReceiveSendMan',
'请选择领样人'
)
}
})
} else {
// 不选择人员
this.$store
.dispatch('FoodContract/oneKeyReceiveSend', {
ids: this.selectIds.join(',')
})
.then(() => {
this._resultChange('一键接收并发放成功')
})
}
}
},
// 一键发放
_oneKeySend() {
if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!')
} else {
// 一键发放判断是否选人
// eslint-disable-next-line no-lonely-if
if (this.acceptSelectUserValue === '是') {
this.$store
.dispatch('FoodContract/oneKeySendCheck', {
ids: this.selectIds.join(',')
})
.then(() => {
if (this.$store.state.FoodContract.success) {
this.$refs.userModal._open('contractSendMan', '请选择领样人')
}
})
} else {
// 一键发放
this.$store
.dispatch('FoodContract/oneKeySend', {
ids: this.selectIds.join(',')
})
.then(() => {
this._resultChange('发放成功')
})
}
}
},
// 一键接收
_oneKeyReceive() {
if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content:
'确定要一键接收这 ' + this.selectIds.length + ' 条委托下的样品?',
onOk: () => {
this.$store
.dispatch('FoodContract/oneKeyReceive', {
ids: this.selectIds.join(',')
})
.then(() => {
this._resultChange('接收成功')
})
}
})
}
},
// 信息维护
_maintainInfo() {
if (this.selectIds.length === 0) {
......@@ -391,24 +266,8 @@ export default {
_editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, name)
},
_editModals(res, data) {
if (res === '登记协议') {
this.$refs.editModal._open(res, data)
} else if (res === '编辑协议') {
this.$store
.dispatch('FoodContract/verificationEdit', { id: data.id })
.then(() => {
if (this.$store.state.FoodContract.model === true) {
this.$refs.editModal._open(res, data)
}
})
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
break
case 'selectIds':
this.selectIds = data
break
......@@ -434,21 +293,6 @@ export default {
this.getPage = result
}
},
_detailModal(id, type) {
// 查看
this.$store.dispatch('FoodContract/getById', id).then(() => {
if (type === 0) {
// 企业委托 ’0‘
this.currentComponent = 'FoodContractCompanyDetail'
} else {
// 政府委托 ’1‘
this.currentComponent = 'FoodContractGovernDetail'
}
this.$nextTick(() => {
this.$refs.refModal._open(this.$store.state.FoodContract.model)
})
})
},
_search() {
this._page()
},
......@@ -461,11 +305,9 @@ export default {
// this.$refs.operation._open(id)
},
_resultChange(msg) {
if (this.$store.state.FoodContract.success) {
this._page()
this.$Message.success(msg)
this.selectIds = []
}
this._page()
this.$Message.success(msg)
this.selectIds = []
},
_upload(id) {
// 上传文件
......@@ -473,7 +315,6 @@ export default {
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// this.$refs.FileManage._open(id, 'entrustId')
}
}
}
......
......@@ -53,43 +53,6 @@ export default {
this.activeName = 'sample'
this.entrustId = entrustId
this.$refs.sampleTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.entrustId)
......
......@@ -371,21 +371,6 @@ export default {
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_detailModal(id, type) {
// 查看
this.$store.dispatch('FoodContract/getById', id).then(() => {
if (type === 0) {
// 企业委托 ’0‘
this.currentComponent = 'FoodContractCompanyDetail'
} else {
// 政府委托 ’1‘
this.currentComponent = 'FoodContractGovernDetail'
}
this.$nextTick(function() {
this.$refs.refModal._open(this.$store.state.FoodContract.model)
})
})
},
_upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
......
......@@ -82,31 +82,8 @@ export default {
currentComponent: '',
searchOpen: false,
btn: [
{
type: 'primary',
id: 'food-report-make-push-to-gc',
name: '推送至国抽平台'
},
{ type: 'success', id: 'ZBC', name: '生成' },
{
type: 'success',
id: 'food-report-make-select-template-create',
name: '选择模板生成',
componentName: 'CreateReport'
},
{
type: 'primary',
id: 'food-report-make-create-samples',
name: '多样品生成',
componentName: 'CreateReportBySamples'
},
{
type: 'primary',
id: 'food-report-make-edit-items',
name: '批量维护检测项目',
componentName: 'FoodItemBatchEditModal'
},
{
type: '',
id: 'food-report-make-sample-maintain-info',
name: '信息维护',
......@@ -168,7 +145,6 @@ export default {
}
],
dataPushedList: [{ value: 0, name: '否' }, { value: 1, name: '是' }],
postUrl: 'FoodSample/pageSampleReportMake',
currentId: ''
}
},
......@@ -253,45 +229,8 @@ export default {
// 上传文件
this.$refs.refModal._open(id, 'sampleId')
},
_edit(data) {
if (data.type === 0) {
this.currentComponent = 'FoodSampleCompanyEdit'
this.$store.dispatch('FoodSample/getByCompanyId', data.id).then(() => {
this.$nextTick(function() {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel,
this.formObj.contractId
)
})
})
} else if (data.type === 2) {
this.currentComponent = 'FoodSampleGovernLYEdit'
this.$store.dispatch('FoodSample/getByGovernId', data.id).then(() => {
this.$nextTick(function() {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.formObj.contractId
)
})
})
} else {
this.currentComponent = 'FoodSampleGovernEdit'
this.$store.dispatch('FoodSample/getByGovernId', data.id).then(() => {
this.$nextTick(function() {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel,
this.formObj.contractId
)
})
})
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSample.page
break
case 'selectData':
this.selectData = data
this.selectIds = []
......@@ -340,12 +279,6 @@ export default {
case '选择模板生成':
this._judgeReport('create')
break
case '推送至国抽平台':
this._pushToGC()
break
case '多样品生成':
this._judgeReport('create-samples')
break
case '批量维护检测项目':
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
......@@ -370,32 +303,10 @@ export default {
this.$refs.refModal._open(this.selectIds, 2)
}
},
// 推送至国抽平台
_pushToGC() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要推送这' + ids.length + '条数据至国抽平台?',
loading: true,
onOk: () => {
this.$store
.dispatch('FoodSample/pushDataToGC', { ids: ids.join(',') })
.then(() => {
this._resultChange('信息推送成功')
})
}
})
}
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this.$Message.success(msg)
this._page()
this.selectIds = []
}
this.$Message.success(msg)
this._page()
this.selectIds = []
this.$Modal.remove()
},
// 生成报告
......@@ -412,38 +323,6 @@ export default {
break
}
}
},
_createReport() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const validateObj = { sampleIds: this.selectIds }
// 先进行验证
this.$store
.dispatch('FoodSampleReport/generateAutomaticValidate', validateObj)
.then(() => {
if (this.$store.state.FoodSampleReport.success) {
// 验证成功之后再建立连接,然后进行生成报告操作
// 建立websocket连接
const currentTime = new Date().getTime()
// true --- 建立连接
this.currentComponent = 'ProgressByReport'
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds.length, currentTime)
})
validateObj.seriesNo = currentTime
this.$store
.dispatch('FoodSampleReport/generateAutomatic', validateObj)
.then(() => {})
} else {
// false --- 弹出选择模板框
this.currentComponent = 'CreateReport'
this.$nextTick(() => {
this.$refs.refModal._open(this.selectData)
})
}
})
}
}
}
}
......
......@@ -177,19 +177,6 @@ export default {
this._page()
}
},
_updateDate(date) {
this.$store
.dispatch('PrintForm/updateTimeBatch', {
ids: this.selectIds.join(','),
fillInTime: date
})
.then(() => {
if (this.$store.state.PrintForm.success) {
this._page()
this.$Message.success('更新成功!')
}
})
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -418,14 +405,7 @@ export default {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this.$store.dispatch('EnvItem/deleteOriRecord', ids).then(() => {
if (this.$store.state.EnvItem.success) {
this._page()
this.$Message.success('删除成功!')
}
})
}
onOk: () => {}
})
}
}
......
......@@ -53,43 +53,6 @@ export default {
this.activeName = 'sample'
this.entrustId = entrustId
this.$refs.sampleTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.entrustId)
......
......@@ -206,22 +206,6 @@ export default {
$('input[name="reportDueDateBegin"]').val(data[0])
$('input[name="reportDueDateEnd"]').val(data[1])
},
// 从字典查预警期
_dicSearch() {
// 食品报告编制个人任务是否勾选
const data = ['食品报告编制个人任务是否勾选']
this.$store.dispatch('LmsBaseDict/listDict', data).then(() => {
const result = this.$store.state.LmsBaseDict.list
const personalList = result[0]
// 食品报告编制个人任务是否勾选
if (personalList.length && personalList[0].name === '是') {
this.personal = 1
} else {
this.personal = 0
}
this._page()
})
},
_btnClick(msg) {
switch (msg) {
case '信息维护':
......@@ -397,21 +381,6 @@ export default {
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_detailModal(id, type) {
// 查看
this.$store.dispatch('FoodContract/getById', id).then(() => {
if (type === 0) {
// 企业委托 ’0‘
this.currentComponent = 'FoodContractCompanyDetail'
} else {
// 政府委托 ’1‘
this.currentComponent = 'FoodContractGovernDetail'
}
this.$nextTick(function() {
this.$refs.refModal._open(this.$store.state.FoodContract.model)
})
})
},
_upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
......
......@@ -54,7 +54,6 @@
</Col>
</Row>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
</div>
......@@ -77,10 +76,6 @@ export default {
{ value: 0, name: '合格' },
{ value: 1, name: '不合格' }
],
// typeList: [
// {name: '企业', value: 0},
// {name: '政府', value: 1},
// ],
currentComponent: '',
searchOpen: false,
selectIds: [],
......@@ -152,7 +147,6 @@ export default {
name: '操作记录',
componentName: 'FoodReportRecord'
},
formObj: {
reportSn: '',
sampleName: '',
......@@ -188,8 +182,7 @@ export default {
{ name: '否', value: 0 },
{ name: '进行中', value: 1 }
],
reportType: 'FOOD_REPORT_MANAGE',
selectStatuss: []
reportType: 'FOOD_REPORT_MANAGE'
}
},
computed: {
......@@ -218,11 +211,6 @@ export default {
this.formObj.statusList = ''
}
},
_getStatus() {
this.$store.dispatch('LmsEnum/getByType', 'ReportStatusEnum').then(() => {
this.statusList = this.$store.state.LmsEnum.model
})
},
_reportDateChange(data) {
this.formObj.reportDueDateBegin = data[0]
this.formObj.reportDueDateEnd = data[1]
......@@ -250,16 +238,6 @@ export default {
break
}
},
// 查询执行标准
_getStdList(data) {
const obj = { classify: 0, page: 1, row: 20 }
if (data) {
obj.name = data.name
}
this.$store.dispatch('StandardInfo/pageListByName', obj).then(() => {
this.stdList = this.$store.state.StandardInfo.page.records
})
},
// 盖完章以后刷新已选择的数据
_refreshData() {
if (this.selectIds.length > 0) {
......@@ -268,17 +246,6 @@ export default {
this._page()
}
},
// 根据ids 请求
_refreshPage() {
const obj = {}
obj.ids = this.selectIds.join(',')
obj.page = 1
obj.rows = 1000
this.$store.dispatch('FoodSampleReport/pageTableReport', obj).then(() => {
const resRows = this.$store.state.FoodSampleReport.page.records
this.$refs.pageTable._refreshRows(resRows)
})
},
async _page() {
const data = this.$serialize('res-reports-form')
Object.assign(data, this.$refs.pageTable._searchParams())
......@@ -342,18 +309,6 @@ export default {
}
})
},
_viewPDF(data) {
this.$store
.dispatch('FoodSampleReport/viewReportPDF', data.id)
.then(() => {
const res = this.$store.state.FoodSampleReport.model
if (res) {
this.$pdfView(res)
} else {
this.autoPdf(data)
}
})
},
_record(id) {
this.$refs.refModal._open(id)
},
......@@ -364,9 +319,6 @@ export default {
case '退回':
this._return()
break
case '盖章':
this._toPDF()
break
case '下载':
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
......@@ -374,13 +326,6 @@ export default {
this.$refs.refModal._open(this.selectIds)
}
break
case '下载报告二维码':
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._downloadCode(this.selectIds)
}
break
case '打印':
const ids = this.selectIds
if (ids.length === 0) {
......@@ -389,13 +334,6 @@ export default {
this.$refs.refModal._open(this.selectIds)
}
break
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case '批量填写发放记录':
if (this.selectData.length === 0) {
this.$Message.warning('请至少选择一条数据!')
......@@ -406,59 +344,12 @@ export default {
)
}
break
case '更新PDF版报告':
this._updatePdfReport()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
// 下载报告二维码
_downloadCode(selectIds) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载这 ' + selectIds.length + ' 个报告二维码?',
onOk: () => {
// eslint-disable-next-line no-undef
http.open(
global.baseURL + '/food/v1/sample_report/download_qrcode_batch',
{
reportIds: this.selectIds.join(',')
},
'_blank'
)
}
})
},
// 更新PDF版报告
_updatePdfReport() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
// 打印word
_printWord() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条样品数据!')
} else {
for (let i = 0; i < ids.length; i++) {
this.$pageofficePrint({ ids: ids })
}
}
},
// 盖章
_toPDF() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_return() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
......@@ -469,50 +360,6 @@ export default {
_upload(id) {
this.$refs.refModal._open(id)
},
_viewReport(id) {
this.$store.dispatch('FoodSampleReport/viewReport', id).then(() => {
const data = this.$store.state.FoodSampleReport.page
if (data !== undefined) {
// 查询token,后台使用pageoffice调接口查询数据,需要token,否则提示未登录
this.$openWindowModeless({
objectKey: data.objectKey,
id: id,
isReport: 1
})
}
})
},
// 下载
_batchDown(Type) {
if (Type === '2') {
const ids = this.selectIds
this.$Modal.confirm({
title: '提示',
content: '确定要下载这 ' + ids.length + ' 个报告?',
onOk: () => {
// eslint-disable-next-line no-undef
http.open(
global.baseURL +
'/food/v1/sample_report/download_batch_by_sampleIds',
{
ids: ids.join(','),
flag: 1
},
'_blank'
)
}
})
} else {
// eslint-disable-next-line no-undef
http.open(
'/food/v1/sample_report/downloadSignature_batch?ids=' +
this.selectIds +
'&flag=1' +
'&pdfType=' +
Type
)
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
......@@ -526,42 +373,6 @@ export default {
this._exportOk(this.selectData.length)
}
},
_exportOk(length) {
this.$Message.destroy()
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + length + '条数据?',
onOk: () => {
if (this.selectData.length > 0) {
this.$exportExcel(
'resReportTable',
'报告台账',
this.pageColumns,
this.selectData
)
} else {
this.$Message.loading({
content: '正在处理,请稍后...',
duration: 0
})
this.$store
.dispatch(
'FoodSampleReport/pageTableReport',
this._searchParams()
)
.then(() => {
const result = this.$store.state.FoodSampleReport.page.records
this.$exportExcel(
'resReportTable',
'报告台账',
this.pageColumns,
result
)
})
}
}
})
},
// 参数
_searchParams() {
const data = this.$serializeFormSearch(this.formObj)
......
......@@ -99,51 +99,20 @@ export default {
{ name: '取消', type: '' },
{ name: '保存', type: 'primary' }
],
microbedList: [{ value: 0, name: '否' }, { value: 1, name: '是' }],
// 检测依据
testBasisData: [],
// 类别下拉数组
typeData: [],
// 检测科室
groupData: [],
groupName: '',
// 主检人
userData: [],
// 单位
unitData: [],
aptitudeData: [],
aptitude: '',
// testBasisName: '',
computeTypeList: [],
tester: '',
marksList: [],
detectionTypeList: [],
testItemData: [],
formId: ''
}
},
mounted() {
// 检测科室
// this._getUserGroup()
// 检测依据
// this._getTestBasisList()
// 资质
// this._getAptitudeList()
// this._getType()
},
mounted() {},
methods: {
// 字典
_dicSearch() {
this.$store.dispatch('LmsBaseDict/getItem', '食品检出类别').then(() => {
const result = this.$store.state.LmsBaseDict.item
this.detectionTypeList = result
if (this.$string(this.id).isEmpty()) {
// 添加界面默认第一个
this.formObj.detectionType = result.length > 0 ? result[0].name : ''
}
})
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
......@@ -189,10 +158,6 @@ export default {
case '保存':
this._ok()
break
case '填写说明':
this.$refs.introduction._open()
this._hideLoading()
break
}
},
_hideLoading() {
......@@ -214,63 +179,6 @@ export default {
}
this.showModal = true
},
// 获取检测项目
_getItemList(value) {
const data = {}
if (value) {
Object.assign(data, { name: value })
}
this.$store.dispatch('FoodAptitudeItem/getTestItem', data).then(() => {
this.testItemData = this.$store.state.FoodAptitudeItem.list
})
},
// 检测项目结果
_testItemChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.name = data
this.$refs.formObj.validateField('name')
this._changeMicrobed()
break
case 'query':
this.formObj.name = data
this._getItemList(data)
break
case 'blur':
this._changeMicrobed()
break
}
},
_changeMicrobed() {
// 新增或者导入新增资质时 如果检测项目名称带‘菌’字,则是否微生物默认为‘是’
if (this.id === '') {
if (this.formObj.name.indexOf('菌') > -1) {
this.$set(this.formObj, 'microbed', 1)
} else {
this.$set(this.formObj, 'microbed', 0)
}
}
},
_clearMarks() {
this.marksList = []
},
// 主检人&检测科室
_groupChange(data) {
if (data) {
this.groupName = data.label
this.formObj.groupId = data.value
this.formObj.tester = ''
this.formObj.testerId = ''
this._getUserList(data.value)
}
},
_userChange(data) {
if (data) {
this.formObj.testerId = data.value
this.formObj.tester = data.label
}
},
// 单位
_unitChange(msg, data) {
switch (msg) {
......
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