| | |
| | | label="统一社会信用代码" |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="industry" |
| | | label="所属行业" |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="inspectionMethod" |
| | | label="检查方式" |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column prop="industry" label="所属行业" width="180"> |
| | | <template #default="scope">{{ |
| | | industryToText(scope.row.industry) |
| | | }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="inspectionMethod" label="检查方式" width="180"> |
| | | <template #default="scope">{{ |
| | | methodToText(scope.row.inspectionMethod) |
| | | }}</template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="enforceContent" |
| | | label="检查内容" |
| | |
| | | label="执行科室" |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="planFrequency" |
| | | label="计划频次" |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column prop="planFrequency" label="计划频次" width="180"> |
| | | <template #default="scope">{{ frequencyToText(scope.row) }} </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="planMonth" |
| | | label="计划月份" |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="orderStatus" |
| | | label="状态" |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column prop="orderStatus" label="状态" width="180"> |
| | | <template #default="scope">{{ |
| | | statusToText(scope.row.checkStatus) |
| | | }}</template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | |
| | | /> |
| | | |
| | | <!-- 添加或修改对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="700px" append-to-body> |
| | | <el-dialog |
| | | :title="title" |
| | | v-model="open" |
| | | width="700px" |
| | | @close="closeUpdHandler" |
| | | append-to-body |
| | | > |
| | | <el-form ref="deptRef" :model="form" :rules="rules" label-width="140px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="计划名称" prop="enforceReason"> |
| | | <el-input v-model="form.enforceReason" placeholder="请输入计划名称" /> |
| | | <el-input |
| | | v-model="form.enforceReason" |
| | | placeholder="请输入计划名称" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="制定计划的机构" prop="makeOrgId"> |
| | | <el-form-item label="制定计划的机构" prop="applyOrgId"> |
| | | <el-tree-select |
| | | v-model="form.makeOrgId" |
| | | v-model="form.applyOrgId" |
| | | :data="deptOptions" |
| | | :props="{ value: 'id', label: 'label', children: 'children' }" |
| | | value-key="id" |
| | | placeholder="请选择制定计划的机构" |
| | | check-strictly |
| | | :default-expanded-keys="[form.applyOrgId]" |
| | | :default-checked-keys="[form.applyOrgId]" |
| | | @node-click="changeTreeHandler" |
| | | /> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-row :gutter="20" v-if="!form.orderId"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="被检查的对象" prop="checkdIds"> |
| | | <el-button type="primary" @click="openFirmSelect" |
| | | >选择企业</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" v-else> |
| | | <el-col :span="12"> |
| | | <el-form-item label="被检查对象" prop="companyName"> |
| | | <el-input |
| | | v-model="form.companyName" |
| | | placeholder="请输入被检查对象" |
| | | readonly |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="统一社会信用代码" prop="companyCode"> |
| | | <el-input |
| | | v-model="form.companyCode" |
| | | placeholder="请输入统一社会信用代码" |
| | | readonly |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计划频率" prop="planFrequency"> |
| | | <el-input v-model="form.planFrequency" placeholder="请输入频率"> |
| | | <el-form-item label="计划频次" prop="planFrequency"> |
| | | <el-input v-model="form.planFrequency" placeholder="请输入频次"> |
| | | <template #append> |
| | | <el-select |
| | | v-model="form.planFrequencyUnit" |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计划编号:">{{ |
| | | planDetail.planNo |
| | | planDetail.orderNo |
| | | }}</el-form-item> |
| | | <el-form-item label="计划名称:">{{ |
| | | planDetail.enforceReason |
| | |
| | | planDetail.applyOrgName |
| | | }}</el-form-item> |
| | | <el-form-item label="被检查的对象:">{{ |
| | | planDetail.checkdObject |
| | | planDetail.companyName |
| | | }}</el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="统一社会信用代码:">{{ |
| | | planDetail.unifiedSocialCreditCode |
| | | planDetail.companyCode |
| | | }}</el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所属行业:">{{ |
| | | planDetail.industry |
| | | industryToText(planDetail.industry) |
| | | }}</el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检查方式:">{{ |
| | | planDetail.inspectionMethod |
| | | methodToText(planDetail.inspectionMethod) |
| | | }}</el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | }}</el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计划频率:">{{ |
| | | planDetail.planFrequency |
| | | }}</el-form-item> |
| | | <el-form-item label="计划频次:"> |
| | | {{ frequencyToText(planDetail) }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态:">{{ |
| | | planDetail.planStatus |
| | | statusToText(planDetail.checkStatus) |
| | | }}</el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-table-column |
| | | type="selection" |
| | | width="55" |
| | | :reserve-selection="true" |
| | | :reserve-selection="false" |
| | | /> |
| | | <el-table-column prop="companyName" label="企业名称" /> |
| | | <el-table-column prop="companyCode" label="统一社会信用代码" /> |
| | |
| | | /> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="closeSelect">确 定</el-button> |
| | | <el-button @click="closeSelect">关 闭</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | delManage, |
| | | exportTemplate, |
| | | exportManage, |
| | | getOrgId, |
| | | } from "@/api/system/manage"; |
| | | import { listCompany } from "@/api/system/company/company"; |
| | | import { deptTreeSelect } from "@/api/system/user"; |
| | |
| | | "industry_type", |
| | | "inspection_method" |
| | | ); |
| | | const statusOptions = ref([ |
| | | { label: "已撤回", value: -1 }, |
| | | { label: "待提交", value: 0 }, |
| | | { label: "已提交", value: 1 }, |
| | | { label: "已审批待执行", value: 2 }, |
| | | { label: "已执行待上报", value: 3 }, |
| | | { label: "已上报", value: 4 }, |
| | | ]); |
| | | const deptList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | |
| | | const selectOffices = ref([]); |
| | | const officeList = ref([]); |
| | | let checkedList = ref([]); // 选中的企业列表 |
| | | |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { get } from "http"; |
| | | const userStore = useUserStore(); |
| | | const userInfo = toRefs(userStore); |
| | | |
| | | onMounted(() => { |
| | | console.log("userInfo", userInfo.value); |
| | | }); |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | enforceReason: "", // 计划名称 |
| | |
| | | applyDeptNames: "", // 执行科室名称 |
| | | companyName: "", // 被检查对象 |
| | | companyId: "", // 被检查对象id |
| | | companyCode: "", // 被检查对象 |
| | | companyCode: "", // 统一社会信用代码 |
| | | industry: "", // 所属行业 |
| | | inspectionMethod: "", // 检查方式 |
| | | enforceContent: "", // 检查内容 |
| | |
| | | checkdIds: [ |
| | | { required: true, message: "被检查对象不能为空", trigger: "blur" }, |
| | | ], |
| | | unifiedSocialCreditCode: [ |
| | | companyName: [ |
| | | { required: true, message: "企业名称不能为空", trigger: "blur" }, |
| | | ], |
| | | companyCode: [ |
| | | { required: true, message: "统一社会信用代码不能为空", trigger: "blur" }, |
| | | ], |
| | | industry: [ |
| | |
| | | inspectionMethod: [ |
| | | { required: true, message: "检查方式不能为空", trigger: "blur" }, |
| | | ], |
| | | planStatus: [{ required: true, message: "状态不能为空", trigger: "blur" }], |
| | | checkStatus: [{ required: true, message: "状态不能为空", trigger: "blur" }], |
| | | }, |
| | | firmQueryParams: { |
| | | pageNum: 1, |
| | |
| | | // 计划月份选择 |
| | | const changeMonth = (value) => { |
| | | form.value.planMonth = value.join(","); |
| | | console.log(form.value.planMonth); |
| | | }; |
| | | |
| | | // 机构选择 |
| | |
| | | }) |
| | | .join(","); |
| | | form.value.applyDeptIds = value.join(","); |
| | | console.log(form.value.applyDeptIds); |
| | | console.log(form.value.applyDeptNames); |
| | | }; |
| | | |
| | | /*** 计划导入参数 */ |
| | |
| | | function reset() { |
| | | form.value = { |
| | | enforceReason: "", // 计划名称 |
| | | makeOrgId: "", // 制定机构id |
| | | applyOrgId: "", // 制定机构id |
| | | applyOrgName: "", // 制定机构 |
| | | applyDeptIds: "", // 执行科室id |
| | | applyDeptNames: "", // 执行科室名称 |
| | |
| | | industry: "", // 所属行业 |
| | | enforceContent: "", // 检查内容 |
| | | planFrequency: "", // 计划频次 |
| | | planFrequencyUnit: "", // 计划频次单位 |
| | | planFrequencyUnit: "1", // 计划频次单位 |
| | | planMonth: "", // 计划月份 |
| | | orderType: 1, |
| | | }; |
| | | proxy.resetForm("deptRef"); |
| | | selectOffices.value = []; |
| | | selectMonth.value = []; |
| | | checkedList.value = []; |
| | | proxy.$refs["deptRef"].clearValidate(); |
| | | proxy.$refs["deptRef"].resetFields(); |
| | | } |
| | | |
| | | function closeUpdHandler() { |
| | | reset(); |
| | | open.value = false; |
| | | } |
| | | |
| | | const queryRef = ref(); |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | |
| | | queryParams.value = { |
| | | planNo: "", // 计划编号 |
| | | enforceReason: "", // 计划名称 |
| | | applyDeptIds: "", // 执法单位 |
| | | applyDeptIds: "", // 执行科室 |
| | | planMonthStart: "", // 计划开始月份 |
| | | planMonthEnd: "", // 计划结束月份 |
| | | orderType: 1, |
| | |
| | | } |
| | | function getDetails(id) { |
| | | getManage(id).then((response) => { |
| | | form.value = response.data; |
| | | form.value = JSON.parse(JSON.stringify(response.data)); |
| | | form.value.planFrequencyUnit = form.value.planFrequencyUnit.toString(); |
| | | selectMonth.value = form.value.planMonth.split(","); |
| | | selectOffices.value = form.value.applyDeptIds |
| | | .split(",") |
| | | .map((item) => Number(item)); |
| | | |
| | | getOfficeList(); |
| | | open.value = true; |
| | | }); |
| | | } |
| | |
| | | function handleAdd(row) { |
| | | if (row) { |
| | | title.value = "编辑计划"; |
| | | getDetails(row.id); |
| | | getDetails(row.orderId); |
| | | } else { |
| | | title.value = "添加计划"; |
| | | open.value = true; |
| | | getUserOrgId(); |
| | | } |
| | | getFirmList(); |
| | | } |
| | | |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | console.log(form.value); |
| | | proxy.$refs["deptRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != undefined) { |
| | | if (form.value.orderId != undefined) { |
| | | updateManage(form.value).then((response) => { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | reset(); |
| | | }); |
| | | } else { |
| | | checkedList.value.forEach((item, index) => { |
| | | console.log(item); |
| | | const submitForm = { ...form.value }; |
| | | submitForm.companyId = item.companyId; |
| | | submitForm.companyName = item.companyName; |
| | |
| | | |
| | | function openFirmSelect() { |
| | | selectOpen.value = true; |
| | | getFirmList(); |
| | | } |
| | | |
| | | /** 查询企业列表 */ |
| | | function getFirmList() { |
| | | loading.value = true; |
| | | listCompany(firmQueryParams.value).then((response) => { |
| | | firmList.value = response.rows; |
| | | firmQueryParams.value.total = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | |
| | |
| | | selectOpen.value = false; |
| | | } |
| | | |
| | | getList(); |
| | | function selectableFun(e) { |
| | | console.log(e); |
| | | function industryToText(industry) { |
| | | return industry_type.value.find((item) => item.key === industry).label; |
| | | } |
| | | |
| | | function methodToText(inspectionMethod) { |
| | | return inspection_method.value.find((item) => item.key === inspectionMethod) |
| | | .label; |
| | | } |
| | | |
| | | function frequencyToText(data) { |
| | | if (!data.planFrequencyUnit) { |
| | | return ""; |
| | | } |
| | | const unit = frequency.value.find( |
| | | (item) => item.key == data.planFrequencyUnit |
| | | ).label; |
| | | return `${data.planFrequency}次/${unit}`; |
| | | } |
| | | |
| | | function statusToText(status) { |
| | | return statusOptions.value.find((item) => item.value === status).label; |
| | | } |
| | | |
| | | function getUserOrgId() { |
| | | getOrgId().then((response) => { |
| | | form.value.applyOrgId = response.data || ''; |
| | | if (response.data) { |
| | | getOfficeList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | getList(); |
| | | function selectableFun(e) {} |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |