Commit d9e28236 by lichengming

修改了资质管理和试样管理

parent aa0dc916
...@@ -32,5 +32,7 @@ export default { ...@@ -32,5 +32,7 @@ export default {
pageCoordinateStatistics: data => pageCoordinateStatistics: data =>
http http
.post('soil/v1/statistics/page_coordinate_statistics', data) .post('soil/v1/statistics/page_coordinate_statistics', data)
.then(res => res) .then(res => res),
filePage: data =>
http.post('soil/v1/standard_annex/page', data).then(res => res)
} }
...@@ -102,8 +102,8 @@ export default { ...@@ -102,8 +102,8 @@ export default {
this.entrustId = id this.entrustId = id
this.urlData = { this.urlData = {
msg: 'FoodContractAttachment', msg: 'FoodContractAttachment',
pageUrl: '/soil/v1/standard_annex/page', pageUrl: 'soil/v1/entrust_annex/page',
deleteUrl: '/soil/v1/standard_annex/?ids=', deleteUrl: '/soil/v1/entrust_annex/?ids=',
uploadFileUrl: '/soil/v1/standard_annex/upload/', uploadFileUrl: '/soil/v1/standard_annex/upload/',
downloadFileUrl: '/soil/v1/standard_annex/download/', downloadFileUrl: '/soil/v1/standard_annex/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch', downloadBatch: '/food/v1/contract_attachment/download_batch',
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
iconMsg: [ iconMsg: [
{ type: 'md-apps', id: '', name: '指标管理' }, { type: 'md-apps', id: '', name: '指标管理' },
{ type: 'md-create', id: '', name: '编辑' }, { type: 'md-create', id: '', name: '编辑' },
{ type: 'md-add', id: '', name: '附件' }, // { type: 'md-add', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' } { type: 'md-trash', id: '', name: '删除' }
// { type: 'md-add', id: '', name: '操作日志' } // { type: 'md-add', id: '', name: '操作日志' }
], ],
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<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.fileName" @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">
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../api' import { soilEntrust, soilStatistics } from '../../../api'
import global from '../../../api/config'
export default { export default {
components: {}, components: {},
data() { data() {
...@@ -65,9 +66,9 @@ export default { ...@@ -65,9 +66,9 @@ export default {
currentComponent: '', currentComponent: '',
btn: [], btn: [],
iconMsg: [ iconMsg: [
{ type: 'pt-a-end', id: '', name: '预览' }, { type: 'ios-book', id: '', name: '预览' },
{ type: 'pt-a-end', id: '', name: '下载' }, { type: 'ios-download', id: '', name: '下载' },
{ type: 'pt-a-end', id: '', name: '删除' } { type: 'md-trash', id: '', name: '删除' }
], ],
sampleId: '', // 样品id sampleId: '', // 样品id
entrustId: '', entrustId: '',
...@@ -93,7 +94,7 @@ export default { ...@@ -93,7 +94,7 @@ export default {
], ],
dateList: [], dateList: [],
formObj: { formObj: {
name: undefined fileName: undefined
} }
} }
}, },
...@@ -162,22 +163,42 @@ export default { ...@@ -162,22 +163,42 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '编辑': case '预览':
this._editModal(true, data) this._viewReport(data)
break break
case '复制': case '下载':
this._copy(data) this._download(data)
break break
case '删除': case '删除':
console.log(index) console.log(index)
this._deleteById(data.id) this._deleteById(data.id)
break break
case '导出样品委托协议': }
this._exportAgreement(data.id) })
break },
case '附件': _viewReport(data) {
this.$refs.refModal._open(data.id, 'sampleId') console.log(navigator.platform)
break if (this.$platform()) {
// eslint-disable-next-line no-undef
POBrowser.openWindowModeless(
global.baseURL + '/print/v1/view_attachment?key=' + data.objectKey,
'width=1163px;height=850px;'
)
} else {
this.$Message.warning('暂不支持预览')
}
},
// 下载
_download(data) {
console.log(data)
this.$Modal.confirm({
title: '提示',
content: '确定要下载文件?',
onOk: () => {
window.open(
global.baseURL + '/soil/v1/standard_annex/download/' + data.id,
'_blank'
)
} }
}) })
}, },
...@@ -213,9 +234,9 @@ export default { ...@@ -213,9 +234,9 @@ export default {
this.selectIds = selectIds this.selectIds = selectIds
this.selectData = data this.selectData = data
break break
// case 'iconClick': case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
// break break
case 'page': case 'page':
this._page() this._page()
break break
...@@ -228,7 +249,7 @@ export default { ...@@ -228,7 +249,7 @@ export default {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
this.dateList = [] this.dateList = []
this.showModal = true this.showModal = true
this.sampleId = id // 委托id this.entrustId = id // 委托id
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this._page() this._page()
}, },
...@@ -268,8 +289,8 @@ export default { ...@@ -268,8 +289,8 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj = this.$serializeForm(this.formObj) this.formObj = this.$serializeForm(this.formObj)
this.formObj.sampleId = this.sampleId this.formObj.entrustId = this.entrustId
const result = await soilEntrust.pageItem( const result = await soilStatistics.filePage(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<DownloadTemplateImport ref="importModal" @on-result-change="_page"></DownloadTemplateImport> <DownloadTemplateImport ref="importModal" @on-result-change="_page"></DownloadTemplateImport>
<SubstitutionalRelation ref="relationModal" @on-result-change="_page"></SubstitutionalRelation> <SubstitutionalRelation ref="relationModal" @on-result-change="_page"></SubstitutionalRelation>
<UploadModal ref="uploadModal" @on-result-change="_page"></UploadModal> <UploadModal ref="uploadModal" @on-result-change="_page"></UploadModal>
<StanardFileManage ref="FileManage"></StanardFileManage> <StanardFileManage ref="stanardFileManage"></StanardFileManage>
<!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>--> <!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>-->
</div> </div>
</template> </template>
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
}) })
}, },
_fileManage(id) { _fileManage(id) {
this.$refs.FileManage._openByEntrustId(id) this.$refs.stanardFileManage._open(id)
}, },
_upload(id) { _upload(id) {
const obj = { const obj = {
......
<template> <template>
<div> <div>
<Modal v-model="showModal" :mask-closable="false" width="100" class="zIndex-1000 full-screen"> <Modal v-model="showModal" :mask-closable="false" :fullscreen="true" width="100" class="zIndex-1000">
<p slot="header">制备</p> <p slot="header">制备</p>
<Row> <Row>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" class="contHide" @on-result-change="_btnClick"></btn-list> <btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col> </Col>
<!--内容--> <!--内容-->
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETableHeight
ref="pageTable" ref="pageTable"
:table-height="tableHeight" :table-height="tableHeight"
:get-page="getPage" :get-page="getPage"
:icon-msg="iconMsg"
:form-id="formId" :form-id="formId"
@on-result-change="_tableResultChange"
select-data select-data
is-edit is-edit
hide-page hide-page>
@on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -33,8 +32,8 @@ ...@@ -33,8 +32,8 @@
<template v-slot:edit="scope"> <template v-slot:edit="scope">
<div v-if="item.key==='prepareWay'" @click="_handleRow(scope)"> <div v-if="item.key==='prepareWay'" @click="_handleRow(scope)">
<AutoComplete v-model="scope.row.prepareWay" :down-data="preparationWayData" :way-data="wayData" <AutoComplete v-model="scope.row.prepareWay" :down-data="preparationWayData" :way-data="wayData"
:handle-obj="scope" clearable placeholder="输入或选择制备方式" :handle-obj="scope" @on-result-change="_preparationChange" clearable
@on-result-change="_preparationChange"></AutoComplete> placeholder="输入或选择制备方式"></AutoComplete>
</div> </div>
<div v-else-if="item.key==='unit'" @click="_handleRow(scope)"> <div v-else-if="item.key==='unit'" @click="_handleRow(scope)">
<el-input v-model="scope.row.unit" name="unit" placeholder="输入或选择单位"> <el-input v-model="scope.row.unit" name="unit" placeholder="输入或选择单位">
...@@ -47,13 +46,13 @@ ...@@ -47,13 +46,13 @@
<span v-else-if="item.key==='type'">{{ scope.row[item.key]===0? '检样':'备样' }}</span> <span v-else-if="item.key==='type'">{{ scope.row[item.key]===0? '检样':'备样' }}</span>
<div v-else-if="item.key==='keepWay'" @click="_handleRow(scope)"> <div v-else-if="item.key==='keepWay'" @click="_handleRow(scope)">
<AutoComplete v-model="scope.row.keepWay" :handle-obj="scope" :down-data="saveWayData" <AutoComplete v-model="scope.row.keepWay" :handle-obj="scope" :down-data="saveWayData"
clearable placeholder="输入或选择保存方式" @on-result-change="_saveChange" clearable
show-key="name" @on-result-change="_saveChange"></AutoComplete> placeholder="输入或选择保存方式" show-key="name"></AutoComplete>
</div> </div>
<div v-else-if="item.key==='keepContainer'" @click="_handleRow(scope)"> <div v-else-if="item.key==='keepContainer'" @click="_handleRow(scope)">
<AutoComplete v-model="scope.row.keepContainer" :handle-obj="scope" :down-data="packList" <AutoComplete v-model="scope.row.keepContainer" :handle-obj="scope" :down-data="packList"
clearable placeholder="输入或选择保存容器" @on-result-change="_packSaveChange" clearable
show-key="name" @on-result-change="_packSaveChange"></AutoComplete> placeholder="输入或选择保存容器" show-key="name"></AutoComplete>
</div> </div>
<!-- <div v-else-if="item.key==='prepareDate'" @click="_handleTimeRow(scope)">--> <!-- <div v-else-if="item.key==='prepareDate'" @click="_handleTimeRow(scope)">-->
<!-- <el-date-picker--> <!-- <el-date-picker-->
...@@ -62,9 +61,9 @@ ...@@ -62,9 +61,9 @@
<!-- placeholder="选择日期时间">--> <!-- placeholder="选择日期时间">-->
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </div>--> <!-- </div>-->
<div v-else-if="item.key==='prepareDate'"> <div v-else-if="item.key==='prepareDate'" @click="_handleRow(scope)">
<Date-picker v-model="scope.row.prepareDate" type="date" format="yyyy-MM-dd HH:mm" style="width:100%;" <el-date-picker @change="timeChange(scope.row)" v-model="scope.row.prepareDate" type="datetime" format="yyyy-MM-dd HH:mm" style="width:100%;"
placeholder="请选择日期"></Date-picker> placeholder="请选择日期"></el-date-picker>
</div> </div>
<!-- <div v-else-if="item.key==='prepareDate' && isAccurate === '是'" @click="_handleRow(scope)">--> <!-- <div v-else-if="item.key==='prepareDate' && isAccurate === '是'" @click="_handleRow(scope)">-->
<!-- <date-picker :editable="false" :transfer="true" v-model="scope.row.prepareDate" type="datetime"--> <!-- <date-picker :editable="false" :transfer="true" v-model="scope.row.prepareDate" type="datetime"-->
...@@ -91,48 +90,32 @@ ...@@ -91,48 +90,32 @@
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </div>--> <!-- </div>-->
<div v-else-if="item.key==='preparer'" @click="_handleRow(scope)"> <div v-else-if="item.key==='preparer'" @click="_handleRow(scope)">
<el-input v-model="scope.row.preparer" placeholder="制备人" <el-input v-model="scope.row.preparer" @focus="_handleRow(scope)"
size="small" name="preparer" @focus="_handleRow(scope)"></el-input> placeholder="制备人" size="small" name="preparer"></el-input>
</div> </div>
<div v-else-if="item.key==='remark'" @click="_handleRow(scope)"> <div v-else-if="item.key==='remark'" @click="_handleRow(scope)">
<el-input v-model="scope.row.remark" placeholder="备注" size="small" <el-input v-model="scope.row.remark" @focus="_handleRow(scope)" placeholder="备注"
@focus="_handleRow(scope)"></el-input> size="small"></el-input>
</div> </div>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
<!--只读模板--> <!--只读模板-->
<template v-slot="scope"> <template v-slot="scope">
<!-- <div v-if="item.key==='prepareDate' && isAccurate === '是'">-->
<!-- <div>-->
<!-- {{scope.row.prepareDate?$dateformat(scope.row.preparationDate,'yyyy-mm-dd HH:MM'):''}}-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-else-if="item.key==='prepareDate' && isAccurate === '否'">-->
<!-- <div>-->
<!-- {{scope.row.prepareDate?$dateformat(scope.row.preparationDate,'yyyy-mm-dd'):''}}-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-else-if="item.key==='prepareDate' && !isAccurate">-->
<!-- <div>-->
<!-- {{scope.row.prepareDate?$dateformat(scope.row.preparationDate,'yyyy-mm-dd'):''}}-->
<!-- </div>-->
<!-- </div>-->
<div v-if="item.key==='num'"> <div v-if="item.key==='num'">
<div v-if="scope.row.itemPreparation===0">{{scope.row[item.key]}}</div> <div v-if="scope.row.itemPreparation===0">{{scope.row[item.key]}}</div>
<div v-else-if="scope.row.itemPreparation===1" class="red-color"> <div v-else-if="scope.row.itemPreparation===1" class="red-color">
{{scope.row[item.key]}} {{scope.row[item.key]}}
</div> </div>
</div> </div>
<div v-else-if="item.key==='prepareDate'"> <div v-else-if="item.date">
{{scope.row.prepareDate?$dateformat(scope.row.preparationDate,'yyyy-mm-dd HH:MM'):''}} {{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM'):''}}
</div> </div>
<span v-else-if="item.key==='type'">{{ scope.row[item.key]===0? '检样':'余样' }}</span> <span v-else-if="item.key==='type'">{{ scope.row[item.key]===0? '检样':'余样' }}</span>
<span v-else-if="item.key==='status'">{{ scope.row[item.key].display }}</span> <span v-else-if="item.key==='status'">{{ scope.row[item.key].display }}</span>
<div v-else>{{scope.row[item.key]}}</div> <div v-else>{{scope.row[item.key]}}</div>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETableHeight>
</Col> </Col>
</Row> </Row>
<div slot="footer"> <div slot="footer">
...@@ -171,8 +154,8 @@ export default { ...@@ -171,8 +154,8 @@ export default {
{ type: 'error', id: '', name: '删除' } { type: 'error', id: '', name: '删除' }
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '批量赋值' }, // { type: 'md-create', id: '', name: '批量赋值' },
{ type: 'md-trash', id: '', name: '删除' } // { type: 'md-trash', id: '', name: '删除' }
], ],
getPage: { getPage: {
records: [] records: []
...@@ -206,6 +189,7 @@ export default { ...@@ -206,6 +189,7 @@ export default {
title: '制备时间', title: '制备时间',
key: 'prepareDate', key: 'prepareDate',
width: 200, width: 200,
date: true,
editCell: true editCell: true
}, },
{ {
...@@ -313,7 +297,9 @@ export default { ...@@ -313,7 +297,9 @@ export default {
}, },
timeChange(data) { timeChange(data) {
console.log(data) console.log(data)
this.currentRow.prepareDate = data this.$forceUpdate()
this.currentRow.prepareDate = data.prepareDate
console.log(this.getPage.records)
}, },
_packSaveChange(msg, data, handleObj) { _packSaveChange(msg, data, handleObj) {
this._handleRow(handleObj) this._handleRow(handleObj)
...@@ -625,6 +611,8 @@ export default { ...@@ -625,6 +611,8 @@ export default {
}, },
// 操作的序号 // 操作的序号
_handleRow(data) { _handleRow(data) {
console.log(data)
this.currentIndex = data.index
this.currentRow = data.row this.currentRow = data.row
}, },
_handleTimeRow(data) { _handleTimeRow(data) {
......
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