Commit b0fa4083 by lichengming

修改了管理样品

parent 8ad70ba0
...@@ -102,40 +102,43 @@ export default { ...@@ -102,40 +102,43 @@ export default {
_page: async function() { _page: async function() {
console.log('要传的参数') console.log('要传的参数')
console.log(this.formObj) console.log(this.formObj)
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.pageOutTaskOperation(this.formObj) const result = await meterEntrust.pageOutTaskOperation(this.formObj)
console.log(result) console.log(result)
if (result) { if (result) {
this.getPage = result this.getPage = result
this.$refs.pageTable._hideLoading()
} }
// this.$refs.pageTable._page(
// 'search-contract-record',
// 'FoodContractRecord/page',
// this.$serializeFormSearch(this.formObj)
// )
}, },
_pageSurplus: async function() { _pageSurplus: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.prepareRecordPage( const result = await meterEntrust.prepareRecordPage(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
this.getPage = result this.getPage = result
this.$refs.pageTable._hideLoading()
} }
}, },
_pageBackup: async function() { _pageBackup: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.backupRecordPage( const result = await meterEntrust.backupRecordPage(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
this.getPage = result this.getPage = result
this.$refs.pageTable._hideLoading()
} }
}, },
_pageTask: async function() { _pageTask: async function() {
console.log('要传的参数') console.log('要传的参数')
console.log(this.formObj) console.log(this.formObj)
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.pageTask(this.formObj) const result = await meterEntrust.pageTask(this.formObj)
console.log(result) console.log(result)
if (result) { if (result) {
this.getPage = result this.getPage = result
this.$refs.pageTable._hideLoading()
} }
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
......
...@@ -63,34 +63,15 @@ ...@@ -63,34 +63,15 @@
</div> </div>
</template> </template>
<script> <script>
import http from '../../api/http'
import { soilEntrust, soilSample } from '../../api' import { soilEntrust, soilSample } from '../../api'
import { getLodop } from '../../plugins/clodop/LodopFuncs'
import SoilSampleItemManage from './SoilSampleItemManage' import SoilSampleItemManage from './SoilSampleItemManage'
let LODOP
export default { export default {
components: { SoilSampleItemManage }, components: { SoilSampleItemManage },
data() { data() {
return { return {
formId: 'soilSampleManage', formId: 'soilSampleManage',
currentComponent: '', currentComponent: '',
btn: [ btn: [],
// {
// type: 'success',
// id: '',
// name: '导入检测项目'
// }
// {
// type: 'success',
// id: '',
// name: '导入检测项目包'
// },
// {
// type: 'success',
// id: '',
// name: '打印标签'
// }
],
itemList: [], itemList: [],
indexList: [], indexList: [],
footerList: [ footerList: [
...@@ -153,93 +134,16 @@ export default { ...@@ -153,93 +134,16 @@ export default {
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
console.log(this.getPage) console.log(this.getPage)
}, },
_itemImportBack(data) {
if (this.selectIds === undefined || this.selectIds.length === 0) {
return false
}
if (data === undefined || data.length === 0) {
return false
}
this._importItemOk({ sampleIds: this.selectIds, drugItemList: data })
},
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
case '添加':
this._editModal(false)
break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '打印标签':
this._printLabel()
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
break break
} }
}) })
}, },
_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.contractId)
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -247,19 +151,9 @@ export default { ...@@ -247,19 +151,9 @@ export default {
case '管理检测项目': case '管理检测项目':
this._itemManage(data.id) this._itemManage(data.id)
break break
case '编辑':
this._editModal(true, data)
break
case '复制':
this._copy(data)
break
case '删除': case '删除':
console.log(index)
this._deleteById(data.id) this._deleteById(data.id)
break break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
} }
}) })
}, },
...@@ -352,173 +246,12 @@ export default { ...@@ -352,173 +246,12 @@ export default {
// 删除一条记录 // 删除一条记录
this._deleteByIds([id]) this._deleteByIds([id])
}, },
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(data) {},
_editModal(edit, data) {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
} else {
// 添加
this.$refs.refModal._open('', this.contractId)
}
},
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.contractId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.contractId)
}
},
_search() { _search() {
this._page() this._page()
}, },
_resultChange(msg) { _resultChange(msg) {
this._page() this._page()
this.$Message.success(msg) this.$Message.success(msg)
},
_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.contractId,
downloadUrl: '/food/v1/excel/template/FoodSampleCompany',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.sampleItemModal._open()
this.$refs.pageTable.checkedData()
}
},
// 导入检测项目包
_importItemPackage() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
// this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
this.$refs.itemPackageModal._open(
this.selectIds,
'sample-rel-package-item'
)
}
},
_printLabel() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
for (let m = 0; m < this.selectData.length; m++) {
const row = this.selectData[m]
this._printLabelOk(row)
}
}
},
_printLabelOk(row) {
LODOP = getLodop()
if (LODOP === 'undefined' || LODOP === undefined) {
this._pluginDownload()
return false
}
if (LODOP.GET_PRINTER_COUNT() === 0) {
this.$Messager.warning('系统未关联打印机,请确认....')
return false
}
LODOP.PRINT_INITA('0mm', '0mm', '70.01mm', '50.01mm', '样品标签打印')
LODOP.ADD_PRINT_LINE(36, 15, 35, 251, 0, 1)
LODOP.ADD_PRINT_LINE(74, 15, 73, 251, 0, 1)
LODOP.ADD_PRINT_LINE(107, 15, 106, 251, 0, 1)
LODOP.ADD_PRINT_LINE(140, 15, 139, 251, 0, 1)
LODOP.ADD_PRINT_LINE(175, 15, 174, 251, 0, 1)
LODOP.ADD_PRINT_LINE(35, 15, 174, 16, 0, 1)
LODOP.ADD_PRINT_LINE(35, 74, 174, 75, 0, 1)
LODOP.ADD_PRINT_LINE(35, 251, 174, 252, 0, 1)
LODOP.ADD_PRINT_TEXT(49, 17, 59, 20, '样品名称')
LODOP.ADD_PRINT_TEXT(82, 18, 59, 20, '样品编号')
LODOP.ADD_PRINT_TEXT(116, 17, 59, 20, '样品状态')
LODOP.ADD_PRINT_TEXT(151, 27, 39, 20, '备注')
LODOP.ADD_PRINT_TEXT(16, 95, 100, 20, '检测样品标签')
LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
LODOP.ADD_PRINT_TEXT(49, 78, 135, 20, row.name)
LODOP.ADD_PRINT_TEXT(82, 77, 136, 20, row.sampleCode)
LODOP.ADD_PRINT_TEXT(117, 76, 176, 20, '□未检 □在检 □已检 □留样')
if (row.surplus === '取回') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '☑"取回 □服务方处理')
} else if (row.surplus === '服务方处理') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 ☑服务方处理')
} else {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 □服务方处理')
}
LODOP.PRINT_DESIGN()
},
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
} }
} }
} }
......
...@@ -215,15 +215,6 @@ export default { ...@@ -215,15 +215,6 @@ export default {
} }
this._importItemOk({ sampleIds: this.selectIds, drugItemList: data }) this._importItemOk({ sampleIds: this.selectIds, drugItemList: data })
}, },
// _importItemOk: async function(data) {
// const result = await drugSample.importSampleItemDTO(data)
// if (result) {
// this.$Message.success('导入成功!')
// await this._page()
// }
// },
_modalResult(data1, data2) { _modalResult(data1, data2) {
switch (this.currentComponent) { switch (this.currentComponent) {
case 'CopyModal': case 'CopyModal':
...@@ -382,6 +373,7 @@ export default { ...@@ -382,6 +373,7 @@ export default {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilEntrust.pagePrepareHis(this.formObj) const result = await soilEntrust.pagePrepareHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
......
...@@ -80,29 +80,8 @@ export default { ...@@ -80,29 +80,8 @@ export default {
currentComponent: '', currentComponent: '',
formId: 'meterSubcontractorFormId', formId: 'meterSubcontractorFormId',
searchOpen: false, searchOpen: false,
btn: [ btn: [],
// {
// type: 'success',
// id: '',
// name: '添加'
// },
// {
// type: 'success',
// id: '',
// name: '提交至评审'
// },
// {
// type: 'success',
// id: '',
// name: '提交'
// }
],
iconMsg: [ iconMsg: [
// {
// type: 'md-create',
// id: '',
// name: '编辑'
// },
{ {
type: 'ios-list', type: 'ios-list',
id: '', id: '',
...@@ -123,11 +102,6 @@ export default { ...@@ -123,11 +102,6 @@ export default {
id: '', id: '',
name: '导出开土制备记录' name: '导出开土制备记录'
}, },
// {
// type: 'ios-beaker',
// id: '',
// name: '管理样品'
// },
{ {
type: 'ios-camera-outline', type: 'ios-camera-outline',
id: '', id: '',
......
...@@ -158,6 +158,7 @@ export default { ...@@ -158,6 +158,7 @@ export default {
}) })
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilEntrust.pageSendHis(this.formObj) const result = await soilEntrust.pageSendHis(this.formObj)
console.log(this.formObj) console.log(this.formObj)
if (result) { if (result) {
......
...@@ -11,11 +11,8 @@ ...@@ -11,11 +11,8 @@
<Col span="24"> <Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="90" inline onsubmit="return false"> <Form id="search-sample-company" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="检测项目:" class="search-item"> <Form-item label="试验名称:" class="search-item">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable /> <Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable />
</Form-item>
<Form-item label="检测依据:" class="search-item">
<Input v-model="formObj.code" @on-enter="_formSearch" placeholder="请输入检测依据" clearable />
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary"> <Button @click="_formSearch" type="primary">
......
...@@ -155,6 +155,7 @@ export default { ...@@ -155,6 +155,7 @@ export default {
}) })
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilEntrust.pageReceiveHis(this.formObj) const result = await soilEntrust.pageReceiveHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
......
...@@ -977,7 +977,7 @@ Vue.prototype.$optColWidth = function(list) { ...@@ -977,7 +977,7 @@ Vue.prototype.$optColWidth = function(list) {
Vue.prototype.$defRow = 500 Vue.prototype.$defRow = 500
Vue.prototype.$setOptimization = function(msg) { Vue.prototype.$setOptimization = function(msg) {
// 默认 数据超过200条,启用虚拟加载,每次加载50条 // 默认 数据超过200条,启用虚拟加载,每次加载50条
let result = { gt: 200, oSize: 20, rSize: 50 } let result = { gt: 200, oSize: 100 }
switch (msg) { switch (msg) {
case 'modal-normal': case 'modal-normal':
// 弹出框正常情况下-- 数据超过25条启用虚拟加载 // 弹出框正常情况下-- 数据超过25条启用虚拟加载
......
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