|
|
|
@ -57,111 +57,36 @@ |
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" |
|
|
|
@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" /> |
|
|
|
<Bj ref="Bj" @callback="handleQuery"/> |
|
|
|
<Xz ref="Xz" @callback="handleQuery"/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<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 SelectDept from '@/views/business/comps/select/SelectDept'; |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import SelectStorageLocation from '@/views/business/comps/select/SelectStorageLocation' |
|
|
|
import StorageLocationDetail from './comps/detail' |
|
|
|
import Bj from "./comps/Bj"; |
|
|
|
import Xz from "./comps/Xz"; |
|
|
|
export default { |
|
|
|
name: 'StorageLocation', |
|
|
|
components: { BusinessSelect, SelectDept, SelectStorageLocation, StorageLocationDetail }, |
|
|
|
components: { BusinessSelect, SelectDept, StorageLocationDetail, Bj, Xz }, |
|
|
|
|
|
|
|
data() { |
|
|
|
return { |
|
|
|
// 遮罩层 |
|
|
|
loading: true, |
|
|
|
// 非单个禁用 |
|
|
|
single: true, |
|
|
|
// 非多个禁用 |
|
|
|
multiple: true, |
|
|
|
// 显示搜索条件 |
|
|
|
showSearch: true, |
|
|
|
// 总条数 |
|
|
|
total: 0, |
|
|
|
// 列表数据 |
|
|
|
list: [], |
|
|
|
// 弹出层标题 |
|
|
|
title: '', |
|
|
|
// 是否显示弹出层 |
|
|
|
open: false, |
|
|
|
// 日期范围 |
|
|
|
dateRange: [], |
|
|
|
// 查询参数 |
|
|
|
@ -172,39 +97,7 @@ export default { |
|
|
|
name: 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: { |
|
|
|
@ -225,27 +118,6 @@ export default { |
|
|
|
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() { |
|
|
|
this.queryParams.pageNum = 1 |
|
|
|
@ -259,45 +131,15 @@ export default { |
|
|
|
}, |
|
|
|
/** 新增按钮操作 */ |
|
|
|
handleAdd() { |
|
|
|
this.reset() |
|
|
|
console.log(this.form) |
|
|
|
this.open = true |
|
|
|
this.title = this.$t('form.add') |
|
|
|
this.$refs.Bj.showAdd() |
|
|
|
}, |
|
|
|
/** 修改按钮操作 */ |
|
|
|
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) { |
|
|
|
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> |