feat: 设备所属车间筛选条件

This commit is contained in:
caoqianming 2023-12-22 09:39:50 +08:00
parent 9ee05321e8
commit ddfc2cb5b5
1 changed files with 15 additions and 17 deletions

View File

@ -3,11 +3,13 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'equipment.create'">新增</el-button> <el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'equipment.create'">新增</el-button>
<el-select v-model="query.belong_dept" placeholder="所在车间" clearable style="margin-left: 2px;"> <el-select v-model="query.belong_dept" placeholder="所在车间" clearable style="margin-left: 2px;"
@change="handleQuery">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-select v-model="query.state" placeholder="设备状态" clearable style="margin-left: 2px;"> <el-select v-model="query.state" placeholder="设备状态" clearable style="margin-left: 2px;">
<el-option v-for="item in stateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value"
@change="handleQuery"></el-option>
</el-select> </el-select>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -16,7 +18,7 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query"> <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="paramsEquipment">
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="设备名称" prop="name" show-overflow-tooltip> <el-table-column label="设备名称" prop="name" show-overflow-tooltip>
</el-table-column> </el-table-column>
@ -81,7 +83,7 @@
</el-container> </el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog> @closed="dialog.save = false"></save-dialog>
<el-drawer title="记录" v-model="visibleRecord" :size="1000" destroy-on-close @closed="visibleRecord = false"> <el-drawer title="检记录" v-model="visibleRecord" :size="1000" destroy-on-close @closed="visibleRecord = false">
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'equipment'" <el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'equipment'"
style="position: absolute;z-index: 10;left: 110px;top: 16px;">新增</el-button> style="position: absolute;z-index: 10;left: 110px;top: 16px;">新增</el-button>
@ -182,6 +184,7 @@
</template> </template>
<script> <script>
import saveDialog from "./equipment_form.vue"; import saveDialog from "./equipment_form.vue";
import { genTree } from "@/utils/verificate";
export default { export default {
name: "rparty", name: "rparty",
components: { components: {
@ -189,15 +192,13 @@ export default {
}, },
data() { data() {
return { return {
deptOptions: [],
dialog: { dialog: {
save: false, save: false,
}, },
apiObj: this.$API.em.equipment.list, apiObj: this.$API.em.equipment.list,
query: { paramsEquipment:{type: 10},
page: 1, query: {},
page_size: 20,
type: 10
},
apiObj2: this.$API.em.einspect.list, apiObj2: this.$API.em.einspect.list,
query2: { query2: {
equipment: '' equipment: ''
@ -235,15 +236,12 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getUserList(); this.getDept()
}, },
methods: { methods: {
// async getDept() {
getUserList() { let res = await this.$API.system.dept.list.req({ page: 0, type: "dept" });
let that = this; this.deptOptions = genTree(res);
this.$API.system.user.list.req({ page_size: 20, page: 1 }).then(res => {
that.userList = res.results;
});
}, },
getReceptionist(data) { getReceptionist(data) {
this.form.inspect_user = data.id; this.form.inspect_user = data.id;
@ -283,7 +281,7 @@ export default {
record_create() { record_create() {
this.visible = true; this.visible = true;
}, },
// //
submit() { submit() {
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {