| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="工厂名称" prop="plantName"> |
| | | <el-input |
| | | v-model="queryParams.plantName" |
| | | placeholder="请输入工厂名称" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="工厂编码" prop="plantCode"> |
| | | <el-input |
| | | v-model="queryParams.plantCode" |
| | | placeholder="请输入工厂编码" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="启用状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="请选择启用状态" clearable> |
| | | <el-option |
| | | v-for="dict in aps_plant_status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['aps_plant:aps_plant:add']" |
| | | v-hasPermi="['plant:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['aps_plant:aps_plant:edit']" |
| | | v-hasPermi="['plant:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | |
| | | @click="handleDelete" |
| | | v-hasPermi="['aps_plant:aps_plant:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | </el-col>--> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['aps_plant:aps_plant:export']" |
| | | v-hasPermi="['plant:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="创建者" align="center" prop="createBy" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" /> |
| | | <el-table-column label="更新者" align="center" prop="updateBy" /> |
| | | <el-table-column label="更新时间" align="center" prop="updateTime" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['aps_plant:aps_plant:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['aps_plant:aps_plant:remove']">删除</el-button> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['plant:edit']">修改</el-button> |
| | | <!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['aps_plant:aps_plant:remove']">删除</el-button>--> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <!-- 添加或修改工厂管理对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="aps_plantRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="id" prop="id"> |
| | | <el-input v-model="form.id" placeholder="请输入id" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="工厂名称" prop="plantName"> |
| | | <el-input v-model="form.plantName" placeholder="请输入工厂名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="工厂编码" prop="plantCode"> |
| | | <el-input v-model="form.plantCode" placeholder="请输入工厂编码" /> |
| | | <el-input v-model="form.plantCode" placeholder="请输入工厂编码" :disabled=disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="启用状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | |
| | | const disabled = ref(false); |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | |
| | | status: null, |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "id不能为空", trigger: "blur" } |
| | | plantName: [ |
| | | { required: true, message: "工厂名称不能为空", trigger: "blur" }, |
| | | ], |
| | | plantCode: [ |
| | | { required: true, message: "工厂编码不能为空", trigger: "blur" }, |
| | | ], |
| | | status: [ |
| | | { required: true, message: "启用状态不能为空", trigger: "blur" }, |
| | | ], |
| | | } |
| | | }); |
| | |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "添加工厂管理"; |
| | | disabled.value = false; |
| | | } |
| | | |
| | | /** 修改按钮操作 */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value |
| | | disabled.value = true; |
| | | getAps_plant(_id).then(response => { |
| | | form.value = response.data; |
| | | open.value = true; |
| | |
| | | /** 删除按钮操作 */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal.confirm('是否确认删除工厂管理编号为"' + _ids + '"的数据项?').then(function() { |
| | | proxy.$modal.confirm('是否确认删除工厂数据?').then(function() { |
| | | return delAps_plant(_ids); |
| | | }).then(() => { |
| | | getList(); |