| | |
| | | operationsArr.value = ['edit']; |
| | | } else if (value === "task") { |
| | | const operationColumn = getOperationColumn(['viewFile']); |
| | | tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])]; |
| | | const statusColumn = { |
| | | prop: "status", |
| | | label: "ä»»å¡ç¶æ", |
| | | minWidth: 100, |
| | | dataType: "tag", |
| | | formatType: (row) => { |
| | | if (row.status === '已巡æ£') return 'success'; |
| | | return 'warning'; |
| | | } |
| | | }; |
| | | tableColumns.value = [...columns.value, statusColumn, ...(operationColumn ? [operationColumn] : [])]; |
| | | operationsArr.value = ['viewFile']; |
| | | } |
| | | pageNum.value = 1; |
| | |
| | | <el-radio :value="3">ä¸éè¿</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="çç£äºº" prop="supervisoryName"> |
| | | <el-input v-model="form.supervisoryName" placeholder="请è¾å
¥çç£äºº" clearable style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </FormDialog> |
| | |
| | | const formRef = ref(); |
| | | const form = ref({ |
| | | decision: undefined, // 0 éè¿ 3 ä¸éè¿ |
| | | supervisoryName: undefined, // çç£äºº |
| | | }); |
| | | |
| | | const rules = { |
| | | decision: [{ required: true, message: "è¯·éæ©å®¡æ¹ç»æ", trigger: "change" }], |
| | | supervisoryName: [{ required: true, message: "è¯·éæ©çç£äºº", trigger: "change" }], |
| | | }; |
| | | |
| | | const statusText = (status) => { |
| | |
| | | await nextTick(); |
| | | await loadDetail(repairId); |
| | | form.value.decision = undefined; |
| | | form.value.supervisoryName = undefined; |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | |
| | | id.value = undefined; |
| | | detail.value = {}; |
| | | form.value.decision = undefined; |
| | | form.value.supervisoryName = undefined; |
| | | }; |
| | | |
| | | const updateStatus = async (status) => { |
| | | loading.value = true; |
| | | try { |
| | | const { code } = await editRepair({ id: id.value, status }); |
| | | const { code } = await editRepair({ id: id.value, status, supervisoryName: form.value.supervisoryName }); |
| | | if (code === 200) { |
| | | ElMessage.success("å®¡æ¹æå"); |
| | | emits("ok"); |
| | |
| | | prop: "maintenanceTime", |
| | | formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""), |
| | | }, |
| | | { prop: "auditName", label: "å®¡æ ¸äºº", width: 120 }, |
| | | { prop: "supervisoryName", label: "çç£äºº", width: 120 }, |
| | | { |
| | | label: "ç¶æ", |
| | | align: "center", |
| | |
| | | <el-radio label="å®¡æ ¸ä¸éè¿">å®¡æ ¸ä¸éè¿</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="çç£äºº" prop="supervisoryName"> |
| | | <el-input v-model="form.supervisoryName" placeholder="请è¾å
¥çç£äºº" clearable style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </FormDialog> |
| | |
| | | const formRef = ref(); |
| | | const form = ref({ |
| | | decision: undefined, // å®¡æ ¸éè¿ / å®¡æ ¸ä¸éè¿ |
| | | supervisoryName: undefined, // çç£äºº |
| | | }); |
| | | |
| | | const rules = { |
| | | decision: [{ required: true, message: "è¯·éæ©å®¡æ¹ç»æ", trigger: "change" }], |
| | | supervisoryName: [{ required: true, message: "è¯·éæ©çç£äºº", trigger: "change" }], |
| | | }; |
| | | |
| | | const statusText = (status) => status || "-"; |
| | |
| | | visible.value = true; |
| | | await nextTick(); |
| | | form.value.decision = undefined; |
| | | form.value.supervisoryName = undefined; |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | | visible.value = false; |
| | | detail.value = {}; |
| | | form.value.decision = undefined; |
| | | form.value.supervisoryName = undefined; |
| | | }; |
| | | |
| | | const updateStatus = async (status) => { |
| | | loading.value = true; |
| | | try { |
| | | const payload = { ...(detail.value || {}), status }; |
| | | const payload = { ...(detail.value || {}), status, supervisoryName: form.value.supervisoryName }; |
| | | const { code } = await deviceMaintenanceTaskEdit(payload); |
| | | if (code === 200) { |
| | | ElMessage.success("å®¡æ¹æå"); |
| | |
| | | }, |
| | | { prop: "registrant", label: "ç»è®°äºº", minWidth: 100 }, |
| | | { prop: "registrationDate", label: "ç»è®°æ¥æ", minWidth: 100 }, |
| | | { prop: "auditName", label: "å®¡æ ¸äºº", width: 120 }, |
| | | { prop: "supervisoryName", label: "çç£äºº", width: 120 }, |
| | | { |
| | | label: "ç¶æ", |
| | | align: "center", |
| | |
| | | |
| | | // æå»ºæ¥è¯¢åæ° |
| | | const query = { |
| | | page: pagination.currentPage, |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | documentationId: searchForm.documentationId || undefined, |
| | | borrowStatus: searchForm.borrowStatus || undefined, |
| | |
| | | }; |
| | | |
| | | // å¤çå页åå |
| | | const handlePagination = (current, size) => { |
| | | pagination.currentPage = current; |
| | | pagination.pageSize = size; |
| | | const handlePagination = (pageInfo) => { |
| | | pagination.currentPage = pageInfo.current || pageInfo.page; |
| | | pagination.pageSize = pageInfo.size || pageInfo.limit; |
| | | loadBorrowList(); |
| | | }; |
| | | |
| | |
| | | |
| | | // æå»ºæ¥è¯¢åæ° |
| | | const query = { |
| | | page: pagination.currentPage, |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | borrowStatus: searchForm.borrowStatus || undefined, |
| | | borrower: searchForm.borrower || undefined, |
| | |
| | | }; |
| | | |
| | | // å¤çå页åå |
| | | const handlePagination = (current, size) => { |
| | | pagination.currentPage = current; |
| | | pagination.pageSize = size; |
| | | const handlePagination = (pageInfo) => { |
| | | pagination.currentPage = pageInfo.current || pageInfo.page; |
| | | pagination.pageSize = pageInfo.size || pageInfo.limit; |
| | | loadReturnList(); |
| | | }; |
| | | // å¤çæ«ç å
容 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="å³ä¿é²å
·" prop="dictLabel"> |
| | | <el-input |
| | | v-model="queryParams.dictLabel" |
| | | placeholder="请è¾å
¥å³ä¿é²å
·" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </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"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="é²å
·ç¼ç " align="center" prop="dictValue" /> |
| | | <el-table-column label="å³ä¿é²å
·" align="center" prop="dictLabel" /> |
| | | <el-table-column label="æ°é" align="center" prop="num" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" width="160" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">ä¿®æ¹</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹åæ°é
ç½®å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="dataRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="å³ä¿é²å
·" prop="dictLabel"> |
| | | <el-input v-model="form.dictLabel" placeholder="请è¾å
¥å³ä¿é²å
·" /> |
| | | </el-form-item> |
| | | <el-form-item label="é²å
·ç¼ç " prop="dictValue"> |
| | | <el-input v-model="form.dictValue" placeholder="请è¾å
¥é²å
·ç¼ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="æ°é" prop="num"> |
| | | <el-input-number v-model="form.num" controls-position="right" :min="0" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="LavorIssueDictData"> |
| | | import useDictStore from '@/store/modules/dict' |
| | | import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data" |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | const dataList = ref([]) |
| | | const open = ref(false) |
| | | const loading = ref(true) |
| | | const showSearch = ref(true) |
| | | const ids = ref([]) |
| | | const single = ref(true) |
| | | const multiple = ref(true) |
| | | const total = ref(0) |
| | | const title = ref("") |
| | | const fixedDictType = ref("sys_lavor_issue") |
| | | |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dictType: "sys_lavor_issue", |
| | | dictLabel: undefined |
| | | }, |
| | | rules: { |
| | | dictLabel: [{ required: true, message: "å³ä¿é²å
·ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | dictValue: [{ required: true, message: "é²å
·ç¼ç ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | num: [{ required: true, message: "æ°éä¸è½ä¸ºç©º", trigger: "blur" }] |
| | | } |
| | | }) |
| | | |
| | | const { queryParams, form, rules } = toRefs(data) |
| | | |
| | | /** æ¥è¯¢åå
¸æ°æ®å表 */ |
| | | function getList() { |
| | | loading.value = true |
| | | queryParams.value.dictType = fixedDictType.value |
| | | listData(queryParams.value).then(response => { |
| | | dataList.value = response.rows |
| | | total.value = response.total |
| | | loading.value = false |
| | | }) |
| | | } |
| | | |
| | | /** åæ¶æé® */ |
| | | function cancel() { |
| | | open.value = false |
| | | reset() |
| | | } |
| | | |
| | | /** 表åéç½® */ |
| | | function reset() { |
| | | form.value = { |
| | | dictCode: undefined, |
| | | dictLabel: undefined, |
| | | dictValue: undefined, |
| | | num: undefined, |
| | | dictType: fixedDictType.value, |
| | | dictSort: 0, |
| | | status: "0", |
| | | cssClass: undefined, |
| | | listClass: "default", |
| | | remark: undefined |
| | | } |
| | | proxy.resetForm("dataRef") |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef") |
| | | queryParams.value.dictType = fixedDictType.value |
| | | handleQuery() |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | function handleAdd() { |
| | | reset() |
| | | open.value = true |
| | | title.value = "æ·»å å³ä¿ç±»åæ°æ®" |
| | | form.value.dictType = fixedDictType.value |
| | | } |
| | | |
| | | /** å¤éæ¡é䏿°æ® */ |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.dictCode) |
| | | single.value = selection.length != 1 |
| | | multiple.value = !selection.length |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset() |
| | | const dictCode = row.dictCode || ids.value |
| | | getData(dictCode).then(response => { |
| | | form.value = response.data |
| | | open.value = true |
| | | title.value = "ä¿®æ¹å³ä¿ç±»åæ°æ®" |
| | | }) |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["dataRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.dictCode != undefined) { |
| | | updateData(form.value).then(response => { |
| | | useDictStore().removeDict(fixedDictType.value) |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå") |
| | | open.value = false |
| | | getList() |
| | | }) |
| | | } else { |
| | | addData(form.value).then(response => { |
| | | useDictStore().removeDict(fixedDictType.value) |
| | | proxy.$modal.msgSuccess("æ°å¢æå") |
| | | open.value = false |
| | | getList() |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | function handleDelete(row) { |
| | | const dictCodes = row.dictCode || ids.value |
| | | proxy.$modal.confirm('æ¯å¦ç¡®è®¤å é¤åå
¸ç¼ç 为"' + dictCodes + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delData(dictCodes) |
| | | }).then(() => { |
| | | getList() |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | useDictStore().removeDict(fixedDictType.value) |
| | | }).catch(() => {}) |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download("system/dict/data/export", { |
| | | ...queryParams.value |
| | | }, `lavor_issue_dict_data_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | getList() |
| | | </script> |
| | |
| | | <el-option :label="item.name" :value="item.id" v-for="(item,index) in positionOptions" :key="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å³ä¿ç±»å" prop="dictType"> |
| | | <el-select |
| | | v-model="form.dictType" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option :label="item.label" :value="item.value" v-for="(item,index) in sys_lavor_issue_type" :key="value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å³ä¿ç¨å" prop="dictId"> |
| | | <el-select v-model="form.dictId" placeholder="è¯·éæ©" clearable> |
| | | <el-option :label="item.dictName" :value="item.dictId" v-for="(item,index) in laborSuppliesOptions" :key="item.dictId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è¿åæ¥æ" prop="factoryDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="åå·¥åç§°" prop="staffId"> |
| | | <el-select |
| | | v-model="form.staffId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option :label="item.staffName" :value="item.id" v-for="(item,index) in personList" :key="id" /> |
| | | </el-select> |
| | | <span>{{ personList.find(p => p.id === form.staffId)?.staffName }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="åæ¾æ°é" prop="num"> |
| | | <el-input-number :step="1" :min="0" style="width: 100%" |
| | |
| | | import useUserStore from "@/store/modules/user"; |
| | | import {staffOnJobListPage} from "@/api/personnelManagement/employeeRecord.js"; |
| | | import { getDept } from "@/api/collaborativeApproval/approvalProcess.js"; |
| | | import { deptPositionListPage, getDeptPositionByDeptIdLabor } from "@/api/lavorissce/issue"; |
| | | import { deptPositionListPage } from "@/api/lavorissce/issue"; |
| | | import { deepCopySameProperties } from '@/utils/util' |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | |
| | | const formRef = ref(null) |
| | | const userStore = useUserStore(); |
| | | const { sys_lavor_issue } = proxy.useDict("sys_lavor_issue") |
| | | const { sys_lavor_issue_type } = proxy.useDict("sys_lavor_issue_type") |
| | | |
| | | const productOptions = ref([]); |
| | | const personList = ref([]); |
| | | const positionOptions = ref([]); |
| | | const laborSuppliesOptions = ref([]); |
| | | |
| | | const formRules = { |
| | | deptPositionId: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | dictType: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | dictId: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | adoptedDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | factoryDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | issueDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | |
| | | openModal(row.id) |
| | | await nextTick() |
| | | deepCopySameProperties(row, form) |
| | | // å¦æä¼ å
¥äºå²ä½IDï¼èªå¨æ¥è¯¢å³ä¿ç¨åæ°æ® |
| | | if (form.deptPositionId) { |
| | | await handlePositionChange(form.deptPositionId) |
| | | } |
| | | } |
| | | async function loadPositions() { |
| | | const res = await deptPositionListPage({pageNum: -1, pageSize:-1}) |
| | |
| | | } |
| | | |
| | | async function handlePositionChange(deptPositionId) { |
| | | if (!deptPositionId) { |
| | | laborSuppliesOptions.value = [] |
| | | form.dictId = undefined |
| | | return |
| | | } |
| | | const res = await getDeptPositionByDeptIdLabor({ id: deptPositionId }) |
| | | laborSuppliesOptions.value = res?.data || [] |
| | | console.log('éæ©çå²ä½ID:', deptPositionId) |
| | | } |
| | | |
| | | onMounted(() => { |
| | |
| | | <el-tree-select |
| | | v-model="form.deptPositionId" |
| | | :data="deptPositionTree" |
| | | :props="{ value: 'id', label: 'label', children: 'children' }" |
| | | placeholder="è¯·éæ©é¨é¨æå²ä½" |
| | | :props="{ value: 'id', label: 'label', children: 'children', disabled: checkDisabled }" |
| | | placeholder="è¯·éæ©å²ä½" |
| | | clearable |
| | | check-strictly |
| | | :render-after-expand="false" |
| | |
| | | </template> |
| | | </el-tree-select> |
| | | </el-form-item> |
| | | <el-form-item label="å³ä¿ç±»å" prop="dictType"> |
| | | <el-select v-model="form.dictType" placeholder="è¯·éæ©" clearable> |
| | | <el-option :label="item.label" :value="item.value" v-for="(item,index) in sys_lavor_issue_type" :key="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å³ä¿ç¨å" prop="dictId"> |
| | | <el-select v-model="form.dictId" placeholder="è¯·éæ©" clearable> |
| | | <el-option :label="item.dictName" :value="item.dictId" v-for="(item,index) in laborSuppliesOptions" :key="item.dictId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è¿åæ¥æ" prop="factoryDate"> |
| | | <el-date-picker style="width: 100%" v-model="form.factoryDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="è¯·éæ©æ¥æ" clearable /> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="å工䏿°é" required> |
| | | <div style="width:100%"> |
| | | <div style="margin-bottom:8px; text-align:right;"> |
| | | <el-button size="small" type="primary" @click="addItemRow">æ°å¢ä¸è¡</el-button> |
| | | </div> |
| | | <el-table :data="form.laborIssueList" border size="small"> |
| | | <el-table :data="form.laborIssueList" border size="small" :span-method="arraySpanMethod"> |
| | | <el-table-column label="åå·¥åç§°" width="220"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.staffId" placeholder="è¯·éæ©" filterable> |
| | | <el-option :label="p.staffName" :value="p.id" v-for="p in personList" :key="p.id" /> |
| | | </el-select> |
| | | <span>{{ personList.find(p => p.id === scope.row.staffId)?.staffName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åæ¾æ°é" align="center"> |
| | | <el-table-column label="å³ä¿ç¨å" prop="dictName" align="center" /> |
| | | <el-table-column label="åæ¾æ°é" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <el-input-number v-model="scope.row.num" :min="0" :step="1" /> |
| | | </template> |
| | |
| | | |
| | | const formRules = { |
| | | deptPositionId: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | dictType: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | dictId: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | adoptedDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | factoryDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | issueDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | |
| | | getPersonList() |
| | | } |
| | | |
| | | function addItemRow() { |
| | | form.laborIssueList.push({ staffId: undefined, num: undefined }) |
| | | } |
| | | function removeItemRow(index) { |
| | | form.laborIssueList.splice(index, 1) |
| | | } |
| | |
| | | function sendForm() { |
| | | formRef.value?.validate(async valid => { |
| | | if (!valid) return |
| | | // é¢å¤æ ¡éªå¤äººæç» |
| | | if (!Array.isArray(form.laborIssueList) || form.laborIssueList.length === 0) { |
| | | ElMessage.error('请è³å°æ·»å ä¸è¡å工䏿°é') |
| | | return |
| | | } |
| | | for (const row of form.laborIssueList) { |
| | | if (!row.staffId) { ElMessage.error('è¯·éæ©åå·¥'); return } |
| | | if (!row.dictId) { ElMessage.error('è¯·éæ©å³ä¿ç¨å'); return } |
| | | if (row.num == null || row.num === '' || Number(row.num) < 0) { ElMessage.error('请è¾å
¥æ°é'); return } |
| | | } |
| | | const payload = { ...form } |
| | |
| | | if (!deptPositionId) { |
| | | laborSuppliesOptions.value = [] |
| | | form.dictId = undefined |
| | | form.laborIssueList = [] |
| | | return |
| | | } |
| | | const res = await getDeptPositionByDeptIdLabor({ id: deptPositionId }) |
| | | laborSuppliesOptions.value = res?.data || [] |
| | | |
| | | const staffRes = await staffOnJobListPage({ current: -1, size: -1, staffState: 1, deptPositionId: deptPositionId }) |
| | | const staffList = staffRes?.data?.records || [] |
| | | const suppliesList = laborSuppliesOptions.value || [] |
| | | |
| | | if (staffList.length > 0 && suppliesList.length > 0) { |
| | | form.laborIssueList = [] |
| | | staffList.forEach(staff => { |
| | | suppliesList.forEach(supply => { |
| | | form.laborIssueList.push({ |
| | | staffId: staff.id, |
| | | dictId: supply.dictId, |
| | | dictName: supply.dictName, |
| | | num: supply.num || 0 |
| | | }) |
| | | }) |
| | | }) |
| | | } else { |
| | | form.laborIssueList = [] |
| | | } |
| | | } |
| | | |
| | | function arraySpanMethod({ row, column, rowIndex, columnIndex }) { |
| | | if (columnIndex === 0) { |
| | | const staffId = row.staffId |
| | | const sameStaffRows = form.laborIssueList.filter(item => item.staffId === staffId) |
| | | const firstIndex = form.laborIssueList.findIndex(item => item.staffId === staffId) |
| | | if (rowIndex === firstIndex) { |
| | | return { |
| | | rowspan: sameStaffRows.length, |
| | | colspan: 1 |
| | | } |
| | | } else { |
| | | return { |
| | | rowspan: 0, |
| | | colspan: 0 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function checkDisabled(data) { |
| | | return data.type === 1 |
| | | } |
| | | |
| | | onMounted(() => { |
| | |
| | | }, |
| | | [ |
| | | { |
| | | label: "é¨é¨/å²ä½", |
| | | label: "å²ä½", |
| | | align: "center", |
| | | prop: "deptName" |
| | | }, |
| | |
| | | label: "åå·¥ç¼å·", |
| | | align: "center", |
| | | prop: "staffNo" |
| | | }, |
| | | { |
| | | label: "å³ä¿ç±»å", |
| | | align: "center", |
| | | prop: "dictTypeName", |
| | | |
| | | }, |
| | | { |
| | | label: "å³ä¿é²å
·", |