|
@@ -18,8 +18,18 @@
|
|
|
highlight-current-row
|
|
|
@current-change="handleWorkSectionChange"
|
|
|
>
|
|
|
- <el-table-column label="行号" type="index" width="50" align="center" />
|
|
|
- <el-table-column label="工段编码" prop="deptCode" width="80" align="center" />
|
|
|
+ <el-table-column
|
|
|
+ label="行号"
|
|
|
+ type="index"
|
|
|
+ width="50"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="工段编码"
|
|
|
+ prop="deptCode"
|
|
|
+ width="80"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
<el-table-column label="工段名称" prop="label" align="center" />
|
|
|
</el-table>
|
|
|
</div>
|
|
@@ -33,43 +43,85 @@
|
|
|
<el-form class="list-search-container" :inline="true">
|
|
|
<el-form-item class="section-title" label="设备资源" />
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="Plus" @click="handleShowEquipmentFormDialog()">新增</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleShowEquipmentFormDialog()"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备名称:">
|
|
|
- <el-input
|
|
|
- placeholder="请输入设备名称"
|
|
|
- v-model.trim="queryParams.equipmentName"
|
|
|
- @keydown.enter.prevent
|
|
|
- @keyup.enter="handleRefreshEquipment"
|
|
|
- clearable
|
|
|
- style="width: 180px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设备编码:">
|
|
|
- <el-input
|
|
|
- placeholder="请输入设备编码"
|
|
|
- v-model.trim="queryParams.equipmentCode"
|
|
|
- @keydown.enter.prevent
|
|
|
- @keyup.enter="handleRefreshEquipment"
|
|
|
- clearable
|
|
|
- style="width: 180px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="info" icon="Search" @click="handleRefreshEquipment">搜索</el-button>
|
|
|
- </el-form-item>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入设备名称"
|
|
|
+ v-model.trim="queryParams.equipmentName"
|
|
|
+ @keydown.enter.prevent
|
|
|
+ @keyup.enter="handleRefreshEquipment"
|
|
|
+ clearable
|
|
|
+ style="width: 180px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备编码:">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入设备编码"
|
|
|
+ v-model.trim="queryParams.equipmentCode"
|
|
|
+ @keydown.enter.prevent
|
|
|
+ @keyup.enter="handleRefreshEquipment"
|
|
|
+ clearable
|
|
|
+ style="width: 180px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="info" icon="Search" @click="handleRefreshEquipment"
|
|
|
+ >搜索</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<!-- 列表区 -->
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table v-loading="equipmentLoading" :data="equipmentList" height="100%" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column label="设备类别" prop="categoryName" width="150" align="center" />
|
|
|
- <el-table-column label="设备名称" prop="equipmentName" width="150" align="center" />
|
|
|
- <el-table-column label="规格型号" prop="standard" width="150" align="center" />
|
|
|
- <el-table-column label="设备编码" prop="equipmentCode" width="150" align="center" />
|
|
|
- <el-table-column label="使用部门" prop="usageDeptAlias" width="150" align="center" />
|
|
|
- <el-table-column label="备注" prop="remark" header-align="center" align="center" />
|
|
|
+ <el-table
|
|
|
+ v-loading="equipmentLoading"
|
|
|
+ :data="equipmentList"
|
|
|
+ height="100%"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="设备类别"
|
|
|
+ prop="categoryName"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="设备名称"
|
|
|
+ prop="equipmentName"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="规格型号"
|
|
|
+ prop="standard"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="设备编码"
|
|
|
+ prop="equipmentCode"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="使用部门"
|
|
|
+ prop="usageDeptAlias"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="备注"
|
|
|
+ prop="remark"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -86,19 +138,50 @@
|
|
|
<el-form class="list-search-container" :inline="true">
|
|
|
<el-form-item class="section-title" label="添加工序" />
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="Plus" @click="handleShowProcessFormDialog()">新增</el-button>
|
|
|
- <el-button type="danger" icon="Delete" @click="handledelDeptProcess" :disabled="deptProcessIds.length === 0"> 删除 </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleShowProcessFormDialog()"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ icon="Delete"
|
|
|
+ @click="handledelDeptProcess"
|
|
|
+ :disabled="deptProcessIds.length === 0"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<!-- 列表区 -->
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table v-loading="deptProcessLoading" :data="deptProcessList" height="100%" @selection-change="deptProcessSelectionChange">
|
|
|
+ <el-table
|
|
|
+ v-loading="deptProcessLoading"
|
|
|
+ :data="deptProcessList"
|
|
|
+ row-key="id"
|
|
|
+ height="100%"
|
|
|
+ @selection-change="deptProcessSelectionChange"
|
|
|
+ >
|
|
|
<el-table-column type="selection" width="40" align="center" />
|
|
|
- <el-table-column label="行号" type="index" width="50" align="center" />
|
|
|
- <el-table-column label="工序编码" prop="processCode" align="center" />
|
|
|
- <el-table-column label="工序简称" prop="processAlias" align="center" />
|
|
|
+ <el-table-column
|
|
|
+ label="行号"
|
|
|
+ type="index"
|
|
|
+ width="50"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="工序编码"
|
|
|
+ prop="processCode"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="工序简称"
|
|
|
+ prop="processAlias"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -111,171 +194,186 @@
|
|
|
/>
|
|
|
</section>
|
|
|
</section>
|
|
|
- <equipment-form ref="equipmentFormRef" :multipleSelected="handleEquipmentMultipleSelected" @handleSaveSuccess="handleRefreshEquipment" />
|
|
|
- <process-form ref="processFormRef" :multipleSelected="handleProcessMultipleSelected" @handleSaveSuccess="handleRefreshProcess" />
|
|
|
+ <equipment-form
|
|
|
+ ref="equipmentFormRef"
|
|
|
+ :multipleSelected="handleEquipmentMultipleSelected"
|
|
|
+ @handleSaveSuccess="handleRefreshEquipment"
|
|
|
+ />
|
|
|
+ <process-form
|
|
|
+ ref="processFormRef"
|
|
|
+ :multipleSelected="handleProcessMultipleSelected"
|
|
|
+ @handleSaveSuccess="handleRefreshProcess"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { workSectionTree } from '@/api/system/dept'
|
|
|
-import { detailList, updateBacth } from '@/api/business/equipment'
|
|
|
-import { listDeptProcess, addDeptProcess, delDeptProcess } from '@/api/business/deptProcess'
|
|
|
-import equipmentForm from './form'
|
|
|
-import processForm from './DialogProcessChoice'
|
|
|
-const { proxy } = getCurrentInstance()
|
|
|
+import { workSectionTree } from "@/api/system/dept";
|
|
|
+import { detailList, updateBacth } from "@/api/business/equipment";
|
|
|
+import {
|
|
|
+ listDeptProcess,
|
|
|
+ addDeptProcess,
|
|
|
+ delDeptProcess,
|
|
|
+} from "@/api/business/deptProcess";
|
|
|
+import equipmentForm from "./form";
|
|
|
+import processForm from "./DialogProcessChoice";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
/** 设备档案 查询对象 */
|
|
|
const data = reactive({
|
|
|
form: {},
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- equipmentName:'',
|
|
|
- equipmentCode: ''
|
|
|
+ equipmentName: "",
|
|
|
+ equipmentCode: "",
|
|
|
},
|
|
|
queryDeptProcessParams: {
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
- }
|
|
|
-})
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+});
|
|
|
|
|
|
-const { queryParams, queryDeptProcessParams } = toRefs(data)
|
|
|
+const { queryParams, queryDeptProcessParams } = toRefs(data);
|
|
|
|
|
|
/** 查询 对象 */
|
|
|
-const workSectionList = ref([])
|
|
|
-const equipmentList = ref([])
|
|
|
-const deptProcessList = ref([])
|
|
|
-const workSectionLoading = ref(false)
|
|
|
-const equipmentLoading = ref(false)
|
|
|
-const deptProcessLoading = ref(false)
|
|
|
-const equipmentTotal = ref(0)
|
|
|
-const deptProcessTotal = ref(0)
|
|
|
-const single = ref(true)
|
|
|
-const currentWorkSection = ref({})
|
|
|
-const ids = ref([])
|
|
|
-const deptProcessIds = ref([])
|
|
|
+const workSectionList = ref([]);
|
|
|
+const equipmentList = ref([]);
|
|
|
+const deptProcessList = ref([]);
|
|
|
+const workSectionLoading = ref(false);
|
|
|
+const equipmentLoading = ref(false);
|
|
|
+const deptProcessLoading = ref(false);
|
|
|
+const equipmentTotal = ref(0);
|
|
|
+const deptProcessTotal = ref(0);
|
|
|
+const single = ref(true);
|
|
|
+const currentWorkSection = ref({});
|
|
|
+const ids = ref([]);
|
|
|
+const deptProcessIds = ref([]);
|
|
|
|
|
|
/**************************** 工段方法区 ****************************/
|
|
|
|
|
|
/** 获取工段列表 */
|
|
|
function getWorkSections() {
|
|
|
- workSectionLoading.value = true
|
|
|
+ workSectionLoading.value = true;
|
|
|
workSectionTree().then((res) => {
|
|
|
- workSectionList.value = res.data
|
|
|
+ workSectionList.value = res.data;
|
|
|
if (workSectionList.value.length > 0) {
|
|
|
- proxy.$refs.workSectionTable.setCurrentRow(workSectionList.value[0])
|
|
|
+ proxy.$refs.workSectionTable.setCurrentRow(workSectionList.value[0]);
|
|
|
}
|
|
|
- workSectionLoading.value = false
|
|
|
- })
|
|
|
+ workSectionLoading.value = false;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const handleWorkSectionChange = (row) => {
|
|
|
if (row) {
|
|
|
- currentWorkSection.value = row
|
|
|
- queryParams.value.usageDeptId = row.id
|
|
|
+ currentWorkSection.value = row;
|
|
|
+ queryParams.value.usageDeptId = row.id;
|
|
|
|
|
|
- getEquipment()
|
|
|
- getDeptProcess()
|
|
|
+ getEquipment();
|
|
|
+ getDeptProcess();
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
/**************************** 设备区方法区 ****************************/
|
|
|
const getEquipment = () => {
|
|
|
- equipmentLoading.value = true
|
|
|
+ equipmentLoading.value = true;
|
|
|
detailList(queryParams.value).then((res) => {
|
|
|
- equipmentList.value = res.rows
|
|
|
- equipmentLoading.value = false
|
|
|
- equipmentTotal.value = res.total
|
|
|
- })
|
|
|
-}
|
|
|
+ equipmentList.value = res.rows;
|
|
|
+ equipmentLoading.value = false;
|
|
|
+ equipmentTotal.value = res.total;
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
/** 打开设备对话框事件 */
|
|
|
function handleShowEquipmentFormDialog() {
|
|
|
- proxy.$refs.equipmentFormRef.open(currentWorkSection.value)
|
|
|
+ proxy.$refs.equipmentFormRef.open(currentWorkSection.value);
|
|
|
}
|
|
|
|
|
|
// 设备区多选事件
|
|
|
function handleSelectionChange(selection) {
|
|
|
- ids.value = selection.map((item) => item.id)
|
|
|
+ ids.value = selection.map((item) => item.id);
|
|
|
}
|
|
|
/**设备多选带回 */
|
|
|
function handleEquipmentMultipleSelected(selection) {
|
|
|
- var items = []
|
|
|
+ var items = [];
|
|
|
selection.map((item) => {
|
|
|
- item.usageDeptId = currentWorkSection.value.id
|
|
|
- })
|
|
|
- items = selection
|
|
|
+ item.usageDeptId = currentWorkSection.value.id;
|
|
|
+ });
|
|
|
+ items = selection;
|
|
|
updateBacth(items).then((res) => {
|
|
|
- getEquipment()
|
|
|
- })
|
|
|
+ getEquipment();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/** 刷新设备区事件 */
|
|
|
function handleRefreshEquipment(row) {
|
|
|
- getEquipment()
|
|
|
+ getEquipment();
|
|
|
}
|
|
|
|
|
|
/*******************************工序方法区*********************************** */
|
|
|
|
|
|
const getDeptProcess = () => {
|
|
|
- deptProcessLoading.value = true
|
|
|
- queryDeptProcessParams.value.deptId = currentWorkSection.value.id
|
|
|
- console.log(queryDeptProcessParams.value)
|
|
|
+ deptProcessLoading.value = true;
|
|
|
+ queryDeptProcessParams.value.deptId = currentWorkSection.value.id;
|
|
|
+ console.log(queryDeptProcessParams.value);
|
|
|
listDeptProcess(queryDeptProcessParams.value).then((res) => {
|
|
|
- deptProcessList.value = res.rows
|
|
|
- deptProcessLoading.value = false
|
|
|
- deptProcessTotal.value = res.total
|
|
|
- })
|
|
|
-}
|
|
|
+ deptProcessList.value = res.rows;
|
|
|
+ deptProcessLoading.value = false;
|
|
|
+ deptProcessTotal.value = res.total;
|
|
|
+ });
|
|
|
+};
|
|
|
/** 打开工序对话框事件 */
|
|
|
function handleShowProcessFormDialog() {
|
|
|
- proxy.$refs.processFormRef.open(currentWorkSection.value)
|
|
|
+ proxy.$refs.processFormRef.open(currentWorkSection.value);
|
|
|
}
|
|
|
|
|
|
/**工序多选带回 */
|
|
|
function handleProcessMultipleSelected(selection) {
|
|
|
for (var i = 0; i < selection.length; i++) {
|
|
|
- var deptProcessAdd = {}
|
|
|
- deptProcessAdd.deptId = currentWorkSection.value.id
|
|
|
- deptProcessAdd.processId = selection[i].id
|
|
|
- deptProcessAdd.processCode = selection[i].processCode
|
|
|
- deptProcessAdd.processAlias = selection[i].processAlias
|
|
|
- deptProcessList.value.push(deptProcessAdd)
|
|
|
+ var deptProcessAdd = {};
|
|
|
+ deptProcessAdd.deptId = currentWorkSection.value.id;
|
|
|
+ deptProcessAdd.processId = selection[i].id;
|
|
|
+ deptProcessAdd.processCode = selection[i].processCode;
|
|
|
+ deptProcessAdd.processAlias = selection[i].processAlias;
|
|
|
+ deptProcessList.value.push(deptProcessAdd);
|
|
|
}
|
|
|
addDeptProcess(deptProcessList.value).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- proxy.$modal.msgSuccess('保存成功')
|
|
|
+ proxy.$modal.msgSuccess("保存成功");
|
|
|
+ handleWorkSectionChange(currentWorkSection.value);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/** 刷新工序区事件 */
|
|
|
function handleRefreshProcess(row) {
|
|
|
- getDeptProcess()
|
|
|
+ getDeptProcess();
|
|
|
}
|
|
|
|
|
|
//工段工序多选框选中数据
|
|
|
function deptProcessSelectionChange(selection) {
|
|
|
- deptProcessIds.value = selection.map((item) => item.id)
|
|
|
- single.value = selection.length != 1
|
|
|
+ console.log(selection);
|
|
|
+ deptProcessIds.value = selection.map((item) => item.id);
|
|
|
+ single.value = selection.length != 1;
|
|
|
}
|
|
|
|
|
|
/**删除工序工段表数据 */
|
|
|
function handledelDeptProcess() {
|
|
|
+ console.log(deptProcessIds.value);
|
|
|
proxy.$modal
|
|
|
- .confirm('是否确认删除选中的数据项?')
|
|
|
+ .confirm("是否确认删除选中的数据项?")
|
|
|
.then(function () {
|
|
|
- return delDeptProcess(deptProcessIds.value)
|
|
|
+ return delDeptProcess(deptProcessIds.value);
|
|
|
})
|
|
|
.then(() => {
|
|
|
- getDeptProcess()
|
|
|
- proxy.$modal.msgSuccess('删除成功!')
|
|
|
+ getDeptProcess();
|
|
|
+ proxy.$modal.msgSuccess("删除成功!");
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
- proxy.$modal.msg('操作失败!')
|
|
|
- })
|
|
|
+ proxy.$modal.msg("操作失败!");
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getWorkSections()
|
|
|
-})
|
|
|
+ getWorkSections();
|
|
|
+});
|
|
|
</script>
|