luojie 2 months ago
parent
commit
c045ed220f
6 changed files with 221 additions and 31 deletions
  1. +2
    -0
      src/lang/en.js
  2. +2
    -1
      src/lang/zh.js
  3. +69
    -0
      src/views/business/comps/select/SelectBalanceValue.vue
  4. +120
    -0
      src/views/business/comps/select/SelectInstrumentDialog.vue
  5. +9
    -11
      src/views/business/resource/gyzj/comps/gyzj/Ff.vue
  6. +19
    -19
      src/views/business/resource/mjy/comps/mjy/Ff.vue

+ 2
- 0
src/lang/en.js View File

@ -104,6 +104,8 @@ export default {
reason: 'Reason', reason: 'Reason',
modify: 'Modify', modify: 'Modify',
modifyRecord: 'Change Data', modifyRecord: 'Change Data',
hqz:'Get the value',
xztp:'选择天平',
lengthLimit: '长度不能超过', lengthLimit: '长度不能超过',
notEmpty: '不能为空', notEmpty: '不能为空',

+ 2
- 1
src/lang/zh.js View File

@ -100,7 +100,8 @@ export default {
reason: '原因', reason: '原因',
modify: '修改', modify: '修改',
modifyRecord: '修改记录', modifyRecord: '修改记录',
hqz:'获取值',
xztp:'选择天平',
lengthLimit: '长度不能超过', lengthLimit: '长度不能超过',
notEmpty: '不能为空', notEmpty: '不能为空',
operationSuccess: '操作成功', operationSuccess: '操作成功',

+ 69
- 0
src/views/business/comps/select/SelectBalanceValue.vue View File

@ -0,0 +1,69 @@
<template>
<div>
<div style="display: flex;">
<div>
<el-input v-model="tpName" :placeholder="$t('form.xztp')" readonly
@click.native="showSelectBalance" style="width: 100px;"/>
</div>
<div>
<el-input v-model="tpz" :placeholder="$t('form.placeholderInput')" maxlength="20" @change="tpzChange">
<template slot="append">{{ dw }}
</template>
</el-input>
</div>
<div>
<el-button type="primary" @click="getBalanceValue">{{ $t('form.hqz') }}</el-button>
</div>
</div>
<SelectInstrumentDialog ref="selectInstrumentDialog" @change="selectInstrumentChange"/>
</div>
</template>
<script>
import SelectInstrumentDialog from '@/views/business/comps/select/SelectInstrumentDialog';
export default {
name: "SelectBalanceValue",
components: {SelectInstrumentDialog},
props: {
value: {
type: [Number, String],
default: ''
},
dw: {
type: String,
default: ''
},
},
watch: {
value: {
immediate: true,
handler(v) {
this.tpz = v || ''
}
}
},
data() {
return {
tpName: '',
tpz: ''
};
},
mounted() {
},
methods: {
showSelectBalance() {
this.$refs.selectInstrumentDialog.show()
},
selectInstrumentChange(val,row){
this.tpName=row.mc
},
getBalanceValue() {
alert('todo')
},
tpzChange() {
this.$emit('change', this.tpz)
this.$emit('input', this.tpz)
},
}
};
</script>

+ 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>

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

@ -40,12 +40,9 @@
@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">
<el-input type="text" v-model="scope.row.ckmz" maxlength="50" > <template slot="append">{{
scope.row.kcdw
}}</template>
</el-input>
<SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.kcdw" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('form.remark')" align="center" width="250px"> <el-table-column :label="$t('form.remark')" align="center" width="250px">
@ -125,9 +122,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.ckmz')" prop="ckmz"> <el-form-item :label="$t('page.business.resource.gyzj.ckmz')" prop="ckmz">
<el-input type="text" v-model="form.ckmz" maxlength="50" > <template slot="append">{{ form.ckldw
}}</template>
</el-input>
<SelectBalanceValue v-model="form.ckmz" :dw="form.ckmzdw" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -219,10 +214,11 @@ import SelectList from "./SelectList";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import SelectStudy from '@/views/business/comps/select/SelectStudy'; import SelectStudy from '@/views/business/comps/select/SelectStudy';
import BusinessSelect from '@/views/business/comps/select/BusinessSelect'; import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import SelectBalanceValue from '@/views/business/comps/select/SelectBalanceValue';
export default { export default {
name: "Ff", name: "Ff",
components: { SelectList, SelectDeptUser, SelectStudy, BusinessSelect },
components: { SelectList, SelectDeptUser, SelectStudy, BusinessSelect,SelectBalanceValue },
data() { data() {
return { return {
isBatch: false, isBatch: false,
@ -401,8 +397,10 @@ export default {
this.form.nddw = row.nddw this.form.nddw = row.nddw
this.form.cctj = row.cctj this.form.cctj = row.cctj
this.form.ccwz = row.ccwz this.form.ccwz = row.ccwz
this.form.ckl = row.ckl
this.form.ckldw = row.ckldw
this.form.ckl = row.kc
this.form.ckmz = null
this.form.ckmzdw = row.kcdw
this.form.ckldw = row.kcdw
this.open = true this.open = true
}, },
save() { save() {

+ 19
- 19
src/views/business/resource/mjy/comps/mjy/Ff.vue View File

@ -5,7 +5,7 @@
:close-on-click-modal="false"> :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" :label-width="$i18n.locale === 'zh_CN' ? '120px' : '170px'" <el-form ref="form" :model="form" :rules="rules" :label-width="$i18n.locale === 'zh_CN' ? '120px' : '170px'"
v-if="open"> v-if="open">
<div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
<div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
<div :style="isBatch ? 'display:block' : 'display:none'"> <div :style="isBatch ? 'display:block' : 'display:none'">
<el-row style="margin:10px 0px;"> <el-row style="margin:10px 0px;">
<el-col :span="24"> <el-col :span="24">
@ -35,12 +35,9 @@
<BusinessSelect v-model="scope.row.zytj" dictType="business_zytj"></BusinessSelect> <BusinessSelect v-model="scope.row.zytj" dictType="business_zytj"></BusinessSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('page.business.resource.mjy.ckmz')" align="center" width="250px">
<el-table-column :label="$t('page.business.resource.mjy.ckmz')" align="center" width="400px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="text" v-model="scope.row.ckmz" maxlength="50"
:placeholder="$t('form.placeholderInput')"><template slot="append">{{ scope.row.ckmzdw
}}</template>
</el-input>
<SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.ckmzdw" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('page.business.resource.mjy.md')" align="center" width="250px"> <el-table-column :label="$t('page.business.resource.mjy.md')" align="center" width="250px">
@ -88,7 +85,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.nd')"> <el-form-item :label="$t('page.business.resource.mjy.nd')">
<el-input type="text" v-model="form.nd" maxlength="50" disabled> <template slot="append">{{ form.nddw <el-input type="text" v-model="form.nd" maxlength="50" disabled> <template slot="append">{{ form.nddw
}}</template>
}}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -109,7 +106,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.ckjz')"> <el-form-item :label="$t('page.business.resource.mjy.ckjz')">
<el-input type="text" v-model="form.ckl" maxlength="50" disabled> <template slot="append">{{ form.ckldw <el-input type="text" v-model="form.ckl" maxlength="50" disabled> <template slot="append">{{ form.ckldw
}}</template>
}}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -127,9 +124,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.ckmz')" prop="ckmz"> <el-form-item :label="$t('page.business.resource.mjy.ckmz')" prop="ckmz">
<el-input type="number" v-model="form.ckmz" maxlength="20" :placeholder="$t('form.placeholderInput')">
<template slot="append">{{ form.ckmzdw }}</template>
</el-input>
<SelectBalanceValue v-model="form.ckmz" :dw="form.ckmzdw" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -152,7 +147,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.lqr1') + $t('form.password')" prop="lqr1mm"> <el-form-item :label="$t('page.business.resource.mjy.lqr1') + $t('form.password')" prop="lqr1mm">
<el-input type="password" show-password v-model="form.lqr1mm" maxlength="20"
<el-input type="password" show-password v-model="form.lqr1mm" maxlength="20"
:placeholder="$t('form.placeholderInput')" /> :placeholder="$t('form.placeholderInput')" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -165,7 +160,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.lqr2') + $t('form.password')" prop="lqr2mm"> <el-form-item :label="$t('page.business.resource.mjy.lqr2') + $t('form.password')" prop="lqr2mm">
<el-input type="password" show-password v-model="form.lqr2mm" maxlength="20"
<el-input type="password" show-password v-model="form.lqr2mm" maxlength="20"
:placeholder="$t('form.placeholderInput')" /> :placeholder="$t('form.placeholderInput')" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -179,7 +174,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.ffr1') + $t('form.password')" prop="ffr1mm"> <el-form-item :label="$t('page.business.resource.mjy.ffr1') + $t('form.password')" prop="ffr1mm">
<el-input type="password" show-password v-model="form.ffr1mm" maxlength="20"
<el-input type="password" show-password v-model="form.ffr1mm" maxlength="20"
:placeholder="$t('form.placeholderInput')" /> :placeholder="$t('form.placeholderInput')" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -192,7 +187,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.ffr2') + $t('form.password')" prop="ffr2mm"> <el-form-item :label="$t('page.business.resource.mjy.ffr2') + $t('form.password')" prop="ffr2mm">
<el-input type="password" show-password v-model="form.ffr2mm" maxlength="20"
<el-input type="password" show-password v-model="form.ffr2mm" maxlength="20"
:placeholder="$t('form.placeholderInput')" /> :placeholder="$t('form.placeholderInput')" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -207,7 +202,8 @@
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="save" :disabled="isBatch && selectList.length == 0">{{ $t('form.confirm') }}</el-button>
<el-button type="primary" @click="save" :disabled="isBatch && selectList.length == 0">{{ $t('form.confirm')
}}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button> <el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -221,10 +217,11 @@ import SelectList from "./SelectList";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import SelectStudy from '@/views/business/comps/select/SelectStudy'; import SelectStudy from '@/views/business/comps/select/SelectStudy';
import BusinessSelect from '@/views/business/comps/select/BusinessSelect'; import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import SelectBalanceValue from '@/views/business/comps/select/SelectBalanceValue';
export default { export default {
name: "Ff", name: "Ff",
components: { SelectList, SelectDeptUser, SelectStudy, BusinessSelect },
components: { SelectList, SelectDeptUser, SelectStudy, BusinessSelect, SelectBalanceValue },
data() { data() {
return { return {
isBatch: false, isBatch: false,
@ -312,6 +309,9 @@ export default {
created() { created() {
}, },
methods: { methods: {
getTpValue() {
alert('todo')
},
selectStudyChange(val) { selectStudyChange(val) {
this.form.mdMcs = val.name this.form.mdMcs = val.name
this.form.mdOther = val.mdOther this.form.mdOther = val.mdOther
@ -407,8 +407,8 @@ export default {
this.form.nddw = row.nddw this.form.nddw = row.nddw
this.form.cctj = row.cctj this.form.cctj = row.cctj
this.form.ccwz = row.ccwz this.form.ccwz = row.ccwz
this.form.ckl = row.ckl
this.form.ckldw = row.ckldw
this.form.ckl = row.kc
this.form.ckldw = row.kcdw
this.open = true this.open = true
}, },
save() { save() {

Loading…
Cancel
Save