华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

272 lines
8.7 KiB

G<template>
<div>
<!-- 处置容器弹窗 -->
<el-dialog :title="$t('page.business.zykgl.mjy.czrq')" :visible.sync="open" width="1200px" append-to-body
:close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<div :style="isBatch?'display:block':'display:none'">
<el-row style="margin:10px 0px;">
<el-col :span="24">
<el-table :data="selectList" border>
<el-table-column :label="$t('page.business.zykgl.mjy.mc')" align="left" prop="mc"
:show-overflow-tooltip="true" width="120px" />
<el-table-column :label="$t('page.business.zykgl.mjy.bh')" align="left" prop="bh"
:show-overflow-tooltip="true" width="120px" />
<el-table-column :label="$t('page.business.zykgl.mjy.czfs')" align="center" width="250px">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.czfs" maxlength="50"
:placeholder="$t('form.placeholderInput')" />
</template>
</el-table-column>
<el-table-column :label="$t('page.business.zykgl.mjy.yuanyin')" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.czyy" maxlength="50"
:placeholder="$t('form.placeholderInput')" />
</template>
</el-table-column>
<el-table-column :label="$t('form.operate')" align="center" width="150px">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleSc(scope.row)">{{
$t('form.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</div>
<div :style="!isBatch?'display:block':'display:none'">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.zykgl.mjy.mc')" prop="mc">
<el-input type="text" v-model="form.mc" maxlength="50" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.business.zykgl.mjy.bh')" prop="glyj">
<el-input type="text" v-model="form.bh" maxlength="50" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.zykgl.mjy.czfs')" prop="czfs">
<el-input type="text" v-model="form.czfs" maxlength="50" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('page.business.zykgl.mjy.yuanyin')" prop="czyy">
<el-input type="textarea" v-model="form.czyy" :rows="2" maxlength="500"
:placeholder="$t('form.placeholderInput')">
</el-input>
</el-form-item>
</el-col>
</el-row>
</div>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.zykgl.mjy.clr')">
<el-input type="text" v-model="nickName" maxlength="50" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('form.password')" prop="clrmm">
<el-input type="password" v-model="form.clrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.zykgl.mjy.fhr')" prop="fhrId">
<el-input type="text" v-model="form.fhrId" maxlength="50" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('form.password')" prop="fhrmm">
<el-input type="password" v-model="form.fhrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.zykgl.mjy.jdr')" prop="jdrId">
<el-input type="text" v-model="form.jdrId" maxlength="50" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('form.password')" prop="jdrmm">
<el-input type="password" v-model="form.jdrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-input type="text" v-model="form.qmyy" maxlength="20" disabled />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mjy_czrq, mjy_plczrq } from "@/api/business/mjy/mjy"
import { mapGetters } from 'vuex'
export default {
name: "MjyBj",
data() {
return {
isBatch: false,
ids: [],
selectList: [],
open: false,
form: {},
rules: {
czyy: [{
required: true,
message: ' ',
trigger: 'blur'
}],
czfs: [{
required: true,
message: ' ',
trigger: 'blur'
}],
clrId: [{
required: true,
message: ' ',
trigger: 'blur'
}],
fhrId: [{
required: true,
message: ' ',
trigger: 'blur'
}],
jdrId: [{
required: true,
message: ' ',
trigger: 'blur'
}],
clrmm: [{
required: true,
message: ' ',
trigger: 'blur'
}],
fhrmm: [{
required: true,
message: ' ',
trigger: 'blur'
}],
jdrmm: [{
required: true,
message: ' ',
trigger: 'blur'
}]
}
}
},
computed: {
...mapGetters([
'nickName'
]),
},
created() {
},
methods: {
handleSc(row) {
const that = this
this.$modal.confirm(this.$t('form.confirmDelete')).then(function () {
return delDept(row.deptId)
}).then(() => {
const _index = _.findIndex(that.selectList, function (o) { return o.id === row.id })
if (_index > -1) {
that.selectList.splice(_index, 1)
that.form.ids = that.selectList.map(item => item.id)
}
}).catch(() => { })
},
showBatch(val) {
this.reset()
this.isBatch = true
this.selectList = []
this.form.ids = val.map(item => item.id)
let tmp = []
_.forEach(val, function (item) {
tmp.push({
id: item.id,
mc: item.mc,
bh: item.bh,
czyy: null,
czfs: null,
})
})
this.selectList = tmp
this.open = true
},
cancel() {
this.open = false
},
reset() {
this.form = {
id: null,
ids: [],
mc: null,
bh: null,
czyy: null,
czfs: null,
clrId: null,
fhrId: null,
jdrId: null,
qmyy: '处置容器',
sdrmm: null
}
this.resetForm("form")
},
show(row) {
this.reset()
this.isBatch = false
this.form.ids = []
this.selectList = []
this.form.id = row.id
this.form.mc = row.mc
this.form.bh = row.bh
this.open = true
},
save() {
this.$refs["form"].validate(valid => {
if (valid) {
let params = this.form
if (this.isBatch) {
params.list = this.selectList
if (this.selectList.length <= 0) {
this.$modal.msgError("请选择要操作的麻精药")
} else {
mjy_plczrq(params).then(response => {
this.open = false
this.$emit('callback')
})
}
} else {
mjy_czrq(params).then(response => {
this.open = false
this.$emit('callback')
})
}
}
})
}
}
}
</script>