Browse Source

fix:[模板管理]优化

zhangteng
15881625488@163.com 3 days ago
parent
commit
ab3b605bed
5 changed files with 110 additions and 29 deletions
  1. +9
    -5
      src/views/business/comps/select/SelectBalanceValue.vue
  2. +34
    -10
      src/views/business/resource/gyzj/comps/gyzj/Ff.vue
  3. +18
    -6
      src/views/business/resource/gyzj/comps/gyzj/Gh.vue
  4. +26
    -2
      src/views/business/resource/mjy/comps/mjy/Ff.vue
  5. +23
    -6
      src/views/business/resource/mjy/comps/mjy/Gh.vue

+ 9
- 5
src/views/business/comps/select/SelectBalanceValue.vue View File

@ -1,7 +1,7 @@
<template>
<div>
<div style="display: flex;">
<el-select v-model="type" :placeholder="$t('form.placeholderSelect')" @change="typeChange">
<el-select v-model="type" :placeholder="$t('form.placeholderSelect')" @change="typeChange" style="width: 200px;">
<el-option :label="$t('page.business.resource.resource.common.tj')" :value="1"></el-option>
<el-option :label="$t('page.business.resource.resource.common.zl')" :value="3"></el-option>
</el-select>
@ -14,7 +14,7 @@
<template v-if="type == 3">
<div>
<el-input v-model="tpName" :placeholder="$t('form.xztp')" readonly @click.native="showSelectBalance"
style="width: 100px;" />
style="width: 80px;" />
</div>
<div>
<el-input v-model="tpz" :placeholder="$t('form.placeholderInput')" maxlength="20" @change="tpzChange">
@ -42,6 +42,10 @@ export default {
type: [Number, String],
default: ''
},
selectkey: {
type: String,
default: ''
},
dw: {
type: String,
default: ''
@ -91,15 +95,15 @@ export default {
this.tpzChange()
},
tpzChange() {
this.$emit('change', { tpz: this.tpz, dw: this.tpdw })
this.$emit('change', { tpz: this.tpz, dw: this.tpdw,selectkey:this.selectkey})
this.$emit('input', this.tpz)
},
inputChange() {
this.$emit('change', { tpz: this.srz, dw: this.dw })
this.$emit('change', { tpz: this.srz, dw: this.dw,selectkey:this.selectkey })
this.$emit('input', this.srz)
},
typeChange(){
this.$emit('change', { tpz: null, dw: null })
this.$emit('change', null)
this.$emit('input', null)
this.srz=null
this.tpz=null

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

@ -44,7 +44,8 @@
</el-table-column>
<el-table-column :label="$t('page.business.resource.gyzj.ckmz')" align="center" width="400px">
<template slot-scope="scope">
<SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.kcdw" @change="tpChange"/>
<SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.kcdw" :selectkey="scope.row.id + ''"
@change="tpChange" />
</template>
</el-table-column>
<el-table-column :label="$t('form.remark')" align="center" width="250px">
@ -124,7 +125,7 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.ckmz')" prop="ckmz">
<SelectBalanceValue v-model="form.ckmz" :dw="form.ckmzdw" @change="tpChange"/>
<SelectBalanceValue v-model="form.ckmz" :dw="form.ckldw" @change="tpChange2" />
</el-form-item>
</el-col>
</el-row>
@ -154,12 +155,12 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.lqr2')" prop="lqr2Id">
<el-form-item :label="$t('page.business.resource.gyzj.lqr2')" >
<SelectDeptUser v-model="form.lqr2Id" key="lqr2Id" @change="validateForm" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.lqr2') + $t('form.password')" prop="lqr2mm">
<el-form-item :label="$t('page.business.resource.gyzj.lqr2') + $t('form.password')" >
<el-input type="password" @contextmenu.native.prevent @copy.native.prevent @cut.native.prevent
show-password v-model="form.lqr2mm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
@ -181,12 +182,12 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.ffr2')" prop="ffr2Id">
<el-form-item :label="$t('page.business.resource.gyzj.ffr2')" >
<SelectDeptUser v-model="form.ffr2Id" key="ffr2Id" @change="validateForm" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.ffr2') + $t('form.password')" prop="ffr2mm">
<el-form-item :label="$t('page.business.resource.gyzj.ffr2') + $t('form.password')" >
<el-input type="password" @contextmenu.native.prevent @copy.native.prevent @cut.native.prevent
show-password v-model="form.ffr2mm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
@ -325,6 +326,29 @@ export default {
}
}
},
tpChange2(val) {
let that = this
if (val) {
that.form.ckmz = val.tpz
that.form.ckmzdw = val.dw
} else {
that.form.ckmz = null
that.form.ckmzdw = null
}
},
tpChange(val) {
let that = this
if (val) {
const _index = _.findIndex(that.selectList, function (o) { return o.id + '' === val.key })
if (_index > -1) {
that.selectList[_index].ckmz = val.tpz
that.selectList[_index].ckmzdw = val.dw
}
} else {
that.selectList[_index].ckmz = null
that.selectList[_index].ckmzdw = null
}
},
handleSc(row) {
const that = this
this.$modal.confirm(this.$t('form.confirmDelete')).then(() => {
@ -428,24 +452,24 @@ export default {
for (var i = 0; i < params.list.length; i++) {
if (!params.list[i].zytj || params.list[i].zytj == '') {
// this.$modal.msgError(params.list[i].mc + "")
this.$modal.msgError( "转移条件不能为空")
this.$modal.msgError("转移条件不能为空")
return
}
if (!params.list[i].mdMcs || params.list[i].mdMcs == '') {
if (!params.list[i].mdOther || params.list[i].mdOther == '') {
// this.$modal.msgError(params.list[i].mc + "")
this.$modal.msgError( "目的不能为空")
this.$modal.msgError("目的不能为空")
}
return
}
if (!params.list[i].ckmz || params.list[i].ckmz == '') {
// this.$modal.msgError(params.list[i].mc + "")
this.$modal.msgError( "出库毛重不能为空")
this.$modal.msgError("出库毛重不能为空")
return
}
if (!params.list[i].remark || params.list[i].remark == '') {
// this.$modal.msgError(params.list[i].mc + "")
this.$modal.msgError( "备注不能为空")
this.$modal.msgError("备注不能为空")
return
}
}

+ 18
- 6
src/views/business/resource/gyzj/comps/gyzj/Gh.vue View File

@ -1,7 +1,7 @@
<template>
<div>
<!-- 确认归还弹窗 -->
<el-dialog :title="$t('page.business.resource.gyzj.guihuan')" :visible.sync="open" width="800px" append-to-body
<el-dialog :title="$t('page.business.resource.gyzj.guihuan')" :visible.sync="open" width="1000px" append-to-body
:close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" v-if="open">
<div class="sbzdtcma"> <input type="text"> <input type="password" @contextmenu.native.prevent @copy.native.prevent @cut.native.prevent show-password> </div>
@ -94,9 +94,10 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.rkmz')" prop="rkmz">
<el-input type="number" v-model="form.rkmz" maxlength="50" :placeholder="$t('form.placeholderInput')">
<SelectBalanceValue v-model="form.rkmz" :dw="form.ckldw" @change="tpChange" />
<!-- <el-input type="number" v-model="form.rkmz" maxlength="50" :placeholder="$t('form.placeholderInput')">
<template slot="append">{{ form.ckldw }}</template>
</el-input>
</el-input> -->
</el-form-item>
</el-col>
</el-row>
@ -137,12 +138,12 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.jsr2Id')" prop="jsr2Id">
<el-form-item :label="$t('page.business.resource.gyzj.jsr2Id')" >
<SelectDeptUser v-model="form.jsr2Id" key="jsr2Id" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.gyzj.jsr2Id') + $t('form.password')" prop="jsr2mm">
<el-form-item :label="$t('page.business.resource.gyzj.jsr2Id') + $t('form.password')" >
<el-input type="password" @contextmenu.native.prevent @copy.native.prevent @cut.native.prevent show-password v-model="form.jsr2mm" maxlength="20"
:placeholder="$t('form.placeholderInput')" />
</el-form-item>
@ -169,11 +170,12 @@
import { gh, info } from "@/api/business/gyzj/gyzj"
import { mapGetters } from 'vuex'
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import SelectBalanceValue from '@/views/business/comps/select/SelectBalanceValue';
import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
export default {
name: "Gh",
components: { SelectDeptUser,BusinessSelect },
components: { SelectDeptUser,BusinessSelect,SelectBalanceValue },
data() {
return {
isBatch: false,
@ -238,6 +240,16 @@ export default {
created() {
},
methods: {
tpChange(val) {
let that = this
if (val) {
that.form.rkmz = val.tpz
that.form.rkmzdw = val.dw
} else {
that.form.rkmz = null
that.form.rkmzdw = null
}
},
cancel() {
this.open = false
},

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

@ -37,7 +37,8 @@
</el-table-column>
<el-table-column :label="$t('page.business.resource.mjy.ckmz')" align="center" width="400px">
<template slot-scope="scope">
<SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.ckmzdw" @change="tpChange"/>
<SelectBalanceValue v-model="scope.row.ckmz" :dw="scope.row.kcdw" :selectkey="scope.row.id + ''"
@change="tpChange"/>
</template>
</el-table-column>
<el-table-column :label="$t('page.business.resource.mjy.md')" align="center" width="250px">
@ -124,7 +125,7 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.ckmz')" prop="ckmz">
<SelectBalanceValue v-model="form.ckmz" :dw="form.ckmzdw" @change="tpChange"/>
<SelectBalanceValue v-model="form.ckmz" :dw="form.ckldw" @change="tpChange2"/>
</el-form-item>
</el-col>
</el-row>
@ -325,6 +326,29 @@ export default {
}
}
},
tpChange2(val) {
let that = this
if (val) {
that.form.ckmz = val.tpz
that.form.ckmzdw = val.dw
} else {
that.form.ckmz = null
that.form.ckmzdw = null
}
},
tpChange(val) {
let that = this
if (val) {
const _index = _.findIndex(that.selectList, function (o) { return o.id + '' === val.key })
if (_index > -1) {
that.selectList[_index].ckmz = val.tpz
that.selectList[_index].ckmzdw = val.dw
}
} else {
that.selectList[_index].ckmz = null
that.selectList[_index].ckmzdw = null
}
},
handleSc(row) {
this.$modal.confirm(this.$t('form.confirmDelete')).then(() => {
const _index = _.findIndex(this.selectList, function (o) { return o.id === row.id })

+ 23
- 6
src/views/business/resource/mjy/comps/mjy/Gh.vue View File

@ -1,7 +1,7 @@
<template>
<div>
<!-- 归还弹窗 -->
<el-dialog :title="$t('page.business.resource.mjy.guihuan')" :visible.sync="open" width="800px" append-to-body
<el-dialog :title="$t('page.business.resource.mjy.guihuan')" :visible.sync="open" width="1000px" append-to-body
:close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" v-if="open">
<div class="sbzdtcma"> <input type="text"> <input type="password" show-password> </div>
@ -95,19 +95,20 @@
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.rkmz')" prop="rkmz">
<el-input type="number" v-model="form.rkmz" maxlength="50" @change="rklChange"
<SelectBalanceValue v-model="form.rkmz" :dw="form.kcdw" @change="tpChange" />
<!-- <el-input type="number" v-model="form.rkmz" maxlength="50" @change="rklChange"
:placeholder="$t('form.placeholderInput')">
<template slot="append">{{ form.kcdw }}</template>
</el-input>
</el-input> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.resource.mjy.jsl')" prop="jsl">
<el-input type="number" v-model="form.jsl" maxlength="50" disabled
<el-input type="number" v-model="form.jsl" maxlength="50"
:placeholder="$t('form.placeholderInput')">
<template slot="append">{{ form.kcdw }}</template>
<template slot="append">{{ form.ckmzdw }}</template>
</el-input>
</el-form-item>
</el-col>
@ -206,10 +207,11 @@ import { gh, info } from "@/api/business/mjy/mjy"
import { mapGetters } from 'vuex'
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import SelectBalanceValue from '@/views/business/comps/select/SelectBalanceValue';
export default {
name: "Gh",
components: { SelectDeptUser, BusinessSelect },
components: { SelectDeptUser, BusinessSelect,SelectBalanceValue },
data() {
return {
isBatch: false,
@ -299,6 +301,21 @@ export default {
created() {
},
methods: {
tpChange(val) {
let that = this
if (val) {
that.form.rkmz = val.tpz
that.form.rkmzdw = val.dw
} else {
that.form.rkmz = null
that.form.rkmzdw = null
}
if(that.form.rkmzdw==that.form.ckmzdw){
that.rklChange()
}else{
this.form.jsl = ''
}
},
rkwzChange(val) {
this.form.rktj = val.wc
},

Loading…
Cancel
Save