Commit 652d4bcd by lichengming

修改了试验委托评审

parent 64f72fc5
...@@ -267,7 +267,7 @@ export default { ...@@ -267,7 +267,7 @@ export default {
for (let i = 0; i < selData.length; i++) { for (let i = 0; i < selData.length; i++) {
idList.push(selData[i].id) idList.push(selData[i].id)
} }
this.$emit('on-result-change', 'selectIds', idList) this.$emit('on-result-change', 'selectIds', idList, selData)
} else { } else {
// 有selectData参数时执行 // 有selectData参数时执行
this.$emit('on-result-change', 'selectData', selData) this.$emit('on-result-change', 'selectData', selData)
...@@ -276,6 +276,7 @@ export default { ...@@ -276,6 +276,7 @@ export default {
}, },
// 整行变色 // 整行变色
_tableRowClassName({ row, rowIndex }) { _tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
if (this.checkData.length !== 0) { if (this.checkData.length !== 0) {
/* 选中的进行高亮显示 */ /* 选中的进行高亮显示 */
const index = this.checkData.indexOf(row) const index = this.checkData.indexOf(row)
...@@ -418,6 +419,10 @@ export default { ...@@ -418,6 +419,10 @@ export default {
obj: obj obj: obj
}) })
}, },
checkedData() {
console.log(this.$refs.xTable.selection)
this.$emit('on-result-change', 'allSelect', this.$refs.xTable.selection)
},
// 双击行操作 // 双击行操作
_dbChange(data, event) { _dbChange(data, event) {
this.$emit('on-result-change', 'dbSelect', data.row) this.$emit('on-result-change', 'dbSelect', data.row)
......
<!--检测项目编辑列表(添加、导入检测项目)-->
<template>
<div>
<Modal
v-model="showModal"
:mask-closable="false"
title="检测项目管理"
:width="1200"
>
<Row>
<Col span="24">
<Form v-model="formObj" inline onsubmit="return false" :label-width="90">
<Form-item class="search-item" label="检测项目:" style="margin-left: -25px">
<Input v-model="formObj.name" placeholder="请输入检测项目" clearable @on-enter="_formSearch" />
<input v-model="formObj.catalogueId" type="hidden">
</Form-item>
<!-- <Form-item class="search-item" label="检测依据:">-->
<!-- <Input v-model="formObj.code" placeholder="请输入检测依据名称" clearable @on-enter="_formSearch" />-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--正常界面-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" />
</Col>
<!-- 表格 -->
<Col span="24">
<element-table
ref="pageTable"
:page-columns="pageColumns"
select-data
:table-height="350"
:get-page="getPage"
:icon-msg="iconMsg"
:opt-col-width="80"
show-check-box
@on-result-change="_tableResultChange"
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
show-overflow-tooltip
sortable
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
>
<template slot-scope="scope">
<span v-if="item.key==='judged'">
{{ scope.row[item.key]===1?'是':'否' }}
</span>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.compareSymbol"
placeholder="请输入比较符"
/>
</div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.limitValue"
placeholder="请输入限值"
/>
</div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.unit"
placeholder="请输入单位"
/>
</div>
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.code"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search" @click.stop="_selectjudgeBasis(scope.$index)"></i>
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</el-table-column>
</element-table>
</Col>
</Row>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
formObj: {
catalogueId: '',
name: '',
code: '',
standardCode: '',
standardName: ''
},
showModal: false,
searchOpen: false,
btn: [],
index: '',
iconMsg: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
pageColumns: [
{ title: '项目类别', key: 'type', width: 140 },
{ title: '检测项目', key: 'name', width: 140 },
{ title: '子项目', key: 'sonItem', width: 140 },
{ title: '方法', key: 'method', width: 180 },
{ title: '设备', key: 'device', width: 180 },
{ title: '检测依据', key: 'code', width: 180 },
{ title: '检测科室', key: 'groupName', width: 110 },
{ title: '比较符', key: 'compareSymbol', width: 120 },
{ title: '限值', key: 'limitValue' },
{ title: '单位', key: 'unit' },
{ title: '是否系统判定', key: 'judged', width: 120, judged: true },
{ title: '备注', key: 'remark' }
],
catalogueId: '',
getPage: {},
selectData: []
}
},
methods: {
_open(catalogueId, label) {
this.formObj = this.$resetFields(this.formObj)
this.showModal = true
this.catalogueId = catalogueId
this.formObj.catalogueId = catalogueId
this.getPage.records = []
this.$refs.pageTable._hideLoading()
// this._page()
// if (catalogueId) {
// this._page()
// }
},
_handleRow(scope) {
console.log(scope)
},
_selectjudgeBasis(index) {
console.log(index)
this.index = index
this.$refs.EditModal._open()
},
_backData(data) {
console.log(typeof this.index)
this.getPage.records[this.index].code = data.code
this.$set(
this.getPage.records,
this.index,
this.getPage.records[this.index]
)
console.log(this.getPage.records)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
// _page: async function() {
// Object.assign(this.formObj, this.$refs.pageTable._searchParams())
// const result = await aptitudeItem.pageAptitudeItem(
// this.$serializeForm(this.formObj)
// )
// if (result) {
// this.getPage = result
// this.$refs.pageTable._initTable()
// }
// },
_btnClick(msg) {
switch (msg) {
case '导入检测项目':
this.$refs.relItemModal._open(this.catalogueId)
break
}
},
// 操作列操作
_iconClick(res, data) {
switch (res) {
case '删除':
this._deleteById(data.relPackageId)
break
}
},
// 删除
_deleteById(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除该数据?',
onOk: () => {
this._deleteOk(id)
}
})
},
// _deleteOk: async function(id) {
// // const result = await drugCatalogueItem.deleteById(id)
// if (result) {
// this.$Message.success('删除成功')
// this._page()
// }
// },
// table结果 返回整行
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
}
},
_ok() {
const data = this.selectData
if (data.length === 0) {
this._hideLoading()
this.$Message.warning('请选择至少一条数据!')
}
const ids = []
data.forEach(item => {
ids.push(item.id)
})
this._saveCatalogueItem(data)
},
_saveCatalogueItem(data) {
this.showModal = false
this._hideLoading()
this.$emit('on-result-change', data)
console.log('data------', data)
this._hideLoading()
},
_cancel() {
this.selectData = []
this.showModal = false
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
}
}
}
</script>
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
}, },
_upload(id) { _upload(id) {
const obj = { const obj = {
importUrl: '/food/v1/food_standard_info/upload/' + id importUrl: '/soil/v1/standard_annex/upload/' + id
} }
this.$refs.uploadModal._open(obj) this.$refs.uploadModal._open(obj)
}, },
...@@ -371,14 +371,16 @@ export default { ...@@ -371,14 +371,16 @@ export default {
// 预览 // 预览
_viewReport(data) { _viewReport(data) {
const fileUrl = encodeURIComponent( const fileUrl = encodeURIComponent(
global.baseURL + '/food/v1/food_standard_info/download/' + data.id global.baseURL + '/soil/v1/standard_annex/preview/' + data.id
) )
console.log(fileUrl)
window.open( window.open(
global.staticURL + '/pdf/PDFJS/pdfjs/web/viewer.html?file=' + fileUrl global.staticURL + '/pdf/PDFJS/pdfjs/web/viewer.html?file=' + fileUrl
) )
}, },
// 下载 // 下载
_download(data) { _download(data) {
console.log(data)
this.$Modal.confirm({ this.$Modal.confirm({
title: '提示', title: '提示',
content: '确定要下载文件?', content: '确定要下载文件?',
...@@ -388,7 +390,7 @@ export default { ...@@ -388,7 +390,7 @@ export default {
return return
} }
window.open( window.open(
global.baseURL + '/food/v1/food_standard_info/download/' + data.id, global.baseURL + '/soil/v1/standard_annex/download/' + data.id,
'_blank' '_blank'
) )
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200"> <Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p> <p slot="header">{{modalTitle}}</p>
<div> <div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline> <Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="检测依据" prop="code" style="width: 100%"> <Form-item label="检测依据" prop="code" style="width: 100%">
<Input v-model="formObj.code" name="code" placeholder="请输入检测依据"/> <Input v-model="formObj.code" name="code" placeholder="请输入检测依据"/>
</Form-item> </Form-item>
...@@ -71,7 +71,14 @@ export default { ...@@ -71,7 +71,14 @@ export default {
], ],
modalTitle: '添加食品标准表', modalTitle: '添加食品标准表',
formObj: {}, formObj: {},
ruleValidate: {}, ruleValidate: {
code: [
{ required: true, message: '检测依据不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '检测依据名称不能为空', trigger: 'blur' }
]
},
showEditModal: false, showEditModal: false,
classifyList: [ classifyList: [
{ value: 0, name: '判定依据' }, { value: 0, name: '判定依据' },
......
<template> <template>
<div> <div>
<Modal v-model="showModal" :mask-closable="false" width="700"> <Modal v-model="showModal" :mask-closable="false" width="900">
<p slot="header">{{modalTitle}}</p> <p slot="header">{{modalTitle}}</p>
<div> <div>
<Form id="MeterSendTestEdit" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline> <Form id="MeterSendTestEdit" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
...@@ -34,11 +34,61 @@ ...@@ -34,11 +34,61 @@
</Form-item> </Form-item>
</Form> </Form>
</div> </div>
<div style="margin-bottom: 10px;">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick"
class="contHide"></btn-list>
</div>
<div>
<PTVXETable
ref="pageTable"
:form-id="formId"
:table-height="500"
:get-page="getPage"
:icon-msg="iconMsg"
:hidePage = true
@on-result-change="_tableResultChange">
<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">
<!-- <div v-if="item.key==='sampleCode'" @click.stop="_handleRow(scope)">-->
<!-- <el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" style="width: 150px;"-->
<!-- ></el-input>-->
<!-- <a @on-result-change="_judgeBasisChange" @click="_selectjudgeBasis(scope.$rowIndex)" style="font-size: 18px;" class="">+</a>-->
<!-- </div>-->
<div v-if="item.key==='sampleCode'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.sampleCode" blur placeholder="请输入试样编号"
></el-input>
</div>
<div v-if="item.key==='sampleDepth'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.sampleDepth" blur placeholder="请输入试样深度"
></el-input>
</div>
<div v-if="item.key==='samplePack'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.samplePack" blur placeholder="请输入试样包装类型"
></el-input>
</div>
<div v-if="item.key==='sampleDescribe'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.sampleDescribe" blur placeholder="请输入土质描述"
></el-input>
</div>
</template>
</vxe-table-column>
</PTVXETable>
</div>
<div slot="footer"> <div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div> </div>
</Modal> </Modal>
<importModal ref="importModal" @on-result-change="_inputBack" aptitude-item></importModal> <importModal ref="importModal" @on-result-change="_inputBack" aptitude-item></importModal>
<SampleItemSelect ref="sampleItemSelectModal" is-change @on-result-change="_itemImportBack" />
</div> </div>
</template> </template>
<script> <script>
...@@ -48,10 +98,12 @@ ...@@ -48,10 +98,12 @@
import { meterEntrust, meterSample, soilEntrust } from '../../../api' import { meterEntrust, meterSample, soilEntrust } from '../../../api'
import importModal from '../../../components/import/DownloadTemplateImport' import importModal from '../../../components/import/DownloadTemplateImport'
import AutoComplete from '../../../components/base/AutoCompletes' import AutoComplete from '../../../components/base/AutoCompletes'
import SampleItemSelect from '../../meter-aptitude/standard-manage/SampleItemSelect'
export default { export default {
components: { components: {
AutoComplete, AutoComplete,
importModal importModal,
SampleItemSelect
}, },
data() { data() {
const validatefee = (rule, value, callback) => { const validatefee = (rule, value, callback) => {
...@@ -97,40 +149,40 @@ export default { ...@@ -97,40 +149,40 @@ export default {
showBtn: true, showBtn: true,
customerData: [], customerData: [],
cityData: [], cityData: [],
selectData: [],
searchOpen: true, searchOpen: true,
testedCityData: [], testedCityData: [],
judgeType: [{ value: 1, name: '是' }, { value: 0, name: '否' }], judgeType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
iconMsg: [ iconMsg: [
{ {
type: 'md-trash', type: 'md-trash',
id: 'send-test-meter-send-test-edit-remove-o', id: '',
name: '删除' name: '删除'
} }
], ],
pageColumns: [ pageColumns: [
{ title: '样品名称', key: 'name', width: 200 }, { title: '试样编号', key: 'sampleCode', width: 140 },
{ title: '型号规格', key: 'spec' }, { title: '试样深度', key: 'sampleDepth', width: 140 },
{ title: '检定/校准依据', key: 'verification', width: 200 }, { title: '样品包装类型', key: 'samplePack', width: 150 },
{ title: '出厂编号', key: 'factoryNumber' }, { title: '土质描述', key: 'sampleDescribe' }
{ title: '制造单位', key: 'manufacturer' },
{ title: '检测类型', key: 'type' },
{ title: '数量', key: 'quantity' },
{ title: '单价', key: 'price' },
{ title: '总价', key: 'totalPrice' },
{ title: '备注', key: 'remark' }
// {title: '限制范围或说明', key: 'limitDescription'},
], ],
btn: [ btn: [
{ {
type: 'success', type: 'success',
id: 'send-test-meter-send-test-edit-add', id: '',
name: '添加' name: '添加'
}, },
{ {
type: 'success', type: 'success',
id: 'send-test-meter-send-test-edit-import', id: '',
name: '导入' name: '导入试验项目'
} }
// ,
// {
// type: 'success',
// id: '',
// name: '导入'
// }
], ],
options: [ options: [
{ {
...@@ -147,7 +199,8 @@ export default { ...@@ -147,7 +199,8 @@ export default {
modalTitle: '', modalTitle: '',
subcontractorId: '', subcontractorId: '',
formObj: {}, formObj: {},
selectIds: [],
indexList: [],
ruleValidate: { ruleValidate: {
client: [ client: [
{ {
...@@ -208,6 +261,41 @@ export default { ...@@ -208,6 +261,41 @@ export default {
} }
}, },
methods: { methods: {
_itemImportBack(data) {
console.log('传过来的数据', data)
for (let i = 0; i < data.length; i++) {
data[i].id = undefined
}
const info = data
console.log('去掉id后的data', info)
for (let i = 0; i < this.indexList.length; i++) {
const index = this.indexList[i]
if (this.getPage.records[index].drugItemList !== undefined) {
const name = []
this.itemList = this.getPage.records[index].drugItemList
name.push(this.getPage.records[index].itemNames)
for (let i = 0; i < info.length; i++) {
console.log(this.getPage.records[index].itemNames[i])
this.itemList.push(info[i])
name.push(info[i].name)
}
this.getPage.records[index].itemNames = name.join('、')
this.getPage.records[index].drugItemList = this.itemList
this.$set(this.getPage.records, index, this.getPage.records[index])
} else {
const name = []
this.itemList = []
for (let i = 0; i < info.length; i++) {
this.itemList.push(info[i])
name.push(info[i].name)
}
this.getPage.records[index].itemNames = name.join('、')
this.getPage.records[index].drugItemList = this.itemList
this.$set(this.getPage.records, index, this.getPage.records[index])
}
}
console.log(this.getPage.records)
},
_cusNameChange(msg, data) { _cusNameChange(msg, data) {
// this.financeObj = {} // 清空维护发票信息的数据 // this.financeObj = {} // 清空维护发票信息的数据
if (this.$string(this.id).isEmpty()) { if (this.$string(this.id).isEmpty()) {
...@@ -241,6 +329,9 @@ export default { ...@@ -241,6 +329,9 @@ export default {
case '添加': case '添加':
this._add() this._add()
break break
case '导入试验项目':
this._importItem()
break
case '导入': case '导入':
this._importSample() this._importSample()
break break
...@@ -250,6 +341,15 @@ export default { ...@@ -250,6 +341,15 @@ export default {
} }
}) })
}, },
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一条数据!')
} else {
console.log('导入检测项目')
this.$refs.sampleItemSelectModal._open()
this.allSelect(this.selectData)
}
},
_inputBack(data) { _inputBack(data) {
console.log(data) console.log(data)
if (undefined !== data) { if (undefined !== data) {
...@@ -369,12 +469,10 @@ export default { ...@@ -369,12 +469,10 @@ export default {
}, },
_add() { _add() {
const data = { const data = {
name: '', sampleCode: '',
spec: '', sampleDepth: '',
verification: '', samplePack: '',
factoryNumber: '', sampleDescribe: ''
quantity: '1',
type: ''
} }
this.getPage.records.unshift(data) this.getPage.records.unshift(data)
}, },
...@@ -388,10 +486,12 @@ export default { ...@@ -388,10 +486,12 @@ export default {
this.$refs.importModal._open(data, '样品导入') this.$refs.importModal._open(data, '样品导入')
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data, selData) {
switch (msg) { switch (msg) {
case 'selectIds': case 'selectIds':
// this.selectIds = data this.selectIds = data
this.selectData = selData
console.log(this.selectIds)
break break
case 'iconClick': case 'iconClick':
this._iconClick(data.name, data.rowData, data.rowIndex) this._iconClick(data.name, data.rowData, data.rowIndex)
...@@ -401,6 +501,14 @@ export default { ...@@ -401,6 +501,14 @@ export default {
// break // break
} }
}, },
allSelect(data) {
console.log(data)
this.indexList = []
for (let i = 0; i < data.length; i++) {
this.indexList.push(data[i].index)
}
console.log('索引', this.indexList)
},
// 省 市 区 // 省 市 区
_cascaderResult(name, data, msg) { _cascaderResult(name, data, msg) {
switch (name) { switch (name) {
...@@ -515,11 +623,12 @@ export default { ...@@ -515,11 +623,12 @@ export default {
this.$refs.formObj.validate(valid => { this.$refs.formObj.validate(valid => {
if (valid) { if (valid) {
const data = this.$serialize('MeterSendTestEdit') const data = this.$serialize('MeterSendTestEdit')
console.log(this.getPage.records)
// Object.assign(this.formObj, data) // Object.assign(this.formObj, data)
if (this.$string(this.id).isEmpty()) { if (this.$string(this.id).isEmpty()) {
// 添加 // 添加
// const saveData = this.formObj // const saveData = this.formObj
this._save(data) // this._save(data)
} else { } else {
// const saveData = this.formObj // const saveData = this.formObj
console.log(data) console.log(data)
...@@ -561,6 +670,7 @@ export default { ...@@ -561,6 +670,7 @@ export default {
this.$refs.formObj.resetFields() this.$refs.formObj.resetFields()
this._hideLoading() this._hideLoading()
if (this.$string(formObj).isEmpty()) { if (this.$string(formObj).isEmpty()) {
this.getPage.records = []
this.id = '' this.id = ''
this.formObj.entrustDate = new Date() this.formObj.entrustDate = new Date()
this.modalTitle = '委托单新增' this.modalTitle = '委托单新增'
......
<template>
<div>
<Modal v-model="showDetailModal" :width="700" title="委托详情" class="modal-footer-none">
<div :style="{height}" style="overflow-y: auto">
<table class="tableClass">
<tbody>
<tr>
<th colspan="6" class="tableClass_back">委托单信息</th>
</tr>
<tr>
<th>委托商</th>
<td>{{obj.client}}</td>
<th>制表人</th>
<td>{{obj.tabulater}}</td>
</tr>
<tr>
<th>钻孔名称</th>
<td>{{obj.boreholeName}}</td>
<th>钻孔位置</th>
<td>{{obj.boreholeLocation}}</td>
</tr>
<tr>
<th>水深(米)</th>
<td>{{obj.waterDepth}}</td>
<th>检验类别</th>
<td>{{obj.testType}}</td>
</tr>
</tbody>
</table>
</div>
</Modal>
</div>
</template>
<script>
/**
* 政府委托信息表详情
*/
export default {
data() {
return {
obj: {
// detail: {},
// customer: {},
// finance: {},
// tested: {}
firsted: 0,
client: '',
boreholeLocation: '',
boreholeName: '',
waterDepth: '',
tabulater: '',
testType: ''
},
showDetailModal: false,
// sampleType:['退样','留样','作废'],
dispose: '',
height: '',
showMoney: false
}
},
methods: {
_open(obj, flag) {
this.showDetailModal = true
this.obj = obj
console.log('传过来的数据')
console.log(this.obj)
// if(obj.dispose !== undefined || ''){
// this.dispose = this.sampleType[obj.dispose];
// }else{
// this.dispose = '';
// }
if (flag === 'showMoney') {
this.showMoney = true
} else {
this.showMoney = false
}
this.height = '350px'
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable/>
</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"
class="contHide"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :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 v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<FileManage ref="FileManage"></FileManage>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<Operation ref="operation"></Operation>
<EntrustDetail ref="sampleEdit"></EntrustDetail>
<SampleManage ref="sampleManageModal"></SampleManage>
</div>
</template>
<script>
import { soilEntrust } from '../../../api'
import Operation from '../../../components/operation/Operation'
import Reason from '../../../components/base/Reason'
import EntrustDetail from './EntrustDetail'
import SampleManage from './SampleManage'
export default {
components: { Operation, Reason, EntrustDetail, SampleManage },
data() {
return {
currentComponent: 'FoodSampleGovern',
formId: 'meterReviewEntrustFormId',
searchOpen: false,
btn: [
{
// meter-review-entrust-pass-btn
type: 'success',
id: '',
name: '通过'
},
// meter-review-entrust-back-btn
{
type: 'success',
id: '',
name: '驳回'
}
],
iconMsg: [
{
type: 'md-paper',
id: '',
name: '详情'
},
{
type: 'ios-beaker',
id: '',
name: '样品管理'
},
{
type: 'md-cloud',
id: '',
name: '附件'
},
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
client: undefined,
contractCode: undefined,
entrustCode: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_detailModal(data) {
console.log(data)
this.$refs.sampleEdit._open(data)
// 查看
// this.$store.dispatch('FoodContract/getById', data.id).then(() => {
// if (data.type === 0) {
// // 企业委托 ’0‘
// this.currentComponent = 'FoodContractCompanyDetail'
// } else {
// // 政府委托 ’1‘
// this.currentComponent = 'FoodContractGovernDetail'
// }
// this.$nextTick(() => {
// this.$refs.refModal._open(this.$store.state.FoodContract.model)
// })
// })
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '驳回':
this._goBack()
break
case '添加':
this._editModal(false)
break
case '通过':
this._passReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_goBack() {
// 退回
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条委托!')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_reasonResult(data) {
if (undefined !== data && data !== '') {
console.log(data)
this._reportCheckBack(data)
console.log('退回')
}
console.log(data)
},
// _reportCheckBack: async function(data) {
// const result = await meterEntrust.back({
// ids: this.selectIds,
// remark: data
// })
//
// if (result) {
// this.$Message.success('退回成功!')
// await this._page()
// }
// },
_iconClick(res, data) {
this.$nextTick(function() {
switch (res) {
case '样品管理':
this._manageSample(data.id)
break
case '详情':
this._detailModal(data)
break
case '编辑':
this._editModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
}
})
},
_manageSample(data) {
// 管理样品
this.$refs.sampleManageModal._open(data)
},
_record(id) {
this.$refs.operation._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
case 'selectIds':
this.selectIds = data
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.page(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
_passReview() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择要通过评审的委托单!')
return false
}
this.$Modal.confirm({
title: '提示',
content: '确定通过该委托单?',
onOk: () => {
this._passEntrustReview(this.selectIds)
}
})
},
// _passEntrustReview: async function(ids) {
// const result = await meterEntrust.passReview(ids)
// if (result) {
// this.$Message.success('提交成功!')
// await this._page()
// }
// },
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'contractId')
}
// _getById: async function(id) {
// const result = await meterSubcontractor.getById(id)
// if (result) {
// this.$refs.editSubcontractorModal._open(result)
// }
// },
// _delete: async function(ids) {
// const result = await meterSubcontractor.deleteById(ids)
// if (result) {
// this._formSearch()
// this.$Message.success('删除成功!')
// }
// }
}
}
</script>
<template>
<div>
<Modal v-model="showModal" width="1200" class="modal-footer-none">
<p slot="header">{{modalTitle}}</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form id="formId" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="样品名称:" class="search-item">
<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 class="search-btn" style="margin-left: -10px">
<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"
class="contHide"></btn-list>
</Col>
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :get-page="getPage"
@on-result-change="_tableResultChange" select-data>
<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">
<div v-if="item.detail"><a @click.stop="_detailModal(scope.row.id)">{{scope.row[item.key]}}</a></div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</div>
<div v-else-if="item.key==='jobOut'">
{{scope.row[item.key]===1?'是':'否'}}
</div>
<div v-else-if="item.key==='type'">
<span v-if="scope.row[item.key]===0">
检定
</span>
<span v-if="scope.row[item.key]===1">
校准
</span>
<span v-if="scope.row[item.key]===2">
外观检查
</span>
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
export default {
components: {
// FoodSampleGovernDetail,
// CopyModal,
// FoodSampleGovernLYEdits
},
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: '',
name: '删除'
}
],
btn: [
{
type: 'success',
id: 'ZBC',
name: '分包'
}
// ,
// {
// type: 'success',
// id: '',
// name: '取消分包'
// }
// ,
// {
// type: 'success',
// id: 'review-meter-sample-manage-import-test-item',
// name: '导入检测项目'
// }
],
options: [
{
name: '检定'
},
{
name: '校准'
},
{
name: '外观检查'
}
],
formId: 'meterReviewSampleManageFormId',
showModal: false,
modalTitle: '管理样品',
selectIds: [],
selectData: [],
getPage: {},
pageColumns: [
{ title: '样品编号', key: 'code', width: 140 },
{ title: '样品名称', key: 'name', width: 140 },
{ title: '型号规格', key: 'spec', width: 140 },
{ title: '出厂编号', key: 'factoryNumber', width: 140 },
// { title: '检测项目', key: 'itemNames', width: 140 },
{ title: '是否分包', key: 'jobOut', width: 110 },
{ title: '检测类型', key: 'type', width: 140 },
{ title: '数量', key: 'quantity', width: 140 }
],
dateList: [],
formObj: {
entrustId: undefined,
name: undefined,
code: undefined,
type: undefined
}
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '取消分包':
this._subpackageCancelBtn()
break
case '分包':
this._subpackageSample()
break
case '导入检测项目':
this._importItem()
break
case '删除':
this._deleteSelected()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '管理检测项目':
this._sampleEditModal(data)
break
case '编辑':
localStorage.setItem('type', data.type)
if (data.type === 2) {
this._editLY(data.id) // 粮油的编辑页
} else {
this._editModal(true, data.id)
}
break
case '复制':
this._copy(data.id, data.type)
break
case '删除':
this._deleteById(data.id)
break
case '检测项目':
this._itemDetail(data.id)
break
}
})
},
_subpackageCancelBtn() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const data = {}
data.ids = this.selectIds.join(',')
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)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectData':
const selectIds = []
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_open(id) {
this.formObj.entrustId = id
this.showModal = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page() {
console.log(123)
},
// _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('删除成功!')
})
}
})
},
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
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()
},
_searchParams() {
const data = this.$serialize('search-sample-govern')
return this.$extend(data, this.pageParams)
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this._page()
this.$Message.success(msg)
}
},
_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) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.importModal._open(this.selectIds)
}
},
_subpackageSample() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选中一条样品进行分包!')
return false
} else {
for (let i = 0; i < this.selectData.length; i++) {
if (this.selectData[i].jobOut === 1) {
this.$Message.warning(
'样品编号为' +
this.selectData[i].code +
'已经分包了,请选择未分包的样品!'
)
return false
}
}
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) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds, 'batch-rel-package-item')
}
},
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_itemDetail(id) {
this.$refs.foodItem._open(id)
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
...@@ -6,6 +6,7 @@ import workbench from '../pages/workbench/workbench' ...@@ -6,6 +6,7 @@ import workbench from '../pages/workbench/workbench'
import StandardManage from '../pages/meter-aptitude/standard-manage/StandardManage' import StandardManage from '../pages/meter-aptitude/standard-manage/StandardManage'
import ExperimentItemManage from '../pages/meter-aptitude/item-manage/ExperimentItemManage' import ExperimentItemManage from '../pages/meter-aptitude/item-manage/ExperimentItemManage'
import EntrustIndex from '../pages/meter-entrust/entrust-register/EntrustIndex' import EntrustIndex from '../pages/meter-entrust/entrust-register/EntrustIndex'
import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust'
import Blank from '~/pages/blank' import Blank from '~/pages/blank'
export default [ export default [
{ {
...@@ -24,7 +25,7 @@ export default [ ...@@ -24,7 +25,7 @@ export default [
}, },
{ {
path: 'review', path: 'review',
component: workbench, component: ReviewEntrust,
meta: { title: '试验委托评审' } meta: { title: '试验委托评审' }
} }
] ]
......
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