|
@@ -91,20 +91,21 @@
|
|
|
</el-form>
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table v-loading="deptProcessLoading" :data="deptProcessList" row-key="id" height="100%"
|
|
|
+ <el-table v-loading="deptProcessLoading" :data="userList" row-key="id" height="100%"
|
|
|
@selection-change="deptProcessSelectionChange">
|
|
|
<el-table-column type="selection" width="40" align="center" :reserve-selection="true" />
|
|
|
<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="员工号" prop="userName" align="center" />
|
|
|
+ <el-table-column label="员工姓名" prop="nickName" align="center" />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<pagination v-show="deptProcessTotal > 0" :total="deptProcessTotal" v-model:page="queryDeptProcessParams.pageNum"
|
|
|
- v-model:limit="queryDeptProcessParams.pageSize" @pagination="getDeptProcess"
|
|
|
+ v-model:limit="queryDeptProcessParams.pageSize" @pagination="getDetails"
|
|
|
layout="total, sizes, prev, next, jumper" />
|
|
|
</section>
|
|
|
- <EmployeeChoiceDialog ref="employeeChoiceDialogRef" :multiple="true" />
|
|
|
+ <EmployeeChoiceDialog ref="employeeChoiceDialogRef" :multiple="true"
|
|
|
+ :multipleSelected="handleEmployeeMultipleSelected" />
|
|
|
<DeptChoiceDialog ref="deptChoiceDialogRef" @handleSelectBelongingDept="handleSelectBelongingDept" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -112,9 +113,9 @@
|
|
|
<script setup>
|
|
|
import {
|
|
|
listResourceGroup,
|
|
|
- delResourceGroup,
|
|
|
+ delResourceGroup
|
|
|
} from "@/api/business/resourceGroup";
|
|
|
-import { listGroup, addGroup, updateGroup, delGroup } from "@/api/business/packageResourceGroup";
|
|
|
+import { listGroup, addGroup, updateGroup, delGroup, listDetails, addDetails } from "@/api/business/packageResourceGroup";
|
|
|
import {
|
|
|
listDeptProcess,
|
|
|
addDeptProcess,
|
|
@@ -167,7 +168,7 @@ const groupLoading = ref(false);
|
|
|
const groupDetailLoading = ref(false);
|
|
|
const groupDetailList = ref([]);
|
|
|
/**工序 */
|
|
|
-const deptProcessList = ref([]);
|
|
|
+const userList = ref([]);
|
|
|
const deptProcessLoading = ref(false);
|
|
|
const deptProcessTotal = ref(0);
|
|
|
const deptProcessIds = ref([]);
|
|
@@ -198,43 +199,24 @@ const handleWorkSectionChange = (row) => {
|
|
|
if (row) {
|
|
|
currentGroup.value = row;
|
|
|
queryParams.value.deptId = row.id;
|
|
|
- getResourceGroup();
|
|
|
- getDeptProcess();
|
|
|
+ getDetails();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-/**************************** 资源组方法区 ****************************/
|
|
|
-/**获取资源组 */
|
|
|
-function getResourceGroup() {
|
|
|
- groupLoading.value = true;
|
|
|
- listResourceGroup(queryParams.value).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- groupList.value = res.rows;
|
|
|
- if (groupList.value.length > 0) {
|
|
|
- currentGroup.value = groupList.value[0];
|
|
|
- proxy.$refs.groupTable.setCurrentRow(groupList.value[0]);
|
|
|
- } else {
|
|
|
- groupDetailList.value = [];
|
|
|
- }
|
|
|
- }
|
|
|
- groupLoading.value = false;
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
/*******************************工序方法区*********************************** */
|
|
|
/**获取工序 */
|
|
|
-const getDeptProcess = () => {
|
|
|
+const getDetails = () => {
|
|
|
deptProcessLoading.value = true;
|
|
|
- queryDeptProcessParams.value.deptId = currentGroup.value.id;
|
|
|
- listDeptProcess(queryDeptProcessParams.value).then((res) => {
|
|
|
- deptProcessList.value = res.rows;
|
|
|
+ queryDeptProcessParams.value.packageResourceGroupId = currentGroup.value.id;
|
|
|
+ listDetails(queryDeptProcessParams.value).then((res) => {
|
|
|
+ userList.value = res.rows;
|
|
|
deptProcessLoading.value = false;
|
|
|
deptProcessTotal.value = res.total;
|
|
|
});
|
|
|
};
|
|
|
/**工序搜索框 */
|
|
|
function handleQueryProcess() {
|
|
|
- getDeptProcess();
|
|
|
+ getDetails();
|
|
|
}
|
|
|
/** 打开工序对话框事件 */
|
|
|
function handleShowProcessFormDialog(row) {
|
|
@@ -256,7 +238,7 @@ function handledelDeptProcess() {
|
|
|
return delDeptProcess(deptProcessIds.value);
|
|
|
})
|
|
|
.then(() => {
|
|
|
- getDeptProcess();
|
|
|
+ getDetails();
|
|
|
proxy.$modal.msgSuccess("删除成功!");
|
|
|
})
|
|
|
.catch((e) => {
|
|
@@ -276,7 +258,7 @@ function handleDeleteGroup(row, index) {
|
|
|
return packageResourceGroups.splice(index, 1)
|
|
|
})
|
|
|
.then(() => {
|
|
|
- getDeptProcess();
|
|
|
+ getDetails();
|
|
|
proxy.$modal.msgSuccess("删除成功!");
|
|
|
})
|
|
|
.catch((e) => {
|
|
@@ -295,7 +277,7 @@ function showDeptChoiceDialog(row) {
|
|
|
}
|
|
|
|
|
|
function handleAdd() {
|
|
|
- packageResourceGroups.value.push({ editStatus: true })
|
|
|
+ packageResourceGroups.value.push({ editStatus: true, year: proxy.moment().format('YY'), code: '000000' })
|
|
|
}
|
|
|
|
|
|
function handleSelectBelongingDept(info) {
|
|
@@ -309,6 +291,42 @@ function handleGroupCancel(row) {
|
|
|
}
|
|
|
|
|
|
function handleGroupSave(row) {
|
|
|
+ // 判断工段包装线名都不能为空
|
|
|
+ if (row.name == null || row.name == '') {
|
|
|
+ proxy.$modal.msgError("包装线名不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.deptId == null) {
|
|
|
+ proxy.$modal.msgError("工段不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.year == null || row.year == '') {
|
|
|
+ proxy.$modal.msgError("年份不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.deptNo == null || row.deptNo == '') {
|
|
|
+ proxy.$modal.msgError("工段号不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.packageLineNo == null || row.packageLineNo == '') {
|
|
|
+ proxy.$modal.msgError("包装线号不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.code == null || row.code == '') {
|
|
|
+ proxy.$modal.msgError("当前编码不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断年是否是2位数字
|
|
|
+ if (!isNaN(Number(row.year)) && row.year.length > 2) {
|
|
|
+ proxy.$modal.msgError("年份不能为非数字或大于2位")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断code只能是小于6位数字
|
|
|
+ if (!isNaN(Number(row.code)) && row.code.length > 6) {
|
|
|
+ proxy.$modal.msgError("当前编码不能为非数字或大于6位")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (row.id == null) {
|
|
|
addGroup(row).then(() => {
|
|
|
getList()
|
|
@@ -320,6 +338,18 @@ function handleGroupSave(row) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function handleEmployeeMultipleSelected(infos) {
|
|
|
+ const data = {
|
|
|
+ ...currentGroup.value,
|
|
|
+ employees: infos
|
|
|
+ }
|
|
|
+ addDetails(data).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ getDetails()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
});
|