Browse Source

fix:[系统管理][存储位置]

luojie
HanLong 4 weeks ago
parent
commit
be9ff5d028
3 changed files with 382 additions and 167 deletions
  1. +186
    -0
      src/views/business/storageLocation/comps/Bj.vue
  2. +187
    -0
      src/views/business/storageLocation/comps/Xz.vue
  3. +9
    -167
      src/views/business/storageLocation/list.vue

+ 186
- 0
src/views/business/storageLocation/comps/Bj.vue View File

@ -0,0 +1,186 @@
<template>
<div>
<!-- 编辑弹窗 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzdd')" prop="location">
<el-input v-model="form.location" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.sbmc')" prop="name">
<el-input v-model="form.name" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzhj')" prop="shelfPlacement">
<el-input v-model="form.shelfPlacement" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.wc')" prop="compartment">
<BusinessSelect v-model="form.compartment" dictType="business_cctj" :multiple="true"></BusinessSelect>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.ssbm')" prop="deptId">
<SelectDept v-model="form.deptId" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.zt')" prop="status">
<el-select v-model="form.status" :placeholder="$t('form.placeholderSelect')" style="width: 100%;">
<el-option key="1" :label="$t('page.system.storageLocation.no')" :value="1" />
<el-option key="10" :label="$t('page.system.storageLocation.yes')" :value="10" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-input v-model="form.qmyy" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('form.signer')" prop="qmrmc">
<el-input v-model="nickName" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.signerPsw')" prop="qmrmm">
<div class="sbzdtcma"> <input type="text"></div>
<el-input v-model="form.qmrmm" show-password :placeholder="$t('form.placeholderInput')" type="password"
maxlength="20" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t('form.saveConfirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { storageLocation_add, storageLocation_edit, storageLocation_info } from '@/api/business/storageLocation/storageLocation'
import { mapGetters } from 'vuex'
import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import SelectDept from '@/views/business/comps/select/SelectDept';
export default {
name: "StorageLocationBj",
components: { BusinessSelect, SelectDept },
data() {
return {
ids: [],
open: false,
form: {},
title: '',
//
rules: {
location: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
shelfPlacement: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
compartment: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "blur" }
],
deptId: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
status: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
qmrmm: [
{ required: true, message: this.$t('form.signerPsw') + this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 20, message: this.$t('form.signerPsw') + this.$t('form.lengthLimit') + '20', trigger: 'blur' }
]
}
}
},
computed: {
...mapGetters([
'nickName','name'
]),
},
created() {
},
methods: {
cancel() {
this.open = false
},
reset() {
this.form = {
compartment: null,
deptId: null,
deptName: null,
location: null,
name: null,
status: null,
shelfPlacement: null,
wc: null,
qmrmm: null,
}
this.resetForm("form")
},
showEdit(row) {
this.reset()
storageLocation_info({id: row.id}).then(response => {
this.form = response.data
this.form.qmyy = this.$t('page.system.storageLocation.editStroageLocation'),
this.title = this.$t('form.edit')
this.open = true
})
},
showAdd() {
this.reset()
this.title = this.$t('form.add')
this.form.qmyy = this.$t('page.system.storageLocation.addStroageLocation'),
this.open = true
},
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id) {
storageLocation_edit(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.$emit('callback')
})
} else {
storageLocation_add(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.$emit('callback')
})
}
}
})
},
onChangeCcwz(val) {
this.form.cctj = val.wc
}
}
}
</script>

+ 187
- 0
src/views/business/storageLocation/comps/Xz.vue View File

@ -0,0 +1,187 @@
<template>
<div>
<!-- 编辑弹窗 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzdd')" prop="location">
<el-input v-model="form.location" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.sbmc')" prop="name">
<el-input v-model="form.name" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzhj')" prop="shelfPlacement">
<el-input v-model="form.shelfPlacement" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.wc')" prop="compartment">
<BusinessSelect v-model="form.compartment" dictType="business_cctj" :multiple="true"></BusinessSelect>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.ssbm')" prop="deptId">
<SelectDept v-model="form.deptId" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.zt')" prop="status">
<el-select v-model="form.status" :placeholder="$t('form.placeholderSelect')" style="width: 100%;">
<el-option key="1" :label="$t('page.system.storageLocation.no')" :value="1" />
<el-option key="10" :label="$t('page.system.storageLocation.yes')" :value="10" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-input v-model="form.qmyy" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('form.signer')" prop="qmrmc">
<el-input v-model="nickName" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.signerPsw')" prop="qmrmm">
<div class="sbzdtcma"> <input type="text"></div>
<el-input v-model="form.qmrmm" show-password :placeholder="$t('form.placeholderInput')" type="password"
maxlength="20" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t('form.saveConfirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { storageLocation_add, storageLocation_edit, storageLocation_info } from '@/api/business/storageLocation/storageLocation'
import { mapGetters } from 'vuex'
import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import SelectDept from '@/views/business/comps/select/SelectDept';
export default {
name: "StorageLocationBj",
components: { BusinessSelect, SelectDept },
data() {
return {
ids: [],
open: false,
form: {},
title: '',
//
rules: {
location: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
shelfPlacement: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
compartment: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "blur" }
],
deptId: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
status: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
qmrmm: [
{ required: true, message: this.$t('form.signerPsw') + this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 20, message: this.$t('form.signerPsw') + this.$t('form.lengthLimit') + '20', trigger: 'blur' }
]
}
}
},
computed: {
...mapGetters([
'nickName','name'
]),
},
created() {
},
methods: {
cancel() {
this.reset()
this.open = false
},
reset() {
this.form = {
compartment: null,
deptId: null,
deptName: null,
location: null,
name: null,
status: null,
shelfPlacement: null,
wc: null,
qmrmm: null,
}
this.resetForm("form")
},
showEdit(row) {
this.reset()
storageLocation_info({id: row.id}).then(response => {
this.form = response.data
this.form.qmyy = this.$t('page.system.storageLocation.editStroageLocation'),
this.title = this.$t('form.edit')
this.open = true
})
},
showAdd() {
this.reset()
this.title = this.$t('form.add')
this.form.qmyy = this.$t('page.system.storageLocation.addStroageLocation'),
this.open = true
},
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id) {
storageLocation_edit(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.$emit('callback')
})
} else {
storageLocation_add(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.$emit('callback')
})
}
}
})
},
onChangeCcwz(val) {
this.form.cctj = val.wc
}
}
}
</script>

