Browse Source

feat:[资源库]天平选择

lkf
15881625488@163.com 2 months ago
parent
commit
78f0cb33e0
3 changed files with 128 additions and 3 deletions
  1. +7
    -2
      src/views/business/comps/select/SelectBalanceValue.vue
  2. +120
    -0
      src/views/business/comps/select/SelectInstrumentDialog.vue
  3. +1
    -1
      src/views/business/resource/gyzj/comps/gyzj/Ff.vue

+ 7
- 2
src/views/business/comps/select/SelectBalanceValue.vue View File

@ -15,13 +15,15 @@
<el-button type="primary" @click="getBalanceValue">{{ $t('form.hqz') }}</el-button> <el-button type="primary" @click="getBalanceValue">{{ $t('form.hqz') }}</el-button>
</div> </div>
</div> </div>
<SelectInstrumentDialog ref="selectInstrumentDialog" @change="selectInstrumentChange"/>
</div> </div>
</template> </template>
<script> <script>
import SelectInstrumentDialog from '@/views/business/comps/select/SelectInstrumentDialog';
export default { export default {
name: "SelectBalanceValue", name: "SelectBalanceValue",
components: {},
components: {SelectInstrumentDialog},
props: { props: {
value: { value: {
type: [Number, String], type: [Number, String],
@ -50,7 +52,10 @@ export default {
}, },
methods: { methods: {
showSelectBalance() { showSelectBalance() {
alert('todo')
this.$refs.selectInstrumentDialog.show()
},
selectInstrumentChange(val,row){
this.tpName=row.mc
}, },
getBalanceValue() { getBalanceValue() {
alert('todo') alert('todo')

+ 120
- 0
src/views/business/comps/select/SelectInstrumentDialog.vue View File

@ -0,0 +1,120 @@
<template>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="$t(title)" @close="onCancel" :visible.sync="visible" append-to-body width="80%">
<SelectTable ref="selectSjRef" :columns="columns"
:selectedId="selectedId"
:searchForm="searchForm"
:listApi="listApi"
:selectedCode="selectedCode"
@radioSelect="handleSelect"/>
<template slot="footer" class="dialog-footer">
<el-button @click="onCancel">{{$t('form.cancel')}}</el-button>
<el-button :disabled="isDisabled" type="primary" @click="onSubmit">{{$t('form.saveConfirm')}}</el-button>
</template>
</el-dialog>
</template>
<script>
import SelectTable from '@/components/Template/SelectTable.vue';
import SelectDept from "@/views/business/comps/select/SelectDept";
import { public_yqList } from '@/api/business/public/public';
export default {
name: "SelectInstrumentDialog",
components: {
SelectTable,
SelectDept
},
props: {
type: {
type: String,
default: "",
},
title: {
type: String,
default: "选择仪器",
},
selectedCode: {
type: String,
default: "bh",
},
searchForm: {
type: Object,
default: () => {
return {
mc: {
label:'仪器名称',
},
bh: {
label:'仪器编号',
},
ly: {
label:'来源',
},
}
},
},
columns: {
type: Array,
default: () => [
{
prop: 'mc',
label: '仪器名称',
},
{
prop: 'bh',
label: '仪器编号',
},
{
prop: 'ly',
label: '来源(厂家)',
},
{
prop: 'jzrq',
label: '下次校准时间',
},
],
},
},
data() {
return {
visible:false,
listApi:public_yqList,
selectedId: "",
currentRow: {},
}
},
computed: {
isDisabled() {
return !this.selectedId;
}
},
methods: {
show(){
this.visible=true
setTimeout(() => {
this.$refs.selectSjRef.show()
}, 500);
},
onCancel() {
this.visible = false
this.$emit('cancel');
},
onSubmit() {
let row = this.currentRow;
this.$emit('change', this.selectedId,row);
this.visible = false;
},
handleSelect(code,row) {
this.selectedId = code;
this.currentRow = row;
},
}
}
</script>
<style lang="scss" scoped>
.header-row{
display: flex;
align-items: center;
padding: 20px 0;
}
</style>

+ 1
- 1
src/views/business/resource/gyzj/comps/gyzj/Ff.vue View File

@ -40,7 +40,7 @@
@change="selectStudyChangeBatch" /> @change="selectStudyChangeBatch" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('page.business.resource.gyzj.ckmz')" align="center" width="250px">
<el-table-column :label="$t('page.business.resource.gyzj.ckmz')" align="center" width="400px">
<template slot-scope="scope"> <template slot-scope="scope">
<SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.kcdw" /> <SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.kcdw" />
</template> </template>

Loading…
Cancel
Save