布局认证目录

This commit is contained in:
qq787203167
2022-05-23 14:33:32 +08:00
parent 1ccab18a2f
commit 912f2dac24
5 changed files with 123 additions and 43 deletions
+1
View File
@@ -879,4 +879,5 @@ module.exports = {
testScheme:'Test Scheme', testScheme:'Test Scheme',
testReportLocation:'Test report location', testReportLocation:'Test report location',
explain:'Explain', explain:'Explain',
dataCannotEmpty:'Data Cannot Empty',
} }
+1
View File
@@ -884,4 +884,5 @@ module.exports = {
testScheme:'试验方案', testScheme:'试验方案',
testReportLocation:'检测报告位置', testReportLocation:'检测报告位置',
explain:'说明', explain:'说明',
dataCannotEmpty:'数据不能为空'
} }
@@ -42,6 +42,9 @@
</a-col> </a-col>
<span style="float: right;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<globalAdvancedQuery ref="globalAdvancedQueryRef"
@handleSuperQuery="handleSuperQuery"
:fieldList="fieldList"/>
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button> <a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col> </a-col>
@@ -82,13 +85,13 @@
</template> </template>
<script> <script>
import currencySearch from '@/components/currencySearch/index'
import { getAction, postAction } from '@/api/manage' import { getAction, postAction } from '@/api/manage'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
export default { export default {
name: 'addModel', name: 'addModel',
components: { components: {
currencySearch globalAdvancedQuery
}, },
props: { props: {
url: { url: {
@@ -233,7 +236,20 @@
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
} },
handleSuperQuery(params, matchType) {
let sqp = {}
if (!params || (params && params.length == 0)) {
sqp['superQueryParams'] = ''
this.$refs.globalAdvancedQueryRef.superQueryFlag = false
} else {
this.$refs.globalAdvancedQueryRef.superQueryFlag = true
sqp['superQueryParams'] = encodeURI(JSON.stringify(params))
sqp['superQueryMatchType'] = matchType
}
this.queryParamQuery = sqp
this.getList()
},
} }
} }
</script> </script>
@@ -44,25 +44,26 @@
</div> </div>
</div> </div>
<div class="drawer-bootom-button"> <div class="drawer-bootom-button">
<!-- style="margin-right: 16px"--> <!-- style="margin-right: 16px"-->
<a-button @click="handleCancel" type="danger">{{$t('cancel')}}</a-button> <a-button @click="handleCancel" type="danger">{{$t('cancel')}}</a-button>
<!-- <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>--> <!-- <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>-->
</div> </div>
</a-drawer> </a-drawer>
<certificationDirectoryAdd ref="certificationDirectoryAddRef" /> <certificationDirectoryAdd @certificationDirectoryList="certificationDirectoryList"
ref="certificationDirectoryAddRef"/>
</div> </div>
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage' import { getAction, postAction, deleteAction } from '@/api/manage'
import certificationDirectoryAdd from './certificationDirectoryAdd' import certificationDirectoryAdd from './certificationDirectoryAdd'
export default { export default {
name: 'certificationDirectory', name: 'certificationDirectory',
components: { components: {
certificationDirectoryAdd certificationDirectoryAdd
}, },
props: ['url'],
data() { data() {
return { return {
visible: false, visible: false,
@@ -78,31 +79,31 @@
}, },
{ {
title: this.$t('batch'), title: this.$t('batch'),
dataIndex: 'batch', dataIndex: 'lot',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
}, },
{ {
title: this.$t('catalogFile'), title: this.$t('catalogFile'),
dataIndex: 'catalogFile', dataIndex: 'directoryFile',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
}, },
{ {
title: this.$t('testScheme'), title: this.$t('testScheme'),
dataIndex: 'testScheme', dataIndex: 'experimentFile',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
}, },
{ {
title: this.$t('testReportLocation'), title: this.$t('testReportLocation'),
dataIndex: 'testReportLocation', dataIndex: 'detectionReportLocation',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
}, },
{ {
title: this.$t('explain'), title: this.$t('explain'),
dataIndex: 'explain', dataIndex: 'explainInfo',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
}, },
@@ -124,7 +125,11 @@
loading: false, loading: false,
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
total: 0 total: 0,
url: {
page: '/project/projectCertificationDirectoryEO/page',
delete: '/project/projectCertificationDirectoryEO/delete'
}
} }
}, },
mounted() { mounted() {
@@ -162,7 +167,7 @@
...this.queryParam ...this.queryParam
} }
this.loading = true this.loading = true
postAction(this.url.addModelList, query).then((res) => { getAction(this.url.page, query).then((res) => {
if (res.success) { if (res.success) {
this.dataList = res.result.records || [] this.dataList = res.result.records || []
this.total = res.result.total this.total = res.result.total
@@ -178,21 +183,39 @@
handleSubmit() { handleSubmit() {
this.visible = false this.visible = false
}, },
edit() { edit(val) {
this.$refs.certificationDirectoryAddRef.edit(JSON.parse(JSON.stringify(val)))
}, },
deleteData(){ deleteData(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.delete, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.replacePage()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
}, },
addData(){ addData() {
this.$refs.certificationDirectoryAddRef.add() this.$refs.certificationDirectoryAddRef.add()
}, },
certificationDirectoryList() {
this.pageNo = 1
this.replacePage()
}
} }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.page { .page {
text-align: right; text-align: right;
margin-top: 20px; margin-top: 20px;
@@ -202,7 +225,7 @@
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
z-index:100; z-index: 100;
border-top: 1px solid #e8e8e8; border-top: 1px solid #e8e8e8;
padding: 10px 16px; padding: 10px 16px;
text-align: right; text-align: right;
@@ -243,11 +266,13 @@
.box-button { .box-button {
height: 38px; height: 38px;
} }
.table-operator{
.table-operator {
text-align: right; text-align: right;
margin-bottom: 20px; margin-bottom: 20px;
} }
.text{
.text {
margin-right: 8px; margin-right: 8px;
} }
</style> </style>
@@ -33,7 +33,7 @@
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.batch" v-model="formInline.lot"
:placeholder="$t('PleaseEnter')+$t('batch')"/> :placeholder="$t('PleaseEnter')+$t('batch')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -48,9 +48,9 @@
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-button type="primary" class="button-text" <a-button type="primary" class="button-text"
@click="clickButtonToUpload('catalogFile')"> @click="clickButtonToUpload('directoryFile')">
{{ (formInline.catalogFile === 'null' || formInline.catalogFile === ''|| {{ (formInline.directoryFile === 'null' || formInline.directoryFile === ''||
formInline.catalogFile == null) ? $t('clickUpload') : $t('viewUploadedFiles') }} formInline.directoryFile == null) ? $t('clickUpload') : $t('viewUploadedFiles') }}
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -63,9 +63,9 @@
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-button type="primary" class="button-text" <a-button type="primary" class="button-text"
@click="clickButtonToUpload('testScheme')"> @click="clickButtonToUpload('experimentFile')">
{{ (formInline.testScheme === 'null' || formInline.testScheme === ''|| {{ (formInline.experimentFile === 'null' || formInline.experimentFile === ''||
formInline.testScheme == null) ? $t('clickUpload') : $t('viewUploadedFiles') }} formInline.experimentFile == null) ? $t('clickUpload') : $t('viewUploadedFiles') }}
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -80,7 +80,7 @@
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.testReportLocation" v-model="formInline.detectionReportLocation"
:placeholder="$t('PleaseEnter')+$t('testReportLocation')"/> :placeholder="$t('PleaseEnter')+$t('testReportLocation')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -97,7 +97,7 @@
<a-textarea <a-textarea
style="width: 100%" style="width: 100%"
:placeholder="$t('PleaseEnter')+$t('explain')" :placeholder="$t('PleaseEnter')+$t('explain')"
v-model="formInline.explain" :rows="4"/> v-model="formInline.explainInfo" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -115,7 +115,7 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage' import { getAction, postAction, putAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file' import uploadFile from '@/components/uploadFile/file'
export default { export default {
@@ -128,28 +128,57 @@
visible: false, visible: false,
formInline: {}, formInline: {},
confirmLoading: false, confirmLoading: false,
disabled: false disabled: false,
url: {
add: '/project/projectCertificationDirectoryEO/add',
edit: '/project/projectCertificationDirectoryEO/edit'
}
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
add(){ add() {
this.visible = true
this.formInline = {}
},
edit(val){
this.visible = true this.visible = true
this.$nextTick(()=>{ this.formInline = {}
},
edit(val) {
this.visible = true
this.$nextTick(() => {
this.formInline = val this.formInline = val
}) })
}, },
handleCancel() { handleCancel() {
this.visible = false
}, },
handleSubmit() { handleSubmit() {
if (!this.formInline.directoryName && !this.formInline.lot && !this.formInline.directoryFile &&
!this.formInline.experimentFile && !this.detectionReportLocation.lot && !this.formInline.explainInfo) {
this.$message.warning(this.$t('dataCannotEmpty'))
} else {
let Action
let url = ''
if (this.formInline.id) {
url = this.url.edit
Action = putAction
} else {
url = this.url.add
Action = postAction
}
this.confirmLoading = true
Action(url, this.formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('certificationDirectoryList')
} else {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
}
})
}
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
@@ -235,4 +264,12 @@
margin-bottom: 40px; margin-bottom: 40px;
} }
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
</style> </style>