+ 9
- 167
src/views/business/storageLocation/list.vue View File

@ -57,111 +57,36 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改仪器管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzdd')" prop="location">
<el-input v-model="form.location" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.sbmc')" prop="name">
<el-input v-model="form.name" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzhj')" prop="shelfPlacement">
<el-input v-model="form.shelfPlacement" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.wc')" prop="compartment">
<BusinessSelect v-model="form.compartment" dictType="business_cctj" :multiple="true"></BusinessSelect>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.ssbm')" prop="deptId">
<SelectDept v-model="form.deptId" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.zt')" prop="status">
<el-select v-model="form.status" :placeholder="$t('form.placeholderSelect')" style="width: 100%;">
<el-option key="1" :label="$t('page.system.storageLocation.no')" :value="1" />
<el-option key="10" :label="$t('page.system.storageLocation.yes')" :value="10" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-input v-model="form.qmyy" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('form.signer')" prop="qmrmc">
<el-input v-model="nickName" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.signerPsw')" prop="qmrmm">
<div class="sbzdtcma"> <input type="text"></div>
<el-input v-model="form.qmrmm" show-password :placeholder="$t('form.placeholderInput')" type="password"
maxlength="20" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t('form.saveConfirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
<StorageLocationDetail ref="storageLocationDetail" /> <StorageLocationDetail ref="storageLocationDetail" />
<Bj ref="Bj" @callback="handleQuery"/>
<Xz ref="Xz" @callback="handleQuery"/>
</div> </div>
</template> </template>
<script> <script>
import { storageLocation_list, storageLocation_add, storageLocation_edit, storageLocation_info } from '@/api/business/storageLocation/storageLocation'
import { storageLocation_list } from '@/api/business/storageLocation/storageLocation'
import BusinessSelect from '@/views/business/comps/select/BusinessSelect'; import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import SelectDept from '@/views/business/comps/select/SelectDept'; import SelectDept from '@/views/business/comps/select/SelectDept';
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import SelectStorageLocation from '@/views/business/comps/select/SelectStorageLocation'
import StorageLocationDetail from './comps/detail' import StorageLocationDetail from './comps/detail'
import Bj from "./comps/Bj";
import Xz from "./comps/Xz";
export default { export default {
name: 'StorageLocation', name: 'StorageLocation',
components: { BusinessSelect, SelectDept, SelectStorageLocation, StorageLocationDetail },
components: { BusinessSelect, SelectDept, StorageLocationDetail, Bj, Xz },
data() { data() {
return { return {
// //
loading: true, loading: true,
//
single: true,
//
multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
list: [], list: [],
//
title: '',
//
open: false,
// //
dateRange: [], dateRange: [],
// //
@ -172,39 +97,7 @@ export default {
name: null, name: null,
shelfPlacement: null, shelfPlacement: null,
}, },
//
form: {
'qmyy': this.$t('page.form.add'),
qmrmm: null,
},
//
rules: {
location: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
shelfPlacement: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
compartment: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "blur" }
],
deptId: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
status: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
qmrmm: [
{ required: true, message: this.$t('form.signerPsw') + this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 20, message: this.$t('form.signerPsw') + this.$t('form.lengthLimit') + '20', trigger: 'blur' }
]
}
} }
}, },
computed: { computed: {
@ -225,27 +118,6 @@ export default {
this.loading = false this.loading = false
}) })
}, },
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
location: null,
name: null,
shelfPlacement: null,
status: null,
compartment: null,
deptId: null,
qmrmm: null,
qmyy: this.$t('page.system.storageLocation.addStroageLocation'),
}
console.log('resetreset')
this.resetForm('form')
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
@ -259,45 +131,15 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset()
console.log(this.form)
this.open = true
this.title = this.$t('form.add')
this.$refs.Bj.showAdd()
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset()
storageLocation_info({ id: row.id }).then(res => {
this.form = res.data
this.form.qmyy = this.$t('page.system.storageLocation.editStroageLocation')
this.open = true
this.title = this.$t('form.edit')
})
this.$refs.Bj.showEdit(row)
}, },
handleDetail(row) { handleDetail(row) {
this.$refs.storageLocationDetail.show(row) this.$refs.storageLocationDetail.show(row)
}, },
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id) {
storageLocation_edit(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.getList()
})
} else {
storageLocation_add(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.getList()
})
}
}
})
},
} }
} }
</script> </script>

Loading…
Cancel
Save